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) diff --git a/src/schema-parser/schema-utils.ts b/src/schema-parser/schema-utils.ts index 9dec02642..9ad326a69 100644 --- a/src/schema-parser/schema-utils.ts +++ b/src/schema-parser/schema-utils.ts @@ -151,24 +151,20 @@ export class SchemaUtils { isNullMissingInType = (schema, type) => { const { nullable, type: schemaType } = schema || {}; - if ( - !( - nullable || - !!get(schema, "x-nullable") || - schemaType === this.config.Ts.Keyword.Null - ) || - typeof type !== "string" - ) { - return false; - } + const isSchemaMarkedNullable = + nullable || + !!get(schema, "x-nullable") || + schemaType === this.config.Ts.Keyword.Null; + + if (!isSchemaMarkedNullable) return false; + if (typeof type !== "string") return false; const nullKeyword = this.config.Ts.Keyword.Null; - const lastLine = type.trimEnd().split("\n").pop() ?? type; + const hasRootLevelNull = new RegExp( + `(^|\\||\\()\\s*${nullKeyword}\\s*(\\||\\)|$)`, + ).test(type); - return ( - !lastLine.includes(` ${nullKeyword}`) && - !lastLine.includes(`${nullKeyword} `) - ); + return !hasRootLevelNull; }; safeAddNullToType = (schema, type) => { diff --git a/tests/__snapshots__/extended.test.ts.snap b/tests/__snapshots__/extended.test.ts.snap index 33b354acc..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,3015 +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 { - /** - * 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; +/** + * 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; } -export type GistsListForksData = GistSimple[]; +/** + * 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; +} -export interface GistsListForksParams { - /** gist_id parameter */ - gistId: 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; -} - -export interface GistsListParams { + 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; - /** 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_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 GistsListStarredData = BaseGist[]; - -export interface GistsListStarredParams { + 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 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 { + login: string; /** - * The comment text. - * @maxLength 65535 - * @example "Body of the attachment" + * List of oauth scopes the token has been granted. + * @example ["user","repo"] */ - body: string; + scopes?: string[]; + /** + * Last eight characters of the credential. Only included in responses with credential_type of personal access token. + * @example "12345678" + */ + token_last_eight?: string; } -export type GistsUpdateData = GistSimple; - -export interface GistsUpdateParams { - /** 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 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 - * Low-level Git commit operations within a repository + * Deployment + * A request for a specific ref(branch,sha,tag) to be deployed */ -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 Deployment { /** - * Message describing the purpose of the commit - * @example "Fix #42" + * @format date-time + * @example "2012-07-20T01:19:13Z" */ - message: string; - node_id: string; - parents: { - /** @format uri */ - html_url: string; - /** - * SHA for the commit - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" - */ - sha: string; - /** @format uri */ - url: string; - }[]; + created_at: string; + creator: SimpleUser | null; + /** @example "Deploy request from hubot" */ + description: string | null; /** - * SHA for the commit - * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + * Name for the target deployment environment. + * @example "production" */ - 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; - }; + 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; + /** + * @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; } -export type GitCreateBlobData = ShortBlob; +/** + * Deployment Status + * The status of a deployment. + */ +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: 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" + */ + url: string; +} -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; } /** @@ -20561,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", @@ -20569,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 @@ -20652,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", @@ -20661,2417 +19904,2400 @@ 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; + email: string; + /** + * Name of the git user + * @example "Monalisa Octocat" + */ + name: string; + }; + /** @format uri */ + html_url: string; + /** + * Message describing the purpose of the commit + * @example "Fix #42" + */ + message: string; + node_id: string; + parents: { + /** @format uri */ + html_url: string; + /** + * SHA for the commit + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + */ + sha: string; + /** @format uri */ + url: string; }[]; - /** @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", + /** + * SHA for the commit + * @example "7638417db6d59f3c431d3e1f261cc637155684cd" + */ + 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; + }; } -/** - * 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 GitCreateBlobData = ShortBlob; + +export interface GitCreateBlobParams { + owner: string; + repo: string; } -/** - * 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 GitCreateBlobPayload { + /** The new blob's content. */ + content: string; + /** + * The encoding used for \`content\`. Currently, \`"utf-8"\` and \`"base64"\` are supported. + * @default "utf-8" + */ + encoding?: string; } -/** - * Key Simple - * Key Simple - */ -export interface KeySimple { - id: number; - key: string; +export type GitCreateCommitData = GitCommit; + +export interface GitCreateCommitParams { + owner: string; + repo: 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; - /** - * The name of the label. - * @example "bug" - */ - 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 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; } -/** - * 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; +export type GitCreateRefData = GitRef; + +export interface GitCreateRefParams { + owner: string; + repo: string; } -/** - * Language - * Language - */ -export type Language = Record; +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; +} -/** - * 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 type GitCreateTagData = GitTag; + +export interface GitCreateTagParams { + 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 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; }; - 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; + /** 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; } -/** - * 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" - */ - url: string | null; +/** 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", } -export type LicensesGetAllCommonlyUsedData = LicenseSimple[]; +export type GitCreateTreeData = GitTree; -export interface LicensesGetAllCommonlyUsedParams { - featured?: boolean; +/** 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 GitCreateTreeParams { + owner: string; + repo: string; +} + +export interface GitCreateTreePayload { /** - * Results per page (max 100) - * @default 30 + * 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. */ - per_page?: number; + 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 LicensesGetData = License; +/** Either \`blob\`, \`tree\`, or \`commit\`. */ +export enum GitCreateTreeTypeEnum { + Blob = "blob", + Tree = "tree", + Commit = "commit", +} -export type LicensesGetForRepoData = LicenseContent; +export type GitDeleteRefData = any; -export interface LicensesGetForRepoParams { +export interface GitDeleteRefParams { owner: string; + /** ref+ parameter */ + ref: string; repo: string; } -export interface LicensesGetParams { - license: string; -} +export type GitGetBlobData = Blob; -/** - * Link - * Hypermedia Link - */ -export interface Link { - href: string; +export interface GitGetBlobParams { + fileSha: string; + owner: string; + repo: string; } -/** - * Link With Type - * Hypermedia Link with Type - */ -export interface LinkWithType { - href: string; - type: string; +export type GitGetCommitData = GitCommit; + +export interface GitGetCommitParams { + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; } -export type MarkdownRenderData = string; +export type GitGetRefData = GitRef; -/** - * The rendering mode. - * @default "markdown" - * @example "markdown" - */ -export enum MarkdownRenderModeEnum { - Markdown = "markdown", - Gfm = "gfm", +export interface GitGetRefParams { + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; } -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; -} +export type GitGetTagData = GitTag; -export type MarkdownRenderRawData = string; +export interface GitGetTagParams { + owner: string; + repo: string; + tagSha: string; +} -export type MarkdownRenderRawPayload = string; +export type GitGetTreeData = GitTree; -/** 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 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; } -/** - * Marketplace Listing Plan - * Marketplace Listing Plan - */ -export interface MarketplaceListingPlan { +export type GitListMatchingRefsData = GitRef[]; + +export interface GitListMatchingRefsParams { + owner: string; /** - * @format uri - * @example "https://api.github.com/marketplace_listing/plans/1313/accounts" + * Page number of the results to fetch. + * @default 1 */ - 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; + page?: number; /** - * @format uri - * @example "https://api.github.com/marketplace_listing/plans/1313" + * Results per page (max 100) + * @default 30 */ + per_page?: number; + /** ref+ parameter */ + ref: string; + repo: string; +} + +/** + * 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; - /** @example 11870 */ - yearly_price_in_cents: number; } /** - * Marketplace Purchase - * Marketplace Purchase + * Git Tag + * Metadata for a Git tag */ -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 MetaGetData = ApiOverview; - -export type MetaGetOctocatData = string; - -export interface MetaGetOctocatParams { - /** The words to show in Octocat's speech bubble */ - s?: 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; -} - -/** - * Migration - * A migration. - */ -export interface Migration { - /** @format uri */ - archive_url?: string; +export interface GitTag { /** - * @format date-time - * @example "2015-07-06T15:33:38-07:00" + * Message describing the purpose of the tag + * @example "Initial public release" */ - 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; + message: string; + /** @example "MDM6VGFnOTQwYmQzMzYyNDhlZmFlMGY5ZWU1YmM3YjJkNWM5ODU4ODdiMTZhYw==" */ node_id: string; - owner: SimpleUser | null; - repositories: Repository[]; - /** @example "pending" */ - state: string; + object: { + sha: string; + type: string; + /** @format uri */ + url: string; + }; + /** @example "940bd336248efae0f9ee5bc7b2d5c985887b16ac" */ + sha: string; /** - * @format date-time - * @example "2015-07-06T15:33:38-07:00" + * 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/orgs/octo-org/migrations/79" + * @example "https://api.github.com/repositories/42/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac" */ url: string; + verification?: Verification; } -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; +/** + * 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 MigrationsGetCommitAuthorsData = PorterAuthor[]; +export type GitUpdateRefData = GitRef; -export interface MigrationsGetCommitAuthorsParams { +export interface GitUpdateRefParams { owner: string; + /** ref+ parameter */ + ref: 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 { - owner: 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; } -export type MigrationsGetLargeFilesData = PorterLargeFile[]; - -export interface MigrationsGetLargeFilesParams { - owner: string; - repo: 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 MigrationsGetStatusForAuthenticatedUserData = Migration; - -export interface MigrationsGetStatusForAuthenticatedUserParams { - exclude?: string[]; - /** migration_id parameter */ - migrationId: number; -} +export type GitignoreGetAllTemplatesData = string[]; -export type MigrationsGetStatusForOrgData = Migration; +export type GitignoreGetTemplateData = GitignoreTemplate; -export interface MigrationsGetStatusForOrgParams { - /** migration_id parameter */ - migrationId: number; - org: string; +export interface GitignoreGetTemplateParams { + name: string; } -export type MigrationsListForAuthenticatedUserData = Migration[]; - -export interface MigrationsListForAuthenticatedUserParams { +/** + * Gitignore Template + * Gitignore Template + */ +export interface GitignoreTemplate { + /** @example "C" */ + name: string; /** - * Page number of the results to fetch. - * @default 1 + * @example "# Object files + * *.o + * + * # Libraries + * *.lib + * *.a + * + * # Shared objects (inc. Windows DLLs) + * *.dll + * *.so + * *.so.* + * *.dylib + * + * # Executables + * *.exe + * *.out + * *.app + * " */ - page?: number; + source: string; +} + +/** Gone */ +export type Gone = BasicError; + +/** + * 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; /** - * Results per page (max 100) - * @default 30 + * @format date-time + * @example "2016-03-24T11:31:04-06:00" */ - per_page?: number; + 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 type MigrationsListForOrgData = Migration[]; - -export interface MigrationsListForOrgParams { - org: string; +/** + * GroupMapping + * External Groups to be mapped to a team for membership + */ +export interface GroupMapping { /** - * Page number of the results to fetch. - * @default 1 + * a description of the group + * @example "A group of Developers working on AzureAD SAML SSO" */ - page?: number; + group_description?: string; /** - * Results per page (max 100) - * @default 30 + * The ID of the group + * @example "111a1a11-aaa1-1aaa-11a1-a1a1a1a1a1aa" */ - per_page?: number; -} - -export type MigrationsListReposForOrgData = MinimalRepository[]; - -export interface MigrationsListReposForOrgParams { - /** migration_id parameter */ - migrationId: number; - org: string; + group_id?: string; /** - * Page number of the results to fetch. - * @default 1 + * The name of the group + * @example "saml-azuread-test" */ - page?: number; + group_name?: string; /** - * Results per page (max 100) - * @default 30 + * 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"}] */ - per_page?: number; -} - -export type MigrationsListReposForUserData = MinimalRepository[]; - -export interface MigrationsListReposForUserParams { - /** migration_id parameter */ - migrationId: number; + 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; + }[]; /** - * Page number of the results to fetch. - * @default 1 + * synchronization status for this group mapping + * @example "unsynced" */ - page?: number; + status?: string; /** - * Results per page (max 100) - * @default 30 + * the time of the last sync for this group-mapping + * @example "2019-06-03 22:27:15:000 -700" */ - per_page?: number; -} - -export type MigrationsMapCommitAuthorData = PorterAuthor; - -export interface MigrationsMapCommitAuthorParams { - authorId: number; - owner: string; - repo: 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 MigrationsSetLfsPreferenceData = Import; - -export interface MigrationsSetLfsPreferenceParams { - owner: string; - repo: string; -} - -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; -} - -/** 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", + synced_at?: string; } -export type MigrationsStartForAuthenticatedUserData = Migration; - /** - * Allowed values that can be passed to the exclude param. - * @example "repositories" + * Webhook + * Webhooks for repositories. */ -export enum MigrationsStartForAuthenticatedUserExcludeEnum { - Repositories = "repositories", -} - -export interface MigrationsStartForAuthenticatedUserPayload { +export interface Hook { /** - * Exclude attributes from the API response to improve performance - * @example ["repositories"] + * Determines whether the hook is actually triggered on pushes. + * @example true */ - exclude?: MigrationsStartForAuthenticatedUserExcludeEnum[]; + 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; + }; /** - * Do not include attachments in the migration - * @example true + * @format date-time + * @example "2011-09-06T17:26:27Z" */ - exclude_attachments?: boolean; + created_at: string; /** - * Lock the repositories being migrated at the start of the migration - * @example true + * Determines what events the hook is triggered for. Default: ['push']. + * @example ["push","pull_request"] */ - lock_repositories?: boolean; - repositories: string[]; -} - -export type MigrationsStartForOrgData = Migration; - -export interface MigrationsStartForOrgParams { - org: string; -} - -export interface MigrationsStartForOrgPayload { - exclude?: string[]; + events: string[]; /** - * Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). - * @default false + * Unique identifier of the webhook. + * @example 42 */ - exclude_attachments?: boolean; + id: number; + last_response: HookResponse; /** - * Indicates whether repositories should be locked (to prevent manipulation) while migrating data. - * @default false + * The name of a valid service, use 'web' for a webhook. + * @example "web" */ - lock_repositories?: boolean; - /** A list of arrays indicating which repositories should be migrated. */ - repositories: string[]; + name: 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" + */ + test_url: string; + 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" + */ + url: string; } -export type MigrationsStartImportData = Import; +/** Hook Response */ +export interface HookResponse { + code: number | null; + message: string | null; + status: string | null; +} -export interface MigrationsStartImportParams { - owner: string; - repo: string; +/** + * Hovercard + * Hovercard + */ +export interface Hovercard { + contexts: { + message: string; + octicon: string; + }[]; } -export interface MigrationsStartImportPayload { - /** For a tfvc import, the name of the project that is being imported. */ +/** + * 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; - /** 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; + /** @format uri */ + url: string; + use_lfs?: string; + vcs: string | null; /** 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 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 MigrationsUpdateImportData = Import; - -export interface MigrationsUpdateImportParams { - 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 IncludeEnum { + Web = "web", + Git = "git", + All = "all", } -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; +/** + * 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", } /** - * Milestone - * A collection of related issues and pull requests. + * Installation + * Installation */ -export interface Milestone { - /** - * @format date-time - * @example "2013-02-12T13:22:01Z" - */ - closed_at: string | null; - /** @example 8 */ - closed_issues: number; +export interface Installation { /** - * @format date-time - * @example "2011-04-10T20:09:31Z" + * @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; - creator: SimpleUser | null; - /** @example "Tracking milestone for version 1.0" */ - description: string | null; - /** - * @format date-time - * @example "2012-10-09T23:39:01Z" - */ - due_on: string | null; + events: string[]; + /** @example true */ + has_multiple_single_files?: boolean; /** * @format uri - * @example "https://github.com/octocat/Hello-World/milestones/v1.0" + * @example "https://github.com/organizations/github/settings/installations/1" */ 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: MilestoneStateEnum; - /** - * The title of the milestone. - * @example "v1.0" - */ - title: string; /** - * @format date-time - * @example "2014-03-03T18:58:10Z" + * The ID of the installation. + * @example 1 */ - updated_at: string; + 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/repos/octocat/Hello-World/milestones/1" + * @example "https://api.github.com/installation/repositories" */ - 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", } /** - * The state of the milestone. - * @default "open" - * @example "open" + * Installation Token + * Authentication token for a GitHub App installed on a user or org. */ -export enum MilestoneStateEnum { - Open = "open", - Closed = "closed", +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", } /** - * Minimal Repository - * Minimal Repository + * 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 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 uri - * @example "http://api.github.com/repos/octocat/Hello-World/contributors" - */ - contributors_url: string; +export interface Integration { + /** @example ""Iv1.25b5d1e65ffc4022"" */ + client_id?: string; + /** @example ""1d4b2097ac622ba702d19de498f005747a8b21d3"" */ + client_secret?: 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" + * @example "2017-07-08T16:18:44-04:00" */ - deployments_url: string; - /** @example "This your first repo!" */ + created_at: string; + /** @example "The description of the app." */ 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" + * The list of events for the GitHub app + * @example ["label","deployment"] */ - events_url: string; - fork: boolean; - /** @example 0 */ - forks?: number; - forks_count?: number; + events: string[]; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" + * @example "https://example.com" */ - 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; + external_url: string; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + * @example "https://github.com/apps/super-ci" */ - hooks_url: string; + html_url: string; /** - * @format uri - * @example "https://github.com/octocat/Hello-World" + * Unique identifier of the GitHub app + * @example 37 */ - 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" + * 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" - */ -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 + * Issue Search Result Item + * Issue Search Result Item */ -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 @@ -23082,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 @@ -23106,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 @@ -23121,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 @@ -23136,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 @@ -23155,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 @@ -23178,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 @@ -23225,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 @@ -23256,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 @@ -23293,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 @@ -23309,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 @@ -23331,2541 +22758,2251 @@ 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 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 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 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; -} - -/** - * 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; + languages_url: string; + license?: { + key?: string; + name?: string; + node_id?: string; + spdx_id?: string; + url?: string; + } | null; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins" + * @example "http://api.github.com/repos/octocat/Hello-World/merges" */ - 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; + 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; }; - /** @example true */ - require_code_owner_reviews: boolean; + private: boolean; + /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ + pulls_url: string; /** - * @min 1 - * @max 6 - * @example 2 + * @format date-time + * @example "2011-01-26T19:06:43Z" */ - required_approving_review_count?: 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; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions" + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" */ - 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; - /** @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; - 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 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; -} - -/** - * 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 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; + stargazers_url: string; + /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ + statuses_url: string; + subscribers_count?: number; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" */ - closed_at: string | null; - /** @example 10 */ - comments: number; + subscribers_url: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + * @example "http://api.github.com/repos/octocat/Hello-World/subscription" */ - comments_url: string; - /** @example 3 */ - commits: number; + subscription_url: string; + svn_url?: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" + * @example "http://api.github.com/repos/octocat/Hello-World/tags" */ - commits_url: string; + 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:01:12Z" + * @example "2011-01-26T19:14:43Z" */ - created_at: string; - /** @example 3 */ - deletions: number; + updated_at?: string | null; /** * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.diff" + * @example "https://api.github.com/repos/octocat/Hello-World" */ - diff_url: string; + 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 { /** - * Indicates whether or not the pull request is a draft. - * @example false + * The OAuth app client key for which to create the token. + * @maxLength 20 */ - 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; - /** - * @format date-time - * @example "2011-01-26T19:01:12Z" - */ - merged_at: string | null; - merged_by: SimpleUser | null; - milestone: Milestone | null; - /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ - node_id: string; - /** - * Number uniquely identifying the pull request within its repository. - * @example 42 - */ - number: number; - /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1347.patch" - */ - 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; - /** - * @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: PullRequestStateEnum; - /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" - */ - statuses_url: string; + client_id?: string; /** - * The title of the pull request. - * @example "Amazing new feature" + * The OAuth app client secret for which to create the token. + * @maxLength 40 */ - title: string; + client_secret?: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; /** - * @format date-time - * @example "2011-01-26T19:01:12Z" + * A note to remind you what the OAuth token is for. + * @example "Update all gems" */ - updated_at: string; + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] */ - url: string; - user: SimpleUser | null; + scopes?: string[] | null; } -/** - * Pull Request Merge Result - * Pull Request Merge Result - */ -export interface PullRequestMergeResult { - merged: boolean; - message: string; - sha: string; +export type OauthAuthorizationsDeleteAuthorizationData = any; + +export interface OauthAuthorizationsDeleteAuthorizationParams { + /** authorization_id parameter */ + authorizationId: number; } -/** 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 OauthAuthorizationsDeleteGrantData = any; + +export interface OauthAuthorizationsDeleteGrantParams { + /** grant_id parameter */ + grantId: number; } -/** - * 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; - /** - * 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; +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 { /** - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80" + * The OAuth app client secret for which to create the token. + * @maxLength 40 */ - html_url: string; + client_secret: string; /** - * Unique identifier of the review - * @example 42 + * A note to remind you what the OAuth token is for. + * @example "Update all gems" */ - id: number; - /** @example "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=" */ - node_id: string; + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/12" + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] */ - pull_request_url: string; - /** @example "CHANGES_REQUESTED" */ - state: string; - /** @format date-time */ - submitted_at?: string; - user: SimpleUser | null; + scopes?: string[] | 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; +export type OauthAuthorizationsGetOrCreateAuthorizationForAppData = + Authorization; + +export interface OauthAuthorizationsGetOrCreateAuthorizationForAppParams { + /** The client ID of your GitHub app. */ + clientId: string; +} + +export interface OauthAuthorizationsGetOrCreateAuthorizationForAppPayload { /** - * The text of the comment. - * @example "We should probably include a check for null values here." + * The OAuth app client secret for which to create the token. + * @maxLength 40 */ - body: string; - /** @example ""

comment body

"" */ - body_html?: string; - /** @example ""comment body"" */ - body_text?: string; + client_secret: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; /** - * The SHA of the commit to which the comment applies. - * @example "6dcb09b5b57875f334f61aebed695e2e4193db5e" + * A note to remind you what the OAuth token is for. + * @example "Update all gems" */ - commit_id: string; + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; /** - * @format date-time - * @example "2011-04-14T16:00:49Z" + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] */ - created_at: string; + scopes?: string[] | null; +} + +export type OauthAuthorizationsListAuthorizationsData = Authorization[]; + +export interface OauthAuthorizationsListAuthorizationsParams { /** - * The diff of the line that the comment refers to. - * @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." + * Page number of the results to fetch. + * @default 1 */ - diff_hunk: string; + page?: number; /** - * HTML URL for the pull request review comment. - * @format uri - * @example "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + * Results per page (max 100) + * @default 30 */ - html_url: string; + per_page?: number; +} + +export type OauthAuthorizationsListGrantsData = ApplicationGrant[]; + +export interface OauthAuthorizationsListGrantsParams { /** - * The ID of the pull request review comment. - * @example 1 + * Page number of the results to fetch. + * @default 1 */ - id: number; + page?: number; /** - * The comment ID to reply to. - * @example 8 + * Results per page (max 100) + * @default 30 */ - in_reply_to_id?: number; + 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; /** - * The line of the blob to which the comment applies. The last line of the range for a multi-line comment - * @example 2 + * A note to remind you what the OAuth token is for. + * @example "Update all gems" */ - line?: number; + 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[]; /** - * The node ID of the pull request review comment. - * @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] */ - 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; + scopes?: string[] | null; +} + +/** + * 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", +} + +/** + * 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 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 */ + 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 pull request review to which the comment belongs. - * @example 42 + * @format date-time + * @example "2011-09-06T17:26:27Z" */ - pull_request_review_id: number | null; + created_at: string; + /** @example ["push","pull_request"] */ + events: string[]; + /** @example 1 */ + id: number; + /** @example "web" */ + name: string; /** - * 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" + * @example "https://api.github.com/orgs/octocat/hooks/1/pings" */ - start_side?: PullRequestReviewCommentStartSideEnum | null; + ping_url: string; + type: string; /** * @format date-time - * @example "2011-04-14T16:00:49Z" + * @example "2011-09-06T20:39:23Z" */ updated_at: string; /** - * 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/orgs/octocat/hooks/1" */ url: string; - /** Simple User */ - user: SimpleUser; } /** - * 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" + * Org Membership + * Org Membership */ -export enum PullRequestReviewCommentSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", +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; } /** - * The side of the first line of the range for a multi-line comment. - * @default "RIGHT" + * Actions Secret for an Organization + * Secrets for GitHub Actions for an organization. */ -export enum PullRequestReviewCommentStartSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", +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; + /** @format date-time */ + updated_at: string; + /** Visibility of a secret */ + visibility: OrganizationActionsSecretVisibilityEnum; } -/** - * Pull Request Review Request - * Pull Request Review Request - */ -export interface PullRequestReviewRequest { - teams: TeamSimple[]; - users: SimpleUser[]; +/** Visibility of a secret */ +export enum OrganizationActionsSecretVisibilityEnum { + All = "all", + Private = "private", + Selected = "selected", } /** - * Pull Request Simple - * Pull Request Simple + * Organization Full + * Organization Full */ -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; +export interface OrganizationFull { + /** @example "https://github.com/images/error/octocat_happy.gif" */ + avatar_url: string; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + * @format email + * @example "org@example.com" */ - comments_url: string; + billing_email?: string | null; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" + * @example "https://github.com/blog" */ - commits_url: string; + blog?: string; + /** @example 8 */ + collaborators?: number | null; + /** @example "GitHub" */ + company?: string; /** * @format date-time - * @example "2011-01-26T19:01:12Z" + * @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 uri - * @example "https://github.com/octocat/Hello-World/pull/1347.diff" + * @format email + * @example "octocat@github.com" */ - diff_url: string; + email?: string; /** - * Indicates whether or not the pull request is a draft. - * @example false + * @format uri + * @example "https://api.github.com/orgs/github/events" */ - draft?: boolean; - head: { - label: string; - ref: string; - /** A git repository */ - repo: Repository; - sha: string; - user: SimpleUser | null; - }; + 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/Hello-World/pull/1347" + * @example "https://github.com/octocat" */ 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==" */ + 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 1347 */ - number: number; + /** @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://github.com/octocat/Hello-World/pull/1347.patch" + * @example "https://api.github.com/orgs/github/repos" */ - 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; + 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/repos/octocat/Hello-World/pulls/1347/comments" + * @example "https://api.github.com/orgs/github" */ - review_comments_url: string; - /** @example "open" */ - state: string; + 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; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" + * @example "https://api.github.com/orgs/github/events" */ - statuses_url: string; - /** @example "new-feature" */ - title: string; + 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 date-time - * @example "2011-01-26T19:01:12Z" + * @format uri + * @example "https://api.github.com/orgs/github/repos" */ - updated_at: string; + repos_url: string; /** * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + * @example "https://api.github.com/orgs/github" */ url: string; - user: SimpleUser | null; -} - -/** - * State of this Pull Request. Either \`open\` or \`closed\`. - * @example "open" - */ -export enum PullRequestStateEnum { - Open = "open", - Closed = "closed", } -export type PullsCheckIfMergedData = any; +export type OrgsBlockUserData = any; -export interface PullsCheckIfMergedParams { - owner: string; - pullNumber: number; - repo: string; +export interface OrgsBlockUserParams { + org: string; + username: string; } -export type PullsCreateData = PullRequest; +export type OrgsCancelInvitationData = any; -export interface PullsCreateParams { - owner: string; - repo: string; +export interface OrgsCancelInvitationParams { + /** invitation_id parameter */ + invitationId: number; + org: 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 OrgsCheckBlockedUserData = any; + +export type OrgsCheckBlockedUserError = BasicError; + +export interface OrgsCheckBlockedUserParams { + org: string; + username: string; } -export type PullsCreateReplyForReviewCommentData = PullRequestReviewComment; +export type OrgsCheckMembershipForUserData = any; -export interface PullsCreateReplyForReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - pullNumber: number; - repo: string; +export interface OrgsCheckMembershipForUserParams { + org: string; + username: string; } -export interface PullsCreateReplyForReviewCommentPayload { - /** The text of the review comment. */ - body: string; +export type OrgsCheckPublicMembershipForUserData = any; + +export interface OrgsCheckPublicMembershipForUserParams { + org: string; + username: string; } -export type PullsCreateReviewCommentData = PullRequestReviewComment; +export type OrgsConvertMemberToOutsideCollaboratorData = any; -export interface PullsCreateReviewCommentParams { - owner: string; - pullNumber: number; - repo: string; +export type OrgsConvertMemberToOutsideCollaboratorError = { + documentation_url?: string; + message?: string; +}; + +export interface OrgsConvertMemberToOutsideCollaboratorParams { + 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; +export type OrgsCreateInvitationData = OrganizationInvitation; + +export interface OrgsCreateInvitationParams { + org: 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 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; + /** + * 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?: OrgsCreateInvitationRoleEnum; + /** Specify IDs for the teams you want to invite new members to. */ + team_ids?: 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. */ -export enum PullsCreateReviewCommentStartSideEnum { - LEFT = "LEFT", - RIGHT = "RIGHT", - Side = "side", +/** + * 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 PullsCreateReviewData = PullRequestReview; +export type OrgsCreateWebhookData = OrgHook; -/** 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 OrgsCreateWebhookParams { + org: string; } -export interface PullsCreateReviewParams { - owner: string; - pullNumber: number; - 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 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 OrgsDeleteWebhookData = any; + +export interface OrgsDeleteWebhookParams { + hookId: number; + org: string; } -export type PullsDeletePendingReviewData = PullRequestReview; +export type OrgsGetAuditLogData = AuditLogEvent[]; -export interface PullsDeletePendingReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; +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 type PullsDeleteReviewCommentData = any; +/** + * 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 interface PullsDeleteReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: 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 OrgsGetAuditLogParams1OrderEnum { + Desc = "desc", + Asc = "asc", } -export type PullsDismissReviewData = PullRequestReview; +export type OrgsGetData = OrganizationFull; -export interface PullsDismissReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; -} +export type OrgsGetMembershipForAuthenticatedUserData = OrgMembership; -export interface PullsDismissReviewPayload { - /** @example ""APPROVE"" */ - event?: string; - /** The message for the pull request review dismissal */ - message: string; +export interface OrgsGetMembershipForAuthenticatedUserParams { + org: string; } -export type PullsGetData = PullRequest; +export type OrgsGetMembershipForUserData = OrgMembership; -export interface PullsGetParams { - owner: string; - pullNumber: number; - repo: string; +export interface OrgsGetMembershipForUserParams { + org: string; + username: string; } -export type PullsGetReviewCommentData = PullRequestReviewComment; +export interface OrgsGetParams { + org: string; +} -export interface PullsGetReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +export type OrgsGetWebhookConfigForOrgData = WebhookConfig; + +export interface OrgsGetWebhookConfigForOrgParams { + hookId: number; + org: string; } -export type PullsGetReviewData = PullRequestReview; +export type OrgsGetWebhookData = OrgHook; -export interface PullsGetReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; +export interface OrgsGetWebhookParams { + hookId: number; + org: string; } -export type PullsListCommentsForReviewData = ReviewComment[]; +export interface OrgsListAppInstallationsData { + installations: Installation[]; + total_count: number; +} -export interface PullsListCommentsForReviewParams { - owner: string; +export interface OrgsListAppInstallationsParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -25876,16 +25013,20 @@ export interface PullsListCommentsForReviewParams { * @default 30 */ per_page?: number; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; } -export type PullsListCommitsData = Commit[]; +export type OrgsListBlockedUsersData = SimpleUser[]; -export interface PullsListCommitsParams { - owner: string; +export interface OrgsListBlockedUsersParams { + org: string; +} + +export type OrgsListData = OrganizationSimple[]; + +export type OrgsListFailedInvitationsData = OrganizationInvitation[]; + +export interface OrgsListFailedInvitationsParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -25896,16 +25037,11 @@ export interface PullsListCommitsParams { * @default 30 */ per_page?: number; - pullNumber: number; - repo: string; } -export type PullsListData = PullRequestSimple[]; - -export type PullsListFilesData = DiffEntry[]; +export type OrgsListForAuthenticatedUserData = OrganizationSimple[]; -export interface PullsListFilesParams { - owner: string; +export interface OrgsListForAuthenticatedUserParams { /** * Page number of the results to fetch. * @default 1 @@ -25916,18 +25052,11 @@ export interface PullsListFilesParams { * @default 30 */ 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; +export type OrgsListForUserData = OrganizationSimple[]; + +export interface OrgsListForUserParams { /** * Page number of the results to fetch. * @default 1 @@ -25938,50 +25067,15 @@ export interface PullsListParams { * @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; -} - -/** 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", -} - -/** - * 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", -} - -/** - * Either \`open\`, \`closed\`, or \`all\` to filter by state. - * @default "open" - */ -export enum PullsListParams1StateEnum { - Open = "open", - Closed = "closed", - All = "all", + username: string; } -export type PullsListRequestedReviewersData = PullRequestReviewRequest; +export type OrgsListInvitationTeamsData = Team[]; -export interface PullsListRequestedReviewersParams { - owner: string; +export interface OrgsListInvitationTeamsParams { + /** invitation_id parameter */ + invitationId: number; + org: string; /** * Page number of the results to fetch. * @default 1 @@ -25992,18 +25086,19 @@ export interface PullsListRequestedReviewersParams { * @default 30 */ per_page?: number; - pullNumber: number; - repo: string; } -export type PullsListReviewCommentsData = PullRequestReviewComment[]; - -export type PullsListReviewCommentsForRepoData = PullRequestReviewComment[]; +export type OrgsListMembersData = SimpleUser[]; -export interface PullsListReviewCommentsForRepoParams { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: DirectionEnum11; - owner: string; +export interface OrgsListMembersParams { + /** + * 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?: FilterEnum2; + org: string; /** * Page number of the results to fetch. * @default 1 @@ -26014,35 +25109,43 @@ export interface PullsListReviewCommentsForRepoParams { * @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" + * 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" */ - sort?: SortEnum10; + role?: RoleEnum; } -/** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ -export enum PullsListReviewCommentsForRepoParams1DirectionEnum { - Asc = "asc", - Desc = "desc", +/** + * 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 OrgsListMembersParams1FilterEnum { + Value2FaDisabled = "2fa_disabled", + All = "all", } /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * 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 PullsListReviewCommentsForRepoParams1SortEnum { - Created = "created", - Updated = "updated", +export enum OrgsListMembersParams1RoleEnum { + All = "all", + Admin = "admin", + Member = "member", } -export interface PullsListReviewCommentsParams { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: DirectionEnum12; - owner: string; +export type OrgsListMembershipsForAuthenticatedUserData = OrgMembership[]; + +export interface OrgsListMembershipsForAuthenticatedUserParams { /** * Page number of the results to fetch. * @default 1 @@ -26053,36 +25156,27 @@ export interface PullsListReviewCommentsParams { * @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", + /** 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; } -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum PullsListReviewCommentsParams1SortEnum { - Created = "created", - Updated = "updated", +/** 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 PullsListReviewsData = PullRequestReview[]; +export type OrgsListOutsideCollaboratorsData = SimpleUser[]; -export interface PullsListReviewsParams { - owner: string; +export interface OrgsListOutsideCollaboratorsParams { + /** + * 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?: FilterEnum3; + org: string; /** * Page number of the results to fetch. * @default 1 @@ -26093,4641 +25187,5586 @@ export interface PullsListReviewsParams { * @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", +/** + * 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 PullsMergeParams { - owner: string; - pullNumber: number; - repo: string; +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; } -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 type OrgsListPendingInvitationsData = OrganizationInvitation[]; -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 interface OrgsListPendingInvitationsParams { + 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 PullsRequestReviewersData = PullRequestSimple; - -export interface PullsRequestReviewersParams { - owner: string; - pullNumber: number; - repo: string; -} +export type OrgsListPublicMembersData = SimpleUser[]; -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 interface OrgsListPublicMembersParams { + 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 PullsSubmitReviewData = PullRequestReview; +export type OrgsListSamlSsoAuthorizationsData = CredentialAuthorization[]; -/** 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 OrgsListSamlSsoAuthorizationsParams { + org: string; } -export interface PullsSubmitReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; -} +export type OrgsListWebhooksData = OrgHook[]; -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 OrgsListWebhooksParams { + 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 PullsUpdateBranchData { - message?: string; - url?: string; -} +export type OrgsPingWebhookData = any; -export interface PullsUpdateBranchParams { - owner: string; - pullNumber: number; - repo: string; +export interface OrgsPingWebhookParams { + hookId: number; + org: 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; -} +export type OrgsRemoveMemberData = any; -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 OrgsRemoveMemberParams { + org: string; + username: string; } -export type PullsUpdateReviewCommentData = PullRequestReviewComment; +export type OrgsRemoveMembershipForUserData = any; -export interface PullsUpdateReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +export interface OrgsRemoveMembershipForUserParams { + org: string; + username: string; } -export interface PullsUpdateReviewCommentPayload { - /** The text of the reply to the review comment. */ - body: string; -} +export type OrgsRemoveOutsideCollaboratorData = any; -export type PullsUpdateReviewData = PullRequestReview; +export type OrgsRemoveOutsideCollaboratorError = { + documentation_url?: string; + message?: string; +}; -export interface PullsUpdateReviewParams { - owner: string; - pullNumber: number; - repo: string; - /** review_id parameter */ - reviewId: number; +export interface OrgsRemoveOutsideCollaboratorParams { + org: string; + username: string; } -export interface PullsUpdateReviewPayload { - /** The body text of the pull request review. */ - body: string; -} +export type OrgsRemovePublicMembershipForAuthenticatedUserData = any; -/** State of this Pull Request. Either \`open\` or \`closed\`. */ -export enum PullsUpdateStateEnum { - Open = "open", - Closed = "closed", +export interface OrgsRemovePublicMembershipForAuthenticatedUserParams { + org: string; + username: string; } -/** Rate Limit */ -export interface RateLimit { - limit: number; - remaining: number; - reset: number; +export type OrgsRemoveSamlSsoAuthorizationData = any; + +export interface OrgsRemoveSamlSsoAuthorizationParams { + credentialId: number; + org: string; } -export type RateLimitGetData = RateLimitOverview; +export type OrgsSetMembershipForUserData = OrgMembership; -/** - * 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 interface OrgsSetMembershipForUserParams { + org: string; + username: string; } -/** - * 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; +export interface OrgsSetMembershipForUserPayload { /** - * @format date-time - * @example "2016-05-20T20:09:31Z" + * 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" */ - created_at: string; - /** @example 1 */ - id: number; - /** @example "MDg6UmVhY3Rpb24x" */ - node_id: string; - user: SimpleUser | null; + role?: OrgsSetMembershipForUserRoleEnum; } /** - * The reaction to use - * @example "heart" + * 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 ReactionContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", +export enum OrgsSetMembershipForUserRoleEnum { + Admin = "admin", + Member = "member", } -/** 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 type OrgsSetPublicMembershipForAuthenticatedUserData = any; -/** 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 OrgsSetPublicMembershipForAuthenticatedUserParams { + org: string; + username: string; } -export type ReactionsCreateForCommitCommentData = Reaction; +export type OrgsUnblockUserData = any; -export interface ReactionsCreateForCommitCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +export interface OrgsUnblockUserParams { + org: string; + username: string; } -export interface ReactionsCreateForCommitCommentPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ - content: ReactionsCreateForCommitCommentContentEnum; -} +export type OrgsUpdateData = OrganizationFull; -/** 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", +/** + * 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 ReactionsCreateForIssueCommentData = Reaction; +export type OrgsUpdateError = ValidationError | ValidationErrorSimple; -export interface ReactionsCreateForIssueCommentParams { - /** 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 interface ReactionsCreateForIssueCommentPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ - content: ReactionsCreateForIssueCommentContentEnum; -} +export type OrgsUpdateMembershipForAuthenticatedUserData = OrgMembership; -/** 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 interface OrgsUpdateMembershipForAuthenticatedUserParams { + org: string; } -export type ReactionsCreateForIssueData = Reaction; +export interface OrgsUpdateMembershipForAuthenticatedUserPayload { + /** The state that the membership should be in. Only \`"active"\` will be accepted. */ + state: OrgsUpdateMembershipForAuthenticatedUserStateEnum; +} -export interface ReactionsCreateForIssueParams { - /** 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 ReactionsCreateForIssuePayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ - content: ReactionsCreateForIssueContentEnum; +export interface OrgsUpdateParams { + org: 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 interface OrgsUpdatePayload { + /** 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?: 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; + /** + * 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?: OrgsUpdateMembersAllowedRepositoryCreationTypeEnum; + /** + * 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; } -export type ReactionsCreateForPullRequestReviewCommentData = Reaction; +export type OrgsUpdateWebhookConfigForOrgData = WebhookConfig; -export interface ReactionsCreateForPullRequestReviewCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; +export interface OrgsUpdateWebhookConfigForOrgParams { + hookId: number; + org: string; } -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; +/** @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 [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 ReactionsCreateForTeamDiscussionCommentInOrgData = Reaction; +export type OrgsUpdateWebhookData = OrgHook; -export interface ReactionsCreateForTeamDiscussionCommentInOrgParams { - commentNumber: number; - discussionNumber: number; +export interface OrgsUpdateWebhookParams { + hookId: number; org: string; - /** team_slug parameter */ - teamSlug: 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; -} - -/** 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 ReactionsCreateForTeamDiscussionCommentLegacyData = Reaction; - -export interface ReactionsCreateForTeamDiscussionCommentLegacyParams { - commentNumber: number; - discussionNumber: number; - teamId: number; -} - -export interface ReactionsCreateForTeamDiscussionCommentLegacyPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ - content: ReactionsCreateForTeamDiscussionCommentLegacyContentEnum; } -/** 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 OrgsUpdateWebhookPayload { + /** + * 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"] + */ + events?: string[]; + /** @example ""web"" */ + name?: string; } -export type ReactionsCreateForTeamDiscussionInOrgData = Reaction; - -export interface ReactionsCreateForTeamDiscussionInOrgParams { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: 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; } -export interface ReactionsCreateForTeamDiscussionInOrgPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ - content: ReactionsCreateForTeamDiscussionInOrgContentEnum; +/** + * GitHub Pages + * The configuration for GitHub Pages for a repository. + */ +export interface Page { + /** + * Whether the Page has a custom 404 page. + * @default false + * @example false + */ + custom_404: boolean; + /** + * The Pages site's custom domain + * @example "example.com" + */ + cname: string | null; + /** + * 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" + */ + status: PageStatusEnum | null; + /** + * The API address for accessing this Page resource. + * @format uri + * @example "https://api.github.com/repos/github/hello-world/pages" + */ + url: 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", +/** + * 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; } -export type ReactionsCreateForTeamDiscussionLegacyData = Reaction; - -export interface ReactionsCreateForTeamDiscussionLegacyParams { - discussionNumber: number; - teamId: number; +/** + * 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" + */ + url: string; } -export interface ReactionsCreateForTeamDiscussionLegacyPayload { - /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ - content: ReactionsCreateForTeamDiscussionLegacyContentEnum; +/** + * The status of the most recent build of the Page. + * @example "built" + */ +export enum PageStatusEnum { + Built = "built", + Building = "building", + Errored = "errored", } -export type ReactionsDeleteForCommitCommentData = any; - -export interface ReactionsDeleteForCommitCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - reactionId: number; - repo: string; +/** Pages Source Hash */ +export interface PagesSourceHash { + branch: string; + path: string; } -export type ReactionsDeleteForIssueCommentData = any; - -export interface ReactionsDeleteForIssueCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - reactionId: number; - repo: string; +/** Participation Stats */ +export interface ParticipationStats { + all: number[]; + owner: number[]; } -export type ReactionsDeleteForIssueData = any; - -export interface ReactionsDeleteForIssueParams { - /** issue_number parameter */ - issueNumber: number; - owner: string; - reactionId: number; - repo: string; +/** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ +export enum PerEnum { + Day = "day", + Week = "week", } -export type ReactionsDeleteForPullRequestCommentData = any; - -export interface ReactionsDeleteForPullRequestCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - reactionId: number; - repo: string; +/** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ +export enum PerEnum1 { + Day = "day", + Week = "week", } -export type ReactionsDeleteForTeamDiscussionCommentData = any; - -export interface ReactionsDeleteForTeamDiscussionCommentParams { - commentNumber: number; - discussionNumber: number; - org: string; - reactionId: number; - /** team_slug parameter */ - teamSlug: 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; } -export type ReactionsDeleteForTeamDiscussionData = any; - -export interface ReactionsDeleteForTeamDiscussionParams { - discussionNumber: number; - org: string; - reactionId: number; - /** team_slug parameter */ - teamSlug: string; +/** + * Porter Large File + * Porter Large File + */ +export interface PorterLargeFile { + oid: string; + path: string; + ref_name: string; + size: number; } -export type ReactionsDeleteLegacyData = any; - -export interface ReactionsDeleteLegacyParams { - reactionId: number; +/** Preview Header Missing */ +export interface PreviewHeaderMissing { + documentation_url: string; + message: string; } -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. - * @default 1 - */ - page?: number; +/** + * Private User + * Private User + */ +export interface PrivateUser { /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://github.com/images/error/octocat_happy.gif" */ - 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", -} - -export type ReactionsListForIssueCommentData = Reaction[]; - -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; + 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; /** - * Page number of the results to fetch. - * @default 1 + * @format date-time + * @example "2008-01-14T04:33:35Z" */ - page?: number; + created_at: string; + /** @example 10000 */ + disk_usage: number; /** - * Results per page (max 100) - * @default 30 + * @format email + * @example "octocat@github.com" */ - 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 comment. */ -export enum ReactionsListForIssueCommentParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", -} - -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; + email: string | null; + /** @example "https://api.github.com/users/octocat/events{/privacy}" */ + events_url: string; + /** @example 20 */ + followers: number; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "https://api.github.com/users/octocat/followers" */ - page?: 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; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://github.com/octocat" */ - 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", -} - -export type ReactionsListForPullRequestReviewCommentData = Reaction[]; - -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; + 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; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "https://api.github.com/users/octocat/orgs" */ - page?: number; + 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; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://api.github.com/users/octocat/received_events" */ - 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 ReactionsListForTeamDiscussionCommentInOrgData = Reaction[]; - -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; + received_events_url: string; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "https://api.github.com/users/octocat/repos" */ - page?: number; + repos_url: string; + site_admin: boolean; + /** @example "https://api.github.com/users/octocat/starred{/owner}{/repo}" */ + starred_url: string; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://api.github.com/users/octocat/subscriptions" */ - per_page?: number; - /** team_slug parameter */ - teamSlug: 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 ReactionsListForTeamDiscussionCommentLegacyData = Reaction[]; - -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; + 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; /** - * Page number of the results to fetch. - * @default 1 + * @format date-time + * @example "2008-01-14T04:33:35Z" */ - page?: number; + updated_at: string; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://api.github.com/users/octocat" */ - per_page?: number; - teamId: 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. */ -export enum ReactionsListForTeamDiscussionCommentLegacyParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", + url: string; } -export type ReactionsListForTeamDiscussionInOrgData = Reaction[]; - -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. - * @default 1 - */ - page?: number; +/** + * Project + * Projects are a way to organize columns and cards of work. + */ +export interface Project { /** - * Results per page (max 100) - * @default 30 + * Body of the project + * @example "This project represents the sprint of the first week in January" */ - per_page?: number; - /** team_slug parameter */ - teamSlug: 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 ReactionsListForTeamDiscussionLegacyData = Reaction[]; - -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; + body: string | null; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "https://api.github.com/projects/1002604/columns" */ - page?: number; + columns_url: string; /** - * Results per page (max 100) - * @default 30 + * @format date-time + * @example "2011-04-10T20:09:31Z" */ - per_page?: number; - teamId: 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 ReactionsListForTeamDiscussionLegacyParams1ContentEnum { - Value1 = "+1", - Value11 = "-1", - Laugh = "laugh", - Confused = "confused", - Heart = "heart", - Hooray = "hooray", - Rocket = "rocket", - Eyes = "eyes", -} - -/** - * Referrer Traffic - * Referrer Traffic - */ -export interface ReferrerTraffic { - /** @example 4 */ - count: number; - /** @example "Google" */ - referrer: string; - /** @example 3 */ - uniques: 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; + creator: SimpleUser | null; /** - * true to create a draft (unpublished) release, false to create a published one. - * @example false + * @format uri + * @example "https://github.com/api-playground/projects-test/projects/12" */ - draft: boolean; - /** @format uri */ html_url: string; + /** @example 1002604 */ id: number; - name: string | null; + /** + * 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; /** - * Whether to identify the release as a prerelease or a full release. - * @example false + * @format uri + * @example "https://api.github.com/repos/api-playground/projects-test" */ - prerelease: boolean; - /** @format date-time */ - published_at: string | null; + owner_url: string; + /** Whether or not this project can be seen by everyone. Only present if owner is an organization. */ + private?: boolean; /** - * The name of the tag. - * @example "v1.0.0" + * State of the project; either 'open' or 'closed' + * @example "open" */ - tag_name: string; - /** @format uri */ - tarball_url: string | null; + state: string; /** - * Specifies the commitish value that determines where the Git tag is created from. - * @example "master" + * @format date-time + * @example "2014-03-03T18:58:10Z" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/projects/1002604" */ - target_commitish: string; - upload_url: string; - /** @format uri */ url: string; - /** @format uri */ - zipball_url: string | null; } /** - * Release Asset - * Data related to a release. + * Project Card + * Project cards represent a scope of work. */ -export interface ReleaseAsset { - /** @format uri */ - browser_download_url: string; - content_type: string; - /** @format date-time */ +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; - download_count: number; - id: number; - label: string | null; + creator: SimpleUser | null; /** - * The file name of the asset. - * @example "Team Environment" + * The project card's ID + * @example 42 */ - name: string; + id: number; + /** @example "MDExOlByb2plY3RDYXJkMTQ3OA==" */ node_id: string; - size: number; - /** State of the release asset. */ - state: ReleaseAssetStateEnum; - /** @format date-time */ + /** @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; - uploader: SimpleUser | null; - /** @format uri */ + /** + * @format uri + * @example "https://api.github.com/projects/columns/cards/1478" + */ url: string; } -/** State of the release asset. */ -export enum ReleaseAssetStateEnum { - Uploaded = "uploaded", - Open = "open", -} - /** - * Repo Search Result Item - * Repo Search Result Item + * Project Column + * Project columns contain cards of work. */ -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 */ +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; - 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; + /** + * The unique identifier of the project column + * @example 42 + */ 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 of the project column + * @example "Remaining tasks" + */ name: string; + /** @example "MDEzOlByb2plY3RDb2x1bW4zNjc=" */ 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 */ + /** + * @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 */ + /** + * @format uri + * @example "https://api.github.com/projects/columns/367" + */ 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[]; +/** 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 ReposAddCollaboratorData = RepositoryInvitation; +export type ProjectsAddCollaboratorData = any; -export interface ReposAddCollaboratorParams { - owner: string; - repo: string; +export interface ProjectsAddCollaboratorParams { + projectId: number; username: string; } -export interface ReposAddCollaboratorPayload { +export interface ProjectsAddCollaboratorPayload { /** - * 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" + * The permission to grant the collaborator. + * @default "write" + * @example "write" */ - permission?: ReposAddCollaboratorPermissionEnum; - /** @example ""push"" */ - permissions?: string; + permission?: ProjectsAddCollaboratorPermissionEnum; } /** - * 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" + * The permission to grant the collaborator. + * @default "write" + * @example "write" */ -export enum ReposAddCollaboratorPermissionEnum { - Pull = "pull", - Push = "push", +export enum ProjectsAddCollaboratorPermissionEnum { + Read = "read", + Write = "write", Admin = "admin", - Maintain = "maintain", - Triage = "triage", } -export type ReposAddStatusCheckContextsData = string[]; +export type ProjectsCreateCardData = ProjectCard; -export interface ReposAddStatusCheckContextsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} +export type ProjectsCreateCardError = + | (ValidationError | ValidationErrorSimple) + | { + code?: string; + documentation_url?: string; + errors?: { + code?: string; + message?: string; + }[]; + message?: string; + }; -/** @example {"contexts":["contexts"]} */ -export interface ReposAddStatusCheckContextsPayload { - /** contexts parameter */ - contexts: string[]; +export interface ProjectsCreateCardParams { + /** column_id parameter */ + columnId: number; } -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 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 ReposAddUserAccessRestrictionsData = SimpleUser[]; +export type ProjectsCreateColumnData = ProjectColumn; -export interface ReposAddUserAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export interface ProjectsCreateColumnParams { + projectId: number; } -/** @example {"users":["mona"]} */ -export interface ReposAddUserAccessRestrictionsPayload { - /** users parameter */ - users: string[]; +export interface ProjectsCreateColumnPayload { + /** + * Name of the project column + * @example "Remaining tasks" + */ + name: string; } -export type ReposCheckCollaboratorData = any; +export type ProjectsCreateForAuthenticatedUserData = Project; -export interface ReposCheckCollaboratorParams { - owner: string; - repo: string; - username: string; +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 ReposCheckVulnerabilityAlertsData = any; +export type ProjectsCreateForOrgData = Project; -export interface ReposCheckVulnerabilityAlertsParams { - owner: string; - repo: string; +export interface ProjectsCreateForOrgParams { + org: string; } -export type ReposCompareCommitsData = CommitComparison; - -export interface ReposCompareCommitsParams { - base: string; - head: string; - owner: string; - repo: string; +export interface ProjectsCreateForOrgPayload { + /** The description of the project. */ + body?: string; + /** The name of the project. */ + name: string; } -export type ReposCreateCommitCommentData = CommitComment; +export type ProjectsCreateForRepoData = Project; -export interface ReposCreateCommitCommentParams { - /** commit_sha parameter */ - commitSha: string; +export interface ProjectsCreateForRepoParams { 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 interface ProjectsCreateForRepoPayload { + /** The description of the project. */ + body?: string; + /** The name of the project. */ + name: string; } -export type ReposCreateCommitSignatureProtectionData = - ProtectedBranchAdminEnforced; +export type ProjectsDeleteCardData = any; -export interface ReposCreateCommitSignatureProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export type ProjectsDeleteCardError = { + documentation_url?: string; + errors?: string[]; + message?: string; +}; + +export interface ProjectsDeleteCardParams { + /** card_id parameter */ + cardId: number; } -export type ReposCreateCommitStatusData = Status; +export type ProjectsDeleteColumnData = any; -export interface ReposCreateCommitStatusParams { - owner: string; - repo: string; - sha: string; +export interface ProjectsDeleteColumnParams { + /** column_id parameter */ + columnId: number; } -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 ProjectsDeleteData = any; -/** 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 ProjectsDeleteError = { + documentation_url?: string; + errors?: string[]; + message?: string; +}; + +export interface ProjectsDeleteParams { + projectId: number; } -export type ReposCreateDeployKeyData = DeployKey; +export type ProjectsGetCardData = ProjectCard; -export interface ReposCreateDeployKeyParams { - owner: string; - repo: string; +export interface ProjectsGetCardParams { + /** card_id parameter */ + cardId: number; } -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 ProjectsGetColumnData = ProjectColumn; + +export interface ProjectsGetColumnParams { + /** column_id parameter */ + columnId: number; } -export type ReposCreateDeploymentData = Deployment; +export type ProjectsGetData = Project; -export type ReposCreateDeploymentError = { - /** @example ""https://docs.github.com/rest/reference/repos#create-a-deployment"" */ - documentation_url?: string; - message?: string; -}; +export interface ProjectsGetParams { + projectId: number; +} -export interface ReposCreateDeploymentParams { - owner: string; - repo: string; +export type ProjectsGetPermissionForUserData = RepositoryCollaboratorPermission; + +export interface ProjectsGetPermissionForUserParams { + projectId: number; + username: string; } -export interface ReposCreateDeploymentPayload { +export type ProjectsListCardsData = ProjectCard[]; + +export interface ProjectsListCardsParams { /** - * Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. - * @default true + * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. + * @default "not_archived" */ - auto_merge?: boolean; - /** @example ""1776-07-04T00:00:00.000-07:52"" */ - created_at?: string; + archived_state?: ArchivedStateEnum; + /** column_id parameter */ + columnId: number; /** - * Short description of the deployment. - * @default "" + * Page number of the results to fetch. + * @default 1 */ - description?: string | null; + page?: number; /** - * Name for the target deployment environment (e.g., \`production\`, \`staging\`, \`qa\`). - * @default "production" + * Results per page (max 100) + * @default 30 */ - environment?: string; - /** JSON payload with extra information about the deployment. */ - payload?: Record | string; + per_page?: number; +} + +/** + * 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 ProjectsListCollaboratorsData = SimpleUser[]; + +export interface ProjectsListCollaboratorsParams { /** - * 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. + * 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" */ - 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[]; + affiliation?: AffiliationEnum; /** - * Specifies a task to execute (e.g., \`deploy\` or \`deploy:migrations\`). - * @default "deploy" + * Page number of the results to fetch. + * @default 1 */ - task?: string; + page?: number; /** - * 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 + * Results per page (max 100) + * @default 30 */ - transient_environment?: boolean; + per_page?: number; + projectId: number; } -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", +/** + * 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 interface ReposCreateDeploymentStatusParams { - /** deployment_id parameter */ - deploymentId: number; - owner: string; - repo: string; -} +export type ProjectsListColumnsData = ProjectColumn[]; -export interface ReposCreateDeploymentStatusPayload { +export interface ProjectsListColumnsParams { /** - * 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. + * Page number of the results to fetch. + * @default 1 */ - auto_inactive?: boolean; + page?: number; /** - * A short description of the status. The maximum description length is 140 characters. - * @default "" + * Results per page (max 100) + * @default 30 */ - 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; + per_page?: number; + projectId: number; +} + +export type ProjectsListForOrgData = Project[]; + +export interface ProjectsListForOrgParams { + org: string; /** - * 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 "" + * Page number of the results to fetch. + * @default 1 */ - environment_url?: string; + page?: number; /** - * 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 "" + * Results per page (max 100) + * @default 30 */ - 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; + per_page?: number; /** - * 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 "" + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" */ - target_url?: string; + state?: StateEnum2; } -/** 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", +/** + * 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 ReposCreateDispatchEventData = any; +export type ProjectsListForRepoData = Project[]; -export interface ReposCreateDispatchEventParams { +export interface ProjectsListForRepoParams { 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 { /** - * Whether to allow merge commits for pull requests. - * @default true - * @example true + * Page number of the results to fetch. + * @default 1 */ - allow_merge_commit?: boolean; + page?: number; /** - * Whether to allow rebase merges for pull requests. - * @default true - * @example true + * Results per page (max 100) + * @default 30 */ - allow_rebase_merge?: boolean; + per_page?: number; + repo: string; /** - * Whether to allow squash merges for pull requests. - * @default true - * @example true + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" */ - allow_squash_merge?: boolean; + 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 { /** - * Whether the repository is initialized with a minimal README. - * @default false + * Page number of the results to fetch. + * @default 1 */ - auto_init?: boolean; + page?: number; /** - * Whether to delete head branches when pull requests are merged - * @default false - * @example false + * Results per page (max 100) + * @default 30 */ - delete_branch_on_merge?: boolean; - /** A short description of the repository. */ - description?: string; + per_page?: number; /** - * The desired language or platform to apply to the .gitignore. - * @example "Haskell" + * Indicates the state of the projects to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" */ - gitignore_template?: string; + state?: StateEnum10; + username: string; +} + +/** + * 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 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 { /** - * Whether downloads are enabled. - * @default true - * @example true + * The unique identifier of the column the card should be moved to + * @example 42 */ - has_downloads?: boolean; + column_id?: number; /** - * Whether issues are enabled. - * @default true - * @example true + * The position of the card in a column + * @pattern ^(?:top|bottom|after:\\d+)$ + * @example "bottom" */ - has_issues?: boolean; + position: string; +} + +export type ProjectsMoveColumnData = object; + +export interface ProjectsMoveColumnParams { + /** column_id parameter */ + columnId: number; +} + +export interface ProjectsMoveColumnPayload { /** - * Whether projects are enabled. - * @default true - * @example true + * The position of the column in a project + * @pattern ^(?:first|last|after:\\d+)$ + * @example "last" */ - 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; + position: string; } -export type ReposCreateForkData = Repository; - -export interface ReposCreateForkParams { - owner: string; - repo: string; -} +export type ProjectsRemoveCollaboratorData = any; -export interface ReposCreateForkPayload { - /** Optional parameter to specify the organization name if forking into an organization. */ - organization?: string; +export interface ProjectsRemoveCollaboratorParams { + projectId: number; + username: string; } -export type ReposCreateInOrgData = Repository; +export type ProjectsUpdateCardData = ProjectCard; -export interface ReposCreateInOrgParams { - org: string; +export interface ProjectsUpdateCardParams { + /** card_id parameter */ + cardId: number; } -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; - /** - * 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; +export interface ProjectsUpdateCardPayload { /** - * Either \`true\` to create a private repository or \`false\` to create a public one. - * @default false + * Whether or not the card is archived + * @example 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; + archived?: 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\`. 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. + * The project card's note + * @example "Update all gems" */ - visibility?: ReposCreateInOrgVisibilityEnum; -} - -/** - * 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", + note?: string | null; } -export type ReposCreateOrUpdateFileContentsData = FileCommit; +export type ProjectsUpdateColumnData = ProjectColumn; -export interface ReposCreateOrUpdateFileContentsParams { - owner: string; - /** path+ parameter */ - path: string; - repo: string; +export interface ProjectsUpdateColumnParams { + /** column_id parameter */ + columnId: number; } -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; +export interface ProjectsUpdateColumnPayload { + /** + * Name of the project column + * @example "Remaining tasks" + */ + name: string; } -export type ReposCreatePagesSiteData = Page; - -export interface ReposCreatePagesSiteParams { - owner: string; - repo: string; -} +export type ProjectsUpdateData = Project; -/** - * 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 ProjectsUpdateError = { + documentation_url?: string; + errors?: string[]; + message?: string; +}; -/** 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; - }; +/** The baseline permission that all organization members have on this project */ +export enum ProjectsUpdateOrganizationPermissionEnum { + Read = "read", + Write = "write", + Admin = "admin", + None = "none", } -export type ReposCreateReleaseData = Release; - -export interface ReposCreateReleaseParams { - owner: string; - repo: string; +export interface ProjectsUpdateParams { + projectId: number; } -export interface ReposCreateReleasePayload { - /** Text describing the contents of the tag. */ - body?: string; +export interface ProjectsUpdatePayload { /** - * \`true\` to create a draft (unpublished) release, \`false\` to create a published one. - * @default false + * 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" */ - draft?: boolean; - /** The name of the release. */ 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; /** - * \`true\` to identify the release as a prerelease. \`false\` to identify the release as a full release. - * @default false + * State of the project; either 'open' or 'closed' + * @example "open" */ - 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; + state?: string; } -export type ReposCreateUsingTemplateData = Repository; - -export interface ReposCreateUsingTemplateParams { - templateOwner: string; - templateRepo: 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; } -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; +/** + * Protected Branch Admin Enforced + * Protected Branch Admin Enforced + */ +export interface ProtectedBranchAdminEnforced { + /** @example true */ + enabled: boolean; /** - * Either \`true\` to create a new private repository or \`false\` to create a new public one. - * @default false + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins" */ - private?: boolean; -} - -export type ReposCreateWebhookData = Hook; - -export interface ReposCreateWebhookParams { - owner: string; - repo: string; + url: string; } -export interface ReposCreateWebhookPayload { +/** + * 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; /** - * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. - * @default true + * @min 1 + * @max 6 + * @example 2 */ - 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; - }; + required_approving_review_count?: number; /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - * @default ["push"] + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions" */ - events?: string[]; - /** Use \`web\` to create a webhook. Default: \`web\`. This parameter only accepts the value \`web\`. */ - name?: string; -} - -export type ReposDeclineInvitationData = any; - -export interface ReposDeclineInvitationParams { - /** invitation_id parameter */ - invitationId: number; -} - -export type ReposDeleteAccessRestrictionsData = any; - -export interface ReposDeleteAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -export type ReposDeleteAdminBranchProtectionData = any; - -export interface ReposDeleteAdminBranchProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -export type ReposDeleteBranchProtectionData = any; - -export interface ReposDeleteBranchProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; -} - -export type ReposDeleteCommitCommentData = any; - -export interface ReposDeleteCommitCommentParams { - /** comment_id parameter */ - commentId: number; - owner: string; - repo: string; + url?: string; } -export type ReposDeleteCommitSignatureProtectionData = any; - -export interface ReposDeleteCommitSignatureProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: 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; + /** @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; + 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 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; } -export type ReposDeleteData = any; - -export type ReposDeleteDeployKeyData = any; - -export interface ReposDeleteDeployKeyParams { - /** key_id parameter */ - keyId: number; +/** + * 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 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; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + */ + comments_url: string; + /** @example 3 */ + commits: number; + /** + * @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; + /** @example 3 */ + deletions: number; + /** + * @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; + 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; + /** + * @format date-time + * @example "2011-01-26T19:01:12Z" + */ + merged_at: string | null; + merged_by: SimpleUser | null; + milestone: Milestone | null; + /** @example "MDExOlB1bGxSZXF1ZXN0MQ==" */ + node_id: string; + /** + * Number uniquely identifying the pull request within its repository. + * @example 42 + */ + number: number; + /** + * @format uri + * @example "https://github.com/octocat/Hello-World/pull/1347.patch" + */ + 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; + /** + * @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: PullRequestStateEnum; + /** + * @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" + */ + updated_at: string; + /** + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + */ + url: string; + user: SimpleUser | null; +} + +/** + * Pull Request Merge Result + * Pull Request Merge Result + */ +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; + }; + sha: string; + }; + head: { + ref: string; + repo: { + id: number; + name: string; + url: string; + }; + sha: string; + }; + id: number; + number: number; + url: string; +} + +/** + * 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; + /** + * 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; +} + +/** + * 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; + /** + * 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; +} + +/** + * 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", +} + +/** + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" + */ +export enum PullRequestReviewCommentStartSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", +} + +/** + * Pull Request Review Request + * Pull Request Review Request + */ +export interface PullRequestReviewRequest { + teams: TeamSimple[]; + users: SimpleUser[]; +} + +/** + * 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; + /** + * @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; +} + +/** + * State of this Pull Request. Either \`open\` or \`closed\`. + * @example "open" + */ +export enum PullRequestStateEnum { + Open = "open", + Closed = "closed", +} + +export type PullsCheckIfMergedData = any; + +export interface PullsCheckIfMergedParams { + owner: string; + pullNumber: number; + repo: string; +} + +export type PullsCreateData = PullRequest; + +export interface PullsCreateParams { + 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 PullsCreateReplyForReviewCommentData = PullRequestReviewComment; + +export interface PullsCreateReplyForReviewCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + pullNumber: number; + repo: string; +} + +export interface PullsCreateReplyForReviewCommentPayload { + /** The text of the review comment. */ + body: string; +} + +export type PullsCreateReviewCommentData = PullRequestReviewComment; + +export interface PullsCreateReviewCommentParams { + owner: string; + pullNumber: number; + 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; +} + +/** **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", +} + +/** **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 PullsCreateReviewData = PullRequestReview; + +/** 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 PullsCreateReviewParams { + owner: string; + pullNumber: number; + 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 PullsDeletePendingReviewData = PullRequestReview; + +export interface PullsDeletePendingReviewParams { + owner: string; + pullNumber: number; + repo: string; + /** review_id parameter */ + reviewId: number; +} + +export type PullsDeleteReviewCommentData = any; + +export interface PullsDeleteReviewCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; +} + +export type PullsDismissReviewData = PullRequestReview; + +export interface PullsDismissReviewParams { + owner: string; + pullNumber: number; + repo: string; + /** review_id parameter */ + reviewId: number; +} + +export interface PullsDismissReviewPayload { + /** @example ""APPROVE"" */ + event?: string; + /** The message for the pull request review dismissal */ + message: string; +} + +export type PullsGetData = PullRequest; + +export interface PullsGetParams { + owner: string; + pullNumber: number; + repo: string; +} + +export type PullsGetReviewCommentData = PullRequestReviewComment; + +export interface PullsGetReviewCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; +} + +export type PullsGetReviewData = PullRequestReview; + +export interface PullsGetReviewParams { + owner: string; + pullNumber: number; + repo: string; + /** review_id parameter */ + reviewId: number; +} + +export type PullsListCommentsForReviewData = ReviewComment[]; + +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 PullsListCommitsData = Commit[]; + +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 PullsListData = PullRequestSimple[]; + +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 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; +} + +/** 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", +} + +/** + * 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", +} + +/** + * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * @default "open" + */ +export enum PullsListParams1StateEnum { + Open = "open", + Closed = "closed", + All = "all", +} + +export type PullsListRequestedReviewersData = PullRequestReviewRequest; + +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 PullsListReviewCommentsData = PullRequestReviewComment[]; + +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; +} + +/** 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; + /** + * 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; + /** 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", +} + +/** + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" + */ +export enum PullsListReviewCommentsParams1SortEnum { + Created = "created", + Updated = "updated", +} + +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 ReposDeleteDeploymentData = any; - -export interface ReposDeleteDeploymentParams { - /** deployment_id parameter */ - deploymentId: number; - owner: string; - repo: string; -} +export type PullsMergeData = PullRequestMergeResult; -export type ReposDeleteError = { +export type PullsMergeError = { documentation_url?: string; message?: string; }; -export type ReposDeleteFileData = FileCommit; +/** 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 ReposDeleteFileParams { +export interface PullsMergeParams { owner: string; - /** path+ parameter */ - path: string; + pullNumber: number; repo: string; } -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; -} +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 ReposDeleteInvitationData = any; +export type PullsRemoveRequestedReviewersData = any; -export interface ReposDeleteInvitationParams { - /** invitation_id parameter */ - invitationId: number; +export interface PullsRemoveRequestedReviewersParams { owner: string; + pullNumber: number; repo: string; } -export type ReposDeletePagesSiteData = any; +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 interface ReposDeletePagesSiteParams { +export type PullsRequestReviewersData = PullRequestSimple; + +export interface PullsRequestReviewersParams { owner: string; + pullNumber: number; repo: string; } -export interface ReposDeleteParams { - 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 ReposDeletePullRequestReviewProtectionData = any; +export type PullsSubmitReviewData = PullRequestReview; -export interface ReposDeletePullRequestReviewProtectionParams { - /** The name of the branch. */ - branch: 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 interface PullsSubmitReviewParams { owner: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; } -export type ReposDeleteReleaseAssetData = any; +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 ReposDeleteReleaseAssetParams { - /** asset_id parameter */ - assetId: number; +export interface PullsUpdateBranchData { + message?: string; + url?: string; +} + +export interface PullsUpdateBranchParams { owner: string; + pullNumber: number; repo: string; } -export type ReposDeleteReleaseData = any; +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 ReposDeleteReleaseParams { +export type PullsUpdateData = PullRequest; + +export interface PullsUpdateParams { owner: string; - /** release_id parameter */ - releaseId: number; + pullNumber: number; repo: string; } -export type ReposDeleteWebhookData = any; +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 ReposDeleteWebhookParams { - hookId: number; +export type PullsUpdateReviewCommentData = PullRequestReviewComment; + +export interface PullsUpdateReviewCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -export type ReposDisableAutomatedSecurityFixesData = any; +export interface PullsUpdateReviewCommentPayload { + /** The text of the reply to the review comment. */ + body: string; +} -export interface ReposDisableAutomatedSecurityFixesParams { +export type PullsUpdateReviewData = PullRequestReview; + +export interface PullsUpdateReviewParams { owner: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; } -export type ReposDisableVulnerabilityAlertsData = any; +export interface PullsUpdateReviewPayload { + /** The body text of the pull request review. */ + body: string; +} -export interface ReposDisableVulnerabilityAlertsParams { - owner: string; - repo: string; +/** State of this Pull Request. Either \`open\` or \`closed\`. */ +export enum PullsUpdateStateEnum { + Open = "open", + Closed = "closed", } -export interface ReposDownloadTarballArchiveParams { - owner: string; - ref: string; - repo: string; +/** Rate Limit */ +export interface RateLimit { + limit: number; + remaining: number; + reset: number; } -export interface ReposDownloadZipballArchiveParams { - owner: string; - ref: 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 ReposEnableAutomatedSecurityFixesData = any; +/** + * 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 ReposEnableAutomatedSecurityFixesParams { - 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 ReposEnableVulnerabilityAlertsData = any; +/** 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 ReposEnableVulnerabilityAlertsParams { +/** 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 type ReposGetAccessRestrictionsData = BranchRestrictionPolicy; +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 ReposGetAccessRestrictionsParams { - /** The name of the branch. */ - branch: 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 ReactionsCreateForIssueCommentData = Reaction; + +export interface ReactionsCreateForIssueCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -export type ReposGetAdminBranchProtectionData = ProtectedBranchAdminEnforced; +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 ReposGetAdminBranchProtectionParams { - /** The name of the branch. */ - branch: 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 ReactionsCreateForIssueData = Reaction; + +export interface ReactionsCreateForIssueParams { + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; } -export type ReposGetAllStatusCheckContextsData = 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 ReposGetAllStatusCheckContextsParams { - /** The name of the branch. */ - branch: 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 ReactionsCreateForPullRequestReviewCommentData = Reaction; + +export interface ReactionsCreateForPullRequestReviewCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -export type ReposGetAllTopicsData = Topic; +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 ReposGetAllTopicsParams { +/** 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 ReactionsCreateForTeamDiscussionCommentInOrgData = Reaction; + +export interface ReactionsCreateForTeamDiscussionCommentInOrgParams { + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: 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; +} + +/** 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 ReactionsCreateForTeamDiscussionCommentLegacyData = Reaction; + +export interface ReactionsCreateForTeamDiscussionCommentLegacyParams { + commentNumber: number; + discussionNumber: number; + teamId: number; +} + +export interface ReactionsCreateForTeamDiscussionCommentLegacyPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ + content: ReactionsCreateForTeamDiscussionCommentLegacyContentEnum; +} + +/** 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 ReactionsCreateForTeamDiscussionInOrgData = Reaction; + +export interface ReactionsCreateForTeamDiscussionInOrgParams { + discussionNumber: number; + 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 type ReactionsCreateForTeamDiscussionLegacyData = Reaction; + +export interface ReactionsCreateForTeamDiscussionLegacyParams { + discussionNumber: number; + teamId: number; +} + +export interface ReactionsCreateForTeamDiscussionLegacyPayload { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ + content: ReactionsCreateForTeamDiscussionLegacyContentEnum; +} + +export type ReactionsDeleteForCommitCommentData = any; + +export interface ReactionsDeleteForCommitCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; + reactionId: number; repo: string; } -export type ReposGetAppsWithAccessToProtectedBranchData = Integration[]; +export type ReactionsDeleteForIssueCommentData = any; -export interface ReposGetAppsWithAccessToProtectedBranchParams { - /** The name of the branch. */ - branch: string; +export interface ReactionsDeleteForIssueCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; + reactionId: number; repo: string; } -export type ReposGetBranchData = BranchWithProtection; +export type ReactionsDeleteForIssueData = any; -export interface ReposGetBranchParams { - /** The name of the branch. */ - branch: string; +export interface ReactionsDeleteForIssueParams { + /** issue_number parameter */ + issueNumber: number; owner: string; + reactionId: number; repo: string; } -export type ReposGetBranchProtectionData = BranchProtection; +export type ReactionsDeleteForPullRequestCommentData = any; -export interface ReposGetBranchProtectionParams { - /** The name of the branch. */ - branch: string; +export interface ReactionsDeleteForPullRequestCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; + reactionId: number; repo: string; } -export type ReposGetClonesData = CloneTraffic; +export type ReactionsDeleteForTeamDiscussionCommentData = any; + +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 ReposGetClonesParams { +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; /** - * 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; repo: string; } -/** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ -export enum ReposGetClonesParams1PerEnum { - Day = "day", - Week = "week", +/** 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 ReposGetCodeFrequencyStatsData = CodeFrequencyStat[]; +export type ReactionsListForIssueCommentData = Reaction[]; -export interface ReposGetCodeFrequencyStatsParams { +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. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; repo: string; } -export type ReposGetCollaboratorPermissionLevelData = - RepositoryCollaboratorPermission; - -export interface ReposGetCollaboratorPermissionLevelParams { - owner: string; - repo: string; - username: 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 ReactionsListForIssueCommentParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetCombinedStatusForRefData = CombinedCommitStatus; +export type ReactionsListForIssueData = Reaction[]; -export interface ReposGetCombinedStatusForRefParams { +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; - /** ref+ parameter */ - ref: 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 ReposGetCommitActivityStatsData = CommitActivity[]; - -export interface ReposGetCommitActivityStatsParams { - owner: string; - 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", } -export type ReposGetCommitCommentData = CommitComment; +export type ReactionsListForPullRequestReviewCommentData = Reaction[]; -export interface ReposGetCommitCommentParams { +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. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; repo: string; } -export type ReposGetCommitData = Commit; - -export interface ReposGetCommitParams { - owner: string; - /** ref+ parameter */ - ref: string; - 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 ReposGetCommitSignatureProtectionData = - ProtectedBranchAdminEnforced; +export type ReactionsListForTeamDiscussionCommentInOrgData = Reaction[]; -export interface ReposGetCommitSignatureProtectionParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: 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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** team_slug parameter */ + teamSlug: string; } -export type ReposGetCommunityProfileMetricsData = CommunityProfile; - -export interface ReposGetCommunityProfileMetricsParams { - owner: string; - 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 team discussion comment. */ +export enum ReactionsListForTeamDiscussionCommentInOrgParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetContentData = ContentTree; +export type ReactionsListForTeamDiscussionCommentLegacyData = Reaction[]; -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 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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + teamId: number; } -export type ReposGetContributorsStatsData = ContributorActivity[]; - -export interface ReposGetContributorsStatsParams { - owner: string; - 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 team discussion comment. */ +export enum ReactionsListForTeamDiscussionCommentLegacyParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetData = FullRepository; - -export type ReposGetDeployKeyData = DeployKey; +export type ReactionsListForTeamDiscussionInOrgData = Reaction[]; -export interface ReposGetDeployKeyParams { - /** key_id parameter */ - keyId: number; - owner: string; - repo: string; +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. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + /** team_slug parameter */ + teamSlug: string; } -export type ReposGetDeploymentData = Deployment; - -export interface ReposGetDeploymentParams { - /** deployment_id parameter */ - deploymentId: number; - owner: string; - 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 team discussion. */ +export enum ReactionsListForTeamDiscussionInOrgParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetDeploymentStatusData = DeploymentStatus; +export type ReactionsListForTeamDiscussionLegacyData = Reaction[]; -export interface ReposGetDeploymentStatusParams { - /** deployment_id parameter */ - deploymentId: number; - owner: string; - repo: string; - statusId: number; +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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + teamId: number; } -export type ReposGetLatestPagesBuildData = PageBuild; - -export interface ReposGetLatestPagesBuildParams { - owner: string; - 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 team discussion. */ +export enum ReactionsListForTeamDiscussionLegacyParams1ContentEnum { + Value1 = "+1", + Value11 = "-1", + Laugh = "laugh", + Confused = "confused", + Heart = "heart", + Hooray = "hooray", + Rocket = "rocket", + Eyes = "eyes", } -export type ReposGetLatestReleaseData = Release; - -export interface ReposGetLatestReleaseParams { - owner: string; - repo: string; +/** + * Referrer Traffic + * Referrer Traffic + */ +export interface ReferrerTraffic { + /** @example 4 */ + count: number; + /** @example "Google" */ + referrer: string; + /** @example 3 */ + uniques: number; } -export type ReposGetPagesBuildData = PageBuild; - -export interface ReposGetPagesBuildParams { - buildId: number; - owner: string; - repo: string; +/** + * 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; } -export type ReposGetPagesData = Page; +/** + * 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: ReleaseAssetStateEnum; + /** @format date-time */ + updated_at: string; + uploader: SimpleUser | null; + /** @format uri */ + url: string; +} -export interface ReposGetPagesParams { - owner: string; - repo: string; +/** State of the release asset. */ +export enum ReleaseAssetStateEnum { + Uploaded = "uploaded", + Open = "open", } -export interface ReposGetParams { - owner: string; - repo: 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 ReposGetParticipationStatsData = ParticipationStats; +export type ReposAcceptInvitationData = any; -export interface ReposGetParticipationStatsParams { - owner: string; - repo: string; +export interface ReposAcceptInvitationParams { + /** invitation_id parameter */ + invitationId: number; } -export type ReposGetPullRequestReviewProtectionData = - ProtectedBranchPullRequestReview; +export type ReposAddAppAccessRestrictionsData = Integration[]; -export interface ReposGetPullRequestReviewProtectionParams { +export interface ReposAddAppAccessRestrictionsParams { /** The name of the branch. */ branch: string; owner: string; repo: string; } -export type ReposGetPunchCardStatsData = CodeFrequencyStat[]; - -export interface ReposGetPunchCardStatsParams { - owner: string; - repo: string; -} - -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; +/** @example {"apps":["my-app"]} */ +export interface ReposAddAppAccessRestrictionsPayload { + /** apps parameter */ + apps: string[]; } -export type ReposGetReleaseAssetData = ReleaseAsset; +export type ReposAddCollaboratorData = RepositoryInvitation; -export interface ReposGetReleaseAssetParams { - /** asset_id parameter */ - assetId: number; +export interface ReposAddCollaboratorParams { owner: string; repo: string; + username: string; } -export type ReposGetReleaseByTagData = Release; - -export interface ReposGetReleaseByTagParams { - owner: string; - repo: string; - /** tag+ parameter */ - tag: 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 type ReposGetReleaseData = Release; - -export interface ReposGetReleaseParams { - owner: string; - /** release_id parameter */ - releaseId: number; - repo: 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" + */ +export enum ReposAddCollaboratorPermissionEnum { + Pull = "pull", + Push = "push", + Admin = "admin", + Maintain = "maintain", + Triage = "triage", } -export type ReposGetStatusChecksProtectionData = StatusCheckPolicy; +export type ReposAddStatusCheckContextsData = string[]; -export interface ReposGetStatusChecksProtectionParams { +export interface ReposAddStatusCheckContextsParams { /** The name of the branch. */ branch: string; owner: string; repo: string; } -export type ReposGetTeamsWithAccessToProtectedBranchData = Team[]; - -export interface ReposGetTeamsWithAccessToProtectedBranchParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +/** @example {"contexts":["contexts"]} */ +export interface ReposAddStatusCheckContextsPayload { + /** contexts parameter */ + contexts: string[]; } -export type ReposGetTopPathsData = ContentTraffic[]; +export type ReposAddTeamAccessRestrictionsData = Team[]; -export interface ReposGetTopPathsParams { +export interface ReposAddTeamAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; owner: string; repo: string; } -export type ReposGetTopReferrersData = ReferrerTraffic[]; - -export interface ReposGetTopReferrersParams { - owner: string; - repo: string; +/** @example {"teams":["my-team"]} */ +export interface ReposAddTeamAccessRestrictionsPayload { + /** teams parameter */ + teams: string[]; } -export type ReposGetUsersWithAccessToProtectedBranchData = SimpleUser[]; +export type ReposAddUserAccessRestrictionsData = SimpleUser[]; -export interface ReposGetUsersWithAccessToProtectedBranchParams { +export interface ReposAddUserAccessRestrictionsParams { /** The name of the branch. */ branch: string; owner: string; repo: string; } -export type ReposGetViewsData = ViewTraffic; - -export interface ReposGetViewsParams { - owner: string; - /** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ - per?: PerEnum1; - repo: string; -} - -/** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ -export enum ReposGetViewsParams1PerEnum { - Day = "day", - Week = "week", -} - -export type ReposGetWebhookConfigForRepoData = WebhookConfig; - -export interface ReposGetWebhookConfigForRepoParams { - hookId: number; - owner: string; - repo: string; +/** @example {"users":["mona"]} */ +export interface ReposAddUserAccessRestrictionsPayload { + /** users parameter */ + users: string[]; } -export type ReposGetWebhookData = Hook; +export type ReposCheckCollaboratorData = any; -export interface ReposGetWebhookParams { - hookId: number; +export interface ReposCheckCollaboratorParams { owner: string; repo: string; + username: string; } -export type ReposListBranchesData = ShortBranch[]; - -export type ReposListBranchesForHeadCommitData = BranchShort[]; - -export interface ReposListBranchesForHeadCommitParams { - /** commit_sha parameter */ - commitSha: string; - owner: string; - repo: string; -} +export type ReposCheckVulnerabilityAlertsData = any; -export interface ReposListBranchesParams { +export interface ReposCheckVulnerabilityAlertsParams { 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 type ReposListCollaboratorsData = Collaborator[]; +export type ReposCompareCommitsData = CommitComparison; -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 ReposCompareCommitsParams { + base: string; + 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; } -/** - * 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", -} - -export type ReposListCommentsForCommitData = CommitComment[]; +export type ReposCreateCommitCommentData = CommitComment; -export interface ReposListCommentsForCommitParams { +export interface ReposCreateCommitCommentParams { /** 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 ReposListCommitCommentsForRepoData = CommitComment[]; - -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; -} - -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. */ +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; - /** - * 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 ReposListContributorsData = Contributor[]; - -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. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - 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; + /** Line index in the diff to comment on. */ + position?: number; } -export type ReposListDeploymentStatusesData = DeploymentStatus[]; +export type ReposCreateCommitSignatureProtectionData = + ProtectedBranchAdminEnforced; -export interface ReposListDeploymentStatusesParams { - /** deployment_id parameter */ - deploymentId: number; +export interface ReposCreateCommitSignatureProtectionParams { + /** The name of the branch. */ + branch: 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 ReposListDeploymentsData = Deployment[]; +export type ReposCreateCommitStatusData = Status; -export interface ReposListDeploymentsParams { - /** - * The name of the environment that was deployed to (e.g., \`staging\` or \`production\`). - * @default "none" - */ - environment?: string; +export interface ReposCreateCommitStatusParams { 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; -} - -export type ReposListForAuthenticatedUserData = Repository[]; - -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", -} - -/** - * 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", -} - -/** - * Can be one of \`all\`, \`public\`, or \`private\`. - * @default "all" - */ -export enum ReposListForAuthenticatedUserParams1VisibilityEnum { - All = "all", - Public = "public", - Private = "private", + sha: string; } -export type ReposListForOrgData = MinimalRepository[]; - -export interface ReposListForOrgParams { - /** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ - direction?: DirectionEnum4; - org: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export interface ReposCreateCommitStatusPayload { /** - * Results per page (max 100) - * @default 30 + * A string label to differentiate this status from the status of other systems. This field is case-insensitive. + * @default "default" */ - per_page?: number; + 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; /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "created" + * 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\` */ - 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; + target_url?: string; } -/** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ -export enum ReposListForOrgParams1DirectionEnum { - Asc = "asc", - Desc = "desc", +/** 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", } -/** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "created" - */ -export enum ReposListForOrgParams1SortEnum { - Created = "created", - Updated = "updated", - Pushed = "pushed", - FullName = "full_name", +export type ReposCreateDeployKeyData = DeployKey; + +export interface ReposCreateDeployKeyParams { + owner: string; + repo: 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", +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 ReposListForUserData = MinimalRepository[]; +export type ReposCreateDeploymentData = Deployment; -export interface ReposListForUserParams { - /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ - direction?: DirectionEnum18; +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 { /** - * Page number of the results to fetch. - * @default 1 + * Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. + * @default true */ - page?: number; + auto_merge?: boolean; + /** @example ""1776-07-04T00:00:00.000-07:52"" */ + created_at?: string; /** - * Results per page (max 100) - * @default 30 + * Short description of the deployment. + * @default "" */ - per_page?: number; + description?: string | null; /** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" + * Name for the target deployment environment (e.g., \`production\`, \`staging\`, \`qa\`). + * @default "production" */ - sort?: SortEnum21; + environment?: string; + /** JSON payload with extra information about the deployment. */ + payload?: Record | string; /** - * Can be one of \`all\`, \`owner\`, \`member\`. - * @default "owner" + * 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. */ - type?: TypeEnum2; - username: string; + 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; } -/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ -export enum ReposListForUserParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} +export type ReposCreateDeploymentStatusData = DeploymentStatus; -/** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ -export enum ReposListForUserParams1SortEnum { - Created = "created", - Updated = "updated", - Pushed = "pushed", - FullName = "full_name", +/** 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", } -/** - * Can be one of \`all\`, \`owner\`, \`member\`. - * @default "owner" - */ -export enum ReposListForUserParams1TypeEnum { - All = "all", - Owner = "owner", - Member = "member", +export interface ReposCreateDeploymentStatusParams { + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; } -export type ReposListForksData = MinimalRepository[]; - -export interface ReposListForksParams { - owner: string; +export interface ReposCreateDeploymentStatusPayload { /** - * Page number of the results to fetch. - * @default 1 + * 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. */ - page?: number; + auto_inactive?: boolean; /** - * Results per page (max 100) - * @default 30 + * A short description of the status. The maximum description length is 140 characters. + * @default "" */ - per_page?: number; - repo: string; + 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; /** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" + * 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 "" */ - sort?: SortEnum5; -} - -/** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" - */ -export enum ReposListForksParams1SortEnum { - Newest = "newest", - Oldest = "oldest", - Stargazers = "stargazers", -} - -export type ReposListInvitationsData = RepositoryInvitation[]; - -export type ReposListInvitationsForAuthenticatedUserData = - RepositoryInvitation[]; - -export interface ReposListInvitationsForAuthenticatedUserParams { + environment_url?: string; /** - * Page number of the results to fetch. - * @default 1 + * 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 "" */ - page?: number; + 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; /** - * Results per page (max 100) - * @default 30 + * 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 "" */ - per_page?: number; + target_url?: string; } -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; +/** 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 ReposListLanguagesData = Language; +export type ReposCreateDispatchEventData = any; -export interface ReposListLanguagesParams { +export interface ReposCreateDispatchEventParams { owner: string; repo: string; } -export type ReposListPagesBuildsData = PageBuild[]; +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 ReposListPagesBuildsParams { - owner: string; +export type ReposCreateForAuthenticatedUserData = Repository; + +export interface ReposCreateForAuthenticatedUserPayload { /** - * Page number of the results to fetch. - * @default 1 + * Whether to allow merge commits for pull requests. + * @default true + * @example true */ - page?: number; + allow_merge_commit?: boolean; /** - * Results per page (max 100) - * @default 30 + * Whether to allow rebase merges for pull requests. + * @default true + * @example true */ - per_page?: number; - repo: string; -} - -export type ReposListPublicData = MinimalRepository[]; - -export interface ReposListPublicParams { - /** A repository ID. Only return repositories with an ID greater than this ID. */ - since?: number; -} - -export type ReposListPullRequestsAssociatedWithCommitData = PullRequestSimple[]; - -export interface ReposListPullRequestsAssociatedWithCommitParams { - /** commit_sha parameter */ - commitSha: string; - owner: string; + allow_rebase_merge?: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Whether to allow squash merges for pull requests. + * @default true + * @example true */ - page?: number; + allow_squash_merge?: boolean; /** - * Results per page (max 100) - * @default 30 + * Whether the repository is initialized with a minimal README. + * @default false */ - per_page?: number; - repo: string; -} - -export type ReposListReleaseAssetsData = ReleaseAsset[]; - -export interface ReposListReleaseAssetsParams { - owner: string; + auto_init?: boolean; /** - * 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; + /** A short description of the repository. */ + description?: string; /** - * Results per page (max 100) - * @default 30 + * The desired language or platform to apply to the .gitignore. + * @example "Haskell" */ - per_page?: number; - /** release_id parameter */ - releaseId: number; - repo: string; -} - -export type ReposListReleasesData = Release[]; - -export interface ReposListReleasesParams { - owner: string; + gitignore_template?: string; /** - * Page number of the results to fetch. - * @default 1 + * Whether downloads are enabled. + * @default true + * @example true */ - page?: number; + has_downloads?: boolean; /** - * Results per page (max 100) - * @default 30 + * Whether issues are enabled. + * @default true + * @example true */ - per_page?: number; - repo: string; -} - -export type ReposListTagsData = Tag[]; - -export interface ReposListTagsParams { - owner: string; + has_issues?: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Whether projects are enabled. + * @default true + * @example true */ - page?: number; + has_projects?: boolean; /** - * Results per page (max 100) - * @default 30 + * Whether the wiki is enabled. + * @default true + * @example true */ - per_page?: number; - repo: string; -} - -export type ReposListTeamsData = Team[]; - -export interface ReposListTeamsParams { - owner: string; + has_wiki?: boolean; + /** A URL with more information about the repository. */ + homepage?: string; /** - * Page number of the results to fetch. - * @default 1 + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false + * @example true */ - page?: number; + is_template?: boolean; /** - * Results per page (max 100) - * @default 30 + * The license keyword of the open source license for this repository. + * @example "mit" */ - per_page?: number; - repo: string; -} - -export type ReposListWebhooksData = Hook[]; - -export interface ReposListWebhooksParams { - owner: string; + license_template?: string; /** - * Page number of the results to fetch. - * @default 1 + * The name of the repository. + * @example "Team Environment" */ - page?: number; + name: string; /** - * Results per page (max 100) - * @default 30 + * Whether the repository is private or public. + * @default false */ - per_page?: number; - repo: string; + 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 ReposMergeData = Commit; - -export type ReposMergeError = { - /** @example ""https://docs.github.com/rest/reference/repos#perform-a-merge"" */ - documentation_url?: string; - message?: string; -}; +export type ReposCreateForkData = Repository; -export interface ReposMergeParams { +export interface ReposCreateForkParams { 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; -} - -export type ReposPingWebhookData = any; - -export interface ReposPingWebhookParams { - hookId: number; - owner: string; - repo: string; +export interface ReposCreateForkPayload { + /** Optional parameter to specify the organization name if forking into an organization. */ + organization?: string; } -export type ReposRemoveAppAccessRestrictionsData = Integration[]; +export type ReposCreateInOrgData = Repository; -export interface ReposRemoveAppAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export interface ReposCreateInOrgParams { + org: string; } -/** @example {"apps":["my-app"]} */ -export interface ReposRemoveAppAccessRestrictionsPayload { - /** apps parameter */ - apps: 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; + /** + * 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?: ReposCreateInOrgVisibilityEnum; } -export type ReposRemoveCollaboratorData = any; - -export interface ReposRemoveCollaboratorParams { - owner: string; - repo: string; - username: 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. + */ +export enum ReposCreateInOrgVisibilityEnum { + Public = "public", + Private = "private", + Visibility = "visibility", + Internal = "internal", } -export type ReposRemoveStatusCheckContextsData = string[]; +export type ReposCreateOrUpdateFileContentsData = FileCommit; -export interface ReposRemoveStatusCheckContextsParams { - /** The name of the branch. */ - branch: string; +export interface ReposCreateOrUpdateFileContentsParams { owner: string; + /** path+ parameter */ + path: string; repo: string; } -/** @example {"contexts":["contexts"]} */ -export interface ReposRemoveStatusCheckContextsPayload { - /** contexts parameter */ - contexts: 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; + }; + /** 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 ReposRemoveStatusCheckProtectionData = any; +export type ReposCreatePagesSiteData = Page; -export interface ReposRemoveStatusCheckProtectionParams { - /** The name of the branch. */ - branch: string; +export interface ReposCreatePagesSiteParams { owner: string; repo: string; } -export type ReposRemoveTeamAccessRestrictionsData = Team[]; - -export interface ReposRemoveTeamAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: 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", } -/** @example {"teams":["my-team"]} */ -export interface ReposRemoveTeamAccessRestrictionsPayload { - /** teams parameter */ - teams: string[]; +/** 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 type ReposRemoveUserAccessRestrictionsData = SimpleUser[]; +export type ReposCreateReleaseData = Release; -export interface ReposRemoveUserAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; +export interface ReposCreateReleaseParams { owner: string; repo: string; } -/** @example {"users":["mona"]} */ -export interface ReposRemoveUserAccessRestrictionsPayload { - /** users parameter */ - users: string[]; +export interface ReposCreateReleasePayload { + /** 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; } -export type ReposRenameBranchData = BranchWithProtection; +export type ReposCreateUsingTemplateData = Repository; -export interface ReposRenameBranchParams { - /** The name of the branch. */ - branch: string; - owner: string; - repo: string; +export interface ReposCreateUsingTemplateParams { + templateOwner: string; + templateRepo: string; } -export interface ReposRenameBranchPayload { - /** The new name of the branch. */ - new_name: string; +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 ReposReplaceAllTopicsData = Topic; +export type ReposCreateWebhookData = Hook; -export interface ReposReplaceAllTopicsParams { +export interface ReposCreateWebhookParams { owner: string; repo: 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 interface ReposCreateWebhookPayload { + /** + * 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; } -export type ReposRequestPagesBuildData = PageBuildStatus; +export type ReposDeclineInvitationData = any; -export interface ReposRequestPagesBuildParams { - owner: string; - repo: string; +export interface ReposDeclineInvitationParams { + /** invitation_id parameter */ + invitationId: number; } -export type ReposSetAdminBranchProtectionData = ProtectedBranchAdminEnforced; +export type ReposDeleteAccessRestrictionsData = any; -export interface ReposSetAdminBranchProtectionParams { +export interface ReposDeleteAccessRestrictionsParams { /** The name of the branch. */ branch: string; owner: string; repo: string; } -export type ReposSetAppAccessRestrictionsData = Integration[]; +export type ReposDeleteAdminBranchProtectionData = any; -export interface ReposSetAppAccessRestrictionsParams { +export interface ReposDeleteAdminBranchProtectionParams { /** The name of the branch. */ branch: string; owner: string; repo: string; } -/** @example {"apps":["my-app"]} */ -export interface ReposSetAppAccessRestrictionsPayload { - /** apps parameter */ - apps: string[]; -} - -export type ReposSetStatusCheckContextsData = string[]; +export type ReposDeleteBranchProtectionData = any; -export interface ReposSetStatusCheckContextsParams { +export interface ReposDeleteBranchProtectionParams { /** 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 ReposDeleteCommitCommentData = any; -export interface ReposSetTeamAccessRestrictionsParams { - /** The name of the branch. */ - branch: string; +export interface ReposDeleteCommitCommentParams { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; } -/** @example {"teams":["my-team"]} */ -export interface ReposSetTeamAccessRestrictionsPayload { - /** teams parameter */ - teams: string[]; -} - -export type ReposSetUserAccessRestrictionsData = SimpleUser[]; +export type ReposDeleteCommitSignatureProtectionData = any; -export interface ReposSetUserAccessRestrictionsParams { +export interface ReposDeleteCommitSignatureProtectionParams { /** The name of the branch. */ branch: string; owner: string; repo: string; } -/** @example {"users":["mona"]} */ -export interface ReposSetUserAccessRestrictionsPayload { - /** users parameter */ - users: string[]; -} +export type ReposDeleteData = any; -export type ReposTestPushWebhookData = any; +export type ReposDeleteDeployKeyData = any; -export interface ReposTestPushWebhookParams { - hookId: number; +export interface ReposDeleteDeployKeyParams { + /** key_id parameter */ + keyId: number; owner: string; repo: string; } -export type ReposTransferData = Repository; +export type ReposDeleteDeploymentData = any; -export interface ReposTransferParams { +export interface ReposDeleteDeploymentParams { + /** deployment_id parameter */ + deploymentId: number; 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 type ReposDeleteError = { + documentation_url?: string; + message?: string; +}; -export type ReposUpdateBranchProtectionData = ProtectedBranch; +export type ReposDeleteFileData = FileCommit; -export interface ReposUpdateBranchProtectionParams { - /** The name of the branch. */ - branch: string; +export interface ReposDeleteFileParams { owner: string; + /** path+ parameter */ + path: 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 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; } -export type ReposUpdateCommitCommentData = CommitComment; +export type ReposDeleteInvitationData = any; -export interface ReposUpdateCommitCommentParams { - /** comment_id parameter */ - commentId: number; +export interface ReposDeleteInvitationParams { + /** invitation_id parameter */ + invitationId: number; owner: string; repo: string; } -export interface ReposUpdateCommitCommentPayload { - /** The contents of the comment */ - body: string; -} - -export type ReposUpdateData = FullRepository; - -export type ReposUpdateInformationAboutPagesSiteData = any; +export type ReposDeletePagesSiteData = any; -export interface ReposUpdateInformationAboutPagesSiteParams { +export interface ReposDeletePagesSiteParams { 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 ReposDeleteParams { + owner: string; + repo: 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 ReposDeletePullRequestReviewProtectionData = any; -/** 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 ReposDeletePullRequestReviewProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export type ReposUpdateInvitationData = RepositoryInvitation; +export type ReposDeleteReleaseAssetData = any; -export interface ReposUpdateInvitationParams { - /** invitation_id parameter */ - invitationId: number; +export interface ReposDeleteReleaseAssetParams { + /** asset_id parameter */ + assetId: number; 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; -} - -/** 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 ReposDeleteReleaseData = any; -export interface ReposUpdateParams { +export interface ReposDeleteReleaseParams { owner: string; + /** release_id parameter */ + releaseId: number; repo: string; } -export interface ReposUpdatePayload { - /** - * 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 - */ - 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; -} - -export type ReposUpdatePullRequestReviewProtectionData = - ProtectedBranchPullRequestReview; +export type ReposDeleteWebhookData = any; -export interface ReposUpdatePullRequestReviewProtectionParams { - /** The name of the branch. */ - branch: string; +export interface ReposDeleteWebhookParams { + hookId: number; owner: 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[]; - }; - /** 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 ReposDisableAutomatedSecurityFixesData = any; + +export interface ReposDisableAutomatedSecurityFixesParams { + owner: string; + repo: string; } -export type ReposUpdateReleaseAssetData = ReleaseAsset; +export type ReposDisableVulnerabilityAlertsData = any; -export interface ReposUpdateReleaseAssetParams { - /** asset_id parameter */ - assetId: number; +export interface ReposDisableVulnerabilityAlertsParams { 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; +export interface ReposDownloadTarballArchiveParams { + owner: string; + ref: string; + repo: string; } -export type ReposUpdateReleaseData = Release; +export interface ReposDownloadZipballArchiveParams { + owner: string; + ref: string; + repo: string; +} -export interface ReposUpdateReleaseParams { +export type ReposEnableAutomatedSecurityFixesData = any; + +export interface ReposEnableAutomatedSecurityFixesParams { owner: string; - /** release_id parameter */ - releaseId: number; repo: string; } -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 ReposEnableVulnerabilityAlertsData = any; + +export interface ReposEnableVulnerabilityAlertsParams { + owner: string; + repo: string; } -export type ReposUpdateStatusCheckProtectionData = StatusCheckPolicy; +export type ReposGetAccessRestrictionsData = BranchRestrictionPolicy; -export interface ReposUpdateStatusCheckProtectionParams { +export interface ReposGetAccessRestrictionsParams { /** 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; -} +export type ReposGetAdminBranchProtectionData = ProtectedBranchAdminEnforced; -/** 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 interface ReposGetAdminBranchProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export type ReposUpdateWebhookConfigForRepoData = WebhookConfig; +export type ReposGetAllStatusCheckContextsData = string[]; -export interface ReposUpdateWebhookConfigForRepoParams { - hookId: number; +export interface ReposGetAllStatusCheckContextsParams { + /** The name of the branch. */ + branch: string; owner: string; repo: 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 ReposUpdateWebhookData = Hook; +export type ReposGetAllTopicsData = Topic; -export interface ReposUpdateWebhookParams { - hookId: number; +export interface ReposGetAllTopicsParams { owner: string; repo: string; } -export interface ReposUpdateWebhookPayload { - /** - * 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[]; -} - -export type ReposUploadReleaseAssetData = ReleaseAsset; +export type ReposGetAppsWithAccessToProtectedBranchData = Integration[]; -export interface ReposUploadReleaseAssetParams { - label?: string; - name?: string; +export interface ReposGetAppsWithAccessToProtectedBranchParams { + /** 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 ReposGetBranchData = BranchWithProtection; -/** - * 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 ReposGetBranchParams { + /** 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 ReposGetBranchProtectionData = BranchProtection; + +export interface ReposGetBranchProtectionParams { + /** 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; +export type ReposGetClonesData = CloneTraffic; + +export interface ReposGetClonesParams { + owner: string; /** - * URL for the repository invitation - * @example "https://api.github.com/user/repository-invitations/1" + * Must be one of: \`day\`, \`week\`. + * @default "day" */ - url: string; + per?: PerEnum; + repo: string; } /** - * The permission associated with the invitation. - * @example "read" + * Must be one of: \`day\`, \`week\`. + * @default "day" */ -export enum RepositoryInvitationPermissionsEnum { - Read = "read", - Write = "write", - Admin = "admin", +export enum ReposGetClonesParams1PerEnum { + Day = "day", + Week = "week", } -/** - * 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 ReposGetCodeFrequencyStatsData = CodeFrequencyStat[]; + +export interface ReposGetCodeFrequencyStatsParams { + owner: string; + repo: string; } -/** Requires Authentication */ -export type RequiresAuthentication = BasicError; +export type ReposGetCollaboratorPermissionLevelData = + RepositoryCollaboratorPermission; -/** - * 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 ReposGetCollaboratorPermissionLevelParams { + owner: string; + repo: string; + username: string; +} + +export type ReposGetCombinedStatusForRefData = CombinedCommitStatus; + +export interface ReposGetCombinedStatusForRefParams { + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; +} + +export type ReposGetCommitActivityStatsData = CommitActivity[]; + +export interface ReposGetCommitActivityStatsParams { + owner: string; + repo: string; +} + +export type ReposGetCommitCommentData = CommitComment; + +export interface ReposGetCommitCommentParams { + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; +} + +export type ReposGetCommitData = Commit; + +export interface ReposGetCommitParams { + owner: string; + /** ref+ parameter */ + ref: string; + repo: string; +} + +export type ReposGetCommitSignatureProtectionData = + ProtectedBranchAdminEnforced; + +export interface ReposGetCommitSignatureProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} + +export type ReposGetCommunityProfileMetricsData = CommunityProfile; + +export interface ReposGetCommunityProfileMetricsParams { + owner: string; + repo: string; +} + +export type ReposGetContentData = ContentTree; + +export interface ReposGetContentParams { + 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; + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ + ref?: string; + 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 type ReposGetContributorsStatsData = ContributorActivity[]; + +export interface ReposGetContributorsStatsParams { + owner: string; + repo: 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 ReposGetData = FullRepository; + +export type ReposGetDeployKeyData = DeployKey; + +export interface ReposGetDeployKeyParams { + /** key_id parameter */ + keyId: 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 ReposGetDeploymentData = Deployment; + +export interface ReposGetDeploymentParams { + /** deployment_id parameter */ + deploymentId: number; + 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 type ReposGetDeploymentStatusData = DeploymentStatus; + +export interface ReposGetDeploymentStatusParams { + /** deployment_id parameter */ + deploymentId: number; + owner: string; + repo: string; + statusId: 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 RoleEnum2 { - Member = "member", - Maintainer = "maintainer", - All = "all", +export type ReposGetLatestPagesBuildData = PageBuild; + +export interface ReposGetLatestPagesBuildParams { + 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; +export type ReposGetLatestReleaseData = Release; + +export interface ReposGetLatestReleaseParams { + owner: string; + repo: string; +} + +export type ReposGetPagesBuildData = PageBuild; + +export interface ReposGetPagesBuildParams { + buildId: number; + owner: string; + repo: string; +} + +export type ReposGetPagesData = Page; + +export interface ReposGetPagesParams { + owner: string; + repo: string; +} + +export interface ReposGetParams { + owner: string; + repo: string; +} + +export type ReposGetParticipationStatsData = ParticipationStats; + +export interface ReposGetParticipationStatsParams { + owner: string; + repo: string; +} + +export type ReposGetPullRequestReviewProtectionData = + ProtectedBranchPullRequestReview; + +export interface ReposGetPullRequestReviewProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} + +export type ReposGetPunchCardStatsData = CodeFrequencyStat[]; + +export interface ReposGetPunchCardStatsParams { + owner: string; + repo: string; +} + +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 type ReposGetReleaseAssetData = ReleaseAsset; + +export interface ReposGetReleaseAssetParams { + /** asset_id parameter */ + assetId: number; + owner: string; + repo: string; +} + +export type ReposGetReleaseByTagData = Release; + +export interface ReposGetReleaseByTagParams { + owner: string; + repo: string; + /** tag+ parameter */ + tag: string; +} + +export type ReposGetReleaseData = Release; + +export interface ReposGetReleaseParams { + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; +} + +export type ReposGetStatusChecksProtectionData = StatusCheckPolicy; + +export interface ReposGetStatusChecksProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; +} + +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; /** - * The status of the runner. - * @example "online" + * Must be one of: \`day\`, \`week\`. + * @default "day" */ - status: string; + per?: PerEnum1; + repo: string; } /** - * Runner Application - * Runner Application + * Must be one of: \`day\`, \`week\`. + * @default "day" */ -export interface RunnerApplication { - architecture: string; - download_url: string; - filename: string; - os: string; +export enum ReposGetViewsParams1PerEnum { + Day = "day", + Week = "week", } -export interface RunnerGroupsEnterprise { - allows_public_repositories: boolean; - default: boolean; - id: number; - name: string; - runners_url: string; - selected_organizations_url?: string; - visibility: string; -} +export type ReposGetWebhookConfigForRepoData = WebhookConfig; -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 ReposGetWebhookConfigForRepoParams { + hookId: number; + 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 ReposGetWebhookData = Hook; -/** Bad Request */ -export type ScimBadRequest = ScimError; +export interface ReposGetWebhookParams { + hookId: number; + owner: string; + repo: string; +} -/** Conflict */ -export type ScimConflict = ScimError; +export type ReposListBranchesData = ShortBranch[]; -export type ScimDeleteUserFromOrgData = any; +export type ReposListBranchesForHeadCommitData = BranchShort[]; -export interface ScimDeleteUserFromOrgParams { - org: string; - /** scim_user_id parameter */ - scimUserId: string; +export interface ReposListBranchesForHeadCommitParams { + /** commit_sha parameter */ + commitSha: string; + 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 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 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 ReposListCollaboratorsData = Collaborator[]; + +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; + 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; } /** - * Scim Error - * Scim Error + * 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 interface ScimError { - detail?: string | null; - documentation_url?: string | null; - message?: string | null; - schemas?: string[]; - scimType?: string | null; - status?: number; +export enum ReposListCollaboratorsParams1AffiliationEnum { + Outside = "outside", + Direct = "direct", + All = "all", } -/** Forbidden */ -export type ScimForbidden = ScimError; - -export type ScimGetProvisioningInformationForUserData = ScimUser; +export type ReposListCommentsForCommitData = CommitComment[]; -export interface ScimGetProvisioningInformationForUserParams { - org: string; - /** scim_user_id parameter */ - scimUserId: string; +export interface ReposListCommentsForCommitParams { + /** 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 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 ReposListCommitCommentsForRepoData = CommitComment[]; -/** Internal Error */ -export type ScimInternalError = ScimError; +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; +} -export type ScimListProvisionedIdentitiesData = ScimUserList; +export type ReposListCommitStatusesForRefData = Status[]; -export interface ScimListProvisionedIdentitiesParams { - /** Used for pagination: the number of results to return. */ - count?: number; +export interface ReposListCommitStatusesForRefParams { + 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\\"\`. + * Page number of the results to fetch. + * @default 1 */ - filter?: string; - org: 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; + /** ref+ parameter */ + ref: string; + repo: string; } -/** Resource Not Found */ -export type ScimNotFound = ScimError; - -export type ScimProvisionAndInviteUserData = ScimUser; +export type ReposListCommitsData = Commit[]; -export interface ScimProvisionAndInviteUserParams { - org: string; +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 interface ScimProvisionAndInviteUserPayload { - active?: boolean; +export type ReposListContributorsData = Contributor[]; + +export interface ReposListContributorsParams { + /** Set to \`1\` or \`true\` to include anonymous contributors in results. */ + anon?: string; + owner: string; /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" + * Page number of the results to fetch. + * @default 1 */ - displayName?: string; + page?: number; /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] + * Results per page (max 100) + * @default 30 */ - 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[]; + per_page?: number; + repo: string; +} + +export type ReposListDeployKeysData = DeployKey[]; + +export interface ReposListDeployKeysParams { + owner: string; /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" + * Page number of the results to fetch. + * @default 1 */ - userName: string; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + repo: string; } -export type ScimSetInformationForProvisionedUserData = ScimUser; +export type ReposListDeploymentStatusesData = DeploymentStatus[]; -export interface ScimSetInformationForProvisionedUserParams { - org: string; - /** scim_user_id parameter */ - scimUserId: string; +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 ScimSetInformationForProvisionedUserPayload { - active?: boolean; +export type ReposListDeploymentsData = Deployment[]; + +export interface ReposListDeploymentsParams { /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" + * The name of the environment that was deployed to (e.g., \`staging\` or \`production\`). + * @default "none" */ - displayName?: string; + environment?: string; + owner: string; /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] + * Page number of the results to fetch. + * @default 1 */ - 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[]; + page?: number; /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" + * Results per page (max 100) + * @default 30 */ - userName: string; + 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; } -export type ScimUpdateAttributeForUserData = ScimUser; +export type ReposListForAuthenticatedUserData = Repository[]; -export type ScimUpdateAttributeForUserError = BasicError; +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; +} -export enum ScimUpdateAttributeForUserOpEnum { - Add = "add", - Remove = "remove", - Replace = "replace", +/** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ +export enum ReposListForAuthenticatedUserParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export interface ScimUpdateAttributeForUserParams { - org: string; - /** scim_user_id parameter */ - scimUserId: string; +/** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ +export enum ReposListForAuthenticatedUserParams1SortEnum { + Created = "created", + Updated = "updated", + Pushed = "pushed", + FullName = "full_name", } -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[]; +/** + * 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", } /** - * SCIM /Users - * SCIM /Users provisioning endpoints + * Can be one of \`all\`, \`public\`, or \`private\`. + * @default "all" */ -export interface ScimUser { - /** - * The active status of the User. - * @example true - */ - active: boolean; +export enum ReposListForAuthenticatedUserParams1VisibilityEnum { + All = "all", + Public = "public", + Private = "private", +} + +export type ReposListForOrgData = MinimalRepository[]; + +export interface ReposListForOrgParams { + /** Can be one of \`asc\` or \`desc\`. Default: when using \`full_name\`: \`asc\`, otherwise \`desc\` */ + direction?: DirectionEnum4; + org: string; /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" + * Page number of the results to fetch. + * @default 1 */ - displayName?: string | null; + page?: number; /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] + * Results per page (max 100) + * @default 30 */ - emails: { - primary?: boolean; - value: string; - }[]; + per_page?: number; /** - * The ID of the User. - * @example "a7b0f98395" + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "created" */ - externalId: string | null; - /** associated groups */ - groups?: { - display?: string; - value?: string; - }[]; + 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", +} + +/** 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", +} + +export type ReposListForUserData = MinimalRepository[]; + +export interface ReposListForUserParams { + /** Can be one of \`asc\` or \`desc\`. Default: \`asc\` when using \`full_name\`, otherwise \`desc\` */ + direction?: DirectionEnum18; /** - * Unique identifier of an external identity - * @example "1b78eada-9baa-11e6-9eb6-a431576d590e" + * Page number of the results to fetch. + * @default 1 */ - 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; - }; + page?: number; /** - * Set of operations to be performed - * @minItems 1 - * @example [{"op":"replace","value":{"active":false}}] + * Results per page (max 100) + * @default 30 */ - operations?: { - op: ScimUserOpEnum; - path?: string; - value?: string | object | any[]; - }[]; - /** The ID of the organization. */ - organization_id?: number; + per_page?: number; /** - * SCIM schema used. - * @minItems 1 + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" */ - schemas: string[]; + sort?: SortEnum21; /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" */ - userName: string | null; + 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", } /** - * SCIM User List - * SCIM User List + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" */ -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 enum ReposListForUserParams1SortEnum { + Created = "created", + Updated = "updated", + Pushed = "pushed", + FullName = "full_name", } -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; +/** + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" + */ +export enum ReposListForUserParams1TypeEnum { + All = "all", + Owner = "owner", + Member = "member", } -export enum ScimUserOpEnum { - Add = "add", - Remove = "remove", - Replace = "replace", -} +export type ReposListForksData = MinimalRepository[]; -/** 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; +export interface ReposListForksParams { + owner: string; /** - * @format uri - * @example "https://api.github.com/users/octocat/repos" + * Page number of the results to fetch. + * @default 1 */ - 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[]; + 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; } -/** Describe whether all repositories have been selected or there's a selection involved */ -export enum ScopedInstallationRepositorySelectionEnum { - All = "all", - Selected = "selected", +/** + * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. + * @default "newest" + */ +export enum ReposListForksParams1SortEnum { + Newest = "newest", + Oldest = "oldest", + Stargazers = "stargazers", } -export interface SearchCodeData { - incomplete_results: boolean; - items: CodeSearchResultItem[]; - total_count: number; -} +export type ReposListInvitationsData = RepositoryInvitation[]; -export interface SearchCodeParams { +export type ReposListInvitationsForAuthenticatedUserData = + RepositoryInvitation[]; + +export interface ReposListInvitationsForAuthenticatedUserParams { /** - * 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" + * Page number of the results to fetch. + * @default 1 */ - order?: OrderEnum2; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; +} + +export interface ReposListInvitationsParams { + owner: string; /** * Page number of the results to fetch. * @default 1 @@ -30738,38 +30777,63 @@ export interface SearchCodeParams { * @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; + 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 ReposListLanguagesData = Language; + +export interface ReposListLanguagesParams { + 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 ReposListPagesBuildsData = PageBuild[]; + +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; } -export interface SearchCommitsData { - incomplete_results: boolean; - items: CommitSearchResultItem[]; - total_count: number; +export type ReposListPublicData = MinimalRepository[]; + +export interface ReposListPublicParams { + /** A repository ID. Only return repositories with an ID greater than this ID. */ + since?: number; } -export interface SearchCommitsParams { +export type ReposListPullRequestsAssociatedWithCommitData = PullRequestSimple[]; + +export interface ReposListPullRequestsAssociatedWithCommitParams { + /** commit_sha parameter */ + commitSha: string; + owner: 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" + * Page number of the results to fetch. + * @default 1 */ - order?: OrderEnum3; + 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 @@ -30780,39 +30844,49 @@ export interface SearchCommitsParams { * @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; + /** release_id parameter */ + releaseId: number; + 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 ReposListReleasesData = Release[]; -/** 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 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 interface SearchIssuesAndPullRequestsData { - incomplete_results: boolean; - items: IssueSearchResultItem[]; - total_count: number; -} +export type ReposListTagsData = Tag[]; -export interface SearchIssuesAndPullRequestsParams { +export interface ReposListTagsParams { + owner: 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" + * Page number of the results to fetch. + * @default 1 */ - order?: OrderEnum4; + 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 @@ -30823,2524 +30897,3630 @@ export interface SearchIssuesAndPullRequestsParams { * @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; + 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 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; } -/** 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 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 SearchLabelsData { - incomplete_results: boolean; - items: LabelSearchResultItem[]; - total_count: number; +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; } -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 ReposPingWebhookData = any; + +export interface ReposPingWebhookParams { + hookId: 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 ReposRemoveAppAccessRestrictionsData = Integration[]; + +export interface ReposRemoveAppAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: 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", +/** @example {"apps":["my-app"]} */ +export interface ReposRemoveAppAccessRestrictionsPayload { + /** apps parameter */ + apps: string[]; } -export interface SearchReposData { - incomplete_results: boolean; - items: RepoSearchResultItem[]; - total_count: number; -} +export type ReposRemoveCollaboratorData = any; -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; - /** - * 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?: SortEnum16; +export interface ReposRemoveCollaboratorParams { + owner: string; + repo: string; + username: 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 SearchReposParams1OrderEnum { - Desc = "desc", - Asc = "asc", +export type ReposRemoveStatusCheckContextsData = string[]; + +export interface ReposRemoveStatusCheckContextsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: 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) */ -export enum SearchReposParams1SortEnum { - Stars = "stars", - Forks = "forks", - HelpWantedIssues = "help-wanted-issues", - Updated = "updated", +/** @example {"contexts":["contexts"]} */ +export interface ReposRemoveStatusCheckContextsPayload { + /** contexts parameter */ + contexts: 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 ReposRemoveStatusCheckProtectionData = any; -export interface SearchTopicsData { - incomplete_results: boolean; - items: TopicSearchResultItem[]; - total_count: number; +export interface ReposRemoveStatusCheckProtectionParams { + /** The name of the branch. */ + branch: string; + 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 ReposRemoveTeamAccessRestrictionsData = Team[]; -export interface SearchUsersData { - incomplete_results: boolean; - items: UserSearchResultItem[]; - total_count: number; +export interface ReposRemoveTeamAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export interface SearchUsersParams { - /** - * 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?: OrderEnum7; - /** - * 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?: SortEnum17; +/** @example {"teams":["my-team"]} */ +export interface ReposRemoveTeamAccessRestrictionsPayload { + /** teams parameter */ + teams: 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 SearchUsersParams1OrderEnum { - Desc = "desc", - Asc = "asc", -} +export type ReposRemoveUserAccessRestrictionsData = SimpleUser[]; -/** 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 interface ReposRemoveUserAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: 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; +/** @example {"users":["mona"]} */ +export interface ReposRemoveUserAccessRestrictionsPayload { + /** users parameter */ + users: 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 ReposRenameBranchData = BranchWithProtection; -export enum SecretScanningAlertResolutionEnum { - FalsePositive = "false_positive", - WontFix = "wont_fix", - Revoked = "revoked", - UsedInTests = "used_in_tests", +export interface ReposRenameBranchParams { + /** The name of the branch. */ + branch: string; + owner: string; + 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 interface ReposRenameBranchPayload { + /** The new name of the branch. */ + new_name: string; } -export type SecretScanningGetAlertData = SecretScanningAlert; +export type ReposReplaceAllTopicsData = Topic; -export interface SecretScanningGetAlertParams { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; +export interface ReposReplaceAllTopicsParams { owner: string; repo: string; } -export type SecretScanningListAlertsForRepoData = SecretScanningAlert[]; +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 interface SecretScanningListAlertsForRepoParams { +export type ReposRequestPagesBuildData = PageBuildStatus; + +export interface ReposRequestPagesBuildParams { 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; } -/** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ -export enum SecretScanningListAlertsForRepoParams1StateEnum { - Open = "open", - Resolved = "resolved", +export type ReposSetAdminBranchProtectionData = ProtectedBranchAdminEnforced; + +export interface ReposSetAdminBranchProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -export type SecretScanningUpdateAlertData = SecretScanningAlert; +export type ReposSetAppAccessRestrictionsData = Integration[]; -export interface SecretScanningUpdateAlertParams { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; +export interface ReposSetAppAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; 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; +/** @example {"apps":["my-app"]} */ +export interface ReposSetAppAccessRestrictionsPayload { + /** apps parameter */ + apps: string[]; } -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 type ReposSetStatusCheckContextsData = string[]; + +export interface ReposSetStatusCheckContextsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: 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; +/** @example {"contexts":["contexts"]} */ +export interface ReposSetStatusCheckContextsPayload { + /** contexts parameter */ + contexts: string[]; +} -/** Service Unavailable */ -export interface ServiceUnavailable { - code?: string; - documentation_url?: string; - message?: string; +export type ReposSetTeamAccessRestrictionsData = Team[]; + +export interface ReposSetTeamAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * Short Blob - * Short Blob - */ -export interface ShortBlob { - sha: string; - url: string; +/** @example {"teams":["my-team"]} */ +export interface ReposSetTeamAccessRestrictionsPayload { + /** teams parameter */ + teams: 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; +export type ReposSetUserAccessRestrictionsData = SimpleUser[]; + +export interface ReposSetUserAccessRestrictionsParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * 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; +/** @example {"users":["mona"]} */ +export interface ReposSetUserAccessRestrictionsPayload { + /** users parameter */ + users: 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; +export type ReposTestPushWebhookData = any; + +export interface ReposTestPushWebhookParams { + hookId: number; + owner: string; + repo: 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; +export type ReposTransferData = Repository; -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum SortEnum { - Created = "created", - Updated = "updated", - Comments = "comments", +export interface ReposTransferParams { + owner: string; + repo: string; } -/** - * 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", +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[]; } -/** - * 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", +export type ReposUpdateBranchProtectionData = ProtectedBranch; + +export interface ReposUpdateBranchProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" - */ -export enum SortEnum11 { - Created = "created", - Updated = "updated", +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; } -/** 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", -} +export type ReposUpdateCommitCommentData = CommitComment; -/** 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", +export interface ReposUpdateCommitCommentParams { + /** comment_id parameter */ + commentId: number; + 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 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", +export interface ReposUpdateCommitCommentPayload { + /** The contents of the comment */ + body: 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 SortEnum15 { - Created = "created", - Updated = "updated", -} +export type ReposUpdateData = FullRepository; -/** 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", -} +export type ReposUpdateInformationAboutPagesSiteData = any; -/** 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", +export interface ReposUpdateInformationAboutPagesSiteParams { + owner: string; + repo: string; } -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum SortEnum18 { - Created = "created", - Updated = "updated", - Comments = "comments", +/** The repository directory that includes the source files for the Pages site. Allowed paths are \`/\` or \`/docs\`. */ +export enum ReposUpdateInformationAboutPagesSitePathEnum { + Value = "/", + ValueDocs = "/docs", } -/** - * 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 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; + }; } -/** - * 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", +/** 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", } -/** - * 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 type ReposUpdateInvitationData = RepositoryInvitation; -/** - * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. - * @default "full_name" - */ -export enum SortEnum21 { - Created = "created", - Updated = "updated", - Pushed = "pushed", - FullName = "full_name", +export interface ReposUpdateInvitationParams { + /** invitation_id parameter */ + invitationId: number; + owner: string; + repo: string; } -/** - * 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", +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; } -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum SortEnum3 { - Created = "created", - Updated = "updated", - Comments = "comments", +/** 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", } -/** - * 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 ReposUpdateParams { + owner: string; + repo: string; } -/** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" - */ -export enum SortEnum5 { - Newest = "newest", - Oldest = "oldest", - Stargazers = "stargazers", +export interface ReposUpdatePayload { + /** + * 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 + */ + 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; } -/** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" - */ -export enum SortEnum6 { - Created = "created", - Updated = "updated", - Comments = "comments", -} +export type ReposUpdatePullRequestReviewProtectionData = + ProtectedBranchPullRequestReview; -/** - * 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 interface ReposUpdatePullRequestReviewProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * What to sort results by. Either \`due_on\` or \`completeness\`. - * @default "due_on" - */ -export enum SortEnum8 { - DueOn = "due_on", - Completeness = "completeness", +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; } -/** - * 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 type ReposUpdateReleaseAssetData = ReleaseAsset; -/** - * Stargazer - * Stargazer - */ -export interface Stargazer { - /** @format date-time */ - starred_at: string; - user: SimpleUser | null; +export interface ReposUpdateReleaseAssetParams { + /** asset_id parameter */ + assetId: number; + owner: string; + repo: string; } -/** - * Starred Repository - * Starred Repository - */ -export interface StarredRepository { - /** A git repository */ - repo: Repository; - /** @format date-time */ - starred_at: 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; } -/** - * 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 ReposUpdateReleaseData = Release; -/** - * 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 ReposUpdateReleaseParams { + owner: string; + /** release_id parameter */ + releaseId: 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 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; } -/** - * 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 type ReposUpdateStatusCheckProtectionData = StatusCheckPolicy; -/** - * 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 interface ReposUpdateStatusCheckProtectionParams { + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; } -/** - * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ -export enum StateEnum4 { - Open = "open", - Closed = "closed", - All = "all", +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; } -/** - * 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", +/** 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", } -/** - * Either \`open\`, \`closed\`, or \`all\` to filter by state. - * @default "open" - */ -export enum StateEnum6 { - Open = "open", - Closed = "closed", - All = "all", -} +export type ReposUpdateWebhookConfigForRepoData = WebhookConfig; -/** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ -export enum StateEnum7 { - Open = "open", - Resolved = "resolved", +export interface ReposUpdateWebhookConfigForRepoParams { + hookId: number; + owner: string; + repo: string; } -/** - * 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", +/** @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; } -/** 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 ReposUpdateWebhookData = Hook; -/** - * 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 interface ReposUpdateWebhookParams { + hookId: number; + owner: string; + repo: string; } -/** - * 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; +export interface ReposUpdateWebhookPayload { /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks" + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true */ - 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", + 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[]; } -/** 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 ReposUploadReleaseAssetData = ReleaseAsset; -/** 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 interface ReposUploadReleaseAssetParams { + label?: string; + name?: string; + owner: string; + /** release_id parameter */ + releaseId: number; + 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", -} +/** The raw file data */ +export type ReposUploadReleaseAssetPayload = string; /** - * Tag - * Tag + * Repository + * A git repository */ -export interface Tag { - commit: { - sha: string; - /** @format uri */ - url: string; - }; - /** @example "v0.1" */ - name: string; - node_id: string; +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 "https://github.com/octocat/Hello-World/tarball/v0.1" + * @example "http://api.github.com/repos/octocat/Hello-World/contributors" */ - tarball_url: string; + 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 "https://github.com/octocat/Hello-World/zipball/v0.1" + * @example "http://api.github.com/repos/octocat/Hello-World/deployments" */ - zipball_url: string; -} - -/** - * Team - * Groups of organization members that gives permissions on specified repositories. - */ -export interface Team { + deployments_url: string; + /** @example "This your first repo!" */ description: string | null; + /** Returns whether or not this repository disabled. */ + disabled: boolean; /** * @format uri - * @example "https://github.com/orgs/rails/teams/core" + * @example "http://api.github.com/repos/octocat/Hello-World/downloads" */ - 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; -} - -/** - * Team Discussion - * A team discussion is a persistent record of a free-form conversation within a team. - */ -export interface TeamDiscussion { - author: SimpleUser | null; + downloads_url: string; /** - * The main text of the discussion. - * @example "Please suggest improvements to our workflow in comments." + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/events" */ - body: string; - /** @example "

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

" */ - body_html: string; + events_url: string; + fork: boolean; + forks: number; + /** @example 9 */ + forks_count: number; /** - * 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 "http://api.github.com/repos/octocat/Hello-World/forks" */ - body_version: string; - /** @example 0 */ - comments_count: 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; + /** + * 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://api.github.com/organizations/1/team/2343027/discussions/1/comments" + * @example "https://github.com" */ - comments_url: string; + homepage: string | null; /** - * @format date-time - * @example "2018-01-25T18:56:31Z" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" */ - created_at: string; + hooks_url: string; /** * @format uri - * @example "https://github.com/orgs/github/teams/justice-league/discussions/1" + * @example "https://github.com/octocat/Hello-World" */ html_url: string; - /** @format date-time */ - last_edited_at: string | null; - /** @example "MDE0OlRlYW1EaXNjdXNzaW9uMQ==" */ - node_id: string; /** - * The unique sequence number of a team discussion. + * Unique identifier of the repository * @example 42 */ - number: number; + id: number; /** - * Whether or not this discussion should be pinned for easy retrieval. + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false * @example true */ - pinned: boolean; + 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; /** - * Whether or not this discussion should be restricted to team members and organization administrators. - * @example true + * @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; - reactions?: ReactionRollup; + /** @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 "https://api.github.com/organizations/1/team/2343027" + * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" */ - team_url: string; + 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; /** - * The title of the discussion. - * @example "How can we improve our workflow?" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" */ - title: string; + 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 "2018-01-25T18:56:31Z" + * @example "2011-01-26T19:14:43Z" */ - updated_at: string; + 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; +} + +/** + * 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. + */ +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; /** - * @format uri - * @example "https://api.github.com/organizations/1/team/2343027/discussions/1" + * URL for the repository invitation + * @example "https://api.github.com/user/repository-invitations/1" */ url: string; } /** - * Team Discussion Comment - * A reply to a discussion within a team. + * The permission associated with the invitation. + * @example "read" */ -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; +export enum RepositoryInvitationPermissionsEnum { + Read = "read", + Write = "write", + Admin = "admin", +} + +/** + * Repository Invitation + * Repository invitations let you manage who you collaborate with. + */ +export interface RepositorySubscription { /** * @format date-time - * @example "2018-01-15T23:53:58Z" + * @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/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 + * @example "https://api.github.com/repos/octocat/example" */ - number: number; - reactions?: ReactionRollup; + repository_url: string; /** - * @format date-time - * @example "2018-01-15T23:53:58Z" + * Determines if notifications should be received from this repository. + * @example true */ - updated_at: string; + subscribed: boolean; /** * @format uri - * @example "https://api.github.com/organizations/1/team/2403582/discussions/1/comments/1" + * @example "https://api.github.com/repos/octocat/example/subscription" */ url: string; } +/** Requires Authentication */ +export type RequiresAuthentication = BasicError; + /** - * Full Team - * Groups of organization members that gives permissions on specified repositories. + * Legacy Review Comment + * Legacy Review Comment */ -export interface TeamFull { +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 "2017-07-14T16:53:42Z" + * @example "2011-04-14T16:00:49Z" */ created_at: string; - /** @example "A great team." */ - description: string | null; + /** @example "@@ -16,33 +16,40 @@ public class Connection : IConnection..." */ + diff_hunk: string; /** * @format uri - * @example "https://github.com/orgs/rails/teams/core" + * @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; /** - * Unique identifier of the team - * @example 42 + * The line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 */ - id: number; + line?: number; + /** @example "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" */ + node_id: string; + /** @example "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840" */ + original_commit_id: string; /** - * Distinguished Name (DN) that team maps to within LDAP environment - * @example "uid=example,ou=users,dc=github,dc=com" + * The original line of the blob to which the comment applies. The last line of the range for a multi-line comment + * @example 2 */ - ldap_dn?: string; - /** @example 3 */ - members_count: number; - /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ - members_url: string; + original_line?: number; + /** @example 4 */ + original_position: number; /** - * Name of the team - * @example "Developers" + * The original first line of the range for a multi-line comment. + * @example 2 */ - name: string; - /** @example "MDQ6VGVhbTE=" */ - node_id: string; - /** Organization Full */ - organization: OrganizationFull; - parent?: TeamSimple | null; + original_start_line?: number | null; + /** @example "file1.txt" */ + path: string; + /** @example 1 */ + position: number | null; + /** @example 42 */ + pull_request_review_id: number | null; /** - * Permission that the team will have for its repositories - * @example "push" + * @format uri + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/1" */ - permission: string; + pull_request_url: string; /** - * The level of privacy this team should have - * @example "closed" + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" */ - privacy?: TeamFullPrivacyEnum; - /** @example 10 */ - repos_count: number; + side?: ReviewCommentSideEnum; /** - * @format uri - * @example "https://api.github.com/organizations/1/team/1/repos" + * The first line of the range for a multi-line comment. + * @example 2 */ - repositories_url: string; - /** @example "justice-league" */ - slug: string; + 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 "2017-08-17T12:37:15Z" + * @example "2011-04-14T16:00:49Z" */ updated_at: string; /** - * URL for the team * @format uri - * @example "https://api.github.com/organizations/1/team/1" + * @example "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" */ url: string; + user: SimpleUser | null; } /** - * The level of privacy this team should have - * @example "closed" + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" */ -export enum TeamFullPrivacyEnum { - Closed = "closed", - Secret = "secret", +export enum ReviewCommentSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", } /** - * Team Membership - * Team Membership + * The side of the first line of the range for a multi-line comment. + * @default "RIGHT" */ -export interface TeamMembership { - /** - * The role of the user in the team. - * @default "member" - * @example "member" - */ - role: TeamMembershipRoleEnum; - state: string; - /** @format uri */ - url: string; +export enum ReviewCommentStartSideEnum { + LEFT = "LEFT", + RIGHT = "RIGHT", } /** - * The role of the user in the team. - * @default "member" - * @example "member" + * 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 TeamMembershipRoleEnum { +export enum RoleEnum { + All = "all", + Admin = "admin", + Member = "member", +} + +/** + * 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", } /** - * Team Project - * A team's access to a project. + * 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 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 enum RoleEnum2 { + Member = "member", + Maintainer = "maintainer", + All = "all", } /** - * Team Repository - * A team's access to a repository. + * Self hosted runners + * A self hosted runner */ -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; +export interface Runner { + busy: boolean; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/deployments" + * The id of the runner. + * @example 5 */ - deployments_url: string; - /** @example "This your first repo!" */ - description: string | null; - /** Returns whether or not this repository disabled. */ - disabled: boolean; + 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 uri - * @example "http://api.github.com/repos/octocat/Hello-World/downloads" + * The name of the runner. + * @example "iMac" */ - downloads_url: string; + name: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/events" + * The Operating System of the runner. + * @example "macos" */ - events_url: string; - fork: boolean; - forks: number; - /** @example 9 */ - forks_count: number; + os: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/forks" + * The status of the runner. + * @example "online" */ - 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; + status: string; +} + +/** + * Runner Application + * Runner Application + */ +export interface RunnerApplication { + architecture: string; + download_url: string; + filename: string; + os: string; +} + +export interface RunnerGroupsEnterprise { + allows_public_repositories: boolean; + default: boolean; + id: number; + 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\` */ + selected_repositories_url?: string; + visibility: string; +} + +/** The type of label. Read-only labels are applied automatically when the runner is configured. */ +export enum RunnerTypeEnum { + ReadOnly = "read-only", + Custom = "custom", +} + +/** Bad Request */ +export type ScimBadRequest = ScimError; + +/** Conflict */ +export type ScimConflict = ScimError; + +export type ScimDeleteUserFromOrgData = any; + +export interface ScimDeleteUserFromOrgParams { + org: string; + /** scim_user_id parameter */ + scimUserId: 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; +} + +/** Forbidden */ +export type ScimForbidden = ScimError; + +export type ScimGetProvisioningInformationForUserData = ScimUser; + +export interface ScimGetProvisioningInformationForUserParams { + org: string; + /** scim_user_id parameter */ + scimUserId: 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; +} + +/** Internal Error */ +export type ScimInternalError = ScimError; + +export type ScimListProvisionedIdentitiesData = ScimUserList; + +export interface ScimListProvisionedIdentitiesParams { + /** Used for pagination: the number of results to return. */ + count?: number; /** - * Whether downloads are enabled. - * @default true - * @example true + * 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\\"\`. */ - has_downloads: boolean; + filter?: string; + org: string; + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; +} + +/** Resource Not Found */ +export type ScimNotFound = ScimError; + +export type ScimProvisionAndInviteUserData = ScimUser; + +export interface ScimProvisionAndInviteUserParams { + org: string; +} + +export interface ScimProvisionAndInviteUserPayload { + active?: boolean; /** - * Whether issues are enabled. - * @default true - * @example true + * The name of the user, suitable for display to end-users + * @example "Jon Doe" */ - has_issues: boolean; - has_pages: boolean; + displayName?: string; /** - * Whether projects are enabled. - * @default true - * @example true + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] */ - has_projects: boolean; + 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[]; /** - * Whether the wiki is enabled. - * @default true - * @example true + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" */ - has_wiki: boolean; + userName: string; +} + +export type ScimSetInformationForProvisionedUserData = ScimUser; + +export interface ScimSetInformationForProvisionedUserParams { + org: string; + /** scim_user_id parameter */ + scimUserId: string; +} + +export interface ScimSetInformationForProvisionedUserPayload { + active?: boolean; /** - * @format uri - * @example "https://github.com" + * The name of the user, suitable for display to end-users + * @example "Jon Doe" */ - homepage: string | null; + displayName?: string; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/hooks" + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] */ - hooks_url: string; + 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[]; /** - * @format uri - * @example "https://github.com/octocat/Hello-World" + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" */ - html_url: string; + userName: string; +} + +export type ScimUpdateAttributeForUserData = ScimUser; + +export type ScimUpdateAttributeForUserError = BasicError; + +export enum ScimUpdateAttributeForUserOpEnum { + Add = "add", + Remove = "remove", + Replace = "replace", +} + +export interface ScimUpdateAttributeForUserParams { + org: string; + /** scim_user_id parameter */ + scimUserId: string; +} + +export interface ScimUpdateAttributeForUserPayload { /** - * Unique identifier of the repository - * @example 42 + * Set of operations to be performed + * @minItems 1 + * @example [{"op":"replace","value":{"active":false}}] */ - id: number; + 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[]; +} + +/** + * SCIM /Users + * SCIM /Users provisioning endpoints + */ +export interface ScimUser { /** - * Whether this repository acts as a template that can be used to generate new repositories. - * @default false + * The active status of the User. * @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; + active: boolean; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/languages" + * The name of the user, suitable for display to end-users + * @example "Jon Doe" */ - languages_url: string; - license: LicenseSimple | null; - master_branch?: string; + displayName?: string | null; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/merges" + * user emails + * @minItems 1 + * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] */ - merges_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" */ - milestones_url: string; + emails: { + primary?: boolean; + value: string; + }[]; /** - * @format uri - * @example "git:git.example.com/octocat/Hello-World" + * The ID of the User. + * @example "a7b0f98395" */ - mirror_url: string | null; + externalId: string | null; + /** associated groups */ + groups?: { + display?: string; + value?: string; + }[]; /** - * The name of the repository. - * @example "Team Environment" + * Unique identifier of an external identity + * @example "1b78eada-9baa-11e6-9eb6-a431576d590e" */ - 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; + 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; }; /** - * Whether the repository is private or public. - * @default false + * Set of operations to be performed + * @minItems 1 + * @example [{"op":"replace","value":{"active":false}}] */ - private: boolean; - /** @example "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" */ - pulls_url: string; + operations?: { + op: ScimUserOpEnum; + path?: string; + value?: string | object | any[]; + }[]; + /** The ID of the organization. */ + organization_id?: number; /** - * @format date-time - * @example "2011-01-26T19:06:43Z" + * SCIM schema used. + * @minItems 1 */ - 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; + schemas: string[]; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/stargazers" + * Configured by the admin. Could be an email, login, or username + * @example "someone@example.com" */ - stargazers_url: string; - /** @example "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" */ - statuses_url: string; - subscribers_count?: number; + userName: string | null; +} + +/** + * SCIM User List + * SCIM User List + */ +export interface ScimUserList { + Resources: ScimUser[]; + /** @example 10 */ + itemsPerPage: number; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscribers" + * SCIM schema used. + * @minItems 1 */ - subscribers_url: string; + 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; +} + +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; /** * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/subscription" + * @example "https://api.github.com/users/octocat/repos" */ - subscription_url: string; + 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[]; +} + +/** Describe whether all repositories have been selected or there's a selection involved */ +export enum ScopedInstallationRepositorySelectionEnum { + All = "all", + Selected = "selected", +} + +export interface SearchCodeData { + incomplete_results: boolean; + items: CodeSearchResultItem[]; + total_count: number; +} + +export interface SearchCodeParams { /** - * @format uri - * @example "https://svn.github.com/octocat/Hello-World" + * 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" */ - svn_url: string; + order?: OrderEnum2; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/tags" + * Page number of the results to fetch. + * @default 1 */ - tags_url: string; + page?: number; /** - * @format uri - * @example "http://api.github.com/repos/octocat/Hello-World/teams" + * Results per page (max 100) + * @default 30 */ - 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; + 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; +} + +/** + * 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", +} + +/** 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 SearchCommitsData { + incomplete_results: boolean; + items: CommitSearchResultItem[]; + total_count: number; +} + +export interface SearchCommitsParams { /** - * @format date-time - * @example "2011-01-26T19:14:43Z" + * 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" */ - updated_at: string | null; + order?: OrderEnum3; /** - * @format uri - * @example "https://api.github.com/repos/octocat/Hello-World" + * Page number of the results to fetch. + * @default 1 */ - url: string; + page?: number; /** - * The repository visibility: public, private, or internal. - * @default "public" + * Results per page (max 100) + * @default 30 */ - visibility?: string; - watchers: number; - /** @example 80 */ - watchers_count: number; + 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; } /** - * Team Simple - * Groups of organization members that gives permissions on specified repositories. + * 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 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; +export enum SearchCommitsParams1OrderEnum { + Desc = "desc", + Asc = "asc", +} + +/** 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 interface SearchIssuesAndPullRequestsData { + incomplete_results: boolean; + items: IssueSearchResultItem[]; + total_count: number; +} + +export interface SearchIssuesAndPullRequestsParams { /** - * Unique identifier of the team - * @example 1 + * 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" */ - id: number; + order?: OrderEnum4; /** - * Distinguished Name (DN) that team maps to within LDAP environment - * @example "uid=example,ou=users,dc=github,dc=com" + * Page number of the results to fetch. + * @default 1 */ - ldap_dn?: string; - /** @example "https://api.github.com/organizations/1/team/1/members{/member}" */ - members_url: string; + page?: number; /** - * Name of the team - * @example "Justice League" + * Results per page (max 100) + * @default 30 */ - name: string; - /** @example "MDQ6VGVhbTE=" */ - node_id: 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 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; +} + +/** + * 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", +} + +/** 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 interface SearchLabelsData { + incomplete_results: boolean; + items: LabelSearchResultItem[]; + total_count: number; +} + +export interface SearchLabelsParams { /** - * Permission that the team will have for its repositories - * @example "admin" + * 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" */ - permission: 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 level of privacy this team should have - * @example "closed" + * 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" */ - privacy?: string; + order?: OrderEnum6; /** - * @format uri - * @example "https://api.github.com/organizations/1/team/1/repos" + * Page number of the results to fetch. + * @default 1 */ - repositories_url: string; - /** @example "justice-league" */ - slug: string; + page?: number; /** - * URL for the team - * @format uri - * @example "https://api.github.com/organizations/1/team/1" + * Results per page (max 100) + * @default 30 */ - url: string; -} | null; + 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; +} -export type TeamsAddMemberLegacyData = any; +/** + * 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", +} -export type TeamsAddMemberLegacyError = { - /** @example ""https://docs.github.com/rest"" */ - documentation_url?: string; - errors?: { - code?: string; - field?: string; - resource?: 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) */ +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; }[]; - message?: string; -}; + object_type?: string | null; + object_url?: string; + property?: string; +}[]; -export interface TeamsAddMemberLegacyParams { - teamId: number; - username: string; +export interface SearchTopicsData { + incomplete_results: boolean; + items: TopicSearchResultItem[]; + total_count: number; } -export type TeamsAddOrUpdateMembershipForUserInOrgData = TeamMembership; - -export type TeamsAddOrUpdateMembershipForUserInOrgError = { - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: 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 interface TeamsAddOrUpdateMembershipForUserInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; +export interface SearchUsersData { + incomplete_results: boolean; + items: UserSearchResultItem[]; + total_count: number; } -export interface TeamsAddOrUpdateMembershipForUserInOrgPayload { +export interface SearchUsersParams { /** - * 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" + * 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" */ - role?: TeamsAddOrUpdateMembershipForUserInOrgRoleEnum; + order?: OrderEnum7; + /** + * 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?: SortEnum17; } /** - * 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" + * 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 TeamsAddOrUpdateMembershipForUserInOrgRoleEnum { - Member = "member", - Maintainer = "maintainer", +export enum SearchUsersParams1OrderEnum { + Desc = "desc", + Asc = "asc", } -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; +/** 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 interface TeamsAddOrUpdateMembershipForUserLegacyPayload { +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 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" + * The time that the alert was resolved in ISO 8601 format: \`YYYY-MM-DDTHH:MM:SSZ\`. + * @format date-time */ - role?: TeamsAddOrUpdateMembershipForUserLegacyRoleEnum; + 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; } -/** - * 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", +/** **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 enum SecretScanningAlertResolutionEnum { + FalsePositive = "false_positive", + WontFix = "wont_fix", + Revoked = "revoked", + UsedInTests = "used_in_tests", } -export type TeamsAddOrUpdateProjectPermissionsInOrgData = any; +/** 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 TeamsAddOrUpdateProjectPermissionsInOrgError = { - documentation_url?: string; - message?: string; -}; +export type SecretScanningGetAlertData = SecretScanningAlert; -export interface TeamsAddOrUpdateProjectPermissionsInOrgParams { - org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; +export interface SecretScanningGetAlertParams { + /** The security alert number, found at the end of the security alert's URL. */ + alertNumber: AlertNumber; + owner: string; + repo: string; } -export interface TeamsAddOrUpdateProjectPermissionsInOrgPayload { +export type SecretScanningListAlertsForRepoData = SecretScanningAlert[]; + +export interface SecretScanningListAlertsForRepoParams { + owner: 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)." + * Page number of the results to fetch. + * @default 1 */ - permission?: TeamsAddOrUpdateProjectPermissionsInOrgPermissionEnum; + 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 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", +/** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ +export enum SecretScanningListAlertsForRepoParams1StateEnum { + Open = "open", + Resolved = "resolved", } -export type TeamsAddOrUpdateProjectPermissionsLegacyData = any; +export type SecretScanningUpdateAlertData = SecretScanningAlert; -export type TeamsAddOrUpdateProjectPermissionsLegacyError = { +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; -}; +} -export interface TeamsAddOrUpdateProjectPermissionsLegacyParams { - projectId: number; - teamId: number; +/** + * Short Blob + * Short Blob + */ +export interface ShortBlob { + sha: string; + url: string; } -export interface TeamsAddOrUpdateProjectPermissionsLegacyPayload { +/** + * 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 + */ +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; /** - * 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)." + * @format uri + * @example "https://api.github.com/users/octocat" */ - permission?: TeamsAddOrUpdateProjectPermissionsLegacyPermissionEnum; -} + url: string; +} | null; /** - * 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)." + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" */ -export enum TeamsAddOrUpdateProjectPermissionsLegacyPermissionEnum { - Read = "read", - Write = "write", - Admin = "admin", +export enum SortEnum { + Created = "created", + Updated = "updated", + Comments = "comments", } -export type TeamsAddOrUpdateRepoPermissionsInOrgData = any; - -export interface TeamsAddOrUpdateRepoPermissionsInOrgParams { - org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: string; +/** + * 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", } -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; +/** + * 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", } /** - * 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. + * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). + * @default "created" */ -export enum TeamsAddOrUpdateRepoPermissionsInOrgPermissionEnum { - Pull = "pull", - Push = "push", - Admin = "admin", - Maintain = "maintain", - Triage = "triage", +export enum SortEnum11 { + Created = "created", + Updated = "updated", } -export type TeamsAddOrUpdateRepoPermissionsLegacyData = any; - -export interface TeamsAddOrUpdateRepoPermissionsLegacyParams { - owner: string; - repo: string; - teamId: number; +/** 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", } -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; +/** 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", } -/** - * 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", +/** 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", } -export type TeamsCheckPermissionsForProjectInOrgData = TeamProject; - -export interface TeamsCheckPermissionsForProjectInOrgParams { - org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: 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 SortEnum15 { + Created = "created", + Updated = "updated", } -export type TeamsCheckPermissionsForProjectLegacyData = TeamProject; - -export interface TeamsCheckPermissionsForProjectLegacyParams { - projectId: number; - teamId: number; +/** 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", } -export type TeamsCheckPermissionsForRepoInOrgData = TeamRepository; - -export interface TeamsCheckPermissionsForRepoInOrgParams { - org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: 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 SortEnum17 { + Followers = "followers", + Repositories = "repositories", + Joined = "joined", } -export type TeamsCheckPermissionsForRepoLegacyData = TeamRepository; - -export interface TeamsCheckPermissionsForRepoLegacyParams { - owner: string; - repo: string; - teamId: number; +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum SortEnum18 { + Created = "created", + Updated = "updated", + Comments = "comments", } -export type TeamsCreateData = TeamFull; - -export type TeamsCreateDiscussionCommentInOrgData = TeamDiscussionComment; - -export interface TeamsCreateDiscussionCommentInOrgParams { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; +/** + * 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 interface TeamsCreateDiscussionCommentInOrgPayload { - /** The discussion comment's body text. */ - body: string; +/** + * 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 type TeamsCreateDiscussionCommentLegacyData = TeamDiscussionComment; - -export interface TeamsCreateDiscussionCommentLegacyParams { - discussionNumber: number; - teamId: number; +/** + * 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 interface TeamsCreateDiscussionCommentLegacyPayload { - /** The discussion comment's body text. */ - body: string; +/** + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" + */ +export enum SortEnum21 { + Created = "created", + Updated = "updated", + Pushed = "pushed", + FullName = "full_name", } -export type TeamsCreateDiscussionInOrgData = TeamDiscussion; - -export interface TeamsCreateDiscussionInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; +/** + * 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", } -export interface TeamsCreateDiscussionInOrgPayload { - /** 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; +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum SortEnum3 { + Created = "created", + Updated = "updated", + Comments = "comments", } -export type TeamsCreateDiscussionLegacyData = TeamDiscussion; - -export interface TeamsCreateDiscussionLegacyParams { - teamId: number; +/** + * 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 TeamsCreateDiscussionLegacyPayload { - /** 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; +/** + * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. + * @default "newest" + */ +export enum SortEnum5 { + Newest = "newest", + Oldest = "oldest", + Stargazers = "stargazers", } -export type TeamsCreateOrUpdateIdpGroupConnectionsInOrgData = GroupMapping; - -export interface TeamsCreateOrUpdateIdpGroupConnectionsInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; +/** + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. + * @default "created" + */ +export enum SortEnum6 { + Created = "created", + Updated = "updated", + Comments = "comments", } -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; - }[]; +/** + * 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 TeamsCreateOrUpdateIdpGroupConnectionsLegacyData = GroupMapping; - -export interface TeamsCreateOrUpdateIdpGroupConnectionsLegacyParams { - teamId: number; +/** + * What to sort results by. Either \`due_on\` or \`completeness\`. + * @default "due_on" + */ +export enum SortEnum8 { + DueOn = "due_on", + Completeness = "completeness", } -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; +/** + * 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 TeamsCreateParams { - org: string; +/** + * Stargazer + * Stargazer + */ +export interface Stargazer { + /** @format date-time */ + starred_at: string; + user: SimpleUser | null; } -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[]; +/** + * Starred Repository + * Starred Repository + */ +export interface StarredRepository { + /** A git repository */ + repo: Repository; + /** @format date-time */ + starred_at: 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" + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" */ -export enum TeamsCreatePermissionEnum { - Pull = "pull", - Push = "push", - Admin = "admin", +export enum StateEnum { + Open = "open", + Closed = "closed", + All = "all", } /** - * 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\` + * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. + * @default "open" */ -export enum TeamsCreatePrivacyEnum { - Secret = "secret", +export enum StateEnum1 { + Open = "open", Closed = "closed", + All = "all", } -export type TeamsDeleteDiscussionCommentInOrgData = any; - -export interface TeamsDeleteDiscussionCommentInOrgParams { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: 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 TeamsDeleteDiscussionCommentLegacyData = any; - -export interface TeamsDeleteDiscussionCommentLegacyParams { - commentNumber: number; - discussionNumber: number; - teamId: number; +/** + * 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 type TeamsDeleteDiscussionInOrgData = any; - -export interface TeamsDeleteDiscussionInOrgParams { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: string; +/** + * 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 TeamsDeleteDiscussionLegacyData = any; - -export interface TeamsDeleteDiscussionLegacyParams { - discussionNumber: number; - teamId: number; +/** + * The state of the milestone. Either \`open\`, \`closed\`, or \`all\`. + * @default "open" + */ +export enum StateEnum4 { + Open = "open", + Closed = "closed", + All = "all", } -export type TeamsDeleteInOrgData = any; - -export interface TeamsDeleteInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: 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 TeamsDeleteLegacyData = any; - -export interface TeamsDeleteLegacyParams { - teamId: number; +/** + * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * @default "open" + */ +export enum StateEnum6 { + Open = "open", + Closed = "closed", + All = "all", } -export type TeamsGetByNameData = TeamFull; +/** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ +export enum StateEnum7 { + Open = "open", + Resolved = "resolved", +} -export interface TeamsGetByNameParams { - org: string; - /** team_slug parameter */ - teamSlug: string; +/** + * 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 type TeamsGetDiscussionCommentInOrgData = TeamDiscussionComment; +/** 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 interface TeamsGetDiscussionCommentInOrgParams { - commentNumber: number; - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: 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 TeamsGetDiscussionCommentLegacyData = TeamDiscussionComment; +/** + * 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; +} -export interface TeamsGetDiscussionCommentLegacyParams { - commentNumber: number; - discussionNumber: number; - teamId: 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)." */ +export enum StatusEnum { + Completed = "completed", + Status = "status", + Conclusion = "conclusion", } -export type TeamsGetDiscussionInOrgData = TeamDiscussion; +/** 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 TeamsGetDiscussionInOrgParams { - discussionNumber: number; - org: string; - /** team_slug parameter */ - teamSlug: 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 TeamsGetDiscussionLegacyData = TeamDiscussion; +/** 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 interface TeamsGetDiscussionLegacyParams { - discussionNumber: number; - teamId: number; +/** 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", } -export type TeamsGetLegacyData = TeamFull; +/** + * 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 interface TeamsGetLegacyParams { - teamId: number; +/** + * 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 TeamsGetMemberLegacyData = any; +/** + * 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; +} -export interface TeamsGetMemberLegacyParams { - teamId: number; - username: 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 TeamsGetMembershipForUserInOrgData = TeamMembership; +/** + * 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 interface TeamsGetMembershipForUserInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; +/** + * The level of privacy this team should have + * @example "closed" + */ +export enum TeamFullPrivacyEnum { + Closed = "closed", + Secret = "secret", } -export type TeamsGetMembershipForUserLegacyData = TeamMembership; +/** + * 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 interface TeamsGetMembershipForUserLegacyParams { - teamId: number; - username: string; +/** + * The role of the user in the team. + * @default "member" + * @example "member" + */ +export enum TeamMembershipRoleEnum { + Member = "member", + Maintainer = "maintainer", } -export type TeamsListChildInOrgData = Team[]; +/** + * 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 interface TeamsListChildInOrgParams { - org: 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; /** - * 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; - /** team_slug parameter */ - teamSlug: string; -} - -export type TeamsListChildLegacyData = Team[]; - -export interface TeamsListChildLegacyParams { + 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; - teamId: number; -} - -export type TeamsListData = Team[]; - -export type TeamsListDiscussionCommentsInOrgData = TeamDiscussionComment[]; - -export interface TeamsListDiscussionCommentsInOrgParams { + events_url: string; + fork: boolean; + forks: number; + /** @example 9 */ + forks_count: number; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/forks" */ - direction?: DirectionEnum6; - discussionNumber: number; - org: 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; /** - * Page number of the results to fetch. - * @default 1 + * Whether downloads are enabled. + * @default true + * @example true */ - page?: number; + has_downloads: boolean; /** - * Results per page (max 100) - * @default 30 + * Whether issues are enabled. + * @default true + * @example true */ - 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 { + has_issues: boolean; + has_pages: boolean; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Whether projects are enabled. + * @default true + * @example true */ - direction?: DirectionEnum14; - discussionNumber: number; + has_projects: boolean; /** - * Page number of the results to fetch. - * @default 1 + * Whether the wiki is enabled. + * @default true + * @example true */ - page?: number; + has_wiki: boolean; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://github.com" */ - 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 { + homepage: string | null; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * @format uri + * @example "http://api.github.com/repos/octocat/Hello-World/hooks" */ - direction?: DirectionEnum5; - org: string; + hooks_url: string; /** - * Page number of the results to fetch. - * @default 1 + * @format uri + * @example "https://github.com/octocat/Hello-World" */ - page?: number; + html_url: string; /** - * Results per page (max 100) - * @default 30 + * Unique identifier of the repository + * @example 42 */ - 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 { + id: number; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Whether this repository acts as a template that can be used to generate new repositories. + * @default false + * @example true */ - direction?: DirectionEnum13; + 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; - teamId: number; + 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; } /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * Team Simple + * Groups of organization members that gives permissions on specified repositories. */ -export enum TeamsListDiscussionsLegacyParams1DirectionEnum { - Asc = "asc", - Desc = "desc", -} - -export type TeamsListForAuthenticatedUserData = TeamFull[]; - -export interface TeamsListForAuthenticatedUserParams { +export type TeamSimple = { /** - * Page number of the results to fetch. - * @default 1 + * Description of the team + * @example "A great team." */ - page?: number; + description: string | null; /** - * Results per page (max 100) - * @default 30 + * @format uri + * @example "https://github.com/orgs/rails/teams/core" */ - per_page?: number; -} - -export type TeamsListIdpGroupsForLegacyData = GroupMapping; - -export interface TeamsListIdpGroupsForLegacyParams { - teamId: number; -} - -export type TeamsListIdpGroupsForOrgData = GroupMapping; - -export interface TeamsListIdpGroupsForOrgParams { - org: string; + html_url: string; /** - * Page number of the results to fetch. - * @default 1 + * Unique identifier of the team + * @example 1 */ - page?: number; + id: number; /** - * Results per page (max 100) - * @default 30 + * Distinguished Name (DN) that team maps to within LDAP environment + * @example "uid=example,ou=users,dc=github,dc=com" */ - per_page?: number; + 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 interface TeamsAddMemberLegacyParams { + teamId: number; + username: string; } -export type TeamsListIdpGroupsInOrgData = GroupMapping; +export type TeamsAddOrUpdateMembershipForUserInOrgData = TeamMembership; -export interface TeamsListIdpGroupsInOrgParams { +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 type TeamsListMembersInOrgData = SimpleUser[]; - -export interface TeamsListMembersInOrgParams { - 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 TeamsAddOrUpdateMembershipForUserInOrgPayload { /** - * 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" + * 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?: RoleEnum1; - /** team_slug parameter */ - teamSlug: string; + role?: TeamsAddOrUpdateMembershipForUserInOrgRoleEnum; } /** - * 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" + * 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 TeamsListMembersInOrgParams1RoleEnum { +export enum TeamsAddOrUpdateMembershipForUserInOrgRoleEnum { Member = "member", Maintainer = "maintainer", - All = "all", } -export type TeamsListMembersLegacyData = SimpleUser[]; +export type TeamsAddOrUpdateMembershipForUserLegacyData = TeamMembership; -export interface TeamsListMembersLegacyParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; +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 { /** - * 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" + * 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?: RoleEnum2; - teamId: number; + role?: TeamsAddOrUpdateMembershipForUserLegacyRoleEnum; } /** - * 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" + * 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 TeamsListMembersLegacyParams1RoleEnum { +export enum TeamsAddOrUpdateMembershipForUserLegacyRoleEnum { Member = "member", Maintainer = "maintainer", - All = "all", } -export interface TeamsListParams { - 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 TeamsAddOrUpdateProjectPermissionsInOrgData = any; -export type TeamsListPendingInvitationsInOrgData = OrganizationInvitation[]; +export type TeamsAddOrUpdateProjectPermissionsInOrgError = { + documentation_url?: string; + message?: string; +}; -export interface TeamsListPendingInvitationsInOrgParams { +export interface TeamsAddOrUpdateProjectPermissionsInOrgParams { org: string; - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + projectId: number; /** team_slug parameter */ teamSlug: string; } -export type TeamsListPendingInvitationsLegacyData = OrganizationInvitation[]; - -export interface TeamsListPendingInvitationsLegacyParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export interface TeamsAddOrUpdateProjectPermissionsInOrgPayload { /** - * Results per page (max 100) - * @default 30 + * 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)." */ - per_page?: number; - teamId: number; + permission?: TeamsAddOrUpdateProjectPermissionsInOrgPermissionEnum; } -export type TeamsListProjectsInOrgData = TeamProject[]; - -export interface TeamsListProjectsInOrgParams { - 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 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 type TeamsListProjectsLegacyData = TeamProject[]; +export type TeamsAddOrUpdateProjectPermissionsLegacyData = any; -export interface TeamsListProjectsLegacyParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export type TeamsAddOrUpdateProjectPermissionsLegacyError = { + documentation_url?: string; + message?: string; +}; + +export interface TeamsAddOrUpdateProjectPermissionsLegacyParams { + projectId: number; + teamId: number; +} + +export interface TeamsAddOrUpdateProjectPermissionsLegacyPayload { /** - * Results per page (max 100) - * @default 30 + * 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)." */ - per_page?: number; - teamId: number; + permission?: TeamsAddOrUpdateProjectPermissionsLegacyPermissionEnum; } -export type TeamsListReposInOrgData = MinimalRepository[]; +/** + * 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 interface TeamsListReposInOrgParams { +export type TeamsAddOrUpdateRepoPermissionsInOrgData = any; + +export interface TeamsAddOrUpdateRepoPermissionsInOrgParams { org: string; - /** - * 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; /** team_slug parameter */ teamSlug: string; } -export type TeamsListReposLegacyData = MinimalRepository[]; - -export interface TeamsListReposLegacyParams { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export interface TeamsAddOrUpdateRepoPermissionsInOrgPayload { /** - * Results per page (max 100) - * @default 30 + * 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. */ - per_page?: number; - teamId: number; + permission?: TeamsAddOrUpdateRepoPermissionsInOrgPermissionEnum; } -export type TeamsRemoveMemberLegacyData = any; - -export interface TeamsRemoveMemberLegacyParams { - teamId: number; - username: string; +/** + * 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 type TeamsRemoveMembershipForUserInOrgData = any; +export type TeamsAddOrUpdateRepoPermissionsLegacyData = any; -export interface TeamsRemoveMembershipForUserInOrgParams { - org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; +export interface TeamsAddOrUpdateRepoPermissionsLegacyParams { + owner: string; + repo: string; + teamId: number; } -export type TeamsRemoveMembershipForUserLegacyData = any; +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; +} -export interface TeamsRemoveMembershipForUserLegacyParams { - teamId: number; - username: string; +/** + * 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 TeamsRemoveProjectInOrgData = any; +export type TeamsCheckPermissionsForProjectInOrgData = TeamProject; -export interface TeamsRemoveProjectInOrgParams { +export interface TeamsCheckPermissionsForProjectInOrgParams { org: string; projectId: number; /** team_slug parameter */ teamSlug: string; } -export type TeamsRemoveProjectLegacyData = any; +export type TeamsCheckPermissionsForProjectLegacyData = TeamProject; -export interface TeamsRemoveProjectLegacyParams { +export interface TeamsCheckPermissionsForProjectLegacyParams { projectId: number; teamId: number; } -export type TeamsRemoveRepoInOrgData = any; +export type TeamsCheckPermissionsForRepoInOrgData = TeamRepository; -export interface TeamsRemoveRepoInOrgParams { +export interface TeamsCheckPermissionsForRepoInOrgParams { org: string; owner: string; repo: string; @@ -33348,145 +34528,139 @@ export interface TeamsRemoveRepoInOrgParams { teamSlug: string; } -export type TeamsRemoveRepoLegacyData = any; +export type TeamsCheckPermissionsForRepoLegacyData = TeamRepository; -export interface TeamsRemoveRepoLegacyParams { +export interface TeamsCheckPermissionsForRepoLegacyParams { owner: string; repo: string; teamId: number; } -export type TeamsUpdateDiscussionCommentInOrgData = TeamDiscussionComment; +export type TeamsCreateData = TeamFull; -export interface TeamsUpdateDiscussionCommentInOrgParams { - commentNumber: number; +export type TeamsCreateDiscussionCommentInOrgData = TeamDiscussionComment; + +export interface TeamsCreateDiscussionCommentInOrgParams { discussionNumber: number; org: string; /** team_slug parameter */ teamSlug: string; } -export interface TeamsUpdateDiscussionCommentInOrgPayload { +export interface TeamsCreateDiscussionCommentInOrgPayload { /** The discussion comment's body text. */ body: string; } -export type TeamsUpdateDiscussionCommentLegacyData = TeamDiscussionComment; +export type TeamsCreateDiscussionCommentLegacyData = TeamDiscussionComment; -export interface TeamsUpdateDiscussionCommentLegacyParams { - commentNumber: number; +export interface TeamsCreateDiscussionCommentLegacyParams { discussionNumber: number; teamId: number; } -export interface TeamsUpdateDiscussionCommentLegacyPayload { +export interface TeamsCreateDiscussionCommentLegacyPayload { /** The discussion comment's body text. */ body: string; } -export type TeamsUpdateDiscussionInOrgData = TeamDiscussion; +export type TeamsCreateDiscussionInOrgData = TeamDiscussion; -export interface TeamsUpdateDiscussionInOrgParams { - discussionNumber: number; +export interface TeamsCreateDiscussionInOrgParams { org: string; /** team_slug parameter */ teamSlug: string; } -export interface TeamsUpdateDiscussionInOrgPayload { +export interface TeamsCreateDiscussionInOrgPayload { /** The discussion post's body text. */ - body?: string; + 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; + title: string; } -export type TeamsUpdateDiscussionLegacyData = TeamDiscussion; +export type TeamsCreateDiscussionLegacyData = TeamDiscussion; -export interface TeamsUpdateDiscussionLegacyParams { - discussionNumber: number; +export interface TeamsCreateDiscussionLegacyParams { teamId: number; } -export interface TeamsUpdateDiscussionLegacyPayload { +export interface TeamsCreateDiscussionLegacyPayload { /** The discussion post's body text. */ - body?: string; + 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; + title: string; } -export type TeamsUpdateInOrgData = TeamFull; +export type TeamsCreateOrUpdateIdpGroupConnectionsInOrgData = GroupMapping; -export interface TeamsUpdateInOrgParams { +export interface TeamsCreateOrUpdateIdpGroupConnectionsInOrgParams { 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; - /** - * **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?: TeamsUpdateInOrgPermissionEnum; - /** - * 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?: TeamsUpdateInOrgPrivacyEnum; +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; + }[]; } -/** - * **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", -} +export type TeamsCreateOrUpdateIdpGroupConnectionsLegacyData = GroupMapping; -/** - * 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 interface TeamsCreateOrUpdateIdpGroupConnectionsLegacyParams { + teamId: number; } -export type TeamsUpdateLegacyData = TeamFull; +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 TeamsUpdateLegacyParams { - teamId: number; +export interface TeamsCreateParams { + org: string; } -export interface TeamsUpdateLegacyPayload { +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 | null; + 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. @@ -33494,16 +34668,20 @@ export interface TeamsUpdateLegacyPayload { * \\* \`admin\` - team members can pull, push and administer newly-added repositories. * @default "pull" */ - permission?: TeamsUpdateLegacyPermissionEnum; + permission?: TeamsCreatePermissionEnum; /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves \`privacy\` intact. The options are: + * 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?: TeamsUpdateLegacyPrivacyEnum; + privacy?: TeamsCreatePrivacyEnum; + /** The full name (e.g., "organization-name/repository-name") of repositories to add the team to. */ + repo_names?: string[]; } /** @@ -33513,399 +34691,311 @@ export interface TeamsUpdateLegacyPayload { * \\* \`admin\` - team members can pull, push and administer newly-added repositories. * @default "pull" */ -export enum TeamsUpdateLegacyPermissionEnum { +export enum TeamsCreatePermissionEnum { 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: + * 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 TeamsUpdateLegacyPrivacyEnum { +export enum TeamsCreatePrivacyEnum { 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; -} +export type TeamsDeleteDiscussionCommentInOrgData = any; -/** - * 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; +export interface TeamsDeleteDiscussionCommentInOrgParams { + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; } -/** - * Topic - * A topic aggregates entities that are related to a subject. - */ -export interface Topic { - names: string[]; +export type TeamsDeleteDiscussionCommentLegacyData = any; + +export interface TeamsDeleteDiscussionCommentLegacyParams { + commentNumber: number; + discussionNumber: number; + teamId: number; } -/** - * 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; +export type TeamsDeleteDiscussionInOrgData = any; + +export interface TeamsDeleteDiscussionInOrgParams { + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; } -/** Traffic */ -export interface Traffic { - count: number; - /** @format date-time */ - timestamp: string; - uniques: number; +export type TeamsDeleteDiscussionLegacyData = any; + +export interface TeamsDeleteDiscussionLegacyParams { + discussionNumber: number; + teamId: 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", +export type TeamsDeleteInOrgData = any; + +export interface TeamsDeleteInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; } -/** - * 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", +export type TeamsDeleteLegacyData = any; + +export interface TeamsDeleteLegacyParams { + teamId: number; } -/** - * Can be one of \`all\`, \`owner\`, \`member\`. - * @default "owner" - */ -export enum TypeEnum2 { - All = "all", - Owner = "owner", - Member = "member", +export type TeamsGetByNameData = TeamFull; + +export interface TeamsGetByNameParams { + org: string; + /** team_slug parameter */ + teamSlug: string; } -/** - * 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; +export type TeamsGetDiscussionCommentInOrgData = TeamDiscussionComment; + +export interface TeamsGetDiscussionCommentInOrgParams { + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; } -/** - * 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 TeamsGetDiscussionCommentLegacyData = TeamDiscussionComment; + +export interface TeamsGetDiscussionCommentLegacyParams { + commentNumber: number; + discussionNumber: number; + teamId: number; } -export type UsersAddEmailForAuthenticatedData = Email[]; +export type TeamsGetDiscussionInOrgData = TeamDiscussion; -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 interface TeamsGetDiscussionInOrgParams { + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} -export type UsersBlockData = any; +export type TeamsGetDiscussionLegacyData = TeamDiscussion; -export interface UsersBlockParams { - username: string; +export interface TeamsGetDiscussionLegacyParams { + discussionNumber: number; + teamId: number; } -export type UsersCheckBlockedData = any; +export type TeamsGetLegacyData = TeamFull; -export type UsersCheckBlockedError = BasicError; +export interface TeamsGetLegacyParams { + teamId: number; +} -export interface UsersCheckBlockedParams { +export type TeamsGetMemberLegacyData = any; + +export interface TeamsGetMemberLegacyParams { + teamId: number; username: string; } -export type UsersCheckFollowingForUserData = any; +export type TeamsGetMembershipForUserInOrgData = TeamMembership; -export interface UsersCheckFollowingForUserParams { - targetUser: string; +export interface TeamsGetMembershipForUserInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; username: string; } -export type UsersCheckPersonIsFollowedByAuthenticatedData = any; - -export type UsersCheckPersonIsFollowedByAuthenticatedError = BasicError; +export type TeamsGetMembershipForUserLegacyData = TeamMembership; -export interface UsersCheckPersonIsFollowedByAuthenticatedParams { +export interface TeamsGetMembershipForUserLegacyParams { + teamId: number; username: string; } -export type UsersCreateGpgKeyForAuthenticatedData = GpgKey; +export type TeamsListChildInOrgData = Team[]; -export interface UsersCreateGpgKeyForAuthenticatedPayload { - /** A GPG key in ASCII-armored format. */ - armored_public_key: string; +export interface TeamsListChildInOrgParams { + 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; } -export type UsersCreatePublicSshKeyForAuthenticatedData = Key; +export type TeamsListChildLegacyData = Team[]; -export interface UsersCreatePublicSshKeyForAuthenticatedPayload { +export interface TeamsListChildLegacyParams { /** - * The public SSH key to add to your GitHub account. - * @pattern ^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) + * Page number of the results to fetch. + * @default 1 */ - key: string; + page?: number; /** - * A descriptive name for the new key. - * @example "Personal MacBook Air" + * Results per page (max 100) + * @default 30 */ - title?: string; + per_page?: number; + teamId: number; } -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 TeamsListData = Team[]; -export type UsersDeleteGpgKeyForAuthenticatedData = any; +export type TeamsListDiscussionCommentsInOrgData = TeamDiscussionComment[]; -export interface UsersDeleteGpgKeyForAuthenticatedParams { - /** gpg_key_id parameter */ - gpgKeyId: number; +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; } -export type UsersDeletePublicSshKeyForAuthenticatedData = any; - -export interface UsersDeletePublicSshKeyForAuthenticatedParams { - /** key_id parameter */ - keyId: number; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum TeamsListDiscussionCommentsInOrgParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export type UsersFollowData = any; +export type TeamsListDiscussionCommentsLegacyData = TeamDiscussionComment[]; -export interface UsersFollowParams { - username: string; +export interface TeamsListDiscussionCommentsLegacyParams { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: DirectionEnum14; + discussionNumber: number; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + teamId: number; } -export type UsersGetAuthenticatedData = PrivateUser | PublicUser; - -export type UsersGetByUsernameData = PrivateUser | PublicUser; - -export interface UsersGetByUsernameParams { - username: string; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum TeamsListDiscussionCommentsLegacyParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export type UsersGetContextForUserData = Hovercard; +export type TeamsListDiscussionsInOrgData = TeamDiscussion[]; -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 interface TeamsListDiscussionsInOrgParams { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: DirectionEnum5; + 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; } -/** 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", +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum TeamsListDiscussionsInOrgParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export type UsersGetGpgKeyForAuthenticatedData = GpgKey; +export type TeamsListDiscussionsLegacyData = TeamDiscussion[]; -export interface UsersGetGpgKeyForAuthenticatedParams { - /** gpg_key_id parameter */ - gpgKeyId: number; +export interface TeamsListDiscussionsLegacyParams { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: DirectionEnum13; + /** + * Page number of the results to fetch. + * @default 1 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + teamId: number; } -export type UsersGetPublicSshKeyForAuthenticatedData = Key; - -export interface UsersGetPublicSshKeyForAuthenticatedParams { - /** key_id parameter */ - keyId: number; +/** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ +export enum TeamsListDiscussionsLegacyParams1DirectionEnum { + Asc = "asc", + Desc = "desc", } -export type UsersListBlockedByAuthenticatedData = SimpleUser[]; - -export type UsersListData = SimpleUser[]; - -export type UsersListEmailsForAuthenticatedData = Email[]; +export type TeamsListForAuthenticatedUserData = TeamFull[]; -export interface UsersListEmailsForAuthenticatedParams { +export interface TeamsListForAuthenticatedUserParams { /** * Page number of the results to fetch. * @default 1 @@ -33918,9 +35008,16 @@ export interface UsersListEmailsForAuthenticatedParams { per_page?: number; } -export type UsersListFollowedByAuthenticatedData = SimpleUser[]; +export type TeamsListIdpGroupsForLegacyData = GroupMapping; -export interface UsersListFollowedByAuthenticatedParams { +export interface TeamsListIdpGroupsForLegacyParams { + teamId: number; +} + +export type TeamsListIdpGroupsForOrgData = GroupMapping; + +export interface TeamsListIdpGroupsForOrgParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -33933,9 +35030,18 @@ export interface UsersListFollowedByAuthenticatedParams { per_page?: number; } -export type UsersListFollowersForAuthenticatedUserData = SimpleUser[]; +export type TeamsListIdpGroupsInOrgData = GroupMapping; -export interface UsersListFollowersForAuthenticatedUserParams { +export interface TeamsListIdpGroupsInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; +} + +export type TeamsListMembersInOrgData = SimpleUser[]; + +export interface TeamsListMembersInOrgParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -33946,11 +35052,34 @@ export interface UsersListFollowersForAuthenticatedUserParams { * @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?: RoleEnum1; + /** team_slug parameter */ + teamSlug: string; } -export type UsersListFollowersForUserData = SimpleUser[]; +/** + * 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 interface UsersListFollowersForUserParams { +export type TeamsListMembersLegacyData = SimpleUser[]; + +export interface TeamsListMembersLegacyParams { /** * Page number of the results to fetch. * @default 1 @@ -33961,12 +35090,32 @@ export interface UsersListFollowersForUserParams { * @default 30 */ per_page?: number; - username: 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" + */ + role?: RoleEnum2; + teamId: number; } -export type UsersListFollowingForUserData = SimpleUser[]; +/** + * 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 UsersListFollowingForUserParams { +export interface TeamsListParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -33977,12 +35126,12 @@ export interface UsersListFollowingForUserParams { * @default 30 */ per_page?: number; - username: string; } -export type UsersListGpgKeysForAuthenticatedData = GpgKey[]; +export type TeamsListPendingInvitationsInOrgData = OrganizationInvitation[]; -export interface UsersListGpgKeysForAuthenticatedParams { +export interface TeamsListPendingInvitationsInOrgParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -33993,11 +35142,13 @@ export interface UsersListGpgKeysForAuthenticatedParams { * @default 30 */ per_page?: number; + /** team_slug parameter */ + teamSlug: string; } -export type UsersListGpgKeysForUserData = GpgKey[]; +export type TeamsListPendingInvitationsLegacyData = OrganizationInvitation[]; -export interface UsersListGpgKeysForUserParams { +export interface TeamsListPendingInvitationsLegacyParams { /** * Page number of the results to fetch. * @default 1 @@ -34008,22 +35159,30 @@ export interface UsersListGpgKeysForUserParams { * @default 30 */ per_page?: number; - username: string; + teamId: number; } -export interface UsersListParams { +export type TeamsListProjectsInOrgData = TeamProject[]; + +export interface TeamsListProjectsInOrgParams { + org: string; + /** + * 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; + /** team_slug parameter */ + teamSlug: string; } -export type UsersListPublicEmailsForAuthenticatedData = Email[]; +export type TeamsListProjectsLegacyData = TeamProject[]; -export interface UsersListPublicEmailsForAuthenticatedParams { +export interface TeamsListProjectsLegacyParams { /** * Page number of the results to fetch. * @default 1 @@ -34034,11 +35193,13 @@ export interface UsersListPublicEmailsForAuthenticatedParams { * @default 30 */ per_page?: number; + teamId: number; } -export type UsersListPublicKeysForUserData = KeySimple[]; +export type TeamsListReposInOrgData = MinimalRepository[]; -export interface UsersListPublicKeysForUserParams { +export interface TeamsListReposInOrgParams { + org: string; /** * Page number of the results to fetch. * @default 1 @@ -34049,12 +35210,13 @@ export interface UsersListPublicKeysForUserParams { * @default 30 */ per_page?: number; - username: string; + /** team_slug parameter */ + teamSlug: string; } -export type UsersListPublicSshKeysForAuthenticatedData = Key[]; +export type TeamsListReposLegacyData = MinimalRepository[]; -export interface UsersListPublicSshKeysForAuthenticatedParams { +export interface TeamsListReposLegacyParams { /** * Page number of the results to fetch. * @default 1 @@ -34065,2092 +35227,1226 @@ export interface UsersListPublicSshKeysForAuthenticatedParams { * @default 30 */ per_page?: number; + teamId: number; } -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; -} +export type TeamsRemoveMemberLegacyData = any; -/** Denotes whether an email is publically visible. */ -export enum UsersSetPrimaryEmailVisibilityForAuthenticatedVisibilityEnum { - Public = "public", - Private = "private", +export interface TeamsRemoveMemberLegacyParams { + teamId: number; + username: string; } -export type UsersUnblockData = any; +export type TeamsRemoveMembershipForUserInOrgData = any; -export interface UsersUnblockParams { +export interface TeamsRemoveMembershipForUserInOrgParams { + org: string; + /** team_slug parameter */ + teamSlug: string; username: string; } -export type UsersUnfollowData = any; +export type TeamsRemoveMembershipForUserLegacyData = any; -export interface UsersUnfollowParams { +export interface TeamsRemoveMembershipForUserLegacyParams { + teamId: number; username: string; } -export type UsersUpdateAuthenticatedData = PrivateUser; +export type TeamsRemoveProjectInOrgData = any; -export interface UsersUpdateAuthenticatedPayload { - /** 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; +export interface TeamsRemoveProjectInOrgParams { + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: 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; -} +export type TeamsRemoveProjectLegacyData = any; -/** - * Validation Error Simple - * Validation Error Simple - */ -export interface ValidationErrorSimple { - documentation_url: string; - errors?: string[]; - message: string; +export interface TeamsRemoveProjectLegacyParams { + projectId: number; + teamId: number; } -/** 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; -} +export type TeamsRemoveRepoInOrgData = any; -/** - * View Traffic - * View Traffic - */ -export interface ViewTraffic { - /** @example 14850 */ - count: number; - /** @example 3782 */ - uniques: number; - views: Traffic[]; +export interface TeamsRemoveRepoInOrgParams { + org: string; + owner: string; + repo: string; + /** team_slug parameter */ + teamSlug: string; } -/** - * Can be one of \`all\`, \`public\`, or \`private\`. - * @default "all" - */ -export enum VisibilityEnum { - All = "all", - Public = "public", - Private = "private", -} +export type TeamsRemoveRepoLegacyData = any; -/** - * 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 interface TeamsRemoveRepoLegacyParams { + owner: string; + repo: string; + teamId: number; } -/** - * 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; +export type TeamsUpdateDiscussionCommentInOrgData = TeamDiscussionComment; -/** - * 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; +export interface TeamsUpdateDiscussionCommentInOrgParams { + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: 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; +export interface TeamsUpdateDiscussionCommentInOrgPayload { + /** The discussion comment's body text. */ + body: 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; -} +export type TeamsUpdateDiscussionCommentLegacyData = TeamDiscussionComment; -/** @example "active" */ -export enum WorkflowStateEnum { - Active = "active", - Deleted = "deleted", +export interface TeamsUpdateDiscussionCommentLegacyParams { + commentNumber: number; + discussionNumber: number; + teamId: number; } -/** - * Workflow Usage - * Workflow Usage - */ -export interface WorkflowUsage { - billable: { - MACOS?: { - total_ms?: number; - }; - UBUNTU?: { - total_ms?: number; - }; - WINDOWS?: { - total_ms?: number; - }; - }; +export interface TeamsUpdateDiscussionCommentLegacyPayload { + /** The discussion comment's body text. */ + body: string; } -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; - } - - /** - * @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; - } +export type TeamsUpdateDiscussionInOrgData = TeamDiscussion; - /** - * @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; - } +export interface TeamsUpdateDiscussionInOrgParams { + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; +} - /** - * @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; - } +export interface TeamsUpdateDiscussionInOrgPayload { + /** The discussion post's body text. */ + body?: string; + /** The discussion post's title. */ + title?: string; +} - /** - * @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; - } +export type TeamsUpdateDiscussionLegacyData = TeamDiscussion; - /** - * @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; - } +export interface TeamsUpdateDiscussionLegacyParams { + discussionNumber: number; + teamId: number; +} - /** - * @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; - } +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 **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 + * **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 AppsUnsuspendInstallation { - export type RequestParams = { - /** installation_id parameter */ - installationId: number; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsUnsuspendInstallationData; - } - + permission?: TeamsUpdateInOrgPermissionEnum; /** - * @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 + * 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 AppsUpdateWebhookConfigForApp { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = AppsUpdateWebhookConfigForAppPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsUpdateWebhookConfigForAppData; - } + privacy?: TeamsUpdateInOrgPrivacyEnum; } -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; - } +/** + * **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", } -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; - } +/** + * 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", +} - /** - * @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; - } +export type TeamsUpdateLegacyData = TeamFull; - /** - * @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; - } +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 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 + * **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 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; - } - + permission?: TeamsUpdateLegacyPermissionEnum; /** - * @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 + * 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 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; - } + privacy?: TeamsUpdateLegacyPrivacyEnum; +} - /** - * @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; - } +/** + * **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", +} - /** - * @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; - } +/** + * 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", +} - /** - * @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; - } +/** + * 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 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 date-time + * @example "2012-10-06T21:34:12Z" */ - 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; - } - + created_at: string | null; + ignored: boolean; + reason: string | 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/). 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/1" */ - 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; - } - + repository_url?: string; + /** @example true */ + subscribed: 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/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://api.github.com/notifications/threads/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; - } - + thread_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://api.github.com/notifications/threads/1/subscription" */ - 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; - } + 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", } -export namespace 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} - */ - export namespace AppsGetBySlug { - export type RequestParams = { - appSlug: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsGetBySlugData; - } +/** + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" + */ +export enum TypeEnum2 { + All = "all", + Owner = "owner", + Member = "member", } -export namespace Authorizations { +/** + * User Marketplace Purchase + * User Marketplace Purchase + */ +export interface UserMarketplacePurchase { + account: MarketplaceAccount; + /** @example "monthly" */ + billing_cycle: 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 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 + * @format date-time + * @example "2017-11-11T00:00:00Z" */ - export namespace OauthAuthorizationsCreateAuthorization { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = OauthAuthorizationsCreateAuthorizationPayload; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsCreateAuthorizationData; - } - + free_trial_ends_on: string | 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 oauth-authorizations - * @name OauthAuthorizationsDeleteAuthorization - * @summary Delete an authorization - * @request DELETE:/authorizations/{authorization_id} - * @deprecated + * @format date-time + * @example "2017-11-11T00:00:00Z" */ - 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; - } - + next_billing_date: string | null; + /** @example true */ + on_free_trial: boolean; + /** Marketplace Listing Plan */ + plan: MarketplaceListingPlan; + unit_count: number | 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 oauth-authorizations - * @name OauthAuthorizationsGetAuthorization - * @summary Get a single authorization - * @request GET:/authorizations/{authorization_id} - * @deprecated + * @format date-time + * @example "2017-11-02T01:12:12Z" */ - 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; - } + updated_at: string | 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 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 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; - } +/** + * 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; +} - /** - * @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 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; - } +export type UsersAddEmailForAuthenticatedData = Email[]; - /** - * @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 OauthAuthorizationsListAuthorizations { - export type RequestParams = {}; - export type RequestQuery = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; +export type UsersAddEmailForAuthenticatedPayload = + | { /** - * Results per page (max 100) - * @default 30 + * 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 [] */ - per_page?: number; - }; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsListAuthorizationsData; - } + emails: string[]; + } + | string[] + | 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 = OauthAuthorizationsUpdateAuthorizationPayload; - export type RequestHeaders = {}; - export type ResponseBody = OauthAuthorizationsUpdateAuthorizationData; - } +export type UsersBlockData = any; + +export interface UsersBlockParams { + username: string; } -export namespace CodesOfConduct { - /** - * No description - * @tags codes-of-conduct - * @name CodesOfConductGetAllCodesOfConduct - * @summary Get all codes of conduct - * @request GET:/codes_of_conduct - */ - export namespace CodesOfConductGetAllCodesOfConduct { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = CodesOfConductGetAllCodesOfConductData; - } +export type UsersCheckBlockedData = any; - /** - * No description - * @tags codes-of-conduct - * @name CodesOfConductGetConductCode - * @summary Get a code of conduct - * @request GET:/codes_of_conduct/{key} - */ - export namespace CodesOfConductGetConductCode { - export type RequestParams = { - key: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = CodesOfConductGetConductCodeData; - } +export type UsersCheckBlockedError = BasicError; + +export interface UsersCheckBlockedParams { + username: string; } -export namespace 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 - */ - export namespace AppsCreateContentAttachment { - export type RequestParams = { - contentReferenceId: number; - }; - export type RequestQuery = {}; - export type RequestBody = AppsCreateContentAttachmentPayload; - export type RequestHeaders = {}; - export type ResponseBody = AppsCreateContentAttachmentData; - } +export type UsersCheckFollowingForUserData = any; + +export interface UsersCheckFollowingForUserParams { + targetUser: string; + username: string; } -export namespace Emojis { - /** - * @description Lists all the emojis available to use on GitHub. - * @tags emojis - * @name EmojisGet - * @summary Get emojis - * @request GET:/emojis - */ - export namespace EmojisGet { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = EmojisGetData; - } +export type UsersCheckPersonIsFollowedByAuthenticatedData = any; + +export type UsersCheckPersonIsFollowedByAuthenticatedError = BasicError; + +export interface UsersCheckPersonIsFollowedByAuthenticatedParams { + username: string; } -export namespace 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 - */ - 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; - } +export type UsersCreateGpgKeyForAuthenticatedData = GpgKey; - /** - * @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 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; - } +export interface UsersCreateGpgKeyForAuthenticatedPayload { + /** A GPG key in ASCII-armored format. */ + armored_public_key: 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 - */ - 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; - } +export type UsersCreatePublicSshKeyForAuthenticatedData = Key; +export interface UsersCreatePublicSshKeyForAuthenticatedPayload { /** - * @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 + * The public SSH key to add to your GitHub account. + * @pattern ^ssh-(rsa|dss|ed25519) |^ecdsa-sha2-nistp(256|384|521) */ - 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; - } - + key: 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} + * A descriptive name for the new key. + * @example "Personal MacBook Air" */ - 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; - } + 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; - /** - * @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 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; - } +export interface UsersGetGpgKeyForAuthenticatedParams { + /** gpg_key_id parameter */ + gpgKeyId: 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 - */ - 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; - } +export type UsersGetPublicSshKeyForAuthenticatedData = Key; - /** - * @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 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; - } +export interface UsersGetPublicSshKeyForAuthenticatedParams { + /** key_id parameter */ + keyId: number; +} - /** - * @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 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; - } +export type UsersListBlockedByAuthenticatedData = SimpleUser[]; - /** - * @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 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; - } +export type UsersListData = SimpleUser[]; +export type UsersListEmailsForAuthenticatedData = Email[]; + +export interface UsersListEmailsForAuthenticatedParams { /** - * @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} + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: 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} + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; +} + +export type UsersListFollowedByAuthenticatedData = SimpleUser[]; +export interface UsersListFollowedByAuthenticatedParams { /** - * @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} + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: number; /** - * @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 + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; +} + +export type UsersListFollowersForAuthenticatedUserData = SimpleUser[]; +export interface UsersListFollowersForAuthenticatedUserParams { /** - * @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 + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: 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} + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; +} +export type UsersListFollowersForUserData = SimpleUser[]; + +export interface UsersListFollowersForUserParams { /** - * @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} + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: number; /** - * @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 + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; + username: string; +} + +export type UsersListFollowingForUserData = SimpleUser[]; +export interface UsersListFollowingForUserParams { /** - * @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 + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: number; /** - * @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 + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; + username: string; +} + +export type UsersListGpgKeysForAuthenticatedData = GpgKey[]; +export interface UsersListGpgKeysForAuthenticatedParams { /** - * @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 + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: number; /** - * @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 + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; +} + +export type UsersListGpgKeysForUserData = GpgKey[]; +export interface UsersListGpgKeysForUserParams { /** - * @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 + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: number; /** - * @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} + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; + username: string; +} +export interface UsersListParams { /** - * @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} + * Results per page (max 100) + * @default 30 */ - 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; - } + 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 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 + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: 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 enterprise-admin - * @name EnterpriseAdminSetGithubActionsPermissionsEnterprise - * @summary Set GitHub Actions permissions for an enterprise - * @request PUT:/enterprises/{enterprise}/actions/permissions + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; +} + +export type UsersListPublicKeysForUserData = KeySimple[]; +export interface UsersListPublicKeysForUserParams { /** - * @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 + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: number; /** - * @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 + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; + username: string; +} + +export type UsersListPublicSshKeysForAuthenticatedData = Key[]; +export interface UsersListPublicSshKeysForAuthenticatedParams { /** - * @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 + * Page number of the results to fetch. + * @default 1 */ - 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; - } - + page?: 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 enterprise-admin - * @name EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise - * @summary Update a self-hosted runner group for an enterprise - * @request PATCH:/enterprises/{enterprise}/actions/runner-groups/{runner_group_id} + * Results per page (max 100) + * @default 30 */ - 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; - } + per_page?: number; } -export namespace Events { +export type UsersSetPrimaryEmailVisibilityForAuthenticatedData = Email[]; + +export interface UsersSetPrimaryEmailVisibilityForAuthenticatedPayload { /** - * @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 + * An email address associated with the GitHub user account to manage. + * @example "org@example.com" */ - 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; - } + email: string; + /** Denotes whether an email is publically visible. */ + visibility: UsersSetPrimaryEmailVisibilityForAuthenticatedVisibilityEnum; } -export namespace Feeds { +/** 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 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 + * The new blog URL of the user. + * @example "blog.example.com" */ - export namespace ActivityGetFeeds { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ActivityGetFeedsData; - } + 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; } -export namespace Gists { +/** + * 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; /** - * No description - * @tags gists - * @name GistsCheckIsStarred - * @summary Check if a gist is starred - * @request GET:/gists/{gist_id}/star + * @format date-time + * @example "2019-12-06T14:20:20.000Z" */ - 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; - } - + created_at: 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 + * @format date-time + * @example "2019-12-06T14:20:20.000Z" */ - export namespace GistsCreate { - export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = GistsCreatePayload; - export type RequestHeaders = {}; - export type ResponseBody = GistsCreateData; - } - + 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; /** - * No description - * @tags gists - * @name GistsCreateComment - * @summary Create a gist comment - * @request POST:/gists/{gist_id}/comments + * @format date-time + * @example "2019-12-06T14:20:20.000Z" */ - 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; - } + 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 { /** - * No description - * @tags gists - * @name GistsDelete - * @summary Delete a gist - * @request DELETE:/gists/{gist_id} + * The URL to the artifacts for the workflow run. + * @example "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts" */ - 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; - } - + 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; /** - * No description - * @tags gists - * @name GistsDeleteComment - * @summary Delete a gist comment - * @request DELETE:/gists/{gist_id}/comments/{comment_id} + * The ID of the parent workflow. + * @example 5 */ - 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; - } - + workflow_id: number; /** - * @description **Note**: This was previously \`/gists/:gist_id/fork\`. - * @tags gists - * @name GistsFork - * @summary Fork a gist - * @request POST:/gists/{gist_id}/forks + * The URL to the workflow. + * @example "https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml" */ - export namespace GistsFork { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; + 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 = GistsForkData; - } + UBUNTU?: { + jobs: number; + total_ms: number; + }; + WINDOWS?: { + jobs: number; + total_ms: number; + }; + }; + run_duration_ms: number; +} - /** - * No description - * @tags gists - * @name GistsGet - * @summary Get a gist - * @request GET:/gists/{gist_id} - */ - export namespace GistsGet { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; +/** @example "active" */ +export enum WorkflowStateEnum { + Active = "active", + Deleted = "deleted", +} + +/** + * Workflow Usage + * Workflow Usage + */ +export interface WorkflowUsage { + billable: { + MACOS?: { + total_ms?: number; }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsGetData; - } + UBUNTU?: { + total_ms?: number; + }; + WINDOWS?: { + total_ms?: number; + }; + }; +} +export namespace App { /** - * No description - * @tags gists - * @name GistsGetComment - * @summary Get a gist comment - * @request GET:/gists/{gist_id}/comments/{comment_id} + * @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 GistsGetComment { + export namespace AppsCreateInstallationAccessToken { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - /** gist_id parameter */ - gistId: string; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsCreateInstallationAccessTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = GistsGetCommentData; + export type ResponseBody = AppsCreateInstallationAccessTokenData; } /** - * No description - * @tags gists - * @name GistsGetRevision - * @summary Get a gist revision - * @request GET:/gists/{gist_id}/{sha} + * @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 GistsGetRevision { + export namespace AppsDeleteInstallation { export type RequestParams = { - /** gist_id parameter */ - gistId: string; - sha: string; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GistsGetRevisionData; + export type ResponseBody = AppsDeleteInstallationData; } /** - * @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 + * @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 GistsList { + export namespace AppsGetAuthenticated { 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; - } - - /** - * No description - * @tags gists - * @name GistsListComments - * @summary List gist comments - * @request GET:/gists/{gist_id}/comments - */ - 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; - } - - /** - * No description - * @tags gists - * @name GistsListCommits - * @summary List gist commits - * @request GET:/gists/{gist_id}/commits - */ - 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GistsListCommitsData; + export type ResponseBody = AppsGetAuthenticatedData; } /** - * No description - * @tags gists - * @name GistsListForks - * @summary List gist forks - * @request GET:/gists/{gist_id}/forks + * @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 GistsListForks { + export namespace AppsGetInstallation { 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; + /** installation_id parameter */ + installationId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GistsListForksData; + export type ResponseBody = AppsGetInstallationData; } /** - * @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 + * @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 GistsListPublic { + export namespace AppsGetWebhookConfigForApp { 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 = GistsListPublicData; + export type ResponseBody = AppsGetWebhookConfigForAppData; } /** - * @description List the authenticated user's starred gists: - * @tags gists - * @name GistsListStarred - * @summary List starred gists - * @request GET:/gists/starred + * @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 GistsListStarred { + export namespace AppsListInstallations { export type RequestParams = {}; export type RequestQuery = { + outdated?: string; /** * Page number of the results to fetch. * @default 1 @@ -36166,438 +36462,298 @@ export namespace Gists { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GistsListStarredData; - } - - /** - * @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 GistsStar { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = GistsStarData; - } - - /** - * No description - * @tags gists - * @name GistsUnstar - * @summary Unstar a gist - * @request DELETE:/gists/{gist_id}/star - */ - 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; - } - - /** - * @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 GistsUpdate { - export type RequestParams = { - /** gist_id parameter */ - gistId: string; - }; - export type RequestQuery = {}; - export type RequestBody = GistsUpdatePayload; - export type RequestHeaders = {}; - export type ResponseBody = GistsUpdateData; + export type ResponseBody = AppsListInstallationsData; } /** - * No description - * @tags gists - * @name GistsUpdateComment - * @summary Update a gist comment - * @request PATCH:/gists/{gist_id}/comments/{comment_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/)." 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 GistsUpdateComment { + export namespace AppsSuspendInstallation { export type RequestParams = { - /** comment_id parameter */ - commentId: number; - /** gist_id parameter */ - gistId: string; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; - export type RequestBody = GistsUpdateCommentPayload; - export type RequestHeaders = {}; - export type ResponseBody = GistsUpdateCommentData; - } -} - -export namespace 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 - */ - export namespace GitignoreGetAllTemplates { - export type RequestParams = {}; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitignoreGetAllTemplatesData; + export type ResponseBody = AppsSuspendInstallationData; } /** - * @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} + * @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 GitignoreGetTemplate { + export namespace AppsUnsuspendInstallation { export type RequestParams = { - name: string; + /** installation_id parameter */ + installationId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitignoreGetTemplateData; - } -} - -export namespace 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 - */ - 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; + export type ResponseBody = AppsUnsuspendInstallationData; } /** - * @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. + * @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 AppsRevokeInstallationAccessToken - * @summary Revoke an installation access token - * @request DELETE:/installation/token + * @name AppsUpdateWebhookConfigForApp + * @summary Update a webhook configuration for an app + * @request PATCH:/app/hook/config */ - export namespace AppsRevokeInstallationAccessToken { + export namespace AppsUpdateWebhookConfigForApp { export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsUpdateWebhookConfigForAppPayload; export type RequestHeaders = {}; - export type ResponseBody = AppsRevokeInstallationAccessTokenData; + export type ResponseBody = AppsUpdateWebhookConfigForAppData; } } -export namespace Issues { +export namespace AppManifests { /** - * @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 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 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 namespace AppsCreateFromManifest { + export type RequestParams = { + code: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListData; + export type ResponseBody = AppsCreateFromManifestData; } } -export namespace Licenses { +export namespace Applications { /** - * No description - * @tags licenses - * @name LicensesGet - * @summary Get a license - * @request GET:/licenses/{license} + * @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 LicensesGet { + export namespace AppsCheckAuthorization { export type RequestParams = { - license: string; + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = LicensesGetData; + export type ResponseBody = AppsCheckAuthorizationData; } /** - * No description - * @tags licenses - * @name LicensesGetAllCommonlyUsed - * @summary Get all commonly used licenses - * @request GET:/licenses + * @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 LicensesGetAllCommonlyUsed { - export type RequestParams = {}; - export type RequestQuery = { - featured?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + export namespace AppsCheckToken { + export type RequestParams = { + /** The client ID of your GitHub app. */ + clientId: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = AppsCheckTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = LicensesGetAllCommonlyUsedData; + export type ResponseBody = AppsCheckTokenData; } -} -export namespace Markdown { /** - * No description - * @tags markdown - * @name MarkdownRender - * @summary Render a Markdown document - * @request POST:/markdown + * @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 MarkdownRender { - export type RequestParams = {}; + export namespace AppsDeleteAuthorization { + export type RequestParams = { + /** The client ID of your GitHub app. */ + clientId: string; + }; export type RequestQuery = {}; - export type RequestBody = MarkdownRenderPayload; + export type RequestBody = AppsDeleteAuthorizationPayload; export type RequestHeaders = {}; - export type ResponseBody = MarkdownRenderData; + export type ResponseBody = AppsDeleteAuthorizationData; } /** - * @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 + * @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 MarkdownRenderRaw { - export type RequestParams = {}; + export namespace AppsDeleteToken { + export type RequestParams = { + /** The client ID of your GitHub app. */ + clientId: string; + }; export type RequestQuery = {}; - export type RequestBody = MarkdownRenderRawPayload; + export type RequestBody = AppsDeleteTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = MarkdownRenderRawData; + export type ResponseBody = AppsDeleteTokenData; } -} -export namespace 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. + * @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 AppsGetSubscriptionPlanForAccount - * @summary Get a subscription plan for an account - * @request GET:/marketplace_listing/accounts/{account_id} + * @name AppsResetAuthorization + * @summary Reset an authorization + * @request POST:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - export namespace AppsGetSubscriptionPlanForAccount { + export namespace AppsResetAuthorization { export type RequestParams = { - /** account_id parameter */ - accountId: 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 = AppsGetSubscriptionPlanForAccountData; + export type ResponseBody = AppsResetAuthorizationData; } /** - * @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. + * @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 AppsGetSubscriptionPlanForAccountStubbed - * @summary Get a subscription plan for an account (stubbed) - * @request GET:/marketplace_listing/stubbed/accounts/{account_id} + * @name AppsResetToken + * @summary Reset a token + * @request PATCH:/applications/{client_id}/token */ - export namespace AppsGetSubscriptionPlanForAccountStubbed { + export namespace AppsResetToken { export type RequestParams = { - /** account_id parameter */ - accountId: number; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = AppsResetTokenPayload; export type RequestHeaders = {}; - export type ResponseBody = AppsGetSubscriptionPlanForAccountStubbedData; + export type ResponseBody = AppsResetTokenData; } /** - * @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. + * @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 AppsListAccountsForPlan - * @summary List accounts for a plan - * @request GET:/marketplace_listing/plans/{plan_id}/accounts + * @name AppsRevokeAuthorizationForApplication + * @summary Revoke an authorization for an application + * @request DELETE:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - export namespace AppsListAccountsForPlan { + export namespace AppsRevokeAuthorizationForApplication { export type RequestParams = { - /** plan_id parameter */ - planId: number; + accessToken: string; + /** The client ID of your GitHub app. */ + clientId: string; }; - 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 = AppsRevokeAuthorizationForApplicationData; + } + + /** + * @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 = AppsListAccountsForPlanData; + export type ResponseBody = AppsRevokeGrantForApplicationData; } /** - * @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. + * @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 AppsListAccountsForPlanStubbed - * @summary List accounts for a plan (stubbed) - * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts + * @name AppsScopeToken + * @summary Create a scoped access token + * @request POST:/applications/{client_id}/token/scoped */ - export namespace AppsListAccountsForPlanStubbed { + export namespace AppsScopeToken { export type RequestParams = { - /** plan_id parameter */ - planId: number; + /** The client ID of your GitHub app. */ + clientId: string; }; - 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 RequestQuery = {}; + export type RequestBody = AppsScopeTokenPayload; + export type RequestHeaders = {}; + export type ResponseBody = AppsScopeTokenData; + } + + /** + * @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 OauthAuthorizationsDeleteGrant { + export type RequestParams = { + /** grant_id parameter */ + grantId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsListAccountsForPlanStubbedData; + export type ResponseBody = OauthAuthorizationsDeleteGrantData; } /** - * @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 + * @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 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 namespace OauthAuthorizationsGetGrant { + export type RequestParams = { + /** grant_id parameter */ + grantId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsListPlansData; + export type ResponseBody = OauthAuthorizationsGetGrantData; } /** - * @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 + * @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 AppsListPlansStubbed { + export namespace OauthAuthorizationsListGrants { export type RequestParams = {}; export type RequestQuery = { /** @@ -36613,599 +36769,625 @@ export namespace MarketplaceListing { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsListPlansStubbedData; + export type ResponseBody = OauthAuthorizationsListGrantsData; } } -export namespace Meta { +export namespace Apps { /** - * @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 + * @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 MetaGet { - export type RequestParams = {}; + export namespace AppsGetBySlug { + export type RequestParams = { + appSlug: string; + }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MetaGetData; + export type ResponseBody = AppsGetBySlugData; } } -export namespace Networks { +export namespace Authorizations { /** - * No description - * @tags activity - * @name ActivityListPublicEventsForRepoNetwork - * @summary List public events for a network of repositories - * @request GET:/networks/{owner}/{repo}/events + * @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 ActivityListPublicEventsForRepoNetwork { + export namespace OauthAuthorizationsCreateAuthorization { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = OauthAuthorizationsCreateAuthorizationPayload; + export type RequestHeaders = {}; + export type ResponseBody = OauthAuthorizationsCreateAuthorizationData; + } + + /** + * @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 OauthAuthorizationsDeleteAuthorization { 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; + /** authorization_id parameter */ + authorizationId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListPublicEventsForRepoNetworkData; + export type ResponseBody = OauthAuthorizationsDeleteAuthorizationData; } -} -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 + * @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 ActivityDeleteThreadSubscription { + export namespace OauthAuthorizationsGetAuthorization { export type RequestParams = { - /** thread_id parameter */ - threadId: number; + /** authorization_id parameter */ + authorizationId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityDeleteThreadSubscriptionData; + export type ResponseBody = OauthAuthorizationsGetAuthorizationData; } /** - * No description - * @tags activity - * @name ActivityGetThread - * @summary Get a thread - * @request GET:/notifications/threads/{thread_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/). **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 ActivityGetThread { + export namespace OauthAuthorizationsGetOrCreateAuthorizationForApp { export type RequestParams = { - /** thread_id parameter */ - threadId: number; + /** The client ID of your GitHub app. */ + clientId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityGetThreadData; + export type ResponseBody = + OauthAuthorizationsGetOrCreateAuthorizationForAppData; } /** - * @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 + * @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 ActivityGetThreadSubscriptionForAuthenticatedUser { + export namespace OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint { export type RequestParams = { - /** thread_id parameter */ - threadId: number; + /** 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 = - ActivityGetThreadSubscriptionForAuthenticatedUserData; + OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData; } /** - * @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 + * @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 ActivityListNotificationsForAuthenticatedUser { + export namespace OauthAuthorizationsListAuthorizations { 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; + export type ResponseBody = OauthAuthorizationsListAuthorizationsData; } /** - * @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 + * @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 ActivityMarkNotificationsAsRead { + 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 { + /** + * No description + * @tags codes-of-conduct + * @name CodesOfConductGetAllCodesOfConduct + * @summary Get all codes of conduct + * @request GET:/codes_of_conduct + */ + export namespace CodesOfConductGetAllCodesOfConduct { export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = ActivityMarkNotificationsAsReadPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityMarkNotificationsAsReadData; + export type ResponseBody = CodesOfConductGetAllCodesOfConductData; } /** * No description - * @tags activity - * @name ActivityMarkThreadAsRead - * @summary Mark a thread as read - * @request PATCH:/notifications/threads/{thread_id} + * @tags codes-of-conduct + * @name CodesOfConductGetConductCode + * @summary Get a code of conduct + * @request GET:/codes_of_conduct/{key} */ - export namespace ActivityMarkThreadAsRead { + export namespace CodesOfConductGetConductCode { export type RequestParams = { - /** thread_id parameter */ - threadId: number; + key: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityMarkThreadAsReadData; + export type ResponseBody = CodesOfConductGetConductCodeData; } +} +export namespace ContentReferences { /** - * @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 + * @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 ActivitySetThreadSubscription { + export namespace AppsCreateContentAttachment { export type RequestParams = { - /** thread_id parameter */ - threadId: number; + contentReferenceId: number; }; export type RequestQuery = {}; - export type RequestBody = ActivitySetThreadSubscriptionPayload; + export type RequestBody = AppsCreateContentAttachmentPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivitySetThreadSubscriptionData; + export type ResponseBody = AppsCreateContentAttachmentData; } } -export namespace Octocat { +export namespace Emojis { /** - * @description Get the octocat as ASCII art - * @tags meta - * @name MetaGetOctocat - * @summary Get Octocat - * @request GET:/octocat + * @description Lists all the emojis available to use on GitHub. + * @tags emojis + * @name EmojisGet + * @summary Get emojis + * @request GET:/emojis */ - export namespace MetaGetOctocat { + export namespace EmojisGet { export type RequestParams = {}; - export type RequestQuery = { - /** The words to show in Octocat's speech bubble */ - s?: string; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MetaGetOctocatData; + export type ResponseBody = EmojisGetData; } } -export namespace Organizations { +export namespace Enterprises { /** - * @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 + * @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 OrgsList { - export type RequestParams = {}; + 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; - /** An organization ID. Only return organizations with an ID greater than this ID. */ - since?: 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 = OrgsListData; + export type ResponseBody = AuditLogGetAuditLogData; } -} -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} + * @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 ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg { + export namespace BillingGetGithubActionsBillingGhe { export type RequestParams = { - org: string; - repositoryId: number; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: 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 = - ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgData; + export type ResponseBody = BillingGetGithubActionsBillingGheData; } /** - * @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} + * @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 ActionsAddSelectedRepoToOrgSecret { + export namespace BillingGetGithubPackagesBillingGhe { export type RequestParams = { - org: string; - repositoryId: number; - /** secret_name parameter */ - secretName: 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 = ActionsAddSelectedRepoToOrgSecretData; + export type ResponseBody = BillingGetGithubPackagesBillingGheData; } /** - * @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} + * @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 ActionsAddSelfHostedRunnerToGroupForOrg { + export namespace BillingGetSharedStorageBillingGhe { export type RequestParams = { - org: string; - /** Unique identifier of the self-hosted runner group. */ - runnerGroupId: number; - /** 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; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsAddSelfHostedRunnerToGroupForOrgData; + export type ResponseBody = BillingGetSharedStorageBillingGheData; } /** - * @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} + * @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 ActionsCreateOrUpdateOrgSecret { + export namespace EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise { export type RequestParams = { - org: 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; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = ActionsCreateOrUpdateOrgSecretPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateOrUpdateOrgSecretData; + export type ResponseBody = + EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** - * @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 + * @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 ActionsCreateRegistrationTokenForOrg { + export namespace EnterpriseAdminAddSelfHostedRunnerToGroupForEnterprise { export type RequestParams = { - org: 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 = ActionsCreateRegistrationTokenForOrgData; + export type ResponseBody = + EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData; } /** - * @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 + * @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 ActionsCreateRemoveTokenForOrg { + export namespace EnterpriseAdminCreateRegistrationTokenForEnterprise { export type RequestParams = { - org: 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 = ActionsCreateRemoveTokenForOrgData; + export type ResponseBody = + EnterpriseAdminCreateRegistrationTokenForEnterpriseData; } /** - * @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 + * @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 ActionsCreateSelfHostedRunnerGroupForOrg { + export namespace EnterpriseAdminCreateRemoveTokenForEnterprise { export type RequestParams = { - org: 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 = ActionsCreateSelfHostedRunnerGroupForOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateSelfHostedRunnerGroupForOrgData; + export type ResponseBody = + EnterpriseAdminCreateRemoveTokenForEnterpriseData; } /** - * @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} + * @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 ActionsDeleteOrgSecret { + export namespace EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise { export type RequestParams = { - org: 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; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteOrgSecretData; + export type ResponseBody = + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData; } /** - * @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} + * @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 ActionsDeleteSelfHostedRunnerFromOrg { + export namespace EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise { export type RequestParams = { - org: 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 = ActionsDeleteSelfHostedRunnerFromOrgData; + export type ResponseBody = + EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData; } /** - * @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} + * @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 ActionsDeleteSelfHostedRunnerGroupFromOrg { + export namespace EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise { export type RequestParams = { - org: 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 = ActionsDeleteSelfHostedRunnerGroupFromOrgData; - } - - /** - * @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; + EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData; } /** - * @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} + * @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 ActionsEnableSelectedRepositoryGithubActionsOrganization { + export namespace EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise { export type RequestParams = { - org: string; - repositoryId: 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 = - ActionsEnableSelectedRepositoryGithubActionsOrganizationData; - } - - /** - * @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; + EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData; } /** - * @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 + * @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 ActionsGetGithubActionsPermissionsOrganization { + export namespace EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise { export type RequestParams = { - org: 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 = - ActionsGetGithubActionsPermissionsOrganizationData; + EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData; } /** - * @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 + * @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 ActionsGetOrgPublicKey { + export namespace EnterpriseAdminGetAllowedActionsEnterprise { export type RequestParams = { - org: 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 = ActionsGetOrgPublicKeyData; + export type ResponseBody = EnterpriseAdminGetAllowedActionsEnterpriseData; } /** - * @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} + * @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 ActionsGetOrgSecret { + export namespace EnterpriseAdminGetGithubActionsPermissionsEnterprise { export type RequestParams = { - org: 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; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetOrgSecretData; + export type ResponseBody = + EnterpriseAdminGetGithubActionsPermissionsEnterpriseData; } /** - * @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} + * @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 ActionsGetSelfHostedRunnerForOrg { + export namespace EnterpriseAdminGetSelfHostedRunnerForEnterprise { export type RequestParams = { - org: 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 = ActionsGetSelfHostedRunnerForOrgData; + export type ResponseBody = + EnterpriseAdminGetSelfHostedRunnerForEnterpriseData; } /** - * @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} + * @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 ActionsGetSelfHostedRunnerGroupForOrg { + export namespace EnterpriseAdminGetSelfHostedRunnerGroupForEnterprise { export type RequestParams = { - org: 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 = ActionsGetSelfHostedRunnerGroupForOrgData; + export type ResponseBody = + EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData; } /** - * @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 + * @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 ActionsListOrgSecrets { + export namespace EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise { export type RequestParams = { - org: 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 = { /** @@ -37221,75 +37403,40 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListOrgSecretsData; - } - - /** - * @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; - } - - /** - * @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; + EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** - * @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 + * @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 ActionsListSelectedReposForOrgSecret { - export type RequestParams = { - org: string; - /** secret_name parameter */ - secretName: string; + 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 = ActionsListSelectedReposForOrgSecretData; + export type ResponseBody = + EnterpriseAdminListRunnerApplicationsForEnterpriseData; } /** - * @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 + * @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 ActionsListSelectedRepositoriesEnabledGithubActionsOrganization { + export namespace EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise { export type RequestParams = { - org: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = { /** @@ -37306,19 +37453,20 @@ export namespace Orgs { export type RequestBody = never; export type RequestHeaders = {}; export type ResponseBody = - ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData; + EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData; } /** - * @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 + * @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 ActionsListSelfHostedRunnerGroupsForOrg { + export namespace EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise { export type RequestParams = { - org: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = { /** @@ -37334,19 +37482,21 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelfHostedRunnerGroupsForOrgData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData; } /** - * @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 + * @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 ActionsListSelfHostedRunnersForOrg { + export namespace EnterpriseAdminListSelfHostedRunnersForEnterprise { export type RequestParams = { - org: string; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; }; export type RequestQuery = { /** @@ -37362,19 +37512,21 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelfHostedRunnersForOrgData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnersForEnterpriseData; } /** - * @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 + * @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 ActionsListSelfHostedRunnersInGroupForOrg { + export namespace EnterpriseAdminListSelfHostedRunnersInGroupForEnterprise { export type RequestParams = { - org: 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; }; @@ -37392,20 +37544,23 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListSelfHostedRunnersInGroupForOrgData; + export type ResponseBody = + EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData; } /** - * @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} + * @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 ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg { + export namespace EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise { export type RequestParams = { - org: string; - repositoryId: 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; }; @@ -37413,39 +37568,20 @@ export namespace Orgs { export type RequestBody = never; export type RequestHeaders = {}; export type ResponseBody = - ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData; - } - - /** - * @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; + EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** - * @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} + * @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 ActionsRemoveSelfHostedRunnerFromGroupForOrg { + export namespace EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise { export type RequestParams = { - org: 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. */ @@ -37454,153 +37590,145 @@ export namespace Orgs { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsRemoveSelfHostedRunnerFromGroupForOrgData; + export type ResponseBody = + EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData; } /** - * @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 + * @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 ActionsSetAllowedActionsOrganization { + export namespace EnterpriseAdminSetAllowedActionsEnterprise { export type RequestParams = { - org: 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 RequestHeaders = {}; - export type ResponseBody = ActionsSetAllowedActionsOrganizationData; + export type ResponseBody = EnterpriseAdminSetAllowedActionsEnterpriseData; } /** - * @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 + * @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 ActionsSetGithubActionsPermissionsOrganization { + export namespace EnterpriseAdminSetGithubActionsPermissionsEnterprise { export type RequestParams = { - org: 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 = - ActionsSetGithubActionsPermissionsOrganizationPayload; + EnterpriseAdminSetGithubActionsPermissionsEnterprisePayload; export type RequestHeaders = {}; export type ResponseBody = - ActionsSetGithubActionsPermissionsOrganizationData; + EnterpriseAdminSetGithubActionsPermissionsEnterpriseData; } /** - * @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 + * @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 ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg { + export namespace EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise { export type RequestParams = { - org: 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 = - ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload; + EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprisePayload; export type RequestHeaders = {}; export type ResponseBody = - ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgData; - } - - /** - * @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; + EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseData; } /** - * @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 + * @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 ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization { + export namespace EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise { export type RequestParams = { - org: 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 = - ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload; + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload; export type RequestHeaders = {}; export type ResponseBody = - ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData; + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData; } /** - * @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 + * @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 ActionsSetSelfHostedRunnersInGroupForOrg { + export namespace EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprise { export type RequestParams = { - org: 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 = ActionsSetSelfHostedRunnersInGroupForOrgPayload; + export type RequestBody = + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsSetSelfHostedRunnersInGroupForOrgData; + export type ResponseBody = + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData; } /** - * @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} + * @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 ActionsUpdateSelfHostedRunnerGroupForOrg { + export namespace EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise { export type RequestParams = { - org: 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 = ActionsUpdateSelfHostedRunnerGroupForOrgPayload; + export type RequestBody = + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsUpdateSelfHostedRunnerGroupForOrgData; + export type ResponseBody = + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData; } +} +export namespace Events { /** - * No description + * @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 ActivityListPublicOrgEvents - * @summary List public organization events - * @request GET:/orgs/{org}/events + * @name ActivityListPublicEvents + * @summary List public events + * @request GET:/events */ - export namespace ActivityListPublicOrgEvents { - export type RequestParams = { - org: string; - }; + export namespace ActivityListPublicEvents { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -37615,252 +37743,260 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListPublicOrgEventsData; + export type ResponseBody = ActivityListPublicEventsData; } +} +export namespace Feeds { /** - * @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 + * @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 */ - export namespace AppsGetOrgInstallation { - export type RequestParams = { - org: string; - }; + export namespace ActivityGetFeeds { + export type RequestParams = {}; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = AppsGetOrgInstallationData; + export type ResponseBody = ActivityGetFeedsData; } +} +export namespace Gists { /** - * @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 + * No description + * @tags gists + * @name GistsCheckIsStarred + * @summary Check if a gist is starred + * @request GET:/gists/{gist_id}/star */ - export namespace BillingGetGithubActionsBillingOrg { + export namespace GistsCheckIsStarred { export type RequestParams = { - org: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubActionsBillingOrgData; + export type ResponseBody = GistsCheckIsStarredData; } /** - * @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 + * @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 BillingGetGithubPackagesBillingOrg { + export namespace GistsCreate { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = GistsCreatePayload; + export type RequestHeaders = {}; + export type ResponseBody = GistsCreateData; + } + + /** + * No description + * @tags gists + * @name GistsCreateComment + * @summary Create a gist comment + * @request POST:/gists/{gist_id}/comments + */ + export namespace GistsCreateComment { export type RequestParams = { - org: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = GistsCreateCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubPackagesBillingOrgData; + export type ResponseBody = GistsCreateCommentData; } /** - * @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 + * No description + * @tags gists + * @name GistsDelete + * @summary Delete a gist + * @request DELETE:/gists/{gist_id} */ - export namespace BillingGetSharedStorageBillingOrg { + export namespace GistsDelete { export type RequestParams = { - org: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = BillingGetSharedStorageBillingOrgData; + export type ResponseBody = GistsDeleteData; } /** - * @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 + * No description + * @tags gists + * @name GistsDeleteComment + * @summary Delete a gist comment + * @request DELETE:/gists/{gist_id}/comments/{comment_id} */ - export namespace InteractionsGetRestrictionsForOrg { + export namespace GistsDeleteComment { export type RequestParams = { - org: string; + /** comment_id parameter */ + commentId: number; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsGetRestrictionsForOrgData; + export type ResponseBody = GistsDeleteCommentData; } /** - * @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 + * @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 InteractionsRemoveRestrictionsForOrg { + export namespace GistsFork { export type RequestParams = { - org: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsRemoveRestrictionsForOrgData; + export type ResponseBody = GistsForkData; } /** - * @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 + * No description + * @tags gists + * @name GistsGet + * @summary Get a gist + * @request GET:/gists/{gist_id} */ - export namespace InteractionsSetRestrictionsForOrg { + export namespace GistsGet { export type RequestParams = { - org: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; - export type RequestBody = InteractionLimit; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsSetRestrictionsForOrgData; + export type ResponseBody = GistsGetData; } /** - * @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 + * No description + * @tags gists + * @name GistsGetComment + * @summary Get a gist comment + * @request GET:/gists/{gist_id}/comments/{comment_id} */ - export namespace IssuesListForOrg { + export namespace GistsGetComment { 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; + /** comment_id parameter */ + commentId: number; + /** gist_id parameter */ + gistId: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListForOrgData; + export type ResponseBody = GistsGetCommentData; } /** - * @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 + * No description + * @tags gists + * @name GistsGetRevision + * @summary Get a gist revision + * @request GET:/gists/{gist_id}/{sha} */ - export namespace MigrationsDeleteArchiveForOrg { + export namespace GistsGetRevision { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; + /** gist_id parameter */ + gistId: string; + sha: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsDeleteArchiveForOrgData; + export type ResponseBody = GistsGetRevisionData; } /** - * @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 + * @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 MigrationsDownloadArchiveForOrg { - export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; + 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = GistsListData; } /** - * @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} + * No description + * @tags gists + * @name GistsListComments + * @summary List gist comments + * @request GET:/gists/{gist_id}/comments */ - export namespace MigrationsGetStatusForOrg { + export namespace GistsListComments { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; + /** 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsGetStatusForOrgData; + export type ResponseBody = GistsListCommentsData; } /** - * @description Lists the most recent migrations. - * @tags migrations - * @name MigrationsListForOrg - * @summary List organization migrations - * @request GET:/orgs/{org}/migrations + * No description + * @tags gists + * @name GistsListCommits + * @summary List gist commits + * @request GET:/gists/{gist_id}/commits */ - export namespace MigrationsListForOrg { + export namespace GistsListCommits { export type RequestParams = { - org: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = { /** @@ -37876,21 +38012,20 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsListForOrgData; + export type ResponseBody = GistsListCommitsData; } /** - * @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 + * No description + * @tags gists + * @name GistsListForks + * @summary List gist forks + * @request GET:/gists/{gist_id}/forks */ - export namespace MigrationsListReposForOrg { + export namespace GistsListForks { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = { /** @@ -37906,336 +38041,403 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsListReposForOrgData; + export type ResponseBody = GistsListForksData; } /** - * @description Initiates the generation of a migration archive. - * @tags migrations - * @name MigrationsStartForOrg - * @summary Start an organization migration - * @request POST:/orgs/{org}/migrations + * @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 MigrationsStartForOrg { - export type RequestParams = { - org: 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 = MigrationsStartForOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsStartForOrgData; + export type ResponseBody = GistsListPublicData; } /** - * @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 + * @description List the authenticated user's starred gists: + * @tags gists + * @name GistsListStarred + * @summary List starred gists + * @request GET:/gists/starred */ - export namespace MigrationsUnlockRepoForOrg { - export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - org: string; - /** repo_name parameter */ - repoName: 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 = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsUnlockRepoForOrgData; + export type ResponseBody = GistsListStarredData; } /** - * No description - * @tags orgs - * @name OrgsBlockUser - * @summary Block a user from an organization - * @request PUT:/orgs/{org}/blocks/{username} + * @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 OrgsBlockUser { + export namespace GistsStar { export type RequestParams = { - org: string; - username: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsBlockUserData; + export type ResponseBody = GistsStarData; } /** - * @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} + * No description + * @tags gists + * @name GistsUnstar + * @summary Unstar a gist + * @request DELETE:/gists/{gist_id}/star */ - export namespace OrgsCancelInvitation { + export namespace GistsUnstar { export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; - org: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsCancelInvitationData; + export type ResponseBody = GistsUnstarData; } /** - * No description - * @tags orgs - * @name OrgsCheckBlockedUser - * @summary Check if a user is blocked by an organization - * @request GET:/orgs/{org}/blocks/{username} + * @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 OrgsCheckBlockedUser { + export namespace GistsUpdate { export type RequestParams = { - org: string; - username: string; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = GistsUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = OrgsCheckBlockedUserData; + export type ResponseBody = GistsUpdateData; } /** - * @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} + * No description + * @tags gists + * @name GistsUpdateComment + * @summary Update a gist comment + * @request PATCH:/gists/{gist_id}/comments/{comment_id} */ - export namespace OrgsCheckMembershipForUser { + export namespace GistsUpdateComment { export type RequestParams = { - org: string; - username: string; + /** comment_id parameter */ + commentId: number; + /** gist_id parameter */ + gistId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = GistsUpdateCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = OrgsCheckMembershipForUserData; + export type ResponseBody = GistsUpdateCommentData; } +} +export namespace Gitignore { /** - * No description - * @tags orgs - * @name OrgsCheckPublicMembershipForUser - * @summary Check public organization membership for a user - * @request GET:/orgs/{org}/public_members/{username} + * @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 OrgsCheckPublicMembershipForUser { - export type RequestParams = { - org: string; - username: string; - }; + export namespace GitignoreGetAllTemplates { + export type RequestParams = {}; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsCheckPublicMembershipForUserData; + export type ResponseBody = GitignoreGetAllTemplatesData; } /** - * @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} + * @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 OrgsConvertMemberToOutsideCollaborator { + export namespace GitignoreGetTemplate { export type RequestParams = { - org: string; - username: string; + name: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsConvertMemberToOutsideCollaboratorData; + export type ResponseBody = GitignoreGetTemplateData; } +} +export namespace Installation { /** - * @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 + * @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 OrgsCreateInvitation { - export type RequestParams = { - org: 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 = OrgsCreateInvitationPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsCreateInvitationData; + export type ResponseBody = AppsListReposAccessibleToInstallationData; } /** - * @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 + * @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 OrgsCreateWebhook { - export type RequestParams = { - org: string; - }; + export namespace AppsRevokeInstallationAccessToken { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = OrgsCreateWebhookPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsCreateWebhookData; + export type ResponseBody = AppsRevokeInstallationAccessTokenData; } +} +export namespace Issues { /** - * No description - * @tags orgs - * @name OrgsDeleteWebhook - * @summary Delete an organization webhook - * @request DELETE:/orgs/{org}/hooks/{hook_id} + * @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 OrgsDeleteWebhook { - export type RequestParams = { - hookId: number; - org: 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 = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsDeleteWebhookData; + export type ResponseBody = IssuesListData; } +} +export namespace Licenses { /** - * @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} + * No description + * @tags licenses + * @name LicensesGet + * @summary Get a license + * @request GET:/licenses/{license} */ - export namespace OrgsGet { + export namespace LicensesGet { export type RequestParams = { - org: string; + license: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsGetData; + export type ResponseBody = LicensesGetData; } /** - * @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 + * No description + * @tags licenses + * @name LicensesGetAllCommonlyUsed + * @summary Get all commonly used licenses + * @request GET:/licenses */ - export namespace OrgsGetAuditLog { - export type RequestParams = { - org: string; - }; + export namespace LicensesGetAllCommonlyUsed { + export type RequestParams = {}; 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; + featured?: boolean; /** * 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; + export type ResponseBody = LicensesGetAllCommonlyUsedData; } +} +export namespace Markdown { /** - * @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} + * No description + * @tags markdown + * @name MarkdownRender + * @summary Render a Markdown document + * @request POST:/markdown */ - export namespace OrgsGetMembershipForUser { - export type RequestParams = { - org: string; - username: string; - }; + export namespace MarkdownRender { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = MarkdownRenderPayload; export type RequestHeaders = {}; - export type ResponseBody = OrgsGetMembershipForUserData; + export type ResponseBody = MarkdownRenderData; } /** - * @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} + * @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 MarkdownRenderRaw { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = MarkdownRenderRawPayload; + export type RequestHeaders = {}; + export type ResponseBody = MarkdownRenderRawData; + } +} + +export namespace 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} */ - export namespace OrgsGetWebhook { + export namespace AppsGetSubscriptionPlanForAccount { export type RequestParams = { - hookId: number; - org: string; + /** account_id parameter */ + accountId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsGetWebhookData; + export type ResponseBody = AppsGetSubscriptionPlanForAccountData; } /** - * @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 + * @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 OrgsGetWebhookConfigForOrg { + export namespace AppsGetSubscriptionPlanForAccountStubbed { export type RequestParams = { - hookId: number; - org: string; + /** account_id parameter */ + accountId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsGetWebhookConfigForOrgData; + export type ResponseBody = AppsGetSubscriptionPlanForAccountStubbedData; } /** - * @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 + * @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 OrgsListAppInstallations { + export namespace AppsListAccountsForPlan { export type RequestParams = { - org: 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 @@ -38246,41 +38448,32 @@ export namespace Orgs { * @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 = OrgsListAppInstallationsData; - } - - /** - * @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 OrgsListBlockedUsers { - export type RequestParams = { - org: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = OrgsListBlockedUsersData; + export type ResponseBody = AppsListAccountsForPlanData; } /** - * @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 + * @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 OrgsListFailedInvitations { + export namespace AppsListAccountsForPlanStubbed { export type RequestParams = { - org: 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?: AppsListAccountsForPlanStubbedParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -38291,25 +38484,26 @@ export namespace Orgs { * @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 = OrgsListFailedInvitationsData; + export type ResponseBody = AppsListAccountsForPlanStubbedData; } /** - * @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 + * @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 OrgsListInvitationTeams { - export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; - org: string; - }; + export namespace AppsListPlans { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -38324,28 +38518,19 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsListInvitationTeamsData; + export type ResponseBody = AppsListPlansData; } /** - * @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 + * @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 OrgsListMembers { - export type RequestParams = { - org: string; - }; + export namespace AppsListPlansStubbed { + export type RequestParams = {}; 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 @@ -38356,39 +38541,44 @@ export namespace Orgs { * @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; + export type ResponseBody = AppsListPlansStubbedData; } +} +export namespace Meta { /** - * @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 + * @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 OrgsListOutsideCollaborators { + export namespace MetaGet { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = MetaGetData; + } +} + +export namespace Networks { + /** + * No description + * @tags activity + * @name ActivityListPublicEventsForRepoNetwork + * @summary List public events for a network of repositories + * @request GET:/networks/{owner}/{repo}/events + */ + export namespace ActivityListPublicEventsForRepoNetwork { export type RequestParams = { - org: string; + owner: string; + repo: 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 @@ -38402,351 +38592,549 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsListOutsideCollaboratorsData; + export type ResponseBody = ActivityListPublicEventsForRepoNetworkData; + } +} + +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; } /** - * @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 + * No description + * @tags activity + * @name ActivityGetThread + * @summary Get a thread + * @request GET:/notifications/threads/{thread_id} */ - export namespace OrgsListPendingInvitations { + export namespace ActivityGetThread { export type RequestParams = { - org: string; + /** thread_id parameter */ + threadId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityGetThreadData; + } + + /** + * @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 ActivityGetThreadSubscriptionForAuthenticatedUser { + export type RequestParams = { + /** thread_id parameter */ + threadId: number; }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + ActivityGetThreadSubscriptionForAuthenticatedUserData; + } + + /** + * @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 = OrgsListPendingInvitationsData; + export type ResponseBody = + ActivityListNotificationsForAuthenticatedUserData; } /** - * @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 + * @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 OrgsListPublicMembers { + export namespace ActivityMarkNotificationsAsRead { + export type RequestParams = {}; + export type RequestQuery = {}; + export type RequestBody = ActivityMarkNotificationsAsReadPayload; + export type RequestHeaders = {}; + export type ResponseBody = ActivityMarkNotificationsAsReadData; + } + + /** + * No description + * @tags activity + * @name ActivityMarkThreadAsRead + * @summary Mark a thread as read + * @request PATCH:/notifications/threads/{thread_id} + */ + export namespace ActivityMarkThreadAsRead { export type RequestParams = { - org: string; + /** thread_id parameter */ + threadId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityMarkThreadAsReadData; + } + + /** + * @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 namespace Octocat { + /** + * @description Get the octocat as ASCII art + * @tags meta + * @name MetaGetOctocat + * @summary Get Octocat + * @request GET:/octocat + */ + 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 = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; /** * 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 = OrgsListPublicMembersData; + export type ResponseBody = OrgsListData; } +} +export namespace Orgs { /** - * @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 + * @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 OrgsListSamlSsoAuthorizations { + 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 = OrgsListSamlSsoAuthorizationsData; + export type ResponseBody = + ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgData; } /** - * No description - * @tags orgs - * @name OrgsListWebhooks - * @summary List organization webhooks - * @request GET:/orgs/{org}/hooks + * @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 OrgsListWebhooks { + export namespace ActionsAddSelectedRepoToOrgSecret { export type RequestParams = { org: string; + repositoryId: number; + /** secret_name parameter */ + secretName: 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 = ActionsAddSelectedRepoToOrgSecretData; + } + + /** + * @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 = OrgsListWebhooksData; + export type ResponseBody = ActionsAddSelfHostedRunnerToGroupForOrgData; } /** - * @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 + * @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 OrgsPingWebhook { + 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; + } + + /** + * @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 = { - hookId: number; org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsPingWebhookData; + export type ResponseBody = ActionsCreateRegistrationTokenForOrgData; } /** - * @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} + * @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 OrgsRemoveMember { + export namespace ActionsCreateRemoveTokenForOrg { export type RequestParams = { org: string; - username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsRemoveMemberData; + export type ResponseBody = ActionsCreateRemoveTokenForOrgData; } /** - * @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} + * @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; + } + + /** + * @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 OrgsRemoveMembershipForUser { + export namespace ActionsDeleteOrgSecret { export type RequestParams = { org: string; - username: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsRemoveMembershipForUserData; + export type ResponseBody = ActionsDeleteOrgSecretData; } /** - * @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} + * @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 OrgsRemoveOutsideCollaborator { + export namespace ActionsDeleteSelfHostedRunnerFromOrg { export type RequestParams = { org: string; - username: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsRemoveOutsideCollaboratorData; + export type ResponseBody = ActionsDeleteSelfHostedRunnerFromOrgData; } /** - * No description - * @tags orgs - * @name OrgsRemovePublicMembershipForAuthenticatedUser - * @summary Remove public organization membership for the authenticated user - * @request DELETE:/orgs/{org}/public_members/{username} + * @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 OrgsRemovePublicMembershipForAuthenticatedUser { + export namespace ActionsDeleteSelfHostedRunnerGroupFromOrg { export type RequestParams = { org: string; - username: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - OrgsRemovePublicMembershipForAuthenticatedUserData; + export type ResponseBody = ActionsDeleteSelfHostedRunnerGroupFromOrgData; } /** - * @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} + * @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 OrgsRemoveSamlSsoAuthorization { + export namespace ActionsDisableSelectedRepositoryGithubActionsOrganization { export type RequestParams = { - credentialId: number; org: string; + repositoryId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsRemoveSamlSsoAuthorizationData; + export type ResponseBody = + ActionsDisableSelectedRepositoryGithubActionsOrganizationData; } /** - * @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} + * @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 OrgsSetMembershipForUser { + export namespace ActionsEnableSelectedRepositoryGithubActionsOrganization { export type RequestParams = { org: string; - username: string; + repositoryId: number; }; export type RequestQuery = {}; - export type RequestBody = OrgsSetMembershipForUserPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsSetMembershipForUserData; + export type ResponseBody = + ActionsEnableSelectedRepositoryGithubActionsOrganizationData; } /** - * @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} + * @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 OrgsSetPublicMembershipForAuthenticatedUser { + export namespace ActionsGetAllowedActionsOrganization { export type RequestParams = { org: string; - username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsSetPublicMembershipForAuthenticatedUserData; + export type ResponseBody = ActionsGetAllowedActionsOrganizationData; } /** - * No description - * @tags orgs - * @name OrgsUnblockUser - * @summary Unblock a user from an organization - * @request DELETE:/orgs/{org}/blocks/{username} + * @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 OrgsUnblockUser { + export namespace ActionsGetGithubActionsPermissionsOrganization { export type RequestParams = { org: string; - username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsUnblockUserData; + export type ResponseBody = + ActionsGetGithubActionsPermissionsOrganizationData; } /** - * @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} + * @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 OrgsUpdate { + export namespace ActionsGetOrgPublicKey { export type RequestParams = { org: string; }; export type RequestQuery = {}; - export type RequestBody = OrgsUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsUpdateData; + export type ResponseBody = ActionsGetOrgPublicKeyData; } /** - * @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} + * @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 OrgsUpdateWebhook { + export namespace ActionsGetOrgSecret { export type RequestParams = { - hookId: number; org: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; - export type RequestBody = OrgsUpdateWebhookPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsUpdateWebhookData; + export type ResponseBody = ActionsGetOrgSecretData; } /** - * @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 + * @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 OrgsUpdateWebhookConfigForOrg { + export namespace ActionsGetSelfHostedRunnerForOrg { export type RequestParams = { - hookId: number; org: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; - export type RequestBody = OrgsUpdateWebhookConfigForOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsUpdateWebhookConfigForOrgData; + export type ResponseBody = ActionsGetSelfHostedRunnerForOrgData; } /** - * @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 + * @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 ProjectsCreateForOrg { + export namespace ActionsGetSelfHostedRunnerGroupForOrg { export type RequestParams = { org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = ProjectsCreateForOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateForOrgData; + export type ResponseBody = ActionsGetSelfHostedRunnerGroupForOrgData; } /** - * @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 + * @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 ProjectsListForOrg { + export namespace ActionsListOrgSecrets { export type RequestParams = { org: string; }; @@ -38761,120 +39149,80 @@ export namespace Orgs { * @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; - } - - /** - * @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 type ResponseBody = ActionsListOrgSecretsData; } /** - * @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 + * @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 ReactionsCreateForTeamDiscussionInOrg { + export namespace ActionsListRepoAccessToSelfHostedRunnerGroupInOrg { export type RequestParams = { - discussionNumber: number; org: string; - /** team_slug parameter */ - teamSlug: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForTeamDiscussionInOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForTeamDiscussionInOrgData; + export type ResponseBody = + ActionsListRepoAccessToSelfHostedRunnerGroupInOrgData; } /** - * @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} + * @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 ReactionsDeleteForTeamDiscussion { + export namespace ActionsListRunnerApplicationsForOrg { 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; + export type ResponseBody = ActionsListRunnerApplicationsForOrgData; } /** - * @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} + * @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 ReactionsDeleteForTeamDiscussionComment { + export namespace ActionsListSelectedReposForOrgSecret { export type RequestParams = { - commentNumber: number; - discussionNumber: number; org: string; - reactionId: number; - /** team_slug parameter */ - teamSlug: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteForTeamDiscussionCommentData; + export type ResponseBody = ActionsListSelectedReposForOrgSecretData; } /** - * @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 + * @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 ReactionsListForTeamDiscussionCommentInOrg { + export namespace ActionsListSelectedRepositoriesEnabledGithubActionsOrganization { 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 @@ -38888,26 +39236,22 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForTeamDiscussionCommentInOrgData; + export type ResponseBody = + ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData; } /** - * @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 + * @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 ReactionsListForTeamDiscussionInOrg { + export namespace ActionsListSelfHostedRunnerGroupsForOrg { 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 @@ -38921,40 +39265,51 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForTeamDiscussionInOrgData; + export type ResponseBody = ActionsListSelfHostedRunnerGroupsForOrgData; } /** - * @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 + * @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 ReposCreateInOrg { + export namespace ActionsListSelfHostedRunnersForOrg { export type RequestParams = { org: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposCreateInOrgPayload; + 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 = ReposCreateInOrgData; + export type ResponseBody = ActionsListSelfHostedRunnersForOrgData; } /** - * @description Lists repositories for the specified organization. - * @tags repos - * @name ReposListForOrg - * @summary List organization repositories - * @request GET:/orgs/{org}/repos + * @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 ReposListForOrg { + export namespace ActionsListSelfHostedRunnersInGroupForOrg { export type RequestParams = { org: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; 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 @@ -38965,349 +39320,383 @@ export namespace Orgs { * @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; + export type ResponseBody = ActionsListSelfHostedRunnersInGroupForOrgData; } /** - * @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} + * @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 TeamsAddOrUpdateMembershipForUserInOrg { + export namespace ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg { export type RequestParams = { org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; + repositoryId: number; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateMembershipForUserInOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateMembershipForUserInOrgData; + export type ResponseBody = + ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData; } /** - * @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} + * @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 TeamsAddOrUpdateProjectPermissionsInOrg { + export namespace ActionsRemoveSelectedRepoFromOrgSecret { export type RequestParams = { org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; + repositoryId: number; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateProjectPermissionsInOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateProjectPermissionsInOrgData; + export type ResponseBody = ActionsRemoveSelectedRepoFromOrgSecretData; } /** - * @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} + * @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 TeamsAddOrUpdateRepoPermissionsInOrg { + export namespace ActionsRemoveSelfHostedRunnerFromGroupForOrg { export type RequestParams = { org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: 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 = TeamsAddOrUpdateRepoPermissionsInOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateRepoPermissionsInOrgData; + export type ResponseBody = ActionsRemoveSelfHostedRunnerFromGroupForOrgData; } /** - * @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} + * @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 TeamsCheckPermissionsForProjectInOrg { + export namespace ActionsSetAllowedActionsOrganization { export type RequestParams = { org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = SelectedActions; export type RequestHeaders = {}; - export type ResponseBody = TeamsCheckPermissionsForProjectInOrgData; + export type ResponseBody = ActionsSetAllowedActionsOrganizationData; } /** - * @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} + * @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 ActionsSetGithubActionsPermissionsOrganization { + export type RequestParams = { + org: string; + }; + export type RequestQuery = {}; + export type RequestBody = + ActionsSetGithubActionsPermissionsOrganizationPayload; + export type RequestHeaders = {}; + export type ResponseBody = + ActionsSetGithubActionsPermissionsOrganizationData; + } + + /** + * @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; + } + + /** + * @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 TeamsCheckPermissionsForRepoInOrg { + export namespace ActionsSetSelectedReposForOrgSecret { export type RequestParams = { org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ActionsSetSelectedReposForOrgSecretPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsCheckPermissionsForRepoInOrgData; + export type ResponseBody = ActionsSetSelectedReposForOrgSecretData; } /** - * @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 + * @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 TeamsCreate { + export namespace ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization { export type RequestParams = { org: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreatePayload; + export type RequestBody = + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateData; + export type ResponseBody = + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData; } /** - * @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 + * @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 TeamsCreateDiscussionCommentInOrg { + export namespace ActionsSetSelfHostedRunnersInGroupForOrg { export type RequestParams = { - discussionNumber: number; org: string; - /** team_slug parameter */ - teamSlug: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreateDiscussionCommentInOrgPayload; + export type RequestBody = ActionsSetSelfHostedRunnersInGroupForOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateDiscussionCommentInOrgData; + export type ResponseBody = ActionsSetSelfHostedRunnersInGroupForOrgData; } /** - * @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 + * @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 TeamsCreateDiscussionInOrg { + export namespace ActionsUpdateSelfHostedRunnerGroupForOrg { export type RequestParams = { org: string; - /** team_slug parameter */ - teamSlug: string; + /** Unique identifier of the self-hosted runner group. */ + runnerGroupId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreateDiscussionInOrgPayload; + export type RequestBody = ActionsUpdateSelfHostedRunnerGroupForOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateDiscussionInOrgData; + export type ResponseBody = ActionsUpdateSelfHostedRunnerGroupForOrgData; } /** - * @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 + * No description + * @tags activity + * @name ActivityListPublicOrgEvents + * @summary List public organization events + * @request GET:/orgs/{org}/events */ - export namespace TeamsCreateOrUpdateIdpGroupConnectionsInOrg { + export namespace ActivityListPublicOrgEvents { export type RequestParams = { org: string; - /** team_slug parameter */ - teamSlug: string; }; - export type RequestQuery = {}; - export type RequestBody = - TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload; + 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 = TeamsCreateOrUpdateIdpGroupConnectionsInOrgData; + export type ResponseBody = ActivityListPublicOrgEventsData; } /** - * @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} + * @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 TeamsDeleteDiscussionCommentInOrg { + export namespace AppsGetOrgInstallation { 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; + export type ResponseBody = AppsGetOrgInstallationData; } /** - * @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} + * @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 TeamsDeleteDiscussionInOrg { + export namespace BillingGetGithubActionsBillingOrg { 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; + export type ResponseBody = BillingGetGithubActionsBillingOrgData; } /** - * @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} + * @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 TeamsDeleteInOrg { + export namespace BillingGetGithubPackagesBillingOrg { export type RequestParams = { org: string; - /** team_slug parameter */ - teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteInOrgData; + export type ResponseBody = BillingGetGithubPackagesBillingOrgData; } /** - * @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} + * @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 TeamsGetByName { + export namespace BillingGetSharedStorageBillingOrg { 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 ResponseBody = BillingGetSharedStorageBillingOrgData; } /** - * @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} + * @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 TeamsGetDiscussionCommentInOrg { + export namespace InteractionsGetRestrictionsForOrg { 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; + export type ResponseBody = InteractionsGetRestrictionsForOrgData; } /** - * @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} + * @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 TeamsGetDiscussionInOrg { + export namespace InteractionsRemoveRestrictionsForOrg { 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; + export type ResponseBody = InteractionsRemoveRestrictionsForOrgData; } /** - * @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} + * @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 TeamsGetMembershipForUserInOrg { + export namespace InteractionsSetRestrictionsForOrg { export type RequestParams = { org: string; - /** team_slug parameter */ - teamSlug: string; - username: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = InteractionLimit; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetMembershipForUserInOrgData; + export type ResponseBody = InteractionsSetRestrictionsForOrgData; } /** - * @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 + * @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 TeamsList { + 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 @@ -39318,97 +39707,93 @@ export namespace Orgs { * @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 = TeamsListData; + export type ResponseBody = IssuesListForOrgData; } /** - * @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 + * @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 */ - export namespace TeamsListChildInOrg { + export namespace MigrationsDeleteArchiveForOrg { export type RequestParams = { + /** migration_id parameter */ + migrationId: number; 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 = TeamsListChildInOrgData; + export type ResponseBody = MigrationsDeleteArchiveForOrgData; } /** - * @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 + * @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 */ - export namespace TeamsListDiscussionCommentsInOrg { + export namespace MigrationsDownloadArchiveForOrg { export type RequestParams = { - discussionNumber: number; + /** migration_id parameter */ + migrationId: 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 RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = any; + } + + /** + * @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 MigrationsGetStatusForOrg { + export type RequestParams = { + /** migration_id parameter */ + migrationId: number; + org: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListDiscussionCommentsInOrgData; + export type ResponseBody = MigrationsGetStatusForOrgData; } /** - * @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 + * @description Lists the most recent migrations. + * @tags migrations + * @name MigrationsListForOrg + * @summary List organization migrations + * @request GET:/orgs/{org}/migrations */ - export namespace TeamsListDiscussionsInOrg { + export namespace MigrationsListForOrg { 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 @@ -39422,18 +39807,20 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListDiscussionsInOrgData; + export type ResponseBody = MigrationsListForOrgData; } /** - * @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 + * @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 TeamsListIdpGroupsForOrg { + export namespace MigrationsListReposForOrg { export type RequestParams = { + /** migration_id parameter */ + migrationId: number; org: string; }; export type RequestQuery = { @@ -39450,474 +39837,489 @@ export namespace Orgs { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListIdpGroupsForOrgData; + export type ResponseBody = MigrationsListReposForOrgData; } /** - * @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 + * @description Initiates the generation of a migration archive. + * @tags migrations + * @name MigrationsStartForOrg + * @summary Start an organization migration + * @request POST:/orgs/{org}/migrations */ - export namespace TeamsListIdpGroupsInOrg { + export namespace MigrationsStartForOrg { export type RequestParams = { org: string; - /** team_slug parameter */ - teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = MigrationsStartForOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsListIdpGroupsInOrgData; + export type ResponseBody = MigrationsStartForOrgData; } /** - * @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 + * @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 TeamsListMembersInOrg { + export namespace MigrationsUnlockRepoForOrg { export type RequestParams = { + /** migration_id parameter */ + migrationId: number; 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; + /** repo_name parameter */ + repoName: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListMembersInOrgData; + export type ResponseBody = MigrationsUnlockRepoForOrgData; } /** - * @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 + * No description + * @tags orgs + * @name OrgsBlockUser + * @summary Block a user from an organization + * @request PUT:/orgs/{org}/blocks/{username} */ - export namespace TeamsListPendingInvitationsInOrg { + export namespace OrgsBlockUser { 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; + username: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListPendingInvitationsInOrgData; + export type ResponseBody = OrgsBlockUserData; } /** - * @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 + * @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 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 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 = TeamsListProjectsInOrgData; + export type ResponseBody = OrgsCancelInvitationData; } /** - * @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 + * No description + * @tags orgs + * @name OrgsCheckBlockedUser + * @summary Check if a user is blocked by an organization + * @request GET:/orgs/{org}/blocks/{username} */ - export namespace TeamsListReposInOrg { + export namespace OrgsCheckBlockedUser { 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; + username: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListReposInOrgData; + export type ResponseBody = OrgsCheckBlockedUserData; } /** - * @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} + * @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 TeamsRemoveMembershipForUserInOrg { + export namespace OrgsCheckMembershipForUser { 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; + export type ResponseBody = OrgsCheckMembershipForUserData; } /** - * @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} + * No description + * @tags orgs + * @name OrgsCheckPublicMembershipForUser + * @summary Check public organization membership for a user + * @request GET:/orgs/{org}/public_members/{username} */ - export namespace TeamsRemoveProjectInOrg { + export namespace OrgsCheckPublicMembershipForUser { export type RequestParams = { org: string; - projectId: number; - /** team_slug parameter */ - teamSlug: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveProjectInOrgData; + export type ResponseBody = OrgsCheckPublicMembershipForUserData; } /** - * @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 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 TeamsRemoveRepoInOrg { + export namespace OrgsConvertMemberToOutsideCollaborator { export type RequestParams = { org: string; - owner: string; - repo: string; - /** team_slug parameter */ - teamSlug: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveRepoInOrgData; + export type ResponseBody = OrgsConvertMemberToOutsideCollaboratorData; } /** - * @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 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 TeamsUpdateDiscussionCommentInOrg { + export namespace OrgsCreateInvitation { export type RequestParams = { - commentNumber: number; - discussionNumber: number; org: string; - /** team_slug parameter */ - teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateDiscussionCommentInOrgPayload; + export type RequestBody = OrgsCreateInvitationPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateDiscussionCommentInOrgData; + export type ResponseBody = OrgsCreateInvitationData; } /** - * @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 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 TeamsUpdateDiscussionInOrg { + export namespace OrgsCreateWebhook { export type RequestParams = { - discussionNumber: number; org: string; - /** team_slug parameter */ - teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateDiscussionInOrgPayload; + export type RequestBody = OrgsCreateWebhookPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateDiscussionInOrgData; + export type ResponseBody = OrgsCreateWebhookData; } /** - * @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} + * No description + * @tags orgs + * @name OrgsDeleteWebhook + * @summary Delete an organization webhook + * @request DELETE:/orgs/{org}/hooks/{hook_id} */ - export namespace TeamsUpdateInOrg { + export namespace OrgsDeleteWebhook { export type RequestParams = { + hookId: number; org: string; - /** team_slug parameter */ - teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateInOrgPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateInOrgData; + export type ResponseBody = OrgsDeleteWebhookData; } -} -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 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 ProjectsAddCollaborator { + export namespace OrgsGet { export type RequestParams = { - projectId: number; - username: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsAddCollaboratorPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsAddCollaboratorData; + export type ResponseBody = OrgsGetData; } /** - * @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 **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 ProjectsCreateCard { + export namespace OrgsGetAuditLog { export type RequestParams = { - /** column_id parameter */ - columnId: number; + org: string; }; - export type RequestQuery = {}; - export type RequestBody = ProjectsCreateCardPayload; + 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 = ProjectsCreateCardData; + export type ResponseBody = OrgsGetAuditLogData; } /** - * No description - * @tags projects - * @name ProjectsCreateColumn - * @summary Create a project column - * @request POST:/projects/{project_id}/columns + * @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 ProjectsCreateColumn { + export namespace OrgsGetMembershipForUser { export type RequestParams = { - projectId: number; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsCreateColumnPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateColumnData; + export type ResponseBody = OrgsGetMembershipForUserData; } /** - * @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 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 ProjectsDelete { + export namespace OrgsGetWebhook { export type RequestParams = { - projectId: number; + hookId: number; + org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsDeleteData; + export type ResponseBody = OrgsGetWebhookData; } /** - * No description - * @tags projects - * @name ProjectsDeleteCard - * @summary Delete a project card - * @request DELETE:/projects/columns/cards/{card_id} + * @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 ProjectsDeleteCard { + export namespace OrgsGetWebhookConfigForOrg { export type RequestParams = { - /** card_id parameter */ - cardId: number; + hookId: number; + org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsDeleteCardData; + export type ResponseBody = OrgsGetWebhookConfigForOrgData; } /** - * No description - * @tags projects - * @name ProjectsDeleteColumn - * @summary Delete a project column - * @request DELETE:/projects/columns/{column_id} + * @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 ProjectsDeleteColumn { + export namespace OrgsListAppInstallations { export type RequestParams = { - /** column_id parameter */ - columnId: 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 = ProjectsDeleteColumnData; + export type ResponseBody = OrgsListAppInstallationsData; } /** - * @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 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 ProjectsGet { + export namespace OrgsListBlockedUsers { export type RequestParams = { - projectId: number; + org: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsGetData; + export type ResponseBody = OrgsListBlockedUsersData; } /** - * No description - * @tags projects - * @name ProjectsGetCard - * @summary Get a project card - * @request GET:/projects/columns/cards/{card_id} + * @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 ProjectsGetCard { + export namespace OrgsListFailedInvitations { export type RequestParams = { - /** card_id parameter */ - cardId: 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 = ProjectsGetCardData; + export type ResponseBody = OrgsListFailedInvitationsData; } /** - * No description - * @tags projects - * @name ProjectsGetColumn - * @summary Get a project column - * @request GET:/projects/columns/{column_id} + * @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 ProjectsGetColumn { + export namespace OrgsListInvitationTeams { export type RequestParams = { - /** column_id parameter */ - columnId: number; + /** 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsGetColumnData; + export type ResponseBody = OrgsListInvitationTeamsData; } /** - * @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 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 ProjectsGetPermissionForUser { + export namespace OrgsListMembers { export type RequestParams = { - projectId: number; - username: 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 + */ + 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsGetPermissionForUserData; + export type ResponseBody = OrgsListMembersData; } /** - * No description - * @tags projects - * @name ProjectsListCards - * @summary List project cards - * @request GET:/projects/columns/{column_id}/cards + * @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 ProjectsListCards { + export namespace OrgsListOutsideCollaborators { export type RequestParams = { - /** column_id parameter */ - columnId: number; + org: string; }; 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" + * 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" */ - archived_state?: ProjectsListCardsParams1ArchivedStateEnum; + filter?: OrgsListOutsideCollaboratorsParams1FilterEnum; /** * Page number of the results to fetch. * @default 1 @@ -39931,29 +40333,49 @@ export namespace Projects { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListCardsData; + export type ResponseBody = OrgsListOutsideCollaboratorsData; } /** - * @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 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 ProjectsListCollaborators { + export namespace OrgsListPendingInvitations { export type RequestParams = { - projectId: number; + org: string; }; 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" + * Page number of the results to fetch. + * @default 1 */ - affiliation?: ProjectsListCollaboratorsParams1AffiliationEnum; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsListPendingInvitationsData; + } + + /** + * @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 OrgsListPublicMembers { + export type RequestParams = { + org: string; + }; + export type RequestQuery = { /** * Page number of the results to fetch. * @default 1 @@ -39967,19 +40389,36 @@ export namespace Projects { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListCollaboratorsData; + export type ResponseBody = OrgsListPublicMembersData; + } + + /** + * @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; } /** * No description - * @tags projects - * @name ProjectsListColumns - * @summary List project columns - * @request GET:/projects/{project_id}/columns + * @tags orgs + * @name OrgsListWebhooks + * @summary List organization webhooks + * @request GET:/orgs/{org}/hooks */ - export namespace ProjectsListColumns { + export namespace OrgsListWebhooks { export type RequestParams = { - projectId: number; + org: string; }; export type RequestQuery = { /** @@ -39995,671 +40434,839 @@ export namespace Projects { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListColumnsData; + export type ResponseBody = OrgsListWebhooksData; } /** - * No description - * @tags projects - * @name ProjectsMoveCard - * @summary Move a project card - * @request POST:/projects/columns/cards/{card_id}/moves + * @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 ProjectsMoveCard { + export namespace OrgsPingWebhook { export type RequestParams = { - /** card_id parameter */ - cardId: number; + hookId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsMoveCardPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsMoveCardData; + export type ResponseBody = OrgsPingWebhookData; } /** - * No description - * @tags projects - * @name ProjectsMoveColumn - * @summary Move a project column - * @request POST:/projects/columns/{column_id}/moves + * @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 ProjectsMoveColumn { + export namespace OrgsRemoveMember { export type RequestParams = { - /** column_id parameter */ - columnId: number; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsMoveColumnPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsMoveColumnData; + export type ResponseBody = OrgsRemoveMemberData; } /** - * @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 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 ProjectsRemoveCollaborator { + export namespace OrgsRemoveMembershipForUser { export type RequestParams = { - projectId: number; + org: string; username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsRemoveCollaboratorData; + export type ResponseBody = OrgsRemoveMembershipForUserData; } /** - * @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 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 ProjectsUpdate { + export namespace OrgsRemoveOutsideCollaborator { export type RequestParams = { - projectId: number; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsUpdateData; + export type ResponseBody = OrgsRemoveOutsideCollaboratorData; } /** * No description - * @tags projects - * @name ProjectsUpdateCard - * @summary Update an existing project card - * @request PATCH:/projects/columns/cards/{card_id} + * @tags orgs + * @name OrgsRemovePublicMembershipForAuthenticatedUser + * @summary Remove public organization membership for the authenticated user + * @request DELETE:/orgs/{org}/public_members/{username} */ - export namespace ProjectsUpdateCard { + export namespace OrgsRemovePublicMembershipForAuthenticatedUser { export type RequestParams = { - /** card_id parameter */ - cardId: number; + org: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsUpdateCardPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsUpdateCardData; + export type ResponseBody = + OrgsRemovePublicMembershipForAuthenticatedUserData; } /** - * No description - * @tags projects - * @name ProjectsUpdateColumn - * @summary Update an existing project column - * @request PATCH:/projects/columns/{column_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 ProjectsUpdateColumn { + export namespace OrgsRemoveSamlSsoAuthorization { export type RequestParams = { - /** column_id parameter */ - columnId: number; + credentialId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsUpdateColumnPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsUpdateColumnData; + export type ResponseBody = OrgsRemoveSamlSsoAuthorizationData; } -} -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 + * @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 RateLimitGet { - export type RequestParams = {}; + export namespace OrgsSetMembershipForUser { + export type RequestParams = { + org: string; + username: string; + }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = OrgsSetMembershipForUserPayload; export type RequestHeaders = {}; - export type ResponseBody = RateLimitGetData; + export type ResponseBody = OrgsSetMembershipForUserData; } -} -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} - * @deprecated + * @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 ReactionsDeleteLegacy { + export namespace OrgsSetPublicMembershipForAuthenticatedUser { export type RequestParams = { - reactionId: number; + org: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteLegacyData; + export type ResponseBody = OrgsSetPublicMembershipForAuthenticatedUserData; } -} -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 + * No description + * @tags orgs + * @name OrgsUnblockUser + * @summary Unblock a user from an organization + * @request DELETE:/orgs/{org}/blocks/{username} */ - export namespace ActionsCancelWorkflowRun { + export namespace OrgsUnblockUser { export type RequestParams = { - owner: string; - repo: string; - runId: number; + org: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsCancelWorkflowRunData; + export type ResponseBody = OrgsUnblockUserData; } /** - * @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 **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 ActionsCreateOrUpdateRepoSecret { + export namespace OrgsUpdate { export type RequestParams = { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = ActionsCreateOrUpdateRepoSecretPayload; + export type RequestBody = OrgsUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateOrUpdateRepoSecretData; + export type ResponseBody = OrgsUpdateData; } /** - * @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 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 ActionsCreateRegistrationTokenForRepo { + export namespace OrgsUpdateWebhook { export type RequestParams = { - owner: string; - repo: string; + hookId: number; + org: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = OrgsUpdateWebhookPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateRegistrationTokenForRepoData; + export type ResponseBody = OrgsUpdateWebhookData; } /** - * @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 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 ActionsCreateRemoveTokenForRepo { + export namespace OrgsUpdateWebhookConfigForOrg { export type RequestParams = { - owner: string; - repo: string; + 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 = ActionsCreateRemoveTokenForRepoData; + export type ResponseBody = ProjectsListForOrgData; } /** - * @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 + * @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 ActionsCreateWorkflowDispatch { + export namespace ReactionsCreateForTeamDiscussionCommentInOrg { 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; + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = ActionsCreateWorkflowDispatchPayload; + export type RequestBody = + ReactionsCreateForTeamDiscussionCommentInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsCreateWorkflowDispatchData; + export type ResponseBody = ReactionsCreateForTeamDiscussionCommentInOrgData; } /** - * @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} + * @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 */ - export namespace ActionsDeleteArtifact { + export namespace ReactionsCreateForTeamDiscussionInOrg { export type RequestParams = { - /** artifact_id parameter */ - artifactId: number; - owner: string; - 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 = ActionsDeleteArtifactData; + export type ResponseBody = ReactionsCreateForTeamDiscussionInOrgData; } /** - * @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} + * @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} */ - export namespace ActionsDeleteRepoSecret { + export namespace ReactionsDeleteForTeamDiscussion { export type RequestParams = { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; + discussionNumber: number; + org: string; + reactionId: number; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteRepoSecretData; + export type ResponseBody = ReactionsDeleteForTeamDiscussionData; } /** - * @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 **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} */ - export namespace ActionsDeleteSelfHostedRunnerFromRepo { + export namespace ReactionsDeleteForTeamDiscussionComment { export type RequestParams = { - owner: string; - repo: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: 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 = ActionsDeleteSelfHostedRunnerFromRepoData; + export type ResponseBody = ReactionsDeleteForTeamDiscussionCommentData; } /** - * @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 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 */ - export namespace ActionsDeleteWorkflowRun { + export namespace ReactionsListForTeamDiscussionCommentInOrg { export type RequestParams = { - owner: string; - repo: string; - runId: number; + 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; + } + + /** + * @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 + */ + 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; + } + + /** + * @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 ReposCreateInOrg { + export type RequestParams = { + 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 = { + /** 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteWorkflowRunData; + export type ResponseBody = ReposListForOrgData; } /** - * @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 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 ActionsDeleteWorkflowRunLogs { + export namespace TeamsAddOrUpdateMembershipForUserInOrg { export type RequestParams = { - owner: string; - repo: string; - runId: number; + org: string; + /** team_slug parameter */ + teamSlug: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsAddOrUpdateMembershipForUserInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsDeleteWorkflowRunLogsData; + export type ResponseBody = TeamsAddOrUpdateMembershipForUserInOrgData; } /** - * @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 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 ActionsDisableWorkflow { + export namespace TeamsAddOrUpdateProjectPermissionsInOrg { 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; + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsAddOrUpdateProjectPermissionsInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsDisableWorkflowData; + export type ResponseBody = TeamsAddOrUpdateProjectPermissionsInOrgData; } /** - * @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 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 ActionsDownloadArtifact { + export namespace TeamsAddOrUpdateRepoPermissionsInOrg { export type RequestParams = { - archiveFormat: string; - /** artifact_id parameter */ - artifactId: number; + org: string; owner: string; repo: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsAddOrUpdateRepoPermissionsInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = TeamsAddOrUpdateRepoPermissionsInOrgData; } /** - * @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 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 ActionsDownloadJobLogsForWorkflowRun { + export namespace TeamsCheckPermissionsForProjectInOrg { export type RequestParams = { - /** job_id parameter */ - jobId: 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 = any; + export type ResponseBody = TeamsCheckPermissionsForProjectInOrgData; } /** - * @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 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 ActionsDownloadWorkflowRunLogs { + export namespace TeamsCheckPermissionsForRepoInOrg { export type RequestParams = { + org: string; owner: string; repo: string; - runId: number; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = TeamsCheckPermissionsForRepoInOrgData; } /** - * @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 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 ActionsEnableWorkflow { + export namespace TeamsCreate { 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; + org: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsCreatePayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsEnableWorkflowData; + export type ResponseBody = TeamsCreateData; } /** - * @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 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 ActionsGetAllowedActionsRepository { + export namespace TeamsCreateDiscussionCommentInOrg { 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 = TeamsCreateDiscussionCommentInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetAllowedActionsRepositoryData; + export type ResponseBody = TeamsCreateDiscussionCommentInOrgData; } /** - * @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 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 ActionsGetArtifact { + export namespace TeamsCreateDiscussionInOrg { export type RequestParams = { - /** artifact_id parameter */ - artifactId: number; - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsCreateDiscussionInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetArtifactData; + export type ResponseBody = TeamsCreateDiscussionInOrgData; } /** - * @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 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 ActionsGetGithubActionsPermissionsRepository { + export namespace TeamsCreateOrUpdateIdpGroupConnectionsInOrg { export type RequestParams = { - 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 = ActionsGetGithubActionsPermissionsRepositoryData; + export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsInOrgData; } /** - * @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 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 ActionsGetJobForWorkflowRun { + export namespace TeamsDeleteDiscussionCommentInOrg { export type RequestParams = { - /** job_id parameter */ - jobId: 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 RequestHeaders = {}; - export type ResponseBody = ActionsGetJobForWorkflowRunData; + export type ResponseBody = TeamsDeleteDiscussionCommentInOrgData; } /** - * @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 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 ActionsGetRepoPublicKey { + 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 = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetRepoPublicKeyData; + export type ResponseBody = TeamsDeleteDiscussionInOrgData; } /** - * @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 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 ActionsGetRepoSecret { + export namespace TeamsDeleteInOrg { export type RequestParams = { - owner: string; - repo: string; - /** secret_name parameter */ - secretName: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetRepoSecretData; + export type ResponseBody = TeamsDeleteInOrgData; } /** - * @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 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 ActionsGetSelfHostedRunnerForRepo { + export namespace TeamsGetByName { export type RequestParams = { - owner: string; - repo: string; - /** Unique identifier of the self-hosted runner. */ - runnerId: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetSelfHostedRunnerForRepoData; + export type ResponseBody = TeamsGetByNameData; } /** - * @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 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 ActionsGetWorkflow { + export namespace TeamsGetDiscussionCommentInOrg { 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; + commentNumber: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetWorkflowData; + export type ResponseBody = TeamsGetDiscussionCommentInOrgData; } /** - * @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 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 ActionsGetWorkflowRun { + export namespace TeamsGetDiscussionInOrg { export type RequestParams = { - owner: string; - repo: string; - runId: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetWorkflowRunData; + export type ResponseBody = TeamsGetDiscussionInOrgData; } /** - * @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 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 ActionsGetWorkflowRunUsage { + export namespace TeamsGetMembershipForUserInOrg { export type RequestParams = { - owner: string; - repo: string; - runId: number; + org: string; + /** team_slug parameter */ + teamSlug: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsGetWorkflowRunUsageData; + export type ResponseBody = TeamsGetMembershipForUserInOrgData; } /** - * @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 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 ActionsGetWorkflowUsage { + export namespace TeamsList { 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; + 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 = ActionsGetWorkflowUsageData; + export type ResponseBody = TeamsListData; } /** - * @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 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 ActionsListArtifactsForRepo { + export namespace TeamsListChildInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = { /** @@ -40675,30 +41282,29 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListArtifactsForRepoData; + export type ResponseBody = TeamsListChildInOrgData; } /** - * @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 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 ActionsListJobsForWorkflowRun { + export namespace TeamsListDiscussionCommentsInOrg { export type RequestParams = { - owner: string; - repo: string; - runId: number; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; 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" + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" */ - filter?: ActionsListJobsForWorkflowRunParams1FilterEnum; + direction?: TeamsListDiscussionCommentsInOrgParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -40712,22 +41318,28 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListJobsForWorkflowRunData; + export type ResponseBody = TeamsListDiscussionCommentsInOrgData; } /** - * @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 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 ActionsListRepoSecrets { + export namespace TeamsListDiscussionsInOrg { export type RequestParams = { - owner: string; - repo: string; + 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 @@ -40741,20 +41353,19 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListRepoSecretsData; + export type ResponseBody = TeamsListDiscussionsInOrgData; } /** - * @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 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 ActionsListRepoWorkflows { + export namespace TeamsListIdpGroupsForOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; }; export type RequestQuery = { /** @@ -40770,38 +41381,40 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListRepoWorkflowsData; + export type ResponseBody = TeamsListIdpGroupsForOrgData; } /** - * @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 + * @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 ActionsListRunnerApplicationsForRepo { + export namespace TeamsListIdpGroupsInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListRunnerApplicationsForRepoData; + export type ResponseBody = TeamsListIdpGroupsInOrgData; } /** - * @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 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 ActionsListSelfHostedRunnersForRepo { + export namespace TeamsListMembersInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = { /** @@ -40814,24 +41427,32 @@ export namespace Repos { * @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 = ActionsListSelfHostedRunnersForRepoData; + export type ResponseBody = TeamsListMembersInOrgData; } /** - * @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 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 ActionsListWorkflowRunArtifacts { + export namespace TeamsListPendingInvitationsInOrg { export type RequestParams = { - owner: string; - repo: string; - runId: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = { /** @@ -40847,30 +41468,23 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListWorkflowRunArtifactsData; + export type ResponseBody = TeamsListPendingInvitationsInOrgData; } /** - * @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 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 ActionsListWorkflowRuns { + export namespace TeamsListProjectsInOrg { 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; + org: string; + /** team_slug parameter */ + teamSlug: 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 @@ -40881,33 +41495,26 @@ 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 = ActionsListWorkflowRunsData; + export type ResponseBody = TeamsListProjectsInOrgData; } /** - * @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 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 ActionsListWorkflowRunsForRepo { + export namespace TeamsListReposInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + /** team_slug parameter */ + teamSlug: 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 @@ -40918,420 +41525,330 @@ 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?: ActionsListWorkflowRunsForRepoParams1StatusEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsListWorkflowRunsForRepoData; + export type ResponseBody = TeamsListReposInOrgData; } /** - * @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 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 ActionsReRunWorkflow { + export namespace TeamsRemoveMembershipForUserInOrg { export type RequestParams = { - owner: string; - repo: string; - runId: number; + org: string; + /** team_slug parameter */ + teamSlug: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsReRunWorkflowData; - } - - /** - * @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 ActionsSetAllowedActionsRepository { - export type RequestParams = { - owner: string; - repo: string; - }; - export type RequestQuery = {}; - export type RequestBody = SelectedActions; - export type RequestHeaders = {}; - export type ResponseBody = ActionsSetAllowedActionsRepositoryData; + export type ResponseBody = TeamsRemoveMembershipForUserInOrgData; } /** - * @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 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 ActionsSetGithubActionsPermissionsRepository { + export namespace TeamsRemoveProjectInOrg { export type RequestParams = { - owner: string; - repo: string; + org: string; + projectId: number; + /** team_slug parameter */ + teamSlug: string; }; export type RequestQuery = {}; - export type RequestBody = - ActionsSetGithubActionsPermissionsRepositoryPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActionsSetGithubActionsPermissionsRepositoryData; + export type ResponseBody = TeamsRemoveProjectInOrgData; } /** - * @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 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 ActivityDeleteRepoSubscription { + export namespace TeamsRemoveRepoInOrg { 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 = ActivityDeleteRepoSubscriptionData; + export type ResponseBody = TeamsRemoveRepoInOrgData; } /** - * No description - * @tags activity - * @name ActivityGetRepoSubscription - * @summary Get a repository subscription - * @request GET:/repos/{owner}/{repo}/subscription + * @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 ActivityGetRepoSubscription { + export namespace TeamsUpdateDiscussionCommentInOrg { export type RequestParams = { - 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 = ActivityGetRepoSubscriptionData; + export type ResponseBody = TeamsUpdateDiscussionCommentInOrgData; } /** - * No description - * @tags activity - * @name ActivityListRepoEvents - * @summary List repository events - * @request GET:/repos/{owner}/{repo}/events + * @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 ActivityListRepoEvents { + export namespace TeamsUpdateDiscussionInOrg { 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; + discussionNumber: number; + org: string; + /** team_slug parameter */ + teamSlug: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = TeamsUpdateDiscussionInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityListRepoEventsData; + export type ResponseBody = TeamsUpdateDiscussionInOrgData; } /** - * @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 + * @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 ActivityListRepoNotificationsForAuthenticatedUser { + export namespace TeamsUpdateInOrg { export type RequestParams = { - owner: string; - repo: string; - }; - 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; + org: string; + /** team_slug parameter */ + teamSlug: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = TeamsUpdateInOrgPayload; export type RequestHeaders = {}; - export type ResponseBody = - ActivityListRepoNotificationsForAuthenticatedUserData; + export type ResponseBody = TeamsUpdateInOrgData; } +} +export namespace Projects { /** - * @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 + * @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 ActivityListStargazersForRepo { + export namespace ProjectsAddCollaborator { 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; + projectId: number; + username: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ProjectsAddCollaboratorPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityListStargazersForRepoData; + export type ResponseBody = ProjectsAddCollaboratorData; } /** - * @description Lists the people watching the specified repository. - * @tags activity - * @name ActivityListWatchersForRepo - * @summary List watchers - * @request GET:/repos/{owner}/{repo}/subscribers + * @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 ActivityListWatchersForRepo { + export namespace ProjectsCreateCard { 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; + /** column_id parameter */ + columnId: number; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ProjectsCreateCardPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityListWatchersForRepoData; + export type ResponseBody = ProjectsCreateCardData; } /** - * @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 + * No description + * @tags projects + * @name ProjectsCreateColumn + * @summary Create a project column + * @request POST:/projects/{project_id}/columns */ - export namespace ActivityMarkRepoNotificationsAsRead { + export namespace ProjectsCreateColumn { export type RequestParams = { - owner: string; - repo: string; + projectId: number; }; export type RequestQuery = {}; - export type RequestBody = ActivityMarkRepoNotificationsAsReadPayload; + export type RequestBody = ProjectsCreateColumnPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityMarkRepoNotificationsAsReadData; + export type ResponseBody = ProjectsCreateColumnData; } /** - * @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 + * @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 ActivitySetRepoSubscription { + export namespace ProjectsDelete { export type RequestParams = { - owner: string; - repo: string; + projectId: number; }; export type RequestQuery = {}; - export type RequestBody = ActivitySetRepoSubscriptionPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivitySetRepoSubscriptionData; + export type ResponseBody = ProjectsDeleteData; } /** - * @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 projects + * @name ProjectsDeleteCard + * @summary Delete a project card + * @request DELETE:/projects/columns/cards/{card_id} */ - export namespace AppsGetRepoInstallation { + 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 = AppsGetRepoInstallationData; + export type ResponseBody = ProjectsDeleteCardData; } /** - * @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 projects + * @name ProjectsDeleteColumn + * @summary Delete a project column + * @request DELETE:/projects/columns/{column_id} */ - export namespace ChecksCreate { + export namespace ProjectsDeleteColumn { export type RequestParams = { - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; - export type RequestBody = ChecksCreatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksCreateData; + export type ResponseBody = ProjectsDeleteColumnData; } /** - * @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 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 ChecksCreateSuite { + export namespace ProjectsGet { export type RequestParams = { - owner: string; - repo: string; + projectId: number; }; export type RequestQuery = {}; - export type RequestBody = ChecksCreateSuitePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksCreateSuiteData; + export type ResponseBody = ProjectsGetData; } /** - * @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 projects + * @name ProjectsGetCard + * @summary Get a project card + * @request GET:/projects/columns/cards/{card_id} */ - export namespace ChecksGet { + export namespace ProjectsGetCard { export type RequestParams = { - /** check_run_id parameter */ - checkRunId: number; - owner: string; - repo: string; + /** card_id parameter */ + cardId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksGetData; + export type ResponseBody = ProjectsGetCardData; } /** - * @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 projects + * @name ProjectsGetColumn + * @summary Get a project column + * @request GET:/projects/columns/{column_id} */ - export namespace ChecksGetSuite { + export namespace ProjectsGetColumn { export type RequestParams = { - /** check_suite_id parameter */ - checkSuiteId: number; - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksGetSuiteData; + export type ResponseBody = ProjectsGetColumnData; } /** - * @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 + * @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 ChecksListAnnotations { + export namespace ProjectsGetPermissionForUser { export type RequestParams = { - /** check_run_id parameter */ - checkRunId: 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; + projectId: number; + username: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksListAnnotationsData; + export type ResponseBody = ProjectsGetPermissionForUserData; } /** - * @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 projects + * @name ProjectsListCards + * @summary List project cards + * @request GET:/projects/columns/{column_id}/cards */ - export namespace ChecksListForRef { + export namespace ProjectsListCards { export type RequestParams = { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; + /** column_id parameter */ + columnId: number; }; 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" + * Filters the project cards that are returned by the card's state. Can be one of \`all\`,\`archived\`, or \`not_archived\`. + * @default "not_archived" */ - filter?: ChecksListForRefParams1FilterEnum; + archived_state?: ProjectsListCardsParams1ArchivedStateEnum; /** * Page number of the results to fetch. * @default 1 @@ -41342,36 +41859,32 @@ 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 = ProjectsListCardsData; } /** - * @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 + * @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 ChecksListForSuite { + export namespace ProjectsListCollaborators { export type RequestParams = { - /** check_suite_id parameter */ - checkSuiteId: number; - owner: string; - repo: string; + projectId: number; }; 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" + * 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" */ - filter?: ChecksListForSuiteParams1FilterEnum; + affiliation?: ProjectsListCollaboratorsParams1AffiliationEnum; /** * Page number of the results to fetch. * @default 1 @@ -41382,36 +41895,24 @@ 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 = ProjectsListCollaboratorsData; } /** - * @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 projects + * @name ProjectsListColumns + * @summary List project columns + * @request GET:/projects/{project_id}/columns */ - export namespace ChecksListSuitesForRef { + export namespace ProjectsListColumns { export type RequestParams = { - owner: string; - /** ref+ parameter */ - ref: string; - repo: string; + projectId: number; }; 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 @@ -41425,801 +41926,810 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ChecksListSuitesForRefData; - } - - /** - * @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 ChecksRerequestSuite { - export type RequestParams = { - /** check_suite_id parameter */ - checkSuiteId: number; - owner: string; - repo: string; - }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ChecksRerequestSuiteData; + export type ResponseBody = ProjectsListColumnsData; } /** - * @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 + * No description + * @tags projects + * @name ProjectsMoveCard + * @summary Move a project card + * @request POST:/projects/columns/cards/{card_id}/moves */ - export namespace ChecksSetSuitesPreferences { + export namespace ProjectsMoveCard { export type RequestParams = { - owner: string; - repo: string; + /** card_id parameter */ + cardId: number; }; export type RequestQuery = {}; - export type RequestBody = ChecksSetSuitesPreferencesPayload; + export type RequestBody = ProjectsMoveCardPayload; export type RequestHeaders = {}; - export type ResponseBody = ChecksSetSuitesPreferencesData; + export type ResponseBody = ProjectsMoveCardData; } /** - * @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} + * No description + * @tags projects + * @name ProjectsMoveColumn + * @summary Move a project column + * @request POST:/projects/columns/{column_id}/moves */ - export namespace ChecksUpdate { + export namespace ProjectsMoveColumn { export type RequestParams = { - /** check_run_id parameter */ - checkRunId: number; - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; - export type RequestBody = ChecksUpdatePayload; + export type RequestBody = ProjectsMoveColumnPayload; export type RequestHeaders = {}; - export type ResponseBody = ChecksUpdateData; + export type ResponseBody = ProjectsMoveColumnData; } /** - * @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} + * @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 CodeScanningGetAlert { + export namespace ProjectsRemoveCollaborator { export type RequestParams = { - alertNumber: number; - owner: string; - repo: string; + projectId: number; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningGetAlertData; + export type ResponseBody = ProjectsRemoveCollaboratorData; } /** - * @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 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 CodeScanningListAlertsForRepo { + export namespace ProjectsUpdate { 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; + projectId: number; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ProjectsUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningListAlertsForRepoData; + export type ResponseBody = ProjectsUpdateData; } /** - * @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 projects + * @name ProjectsUpdateCard + * @summary Update an existing project card + * @request PATCH:/projects/columns/cards/{card_id} */ - export namespace CodeScanningListRecentAnalyses { + export namespace ProjectsUpdateCard { 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; + /** card_id parameter */ + cardId: number; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ProjectsUpdateCardPayload; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningListRecentAnalysesData; + export type ResponseBody = ProjectsUpdateCardData; } /** - * @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} + * No description + * @tags projects + * @name ProjectsUpdateColumn + * @summary Update an existing project column + * @request PATCH:/projects/columns/{column_id} */ - export namespace CodeScanningUpdateAlert { + export namespace ProjectsUpdateColumn { export type RequestParams = { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; - owner: string; - repo: string; + /** column_id parameter */ + columnId: number; }; export type RequestQuery = {}; - export type RequestBody = CodeScanningUpdateAlertPayload; + export type RequestBody = ProjectsUpdateColumnPayload; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningUpdateAlertData; + export type ResponseBody = ProjectsUpdateColumnData; } +} +export namespace RateLimit { /** - * @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 **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 CodeScanningUploadSarif { - export type RequestParams = { - owner: string; - repo: string; - }; + export namespace RateLimitGet { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = CodeScanningUploadSarifPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = CodeScanningUploadSarifData; + export type ResponseBody = RateLimitGetData; } +} +export namespace Reactions { /** - * @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 **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 CodesOfConductGetForRepo { + export namespace ReactionsDeleteLegacy { export type RequestParams = { - owner: string; - repo: string; + reactionId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = CodesOfConductGetForRepoData; + export type ResponseBody = ReactionsDeleteLegacyData; } +} +export namespace Repos { /** - * No description - * @tags git - * @name GitCreateBlob - * @summary Create a blob - * @request POST:/repos/{owner}/{repo}/git/blobs + * @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 GitCreateBlob { + export namespace ActionsCancelWorkflowRun { export type RequestParams = { owner: string; repo: string; + runId: number; }; export type RequestQuery = {}; - export type RequestBody = GitCreateBlobPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitCreateBlobData; + export type ResponseBody = ActionsCancelWorkflowRunData; } /** - * @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 + * @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 GitCreateCommit { + export namespace ActionsCreateOrUpdateRepoSecret { export type RequestParams = { owner: string; repo: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; - export type RequestBody = GitCreateCommitPayload; + export type RequestBody = ActionsCreateOrUpdateRepoSecretPayload; export type RequestHeaders = {}; - export type ResponseBody = GitCreateCommitData; + export type ResponseBody = ActionsCreateOrUpdateRepoSecretData; } /** - * @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 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 GitCreateRef { + export namespace ActionsCreateRegistrationTokenForRepo { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = GitCreateRefPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitCreateRefData; + export type ResponseBody = ActionsCreateRegistrationTokenForRepoData; } /** - * @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 + * @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 GitCreateTag { + export namespace ActionsCreateRemoveTokenForRepo { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = GitCreateTagPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitCreateTagData; + export type ResponseBody = ActionsCreateRemoveTokenForRepoData; } /** - * @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 + * @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 GitCreateTree { + 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; }; export type RequestQuery = {}; - export type RequestBody = GitCreateTreePayload; + export type RequestBody = ActionsCreateWorkflowDispatchPayload; export type RequestHeaders = {}; - export type ResponseBody = GitCreateTreeData; + export type ResponseBody = ActionsCreateWorkflowDispatchData; } /** - * No description - * @tags git - * @name GitDeleteRef - * @summary Delete a reference - * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} + * @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 GitDeleteRef { + export namespace ActionsDeleteArtifact { export type RequestParams = { + /** artifact_id parameter */ + artifactId: number; owner: string; - /** ref+ parameter */ - ref: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitDeleteRefData; + export type ResponseBody = ActionsDeleteArtifactData; } /** - * @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 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 GitGetBlob { + export namespace ActionsDeleteRepoSecret { export type RequestParams = { - fileSha: string; owner: string; repo: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitGetBlobData; + export type ResponseBody = ActionsDeleteRepoSecretData; } /** - * @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 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 GitGetCommit { + export namespace ActionsDeleteSelfHostedRunnerFromRepo { export type RequestParams = { - /** commit_sha parameter */ - commitSha: string; 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 = GitGetCommitData; + export type ResponseBody = ActionsDeleteSelfHostedRunnerFromRepoData; } /** - * @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 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 GitGetRef { + export namespace ActionsDeleteWorkflowRun { 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 = GitGetRefData; + export type ResponseBody = ActionsDeleteWorkflowRunData; } /** - * @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 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 GitGetTag { + export namespace ActionsDeleteWorkflowRunLogs { export type RequestParams = { owner: string; repo: string; - tagSha: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitGetTagData; + export type ResponseBody = ActionsDeleteWorkflowRunLogsData; } /** - * @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 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 GitGetTree { + export namespace ActionsDisableWorkflow { export type RequestParams = { owner: string; repo: string; - treeSha: string; - }; - 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; + /** 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 = GitGetTreeData; + export type ResponseBody = ActionsDisableWorkflowData; } /** - * @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 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 GitListMatchingRefs { + export namespace ActionsDownloadArtifact { export type RequestParams = { + archiveFormat: string; + /** artifact_id parameter */ + artifactId: number; 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitListMatchingRefsData; + export type ResponseBody = any; } /** - * No description - * @tags git - * @name GitUpdateRef - * @summary Update a reference - * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + * @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 GitUpdateRef { + export namespace ActionsDownloadJobLogsForWorkflowRun { export type RequestParams = { + /** job_id parameter */ + jobId: number; owner: string; - /** ref+ parameter */ - ref: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = GitUpdateRefPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = GitUpdateRefData; + export type ResponseBody = any; } /** - * @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 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 InteractionsGetRestrictionsForRepo { + 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 = InteractionsGetRestrictionsForRepoData; + export type ResponseBody = any; } /** - * @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 + * @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 InteractionsRemoveRestrictionsForRepo { + export namespace ActionsEnableWorkflow { 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 = InteractionsRemoveRestrictionsForRepoData; + export type ResponseBody = ActionsEnableWorkflowData; } /** - * @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 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 InteractionsSetRestrictionsForRepo { + export namespace ActionsGetAllowedActionsRepository { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = InteractionLimit; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = InteractionsSetRestrictionsForRepoData; + export type ResponseBody = ActionsGetAllowedActionsRepositoryData; } /** - * @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 + * @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 IssuesAddAssignees { + export namespace ActionsGetArtifact { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; + /** artifact_id parameter */ + artifactId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesAddAssigneesPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesAddAssigneesData; + export type ResponseBody = ActionsGetArtifactData; } /** - * No description - * @tags issues - * @name IssuesAddLabels - * @summary Add labels to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @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 IssuesAddLabels { + export namespace ActionsGetGithubActionsPermissionsRepository { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesAddLabelsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesAddLabelsData; + export type ResponseBody = ActionsGetGithubActionsPermissionsRepositoryData; } /** - * @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 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 IssuesCheckUserCanBeAssigned { + export namespace ActionsGetJobForWorkflowRun { export type RequestParams = { - assignee: string; + /** job_id parameter */ + jobId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesCheckUserCanBeAssignedData; + export type ResponseBody = ActionsGetJobForWorkflowRunData; } /** - * @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 + * @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 IssuesCreate { + export namespace ActionsGetRepoPublicKey { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesCreatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesCreateData; + export type ResponseBody = ActionsGetRepoPublicKeyData; } /** - * @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 + * @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 IssuesCreateComment { + export namespace ActionsGetRepoSecret { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; owner: string; repo: string; + /** secret_name parameter */ + secretName: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesCreateCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesCreateCommentData; + export type ResponseBody = ActionsGetRepoSecretData; } /** - * No description - * @tags issues - * @name IssuesCreateLabel - * @summary Create a label - * @request POST:/repos/{owner}/{repo}/labels + * @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 IssuesCreateLabel { + export namespace ActionsGetSelfHostedRunnerForRepo { export type RequestParams = { owner: string; repo: string; + /** Unique identifier of the self-hosted runner. */ + runnerId: number; }; export type RequestQuery = {}; - export type RequestBody = IssuesCreateLabelPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesCreateLabelData; + export type ResponseBody = ActionsGetSelfHostedRunnerForRepoData; } /** - * No description - * @tags issues - * @name IssuesCreateMilestone - * @summary Create a milestone - * @request POST:/repos/{owner}/{repo}/milestones + * @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 IssuesCreateMilestone { + export namespace ActionsGetWorkflow { 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 = IssuesCreateMilestonePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesCreateMilestoneData; + export type ResponseBody = ActionsGetWorkflowData; } /** - * No description - * @tags issues - * @name IssuesDeleteComment - * @summary Delete an issue comment - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @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 IssuesDeleteComment { + export namespace ActionsGetWorkflowRun { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; repo: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesDeleteCommentData; + export type ResponseBody = ActionsGetWorkflowRunData; } /** - * No description - * @tags issues - * @name IssuesDeleteLabel - * @summary Delete a label - * @request DELETE:/repos/{owner}/{repo}/labels/{name} + * @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 IssuesDeleteLabel { + export namespace ActionsGetWorkflowRunUsage { export type RequestParams = { - name: string; owner: string; repo: string; + runId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesDeleteLabelData; + export type ResponseBody = ActionsGetWorkflowRunUsageData; } /** - * No description - * @tags issues - * @name IssuesDeleteMilestone - * @summary Delete a milestone - * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} + * @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 IssuesDeleteMilestone { + export namespace ActionsGetWorkflowUsage { export type RequestParams = { - /** milestone_number parameter */ - milestoneNumber: 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 = IssuesDeleteMilestoneData; + export type ResponseBody = ActionsGetWorkflowUsageData; } /** - * @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 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 IssuesGet { + export namespace ActionsListArtifactsForRepo { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; 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 = IssuesGetData; + export type ResponseBody = ActionsListArtifactsForRepoData; } /** - * No description - * @tags issues - * @name IssuesGetComment - * @summary Get an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @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 IssuesGetComment { + export namespace ActionsListJobsForWorkflowRun { export type RequestParams = { - /** comment_id parameter */ - commentId: number; 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; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesGetCommentData; + export type ResponseBody = ActionsListJobsForWorkflowRunData; } /** - * No description - * @tags issues - * @name IssuesGetEvent - * @summary Get an issue event - * @request GET:/repos/{owner}/{repo}/issues/events/{event_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 IssuesGetEvent { + export namespace ActionsListRepoSecrets { export type RequestParams = { - eventId: number; 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 = IssuesGetEventData; + export type ResponseBody = ActionsListRepoSecretsData; } /** - * No description - * @tags issues - * @name IssuesGetLabel - * @summary Get a label - * @request GET:/repos/{owner}/{repo}/labels/{name} + * @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 IssuesGetLabel { + export namespace ActionsListRepoWorkflows { export type RequestParams = { - name: 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 = IssuesGetLabelData; + export type ResponseBody = ActionsListRepoWorkflowsData; } /** - * No description - * @tags issues - * @name IssuesGetMilestone - * @summary Get a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} + * @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 IssuesGetMilestone { + export namespace ActionsListRunnerApplicationsForRepo { export type RequestParams = { - /** milestone_number parameter */ - milestoneNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesGetMilestoneData; + export type ResponseBody = ActionsListRunnerApplicationsForRepoData; } /** - * @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 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 IssuesListAssignees { + export namespace ActionsListSelfHostedRunnersForRepo { export type RequestParams = { owner: string; repo: string; @@ -42238,22 +42748,21 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListAssigneesData; + export type ResponseBody = ActionsListSelfHostedRunnersForRepoData; } /** - * @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 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 IssuesListComments { + export namespace ActionsListWorkflowRunArtifacts { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; owner: string; repo: string; + runId: number; }; export type RequestQuery = { /** @@ -42266,29 +42775,33 @@ 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 = IssuesListCommentsData; + export type ResponseBody = ActionsListWorkflowRunArtifactsData; } /** - * @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 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 IssuesListCommentsForRepo { + 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 = { - /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: IssuesListCommentsForRepoParams1DirectionEnum; + /** 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 @@ -42299,177 +42812,152 @@ 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; + /** 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 = ActionsListWorkflowRunsData; + } + + /** + * @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 ActionsListWorkflowRunsForRepo { + 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; /** - * One of \`created\` (when the repository was starred) or \`updated\` (when it was last pushed to). - * @default "created" + * Page number of the results to fetch. + * @default 1 */ - sort?: IssuesListCommentsForRepoParams1SortEnum; + 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; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListCommentsForRepoData; + export type ResponseBody = ActionsListWorkflowRunsForRepoData; } /** - * No description - * @tags issues - * @name IssuesListEvents - * @summary List issue events - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events + * @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 ActionsReRunWorkflow { + export type RequestParams = { + owner: string; + repo: string; + runId: number; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActionsReRunWorkflowData; + } + + /** + * @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 IssuesListEvents { + export namespace ActionsSetAllowedActionsRepository { 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; - }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = SelectedActions; export type RequestHeaders = {}; - export type ResponseBody = IssuesListEventsData; + export type ResponseBody = ActionsSetAllowedActionsRepositoryData; } /** - * No description - * @tags issues - * @name IssuesListEventsForRepo - * @summary List issue events for a repository - * @request GET:/repos/{owner}/{repo}/issues/events + * @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 IssuesListEventsForRepo { + export namespace ActionsSetGithubActionsPermissionsRepository { 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 = + ActionsSetGithubActionsPermissionsRepositoryPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesListEventsForRepoData; + export type ResponseBody = ActionsSetGithubActionsPermissionsRepositoryData; } /** - * No description - * @tags issues - * @name IssuesListEventsForTimeline - * @summary List timeline events for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline + * @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 IssuesListEventsForTimeline { + export namespace ActivityDeleteRepoSubscription { 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; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListEventsForTimelineData; + export type ResponseBody = ActivityDeleteRepoSubscriptionData; } /** - * @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 + * No description + * @tags activity + * @name ActivityGetRepoSubscription + * @summary Get a repository subscription + * @request GET:/repos/{owner}/{repo}/subscription */ - export namespace IssuesListForRepo { + export namespace ActivityGetRepoSubscription { export type RequestParams = { owner: string; repo: 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 - */ - 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?: IssuesListForRepoParams1SortEnum; - /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" - */ - state?: IssuesListForRepoParams1StateEnum; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListForRepoData; + export type ResponseBody = ActivityGetRepoSubscriptionData; } /** * No description - * @tags issues - * @name IssuesListLabelsForMilestone - * @summary List labels for issues in a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels + * @tags activity + * @name ActivityListRepoEvents + * @summary List repository events + * @request GET:/repos/{owner}/{repo}/events */ - export namespace IssuesListLabelsForMilestone { + export namespace ActivityListRepoEvents { export type RequestParams = { - /** milestone_number parameter */ - milestoneNumber: number; owner: string; repo: string; }; @@ -42487,49 +42975,62 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListLabelsForMilestoneData; + export type ResponseBody = ActivityListRepoEventsData; } /** - * No description - * @tags issues - * @name IssuesListLabelsForRepo - * @summary List labels for a repository - * @request GET:/repos/{owner}/{repo}/labels + * @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 IssuesListLabelsForRepo { + export namespace ActivityListRepoNotificationsForAuthenticatedUser { export type RequestParams = { owner: string; repo: string; }; 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 = IssuesListLabelsForRepoData; + export type ResponseBody = + ActivityListRepoNotificationsForAuthenticatedUserData; } /** - * No description - * @tags issues - * @name IssuesListLabelsOnIssue - * @summary List labels for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @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 IssuesListLabelsOnIssue { + export namespace ActivityListStargazersForRepo { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; owner: string; repo: string; }; @@ -42547,27 +43048,22 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesListLabelsOnIssueData; + export type ResponseBody = ActivityListStargazersForRepoData; } /** - * No description - * @tags issues - * @name IssuesListMilestones - * @summary List milestones - * @request GET:/repos/{owner}/{repo}/milestones + * @description Lists the people watching the specified repository. + * @tags activity + * @name ActivityListWatchersForRepo + * @summary List watchers + * @request GET:/repos/{owner}/{repo}/subscribers */ - export namespace IssuesListMilestones { + export namespace ActivityListWatchersForRepo { export type RequestParams = { owner: string; repo: string; }; 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 @@ -42578,677 +43074,695 @@ 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 = ActivityListWatchersForRepoData; } /** - * @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 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 IssuesLock { + export namespace ActivityMarkRepoNotificationsAsRead { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesLockPayload; + export type RequestBody = ActivityMarkRepoNotificationsAsReadPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesLockData; + export type ResponseBody = ActivityMarkRepoNotificationsAsReadData; } /** - * No description - * @tags issues - * @name IssuesRemoveAllLabels - * @summary Remove all labels from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @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 IssuesRemoveAllLabels { + export namespace ActivitySetRepoSubscription { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ActivitySetRepoSubscriptionPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesRemoveAllLabelsData; + export type ResponseBody = ActivitySetRepoSubscriptionData; } /** - * @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 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 IssuesRemoveAssignees { + export namespace AppsGetRepoInstallation { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesRemoveAssigneesPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesRemoveAssigneesData; + export type ResponseBody = AppsGetRepoInstallationData; } /** - * @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 **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 IssuesRemoveLabel { + export namespace ChecksCreate { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; - name: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ChecksCreatePayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesRemoveLabelData; + export type ResponseBody = ChecksCreateData; } /** - * @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 **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 IssuesSetLabels { + export namespace ChecksCreateSuite { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesSetLabelsPayload; + export type RequestBody = ChecksCreateSuitePayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesSetLabelsData; + export type ResponseBody = ChecksCreateSuiteData; } /** - * @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 **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 IssuesUnlock { + export namespace ChecksGet { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; + /** check_run_id parameter */ + checkRunId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesUnlockData; + export type ResponseBody = ChecksGetData; } /** - * @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 **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 IssuesUpdate { + export namespace ChecksGetSuite { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; + /** check_suite_id parameter */ + checkSuiteId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = IssuesUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesUpdateData; + export type ResponseBody = ChecksGetSuiteData; } /** - * No description - * @tags issues - * @name IssuesUpdateComment - * @summary Update an issue comment - * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @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 IssuesUpdateComment { + export namespace ChecksListAnnotations { export type RequestParams = { - /** comment_id parameter */ - commentId: number; + /** check_run_id parameter */ + checkRunId: number; owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = IssuesUpdateCommentPayload; - export type RequestHeaders = {}; - export type ResponseBody = IssuesUpdateCommentData; - } - - /** - * No description - * @tags issues - * @name IssuesUpdateLabel - * @summary Update a label - * @request PATCH:/repos/{owner}/{repo}/labels/{name} - */ - export namespace IssuesUpdateLabel { - export type RequestParams = { - name: 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 = IssuesUpdateLabelPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesUpdateLabelData; + export type ResponseBody = ChecksListAnnotationsData; } /** - * No description - * @tags issues - * @name IssuesUpdateMilestone - * @summary Update a milestone - * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} + * @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 IssuesUpdateMilestone { + export namespace ChecksListForRef { export type RequestParams = { - /** milestone_number parameter */ - milestoneNumber: number; owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = IssuesUpdateMilestonePayload; + 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 + */ + 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?: ChecksListForRefParams1StatusEnum; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = IssuesUpdateMilestoneData; + export type ResponseBody = ChecksListForRefData; } /** - * @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 + * @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 LicensesGetForRepo { + export namespace ChecksListForSuite { export type RequestParams = { + /** check_suite_id parameter */ + checkSuiteId: number; owner: string; repo: string; }; - export type RequestQuery = {}; + 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 + */ + 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?: ChecksListForSuiteParams1StatusEnum; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = LicensesGetForRepoData; + export type ResponseBody = ChecksListForSuiteData; } /** - * @description Stop an import for a repository. - * @tags migrations - * @name MigrationsCancelImport - * @summary Cancel an import - * @request DELETE:/repos/{owner}/{repo}/import + * @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 MigrationsCancelImport { + export namespace ChecksListSuitesForRef { export type RequestParams = { owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; - export type RequestQuery = {}; + 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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsCancelImportData; + export type ResponseBody = ChecksListSuitesForRefData; } /** - * @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 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 MigrationsGetCommitAuthors { + export namespace ChecksRerequestSuite { export type RequestParams = { + /** check_suite_id parameter */ + checkSuiteId: number; owner: string; repo: 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 = MigrationsGetCommitAuthorsData; + export type ResponseBody = ChecksRerequestSuiteData; } /** - * @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 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 MigrationsGetImportStatus { + export namespace ChecksSetSuitesPreferences { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ChecksSetSuitesPreferencesPayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsGetImportStatusData; + export type ResponseBody = ChecksSetSuitesPreferencesData; } /** - * @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 **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 MigrationsGetLargeFiles { + export namespace ChecksUpdate { export type RequestParams = { + /** check_run_id parameter */ + checkRunId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ChecksUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsGetLargeFilesData; + export type ResponseBody = ChecksUpdateData; } /** - * @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 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 MigrationsMapCommitAuthor { + export namespace CodeScanningGetAlert { export type RequestParams = { - authorId: number; + alertNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = MigrationsMapCommitAuthorPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsMapCommitAuthorData; + export type ResponseBody = CodeScanningGetAlertData; } /** - * @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 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 MigrationsSetLfsPreference { + export namespace CodeScanningListAlertsForRepo { export type RequestParams = { owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = MigrationsSetLfsPreferencePayload; + 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 = MigrationsSetLfsPreferenceData; + export type ResponseBody = CodeScanningListAlertsForRepoData; } /** - * @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 + * @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 MigrationsStartImport { + export namespace CodeScanningListRecentAnalyses { export type RequestParams = { owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = MigrationsStartImportPayload; + 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 = MigrationsStartImportData; + export type ResponseBody = CodeScanningListRecentAnalysesData; } /** - * @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 + * @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 MigrationsUpdateImport { + 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 type RequestQuery = {}; - export type RequestBody = MigrationsUpdateImportPayload; + export type RequestBody = CodeScanningUpdateAlertPayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsUpdateImportData; + export type ResponseBody = CodeScanningUpdateAlertData; } /** - * @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 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 ProjectsCreateForRepo { + export namespace CodeScanningUploadSarif { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ProjectsCreateForRepoPayload; + export type RequestBody = CodeScanningUploadSarifPayload; export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateForRepoData; + export type ResponseBody = CodeScanningUploadSarifData; } /** - * @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 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 ProjectsListForRepo { + export namespace CodesOfConductGetForRepo { 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ProjectsListForRepoData; + export type ResponseBody = CodesOfConductGetForRepoData; } /** * No description - * @tags pulls - * @name PullsCheckIfMerged - * @summary Check if a pull request has been merged - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge + * @tags git + * @name GitCreateBlob + * @summary Create a blob + * @request POST:/repos/{owner}/{repo}/git/blobs */ - export namespace PullsCheckIfMerged { + export namespace GitCreateBlob { export type RequestParams = { owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = GitCreateBlobPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsCheckIfMergedData; + export type ResponseBody = GitCreateBlobData; } /** - * @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 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 PullsCreate { + export namespace GitCreateCommit { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsCreatePayload; + export type RequestBody = GitCreateCommitPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsCreateData; + export type ResponseBody = GitCreateCommitData; } /** - * @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 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 PullsCreateReplyForReviewComment { + export namespace GitCreateRef { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsCreateReplyForReviewCommentPayload; + export type RequestBody = GitCreateRefPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsCreateReplyForReviewCommentData; + export type ResponseBody = GitCreateRefData; } /** - * @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 + * @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 PullsCreateReview { + export namespace GitCreateTag { export type RequestParams = { owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsCreateReviewPayload; + export type RequestBody = GitCreateTagPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsCreateReviewData; + export type ResponseBody = GitCreateTagData; } /** - * @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 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 PullsCreateReviewComment { + export namespace GitCreateTree { export type RequestParams = { owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsCreateReviewCommentPayload; + export type RequestBody = GitCreateTreePayload; export type RequestHeaders = {}; - export type ResponseBody = PullsCreateReviewCommentData; + export type ResponseBody = GitCreateTreeData; } /** * 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 GitDeleteRef + * @summary Delete a reference + * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} */ - export namespace PullsDeletePendingReview { + export namespace GitDeleteRef { export type RequestParams = { owner: string; - pullNumber: number; + /** ref+ parameter */ + ref: string; repo: string; - /** review_id parameter */ - reviewId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsDeletePendingReviewData; + export type ResponseBody = GitDeleteRefData; } /** - * @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 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 PullsDeleteReviewComment { + export namespace GitGetBlob { export type RequestParams = { - /** comment_id parameter */ - commentId: number; + fileSha: string; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsDeleteReviewCommentData; + export type ResponseBody = GitGetBlobData; } /** - * @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 + * @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 PullsDismissReview { + export namespace GitGetCommit { export type RequestParams = { + /** commit_sha parameter */ + commitSha: string; owner: string; - pullNumber: number; repo: string; - /** review_id parameter */ - reviewId: number; }; export type RequestQuery = {}; - export type RequestBody = PullsDismissReviewPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsDismissReviewData; + export type ResponseBody = GitGetCommitData; } /** - * @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 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 PullsGet { + export namespace GitGetRef { export type RequestParams = { owner: string; - pullNumber: number; + /** ref+ parameter */ + ref: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsGetData; + export type ResponseBody = GitGetRefData; } /** - * 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 **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 PullsGetReview { + export namespace GitGetTag { export type RequestParams = { owner: string; - pullNumber: number; repo: string; - /** review_id parameter */ - reviewId: number; + tagSha: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsGetReviewData; + export type ResponseBody = GitGetTagData; } /** - * @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 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 PullsGetReviewComment { + export namespace GitGetTree { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; repo: string; + treeSha: string; + }; + 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsGetReviewCommentData; + export type ResponseBody = GitGetTreeData; } /** - * @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 + * @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 PullsList { + export namespace GitListMatchingRefs { export type RequestParams = { owner: string; + /** ref+ parameter */ + ref: 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 @@ -43259,589 +43773,595 @@ export namespace Repos { * @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 = PullsListData; + export type ResponseBody = GitListMatchingRefsData; } /** - * @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 + * No description + * @tags git + * @name GitUpdateRef + * @summary Update a reference + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} */ - export namespace PullsListCommentsForReview { + export namespace GitUpdateRef { export type RequestParams = { owner: string; - pullNumber: number; + /** ref+ parameter */ + ref: string; repo: string; - /** review_id parameter */ - reviewId: 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 = GitUpdateRefPayload; + export type RequestHeaders = {}; + export type ResponseBody = GitUpdateRefData; + } + + /** + * @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 InteractionsGetRestrictionsForRepo { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListCommentsForReviewData; + export type ResponseBody = InteractionsGetRestrictionsForRepoData; } /** - * @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 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 PullsListCommits { + export namespace InteractionsRemoveRestrictionsForRepo { export type RequestParams = { 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 = PullsListCommitsData; + export type ResponseBody = InteractionsRemoveRestrictionsForRepoData; + } + + /** + * @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 InteractionsSetRestrictionsForRepo { + export type RequestParams = { + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = InteractionLimit; + export type RequestHeaders = {}; + export type ResponseBody = InteractionsSetRestrictionsForRepoData; } /** - * @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 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 PullsListFiles { + export namespace IssuesAddAssignees { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; 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 RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = IssuesAddAssigneesPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsListFilesData; + export type ResponseBody = IssuesAddAssigneesData; } /** * 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 issues + * @name IssuesAddLabels + * @summary Add labels to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - export namespace PullsListRequestedReviewers { + export namespace IssuesAddLabels { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; 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 RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = IssuesAddLabelsPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsListRequestedReviewersData; + export type ResponseBody = IssuesAddLabelsData; } /** - * @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 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 PullsListReviewComments { + export namespace IssuesCheckUserCanBeAssigned { export type RequestParams = { + assignee: string; 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 - */ - 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?: PullsListReviewCommentsParams1SortEnum; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsListReviewCommentsData; + export type ResponseBody = IssuesCheckUserCanBeAssignedData; } /** - * @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 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 PullsListReviewCommentsForRepo { + export namespace IssuesCreate { export type RequestParams = { 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 - */ - 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?: PullsListReviewCommentsForRepoParams1SortEnum; - }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = IssuesCreatePayload; export type RequestHeaders = {}; - export type ResponseBody = PullsListReviewCommentsForRepoData; + export type ResponseBody = IssuesCreateData; } /** - * @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 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 PullsListReviews { + export namespace IssuesCreateComment { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; 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 RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = IssuesCreateCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsListReviewsData; + export type ResponseBody = IssuesCreateCommentData; } /** - * @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 + * No description + * @tags issues + * @name IssuesCreateLabel + * @summary Create a label + * @request POST:/repos/{owner}/{repo}/labels */ - export namespace PullsMerge { + export namespace IssuesCreateLabel { export type RequestParams = { owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsMergePayload; + export type RequestBody = IssuesCreateLabelPayload; export type RequestHeaders = {}; - export type ResponseBody = PullsMergeData; + export type ResponseBody = IssuesCreateLabelData; } /** * 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 issues + * @name IssuesCreateMilestone + * @summary Create a milestone + * @request POST:/repos/{owner}/{repo}/milestones */ - export namespace PullsRemoveRequestedReviewers { + export namespace IssuesCreateMilestone { export type RequestParams = { owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsRemoveRequestedReviewersPayload; + export type RequestBody = IssuesCreateMilestonePayload; export type RequestHeaders = {}; - export type ResponseBody = PullsRemoveRequestedReviewersData; + export type ResponseBody = IssuesCreateMilestoneData; } /** - * @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 + * No description + * @tags issues + * @name IssuesDeleteComment + * @summary Delete an issue comment + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - export namespace PullsRequestReviewers { + export namespace IssuesDeleteComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsRequestReviewersPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsRequestReviewersData; + export type ResponseBody = IssuesDeleteCommentData; } /** * 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 issues + * @name IssuesDeleteLabel + * @summary Delete a label + * @request DELETE:/repos/{owner}/{repo}/labels/{name} */ - export namespace PullsSubmitReview { + export namespace IssuesDeleteLabel { export type RequestParams = { + name: string; owner: string; - pullNumber: number; repo: string; - /** review_id parameter */ - reviewId: number; }; export type RequestQuery = {}; - export type RequestBody = PullsSubmitReviewPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsSubmitReviewData; + export type ResponseBody = IssuesDeleteLabelData; } /** - * @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} + * No description + * @tags issues + * @name IssuesDeleteMilestone + * @summary Delete a milestone + * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} */ - export namespace PullsUpdate { + export namespace IssuesDeleteMilestone { export type RequestParams = { + /** milestone_number parameter */ + milestoneNumber: number; owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsUpdateData; + export type ResponseBody = IssuesDeleteMilestoneData; } /** - * @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 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 PullsUpdateBranch { + export namespace IssuesGet { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; owner: string; - pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsUpdateBranchPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsUpdateBranchData; + export type ResponseBody = IssuesGetData; } /** - * @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 issues + * @name IssuesGetComment + * @summary Get an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - export namespace PullsUpdateReview { + export namespace IssuesGetComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; - pullNumber: number; repo: string; - /** review_id parameter */ - reviewId: number; }; export type RequestQuery = {}; - export type RequestBody = PullsUpdateReviewPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsUpdateReviewData; + export type ResponseBody = IssuesGetCommentData; } /** - * @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} + * No description + * @tags issues + * @name IssuesGetEvent + * @summary Get an issue event + * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} */ - export namespace PullsUpdateReviewComment { + export namespace IssuesGetEvent { export type RequestParams = { - /** comment_id parameter */ - commentId: number; + eventId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = PullsUpdateReviewCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = PullsUpdateReviewCommentData; + export type ResponseBody = IssuesGetEventData; } /** - * @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 + * No description + * @tags issues + * @name IssuesGetLabel + * @summary Get a label + * @request GET:/repos/{owner}/{repo}/labels/{name} */ - export namespace ReactionsCreateForCommitComment { + export namespace IssuesGetLabel { export type RequestParams = { - /** comment_id parameter */ - commentId: number; + name: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForCommitCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForCommitCommentData; + export type ResponseBody = IssuesGetLabelData; } /** - * @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 + * No description + * @tags issues + * @name IssuesGetMilestone + * @summary Get a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} */ - export namespace ReactionsCreateForIssue { + export namespace IssuesGetMilestone { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; + /** milestone_number parameter */ + milestoneNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForIssuePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForIssueData; + export type ResponseBody = IssuesGetMilestoneData; } /** - * @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 + * @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 ReactionsCreateForIssueComment { + export namespace IssuesListAssignees { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForIssueCommentPayload; + 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 = ReactionsCreateForIssueCommentData; + export type ResponseBody = IssuesListAssigneesData; } /** - * @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 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 ReactionsCreateForPullRequestReviewComment { + export namespace IssuesListComments { export type RequestParams = { - /** comment_id parameter */ - commentId: number; + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ReactionsCreateForPullRequestReviewCommentPayload; + 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 = ReactionsCreateForPullRequestReviewCommentData; + export type ResponseBody = IssuesListCommentsData; } /** - * @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 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 ReactionsDeleteForCommitComment { + export namespace IssuesListCommentsForRepo { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; - reactionId: number; repo: string; }; - export type RequestQuery = {}; + 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 RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsDeleteForCommitCommentData; + export type ResponseBody = IssuesListCommentsForRepoData; } /** - * @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} + * No description + * @tags issues + * @name IssuesListEvents + * @summary List issue events + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events */ - export namespace ReactionsDeleteForIssue { + export namespace IssuesListEvents { export type RequestParams = { /** issue_number parameter */ issueNumber: number; owner: string; - reactionId: number; 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 = ReactionsDeleteForIssueData; + export type ResponseBody = IssuesListEventsData; } /** - * @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} + * No description + * @tags issues + * @name IssuesListEventsForRepo + * @summary List issue events for a repository + * @request GET:/repos/{owner}/{repo}/issues/events */ - export namespace ReactionsDeleteForIssueComment { + export namespace IssuesListEventsForRepo { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; - reactionId: number; 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 = ReactionsDeleteForIssueCommentData; + export type ResponseBody = IssuesListEventsForRepoData; } /** - * @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} + * No description + * @tags issues + * @name IssuesListEventsForTimeline + * @summary List timeline events for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline */ - export namespace ReactionsDeleteForPullRequestComment { + export namespace IssuesListEventsForTimeline { export type RequestParams = { - /** comment_id parameter */ - commentId: number; + /** issue_number parameter */ + issueNumber: number; owner: string; - reactionId: number; 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 = ReactionsDeleteForPullRequestCommentData; + export type ResponseBody = IssuesListEventsForTimelineData; } /** - * @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 + * @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 ReactionsListForCommitComment { + export namespace IssuesListForRepo { 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; + /** 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 @@ -43852,29 +44372,39 @@ 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 = ReactionsListForCommitCommentData; + export type ResponseBody = IssuesListForRepoData; } /** - * @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 + * 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 ReactionsListForIssue { + export namespace IssuesListLabelsForMilestone { export type RequestParams = { - /** issue_number parameter */ - issueNumber: number; + /** milestone_number parameter */ + milestoneNumber: 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 @@ -43888,26 +44418,22 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForIssueData; + export type ResponseBody = IssuesListLabelsForMilestoneData; } /** - * @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 + * No description + * @tags issues + * @name IssuesListLabelsForRepo + * @summary List labels for a repository + * @request GET:/repos/{owner}/{repo}/labels */ - export namespace ReactionsListForIssueComment { + export namespace IssuesListLabelsForRepo { 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 @@ -43921,26 +44447,24 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForIssueCommentData; + export type ResponseBody = IssuesListLabelsForRepoData; } /** - * @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 + * No description + * @tags issues + * @name IssuesListLabelsOnIssue + * @summary List labels for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - export namespace ReactionsListForPullRequestReviewComment { + export namespace IssuesListLabelsOnIssue { export type RequestParams = { - /** comment_id parameter */ - commentId: number; + /** 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 a pull request review comment. */ - content?: ReactionsListForPullRequestReviewCommentParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -43954,1329 +44478,1542 @@ export namespace Repos { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForPullRequestReviewCommentData; + export type ResponseBody = IssuesListLabelsOnIssueData; } /** - * @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 + * No description + * @tags issues + * @name IssuesListMilestones + * @summary List milestones + * @request GET:/repos/{owner}/{repo}/milestones */ - export namespace ReposAddAppAccessRestrictions { + export namespace IssuesListMilestones { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposAddAppAccessRestrictionsPayload; + 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 + */ + page?: number; + /** + * Results per page (max 100) + * @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 = ReposAddAppAccessRestrictionsData; + export type ResponseBody = IssuesListMilestonesData; } /** - * @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 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 ReposAddCollaborator { + export namespace IssuesLock { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; - username: string; }; export type RequestQuery = {}; - export type RequestBody = ReposAddCollaboratorPayload; + export type RequestBody = IssuesLockPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposAddCollaboratorData; + export type ResponseBody = IssuesLockData; } /** - * @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 + * No description + * @tags issues + * @name IssuesRemoveAllLabels + * @summary Remove all labels from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - export namespace ReposAddStatusCheckContexts { + export namespace IssuesRemoveAllLabels { 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 = ReposAddStatusCheckContextsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposAddStatusCheckContextsData; + export type ResponseBody = IssuesRemoveAllLabelsData; } /** - * @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 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 ReposAddTeamAccessRestrictions { + export namespace IssuesRemoveAssignees { 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 = ReposAddTeamAccessRestrictionsPayload; + export type RequestBody = IssuesRemoveAssigneesPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposAddTeamAccessRestrictionsData; + export type ResponseBody = IssuesRemoveAssigneesData; } /** - * @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 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 ReposAddUserAccessRestrictions { + export namespace IssuesRemoveLabel { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** issue_number parameter */ + issueNumber: number; + name: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposAddUserAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposAddUserAccessRestrictionsData; + export type ResponseBody = IssuesRemoveLabelData; } /** - * @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 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 ReposCheckCollaborator { + export namespace IssuesSetLabels { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; - username: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = IssuesSetLabelsPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCheckCollaboratorData; + export type ResponseBody = IssuesSetLabelsData; } /** - * @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 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 ReposCheckVulnerabilityAlerts { + export namespace IssuesUnlock { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCheckVulnerabilityAlertsData; + export type ResponseBody = IssuesUnlockData; } /** - * @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 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 ReposCompareCommits { + export namespace IssuesUpdate { export type RequestParams = { - base: string; - head: string; + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = IssuesUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCompareCommitsData; + export type ResponseBody = IssuesUpdateData; } /** - * @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 + * No description + * @tags issues + * @name IssuesUpdateComment + * @summary Update an issue comment + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - export namespace ReposCreateCommitComment { + export namespace IssuesUpdateComment { export type RequestParams = { - /** commit_sha parameter */ - commitSha: string; + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateCommitCommentPayload; + export type RequestBody = IssuesUpdateCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateCommitCommentData; + export type ResponseBody = IssuesUpdateCommentData; } /** - * @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 + * No description + * @tags issues + * @name IssuesUpdateLabel + * @summary Update a label + * @request PATCH:/repos/{owner}/{repo}/labels/{name} */ - export namespace ReposCreateCommitSignatureProtection { + export namespace IssuesUpdateLabel { export type RequestParams = { - /** The name of the branch. */ - branch: string; + name: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = IssuesUpdateLabelPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateCommitSignatureProtectionData; + export type ResponseBody = IssuesUpdateLabelData; } /** - * @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} + * No description + * @tags issues + * @name IssuesUpdateMilestone + * @summary Update a milestone + * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} */ - export namespace ReposCreateCommitStatus { + export namespace IssuesUpdateMilestone { export type RequestParams = { + /** milestone_number parameter */ + milestoneNumber: number; owner: string; repo: string; - sha: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateCommitStatusPayload; + export type RequestBody = IssuesUpdateMilestonePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateCommitStatusData; + export type ResponseBody = IssuesUpdateMilestoneData; } /** - * @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 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 ReposCreateDeployKey { + export namespace LicensesGetForRepo { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateDeployKeyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateDeployKeyData; + export type ResponseBody = LicensesGetForRepoData; } /** - * @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 Stop an import for a repository. + * @tags migrations + * @name MigrationsCancelImport + * @summary Cancel an import + * @request DELETE:/repos/{owner}/{repo}/import */ - export namespace ReposCreateDeployment { + export namespace MigrationsCancelImport { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateDeploymentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateDeploymentData; + export type ResponseBody = MigrationsCancelImportData; } /** - * @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 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 ReposCreateDeploymentStatus { + export namespace MigrationsGetCommitAuthors { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: number; owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposCreateDeploymentStatusPayload; + 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 = ReposCreateDeploymentStatusData; + export type ResponseBody = MigrationsGetCommitAuthorsData; } /** - * @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 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 ReposCreateDispatchEvent { + export namespace MigrationsGetImportStatus { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateDispatchEventPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateDispatchEventData; + export type ResponseBody = MigrationsGetImportStatusData; } /** - * @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 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 ReposCreateFork { + export namespace MigrationsGetLargeFiles { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateForkPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateForkData; + export type ResponseBody = MigrationsGetLargeFilesData; } /** - * @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 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 ReposCreateOrUpdateFileContents { + export namespace MigrationsMapCommitAuthor { export type RequestParams = { + authorId: number; owner: string; - /** path+ parameter */ - path: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateOrUpdateFileContentsPayload; + export type RequestBody = MigrationsMapCommitAuthorPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateOrUpdateFileContentsData; + export type ResponseBody = MigrationsMapCommitAuthorData; } /** - * @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 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 ReposCreatePagesSite { + export namespace MigrationsSetLfsPreference { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreatePagesSitePayload; + export type RequestBody = MigrationsSetLfsPreferencePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreatePagesSiteData; + export type ResponseBody = MigrationsSetLfsPreferenceData; } /** - * @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 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 ReposCreateRelease { + export namespace MigrationsStartImport { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateReleasePayload; + export type RequestBody = MigrationsStartImportPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateReleaseData; + export type ResponseBody = MigrationsStartImportData; } /** - * @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 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 ReposCreateUsingTemplate { + export namespace MigrationsUpdateImport { export type RequestParams = { - templateOwner: string; - templateRepo: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateUsingTemplatePayload; + export type RequestBody = MigrationsUpdateImportPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateUsingTemplateData; + export type ResponseBody = MigrationsUpdateImportData; } /** - * @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 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 ReposCreateWebhook { + export namespace ProjectsCreateForRepo { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposCreateWebhookPayload; + export type RequestBody = ProjectsCreateForRepoPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposCreateWebhookData; + export type ResponseBody = ProjectsCreateForRepoData; } /** - * @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 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 ReposDelete { + export namespace ProjectsListForRepo { 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; + /** + * 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 = ReposDeleteData; + export type ResponseBody = ProjectsListForRepoData; } /** - * @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 + * 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 ReposDeleteAccessRestrictions { + export namespace PullsCheckIfMerged { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteAccessRestrictionsData; + export type ResponseBody = PullsCheckIfMergedData; } /** - * @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 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 ReposDeleteAdminBranchProtection { + export namespace PullsCreate { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsCreatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteAdminBranchProtectionData; + export type ResponseBody = PullsCreateData; } /** - * @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 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 ReposDeleteBranchProtection { + export namespace PullsCreateReplyForReviewComment { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** comment_id parameter */ + commentId: number; owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsCreateReplyForReviewCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteBranchProtectionData; + export type ResponseBody = PullsCreateReplyForReviewCommentData; } /** - * No description - * @tags repos - * @name ReposDeleteCommitComment - * @summary Delete a commit comment - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} + * @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 ReposDeleteCommitComment { + export namespace PullsCreateReview { export type RequestParams = { - /** comment_id parameter */ - commentId: number; owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsCreateReviewPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteCommitCommentData; + export type ResponseBody = PullsCreateReviewData; } /** - * @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 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 ReposDeleteCommitSignatureProtection { + export namespace PullsCreateReviewComment { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsCreateReviewCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteCommitSignatureProtectionData; + export type ResponseBody = PullsCreateReviewCommentData; } /** - * @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} + * 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 ReposDeleteDeployKey { + export namespace PullsDeletePendingReview { export type RequestParams = { - /** key_id parameter */ - keyId: number; owner: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteDeployKeyData; + export type ResponseBody = PullsDeletePendingReviewData; } /** - * @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 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 ReposDeleteDeployment { + export namespace PullsDeleteReviewComment { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: number; + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteDeploymentData; + export type ResponseBody = PullsDeleteReviewCommentData; } /** - * @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 **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 ReposDeleteFile { + export namespace PullsDismissReview { export type RequestParams = { owner: string; - /** path+ parameter */ - path: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; }; export type RequestQuery = {}; - export type RequestBody = ReposDeleteFilePayload; + export type RequestBody = PullsDismissReviewPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteFileData; + export type ResponseBody = PullsDismissReviewData; } /** - * No description - * @tags repos - * @name ReposDeleteInvitation - * @summary Delete a repository invitation - * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} + * @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 ReposDeleteInvitation { + export namespace PullsGet { export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteInvitationData; + export type ResponseBody = PullsGetData; } /** * No description - * @tags repos - * @name ReposDeletePagesSite - * @summary Delete a GitHub Pages site - * @request DELETE:/repos/{owner}/{repo}/pages + * @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 ReposDeletePagesSite { + 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 = ReposDeletePagesSiteData; + export type ResponseBody = PullsGetReviewData; } /** - * @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 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 ReposDeletePullRequestReviewProtection { + export namespace PullsGetReviewComment { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeletePullRequestReviewProtectionData; + export type ResponseBody = PullsGetReviewCommentData; } /** - * @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 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 ReposDeleteRelease { + export namespace PullsList { export type RequestParams = { owner: string; - /** release_id parameter */ - releaseId: number; repo: string; }; - export type RequestQuery = {}; + 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 + */ + 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?: PullsListParams1SortEnum; + /** + * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * @default "open" + */ + state?: PullsListParams1StateEnum; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeleteReleaseData; + export type ResponseBody = PullsListData; } /** - * No description - * @tags repos - * @name ReposDeleteReleaseAsset - * @summary Delete a release asset - * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @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 ReposDeleteReleaseAsset { + export namespace PullsListCommentsForReview { export type RequestParams = { - /** asset_id parameter */ - assetId: number; owner: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: 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 = ReposDeleteReleaseAssetData; + export type ResponseBody = PullsListCommentsForReviewData; } /** - * No description - * @tags repos - * @name ReposDeleteWebhook - * @summary Delete a repository webhook - * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} + * @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 ReposDeleteWebhook { + export namespace PullsListCommits { export type RequestParams = { - hookId: number; owner: string; + pullNumber: number; 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 = ReposDeleteWebhookData; + export type ResponseBody = PullsListCommitsData; } /** - * @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 **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 ReposDisableAutomatedSecurityFixes { + export namespace PullsListFiles { export type RequestParams = { owner: string; + pullNumber: number; 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 = ReposDisableAutomatedSecurityFixesData; + export type ResponseBody = PullsListFilesData; } /** - * @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 pulls + * @name PullsListRequestedReviewers + * @summary List requested reviewers for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - export namespace ReposDisableVulnerabilityAlerts { + export namespace PullsListRequestedReviewers { export type RequestParams = { owner: string; + pullNumber: number; 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 = ReposDisableVulnerabilityAlertsData; + export type ResponseBody = PullsListRequestedReviewersData; } /** - * @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} + * @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 ReposDownloadTarballArchive { + export namespace PullsListReviewComments { export type RequestParams = { owner: string; - ref: string; + pullNumber: number; repo: string; }; - export type RequestQuery = {}; + export type RequestQuery = { + /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + direction?: PullsListReviewCommentsParams1DirectionEnum; + /** + * 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?: PullsListReviewCommentsParams1SortEnum; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = PullsListReviewCommentsData; } /** - * @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 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 ReposDownloadZipballArchive { + export namespace PullsListReviewCommentsForRepo { export type RequestParams = { owner: string; - ref: string; repo: string; }; - export type RequestQuery = {}; + export type RequestQuery = { + /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + direction?: PullsListReviewCommentsForRepoParams1DirectionEnum; + /** + * 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?: PullsListReviewCommentsForRepoParams1SortEnum; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = PullsListReviewCommentsForRepoData; } /** - * @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 + * @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 ReposEnableAutomatedSecurityFixes { + export namespace PullsListReviews { export type RequestParams = { owner: string; + pullNumber: number; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = ReposEnableAutomatedSecurityFixesData; - } - - /** - * @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 ReposEnableVulnerabilityAlerts { - 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 = never; export type RequestHeaders = {}; - export type ResponseBody = ReposEnableVulnerabilityAlertsData; + export type ResponseBody = PullsListReviewsData; } /** - * @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 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 ReposGet { + export namespace PullsMerge { export type RequestParams = { owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsMergePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetData; + export type ResponseBody = PullsMergeData; } /** - * @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 pulls + * @name PullsRemoveRequestedReviewers + * @summary Remove requested reviewers from a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - export namespace ReposGetAccessRestrictions { + export namespace PullsRemoveRequestedReviewers { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsRemoveRequestedReviewersPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAccessRestrictionsData; + export type ResponseBody = PullsRemoveRequestedReviewersData; } /** - * @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 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 ReposGetAdminBranchProtection { + export namespace PullsRequestReviewers { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsRequestReviewersPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAdminBranchProtectionData; + export type ResponseBody = PullsRequestReviewersData; } /** - * @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 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 ReposGetAllStatusCheckContexts { + export namespace PullsSubmitReview { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + pullNumber: number; repo: string; + /** review_id parameter */ + reviewId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsSubmitReviewPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAllStatusCheckContextsData; + export type ResponseBody = PullsSubmitReviewData; } /** - * No description - * @tags repos - * @name ReposGetAllTopics - * @summary Get all repository topics - * @request GET:/repos/{owner}/{repo}/topics + * @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 ReposGetAllTopics { + export namespace PullsUpdate { export type RequestParams = { owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAllTopicsData; + export type ResponseBody = PullsUpdateData; } /** - * @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 + * @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 ReposGetAppsWithAccessToProtectedBranch { + export namespace PullsUpdateBranch { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + pullNumber: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsUpdateBranchPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetAppsWithAccessToProtectedBranchData; + export type ResponseBody = PullsUpdateBranchData; } /** - * No description - * @tags repos - * @name ReposGetBranch - * @summary Get a branch - * @request GET:/repos/{owner}/{repo}/branches/{branch} + * @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 ReposGetBranch { + export namespace PullsUpdateReview { export type RequestParams = { - /** The name of the branch. */ - branch: string; 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 = ReposGetBranchData; + export type ResponseBody = PullsUpdateReviewData; } /** - * @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 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 ReposGetBranchProtection { + export namespace PullsUpdateReviewComment { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = PullsUpdateReviewCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetBranchProtectionData; + export type ResponseBody = PullsUpdateReviewCommentData; } /** - * @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 + * @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 ReposGetClones { + export namespace ReactionsCreateForCommitComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; - export type RequestQuery = { - /** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ - per?: ReposGetClonesParams1PerEnum; - }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReactionsCreateForCommitCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetClonesData; + export type ResponseBody = ReactionsCreateForCommitCommentData; } /** - * @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 + * @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 ReposGetCodeFrequencyStats { + export namespace ReactionsCreateForIssue { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReactionsCreateForIssuePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCodeFrequencyStatsData; + export type ResponseBody = ReactionsCreateForIssueData; } /** - * @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 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 ReposGetCollaboratorPermissionLevel { + export namespace ReactionsCreateForIssueComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; - username: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReactionsCreateForIssueCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCollaboratorPermissionLevelData; + export type ResponseBody = ReactionsCreateForIssueCommentData; } /** - * @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 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 ReposGetCombinedStatusForRef { + export namespace ReactionsCreateForPullRequestReviewComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; - /** ref+ parameter */ - ref: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReactionsCreateForPullRequestReviewCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCombinedStatusForRefData; + export type ResponseBody = ReactionsCreateForPullRequestReviewCommentData; } /** - * @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 **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 ReposGetCommit { + export namespace ReactionsDeleteForCommitComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; - /** ref+ parameter */ - ref: string; + reactionId: number; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCommitData; + export type ResponseBody = ReactionsDeleteForCommitCommentData; } /** - * @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 **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 ReposGetCommitActivityStats { + 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 = ReposGetCommitActivityStatsData; + export type ResponseBody = ReactionsDeleteForIssueData; } /** - * No description - * @tags repos - * @name ReposGetCommitComment - * @summary Get a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id} + * @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 ReposGetCommitComment { + 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 = ReposGetCommitCommentData; + export type ResponseBody = ReactionsDeleteForIssueCommentData; } /** - * @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 **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 ReposGetCommitSignatureProtection { + export namespace ReactionsDeleteForPullRequestComment { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** comment_id parameter */ + commentId: number; owner: string; + reactionId: number; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCommitSignatureProtectionData; + export type ResponseBody = ReactionsDeleteForPullRequestCommentData; } /** - * @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 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 ReposGetCommunityProfileMetrics { + export namespace ReactionsListForCommitComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; - export type RequestQuery = {}; + 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; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetCommunityProfileMetricsData; + export type ResponseBody = ReactionsListForCommitCommentData; } /** - * @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 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 ReposGetContent { + export namespace ReactionsListForIssue { export type RequestParams = { + /** issue_number parameter */ + issueNumber: number; owner: string; - /** path+ parameter */ - path: string; repo: string; }; export type RequestQuery = { - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: 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. */ + content?: ReactionsListForIssueParams1ContentEnum; + /** + * 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 = ReposGetContentData; + export type ResponseBody = ReactionsListForIssueData; } /** - * @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 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 ReposGetContributorsStats { + export namespace ReactionsListForIssueComment { export type RequestParams = { + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; - export type RequestQuery = {}; + 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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetContributorsStatsData; + export type ResponseBody = ReactionsListForIssueCommentData; } /** - * No description - * @tags repos - * @name ReposGetDeployKey - * @summary Get a deploy key - * @request GET:/repos/{owner}/{repo}/keys/{key_id} + * @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 ReposGetDeployKey { + export namespace ReactionsListForPullRequestReviewComment { export type RequestParams = { - /** key_id parameter */ - keyId: number; + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; - export type RequestQuery = {}; + 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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; + }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetDeployKeyData; + export type ResponseBody = ReactionsListForPullRequestReviewCommentData; } /** - * 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 repos - * @name ReposGetDeployment - * @summary Get a deployment - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} + * @name ReposAddAppAccessRestrictions + * @summary Add app access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - export namespace ReposGetDeployment { + export namespace ReposAddAppAccessRestrictions { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: 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 = ReposGetDeploymentData; + export type ResponseBody = ReposAddAppAccessRestrictionsData; } /** - * @description Users with pull access can view a deployment status for a deployment: + * @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 ReposGetDeploymentStatus - * @summary Get a deployment status - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + * @name ReposAddCollaborator + * @summary Add a repository collaborator + * @request PUT:/repos/{owner}/{repo}/collaborators/{username} */ - export namespace ReposGetDeploymentStatus { + export namespace ReposAddCollaborator { export type RequestParams = { - /** deployment_id parameter */ - deploymentId: number; owner: string; repo: string; - statusId: number; + username: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposAddCollaboratorPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetDeploymentStatusData; + export type ResponseBody = ReposAddCollaboratorData; } /** - * 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 ReposGetLatestPagesBuild - * @summary Get latest Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/latest + * @name ReposAddStatusCheckContexts + * @summary Add status check contexts + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - export namespace ReposGetLatestPagesBuild { + 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 = ReposGetLatestPagesBuildData; + export type ResponseBody = ReposAddStatusCheckContextsData; } /** - * @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 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 ReposGetLatestRelease - * @summary Get the latest release - * @request GET:/repos/{owner}/{repo}/releases/latest + * @name ReposAddTeamAccessRestrictions + * @summary Add team access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - export namespace ReposGetLatestRelease { + export namespace ReposAddTeamAccessRestrictions { export type RequestParams = { + /** The name of the branch. */ + branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposAddTeamAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetLatestReleaseData; + export type ResponseBody = ReposAddTeamAccessRestrictionsData; } /** - * 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 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 ReposGetPages - * @summary Get a GitHub Pages site - * @request GET:/repos/{owner}/{repo}/pages + * @name ReposAddUserAccessRestrictions + * @summary Add user access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - export namespace ReposGetPages { + export namespace ReposAddUserAccessRestrictions { export type RequestParams = { + /** The name of the branch. */ + branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposAddUserAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetPagesData; + export type ResponseBody = ReposAddUserAccessRestrictionsData; } /** - * 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 repos - * @name ReposGetPagesBuild - * @summary Get GitHub Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} + * @name ReposCheckCollaborator + * @summary Check if a user is a repository collaborator + * @request GET:/repos/{owner}/{repo}/collaborators/{username} */ - export namespace ReposGetPagesBuild { + export namespace ReposCheckCollaborator { export type RequestParams = { - buildId: number; owner: string; repo: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetPagesBuildData; + export type ResponseBody = ReposCheckCollaboratorData; } /** - * @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 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 ReposGetParticipationStats - * @summary Get the weekly commit count - * @request GET:/repos/{owner}/{repo}/stats/participation + * @name ReposCheckVulnerabilityAlerts + * @summary Check if vulnerability alerts are enabled for a repository + * @request GET:/repos/{owner}/{repo}/vulnerability-alerts */ - export namespace ReposGetParticipationStats { + export namespace ReposCheckVulnerabilityAlerts { export type RequestParams = { owner: string; repo: string; @@ -45284,977 +46021,723 @@ export namespace Repos { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetParticipationStatsData; + export type ResponseBody = ReposCheckVulnerabilityAlertsData; } /** - * @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 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 ReposGetPullRequestReviewProtection - * @summary Get pull request review protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @name ReposCompareCommits + * @summary Compare two commits + * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} */ - export namespace ReposGetPullRequestReviewProtection { + export namespace ReposCompareCommits { export type RequestParams = { - /** The name of the branch. */ - branch: string; + base: string; + head: string; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposGetPullRequestReviewProtectionData; + export type ResponseBody = ReposCompareCommitsData; } /** - * @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 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 ReposGetPunchCardStats - * @summary Get the hourly commit count for each day - * @request GET:/repos/{owner}/{repo}/stats/punch_card + * @name ReposCreateCommitComment + * @summary Create a commit comment + * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - export namespace ReposGetPunchCardStats { + export namespace ReposCreateCommitComment { export type RequestParams = { + /** commit_sha parameter */ + commitSha: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateCommitCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetPunchCardStatsData; + export type ResponseBody = ReposCreateCommitCommentData; } /** - * @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 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 ReposGetReadme - * @summary Get a repository README - * @request GET:/repos/{owner}/{repo}/readme + * @name ReposCreateCommitSignatureProtection + * @summary Create commit signature protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - export namespace ReposGetReadme { + export namespace ReposCreateCommitSignatureProtection { export type RequestParams = { + /** The name of the branch. */ + branch: string; 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 = ReposCreateCommitSignatureProtectionData; } /** - * @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 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 ReposGetRelease - * @summary Get a release - * @request GET:/repos/{owner}/{repo}/releases/{release_id} + * @name ReposCreateCommitStatus + * @summary Create a commit status + * @request POST:/repos/{owner}/{repo}/statuses/{sha} */ - export namespace ReposGetRelease { + export namespace ReposCreateCommitStatus { export type RequestParams = { owner: string; - /** release_id parameter */ - releaseId: number; repo: string; + sha: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateCommitStatusPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetReleaseData; + export type ResponseBody = ReposCreateCommitStatusData; } /** - * @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 You can create a read-only deploy key. * @tags repos - * @name ReposGetReleaseAsset - * @summary Get a release asset - * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @name ReposCreateDeployKey + * @summary Create a deploy key + * @request POST:/repos/{owner}/{repo}/keys */ - export namespace ReposGetReleaseAsset { + export namespace ReposCreateDeployKey { export type RequestParams = { - /** asset_id parameter */ - assetId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateDeployKeyPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetReleaseAssetData; + export type ResponseBody = ReposCreateDeployKeyData; } /** - * @description Get a published release with the specified tag. + * @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 ReposGetReleaseByTag - * @summary Get a release by tag name - * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} + * @name ReposCreateDeployment + * @summary Create a deployment + * @request POST:/repos/{owner}/{repo}/deployments */ - export namespace ReposGetReleaseByTag { + export namespace ReposCreateDeployment { export type RequestParams = { owner: string; repo: string; - /** tag+ parameter */ - tag: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateDeploymentPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetReleaseByTagData; + export type ResponseBody = ReposCreateDeploymentData; } /** - * @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 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 ReposGetStatusChecksProtection - * @summary Get status checks protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @name ReposCreateDeploymentStatus + * @summary Create a deployment status + * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - export namespace ReposGetStatusChecksProtection { + export namespace ReposCreateDeploymentStatus { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** deployment_id parameter */ + deploymentId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateDeploymentStatusPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetStatusChecksProtectionData; + export type ResponseBody = ReposCreateDeploymentStatusData; } /** - * @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 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 ReposGetTeamsWithAccessToProtectedBranch - * @summary Get teams with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @name ReposCreateDispatchEvent + * @summary Create a repository dispatch event + * @request POST:/repos/{owner}/{repo}/dispatches */ - export namespace ReposGetTeamsWithAccessToProtectedBranch { + export namespace ReposCreateDispatchEvent { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateDispatchEventPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetTeamsWithAccessToProtectedBranchData; + export type ResponseBody = ReposCreateDispatchEventData; } /** - * @description Get the top 10 popular contents over the last 14 days. + * @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 ReposGetTopPaths - * @summary Get top referral paths - * @request GET:/repos/{owner}/{repo}/traffic/popular/paths + * @name ReposCreateFork + * @summary Create a fork + * @request POST:/repos/{owner}/{repo}/forks */ - export namespace ReposGetTopPaths { + export namespace ReposCreateFork { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateForkPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetTopPathsData; + export type ResponseBody = ReposCreateForkData; } /** - * @description Get the top 10 referrers over the last 14 days. + * @description Creates a new file or replaces an existing file in a repository. * @tags repos - * @name ReposGetTopReferrers - * @summary Get top referral sources - * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers + * @name ReposCreateOrUpdateFileContents + * @summary Create or update file contents + * @request PUT:/repos/{owner}/{repo}/contents/{path} */ - export namespace ReposGetTopReferrers { + export namespace ReposCreateOrUpdateFileContents { export type RequestParams = { owner: string; + /** path+ parameter */ + path: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateOrUpdateFileContentsPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetTopReferrersData; + export type ResponseBody = ReposCreateOrUpdateFileContentsData; } /** - * @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 Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." * @tags repos - * @name ReposGetUsersWithAccessToProtectedBranch - * @summary Get users with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @name ReposCreatePagesSite + * @summary Create a GitHub Pages site + * @request POST:/repos/{owner}/{repo}/pages */ - export namespace ReposGetUsersWithAccessToProtectedBranch { + export namespace ReposCreatePagesSite { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreatePagesSitePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetUsersWithAccessToProtectedBranchData; + export type ResponseBody = ReposCreatePagesSiteData; } /** - * @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 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 ReposGetViews - * @summary Get page views - * @request GET:/repos/{owner}/{repo}/traffic/views + * @name ReposCreateRelease + * @summary Create a release + * @request POST:/repos/{owner}/{repo}/releases */ - export namespace ReposGetViews { + export namespace ReposCreateRelease { 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 RequestQuery = {}; + export type RequestBody = ReposCreateReleasePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetViewsData; + export type ResponseBody = ReposCreateReleaseData; } /** - * @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 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 ReposGetWebhook - * @summary Get a repository webhook - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} + * @name ReposCreateUsingTemplate + * @summary Create a repository using a template + * @request POST:/repos/{template_owner}/{template_repo}/generate */ - export namespace ReposGetWebhook { + export namespace ReposCreateUsingTemplate { export type RequestParams = { - hookId: number; - owner: string; - repo: string; + templateOwner: string; + templateRepo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateUsingTemplatePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetWebhookData; + export type ResponseBody = ReposCreateUsingTemplateData; } /** - * @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 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 ReposGetWebhookConfigForRepo - * @summary Get a webhook configuration for a repository - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @name ReposCreateWebhook + * @summary Create a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks */ - export namespace ReposGetWebhookConfigForRepo { + export namespace ReposCreateWebhook { export type RequestParams = { - hookId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposCreateWebhookPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposGetWebhookConfigForRepoData; + export type ResponseBody = ReposCreateWebhookData; } /** - * No description + * @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 ReposListBranches - * @summary List branches - * @request GET:/repos/{owner}/{repo}/branches + * @name ReposDelete + * @summary Delete a repository + * @request DELETE:/repos/{owner}/{repo} */ - export namespace ReposListBranches { + export namespace ReposDelete { 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListBranchesData; + export type ResponseBody = ReposDeleteData; } /** - * @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 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 ReposListBranchesForHeadCommit - * @summary List branches for HEAD commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + * @name ReposDeleteAccessRestrictions + * @summary Delete access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - export namespace ReposListBranchesForHeadCommit { + export namespace ReposDeleteAccessRestrictions { export type RequestParams = { - /** commit_sha parameter */ - commitSha: 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 = ReposListBranchesForHeadCommitData; + export type ResponseBody = ReposDeleteAccessRestrictionsData; } /** - * @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 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 ReposListCollaborators - * @summary List repository collaborators - * @request GET:/repos/{owner}/{repo}/collaborators + * @name ReposDeleteAdminBranchProtection + * @summary Delete admin branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - export namespace ReposListCollaborators { + export namespace ReposDeleteAdminBranchProtection { export type RequestParams = { + /** The name of the branch. */ + branch: string; 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListCollaboratorsData; + export type ResponseBody = ReposDeleteAdminBranchProtectionData; } /** - * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. + * @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 ReposListCommentsForCommit - * @summary List commit comments - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @name ReposDeleteBranchProtection + * @summary Delete branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection */ - export namespace ReposListCommentsForCommit { + export namespace ReposDeleteBranchProtection { export type RequestParams = { - /** commit_sha parameter */ - commitSha: 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 = ReposListCommentsForCommitData; + export type ResponseBody = ReposDeleteBranchProtectionData; } /** - * @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 + * @name ReposDeleteCommitComment + * @summary Delete a commit comment + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} */ - export namespace ReposListCommitCommentsForRepo { + export namespace ReposDeleteCommitComment { export type RequestParams = { + /** comment_id parameter */ + commentId: 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 = ReposListCommitCommentsForRepoData; + export type ResponseBody = ReposDeleteCommitCommentData; } /** - * @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 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 ReposListCommits - * @summary List commits - * @request GET:/repos/{owner}/{repo}/commits + * @name ReposDeleteCommitSignatureProtection + * @summary Delete commit signature protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - export namespace ReposListCommits { + export namespace ReposDeleteCommitSignatureProtection { export type RequestParams = { + /** The name of the branch. */ + branch: string; 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListCommitsData; + export type ResponseBody = ReposDeleteCommitSignatureProtectionData; } /** - * @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 Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. * @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; + * @name ReposDeleteDeployKey + * @summary Delete a deploy key + * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} + */ + export namespace ReposDeleteDeployKey { + 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 = ReposListCommitStatusesForRefData; + export type ResponseBody = ReposDeleteDeployKeyData; } /** - * @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 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 ReposListContributors - * @summary List repository contributors - * @request GET:/repos/{owner}/{repo}/contributors + * @name ReposDeleteDeployment + * @summary Delete a deployment + * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} */ - export namespace ReposListContributors { + export namespace ReposDeleteDeployment { export type RequestParams = { + /** deployment_id parameter */ + deploymentId: number; 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 = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListContributorsData; + export type ResponseBody = ReposDeleteDeploymentData; } /** - * No description + * @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 ReposListDeployKeys - * @summary List deploy keys - * @request GET:/repos/{owner}/{repo}/keys + * @name ReposDeleteFile + * @summary Delete a file + * @request DELETE:/repos/{owner}/{repo}/contents/{path} */ - export namespace ReposListDeployKeys { + export namespace ReposDeleteFile { export type RequestParams = { 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; - }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposDeleteFilePayload; export type RequestHeaders = {}; - export type ResponseBody = ReposListDeployKeysData; + export type ResponseBody = ReposDeleteFileData; } /** - * @description Simple filtering of deployments is available via query parameters: + * No description * @tags repos - * @name ReposListDeployments - * @summary List deployments - * @request GET:/repos/{owner}/{repo}/deployments + * @name ReposDeleteInvitation + * @summary Delete a repository invitation + * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} */ - export namespace ReposListDeployments { + export namespace ReposDeleteInvitation { export type RequestParams = { + /** invitation_id parameter */ + invitationId: number; 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListDeploymentsData; + export type ResponseBody = ReposDeleteInvitationData; } /** - * @description Users with pull access can view deployment statuses for a deployment: + * No description * @tags repos - * @name ReposListDeploymentStatuses - * @summary List deployment statuses - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @name ReposDeletePagesSite + * @summary Delete a GitHub Pages site + * @request DELETE:/repos/{owner}/{repo}/pages */ - export namespace ReposListDeploymentStatuses { + export namespace ReposDeletePagesSite { 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListDeploymentStatusesData; + export type ResponseBody = ReposDeletePagesSiteData; } /** - * 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 ReposListForks - * @summary List forks - * @request GET:/repos/{owner}/{repo}/forks + * @name ReposDeletePullRequestReviewProtection + * @summary Delete pull request review protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - export namespace ReposListForks { + export namespace ReposDeletePullRequestReviewProtection { export type RequestParams = { + /** 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; - /** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" - */ - sort?: ReposListForksParams1SortEnum; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListForksData; + export type ResponseBody = ReposDeletePullRequestReviewProtectionData; } /** - * @description When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. + * @description Users with push access to the repository can delete a release. * @tags repos - * @name ReposListInvitations - * @summary List repository invitations - * @request GET:/repos/{owner}/{repo}/invitations + * @name ReposDeleteRelease + * @summary Delete a release + * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} */ - export namespace ReposListInvitations { + export namespace ReposDeleteRelease { 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListInvitationsData; + export type ResponseBody = ReposDeleteReleaseData; } /** - * @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 + * @name ReposDeleteReleaseAsset + * @summary Delete a release asset + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - export namespace ReposListLanguages { + export namespace ReposDeleteReleaseAsset { 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 = ReposListLanguagesData; + export type ResponseBody = ReposDeleteReleaseAssetData; } /** * No description * @tags repos - * @name ReposListPagesBuilds - * @summary List GitHub Pages builds - * @request GET:/repos/{owner}/{repo}/pages/builds + * @name ReposDeleteWebhook + * @summary Delete a repository webhook + * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} */ - export namespace ReposListPagesBuilds { + export namespace ReposDeleteWebhook { 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 = ReposListPagesBuildsData; + export type ResponseBody = ReposDeleteWebhookData; } /** - * @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. + * @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 ReposListPullRequestsAssociatedWithCommit - * @summary List pull requests associated with a commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls + * @name ReposDisableAutomatedSecurityFixes + * @summary Disable automated security fixes + * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes */ - export namespace ReposListPullRequestsAssociatedWithCommit { + export namespace ReposDisableAutomatedSecurityFixes { 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 = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListPullRequestsAssociatedWithCommitData; + export type ResponseBody = ReposDisableAutomatedSecurityFixesData; } /** - * No description + * @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 ReposListReleaseAssets - * @summary List release assets - * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets + * @name ReposDisableVulnerabilityAlerts + * @summary Disable vulnerability alerts + * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts */ - export namespace ReposListReleaseAssets { + export namespace ReposDisableVulnerabilityAlerts { 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListReleaseAssetsData; + export type ResponseBody = ReposDisableVulnerabilityAlertsData; } /** - * @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. + * @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 ReposListReleases - * @summary List releases - * @request GET:/repos/{owner}/{repo}/releases + * @name ReposDownloadTarballArchive + * @summary Download a repository archive (tar) + * @request GET:/repos/{owner}/{repo}/tarball/{ref} */ - export namespace ReposListReleases { + export namespace ReposDownloadTarballArchive { export type RequestParams = { owner: string; + 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListReleasesData; + export type ResponseBody = any; } /** - * No description + * @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 ReposListTags - * @summary List repository tags - * @request GET:/repos/{owner}/{repo}/tags + * @name ReposDownloadZipballArchive + * @summary Download a repository archive (zip) + * @request GET:/repos/{owner}/{repo}/zipball/{ref} */ - export namespace ReposListTags { + export namespace ReposDownloadZipballArchive { export type RequestParams = { owner: string; + 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListTagsData; + export type ResponseBody = any; } /** - * 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 repos - * @name ReposListTeams - * @summary List repository teams - * @request GET:/repos/{owner}/{repo}/teams + * @name ReposEnableAutomatedSecurityFixes + * @summary Enable automated security fixes + * @request PUT:/repos/{owner}/{repo}/automated-security-fixes */ - export namespace ReposListTeams { + export namespace ReposEnableAutomatedSecurityFixes { 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 = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListTeamsData; + export type ResponseBody = ReposEnableAutomatedSecurityFixesData; } /** - * No description + * @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 ReposListWebhooks - * @summary List repository webhooks - * @request GET:/repos/{owner}/{repo}/hooks + * @name ReposEnableVulnerabilityAlerts + * @summary Enable vulnerability alerts + * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts */ - export namespace ReposListWebhooks { + export namespace ReposEnableVulnerabilityAlerts { 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 = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListWebhooksData; + export type ResponseBody = ReposEnableVulnerabilityAlertsData; } /** - * No description + * @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 ReposMerge - * @summary Merge a branch - * @request POST:/repos/{owner}/{repo}/merges + * @name ReposGet + * @summary Get a repository + * @request GET:/repos/{owner}/{repo} */ - export namespace ReposMerge { + export namespace ReposGet { export type RequestParams = { 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 = ReposGetData; } /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @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 ReposPingWebhook - * @summary Ping a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings + * @name ReposGetAccessRestrictions + * @summary Get access restrictions + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - export namespace ReposPingWebhook { + export namespace ReposGetAccessRestrictions { export type RequestParams = { - hookId: 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 = ReposPingWebhookData; + export type ResponseBody = ReposGetAccessRestrictionsData; } /** - * @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 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 ReposRemoveAppAccessRestrictions - * @summary Remove app access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @name ReposGetAdminBranchProtection + * @summary Get admin branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - export namespace ReposRemoveAppAccessRestrictions { + export namespace ReposGetAdminBranchProtection { export type RequestParams = { /** The name of the branch. */ branch: string; @@ -46262,58 +46745,57 @@ export namespace Repos { repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposRemoveAppAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveAppAccessRestrictionsData; + export type ResponseBody = ReposGetAdminBranchProtectionData; } /** - * 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 ReposRemoveCollaborator - * @summary Remove a repository collaborator - * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} + * @name ReposGetAllStatusCheckContexts + * @summary Get all status check contexts + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - export namespace ReposRemoveCollaborator { + export namespace ReposGetAllStatusCheckContexts { export type RequestParams = { + /** The name of the branch. */ + branch: string; owner: string; repo: string; - username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveCollaboratorData; + export type ResponseBody = ReposGetAllStatusCheckContextsData; } /** - * @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 ReposRemoveStatusCheckContexts - * @summary Remove status check contexts - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @name ReposGetAllTopics + * @summary Get all repository topics + * @request GET:/repos/{owner}/{repo}/topics */ - export namespace ReposRemoveStatusCheckContexts { + export namespace ReposGetAllTopics { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposRemoveStatusCheckContextsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveStatusCheckContextsData; + export type ResponseBody = ReposGetAllTopicsData; } /** - * @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 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 ReposRemoveStatusCheckProtection - * @summary Remove status check protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @name ReposGetAppsWithAccessToProtectedBranch + * @summary Get apps with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - export namespace ReposRemoveStatusCheckProtection { + export namespace ReposGetAppsWithAccessToProtectedBranch { export type RequestParams = { /** The name of the branch. */ branch: string; @@ -46323,17 +46805,17 @@ export namespace Repos { export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveStatusCheckProtectionData; + export type ResponseBody = ReposGetAppsWithAccessToProtectedBranchData; } /** - * @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 + * @name ReposGetBranch + * @summary Get a branch + * @request GET:/repos/{owner}/{repo}/branches/{branch} */ - export namespace ReposRemoveTeamAccessRestrictions { + export namespace ReposGetBranch { export type RequestParams = { /** The name of the branch. */ branch: string; @@ -46341,19 +46823,19 @@ export namespace Repos { repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposRemoveTeamAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveTeamAccessRestrictionsData; + export type ResponseBody = ReposGetBranchData; } /** - * @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 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 ReposRemoveUserAccessRestrictions - * @summary Remove user access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @name ReposGetBranchProtection + * @summary Get branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection */ - export namespace ReposRemoveUserAccessRestrictions { + export namespace ReposGetBranchProtection { export type RequestParams = { /** The name of the branch. */ branch: string; @@ -46361,155 +46843,158 @@ export namespace Repos { repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposRemoveUserAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRemoveUserAccessRestrictionsData; + export type ResponseBody = ReposGetBranchProtectionData; } /** - * @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 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 ReposRenameBranch - * @summary Rename a branch - * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename + * @name ReposGetClones + * @summary Get repository clones + * @request GET:/repos/{owner}/{repo}/traffic/clones */ - export namespace ReposRenameBranch { + export namespace ReposGetClones { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposRenameBranchPayload; + export type RequestQuery = { + /** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ + per?: ReposGetClonesParams1PerEnum; + }; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRenameBranchData; + export type ResponseBody = ReposGetClonesData; } /** - * No description + * @description Returns a weekly aggregate of the number of additions and deletions pushed to a repository. * @tags repos - * @name ReposReplaceAllTopics - * @summary Replace all repository topics - * @request PUT:/repos/{owner}/{repo}/topics + * @name ReposGetCodeFrequencyStats + * @summary Get the weekly commit activity + * @request GET:/repos/{owner}/{repo}/stats/code_frequency */ - export namespace ReposReplaceAllTopics { + export namespace ReposGetCodeFrequencyStats { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposReplaceAllTopicsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposReplaceAllTopicsData; + export type ResponseBody = ReposGetCodeFrequencyStatsData; } /** - * @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 Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. * @tags repos - * @name ReposRequestPagesBuild - * @summary Request a GitHub Pages build - * @request POST:/repos/{owner}/{repo}/pages/builds + * @name ReposGetCollaboratorPermissionLevel + * @summary Get repository permissions for a user + * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission */ - export namespace ReposRequestPagesBuild { + export namespace ReposGetCollaboratorPermissionLevel { export type RequestParams = { owner: string; repo: string; + username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposRequestPagesBuildData; + export type ResponseBody = ReposGetCollaboratorPermissionLevelData; } /** - * @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 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 ReposSetAdminBranchProtection - * @summary Set admin branch protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @name ReposGetCombinedStatusForRef + * @summary Get the combined status for a specific reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status */ - export namespace ReposSetAdminBranchProtection { + export namespace ReposGetCombinedStatusForRef { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposSetAdminBranchProtectionData; + export type ResponseBody = ReposGetCombinedStatusForRefData; } /** - * @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 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 ReposSetAppAccessRestrictions - * @summary Set app access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @name ReposGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/commits/{ref} */ - export namespace ReposSetAppAccessRestrictions { + export namespace ReposGetCommit { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; + /** ref+ parameter */ + ref: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposSetAppAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposSetAppAccessRestrictionsData; + export type ResponseBody = ReposGetCommitData; } /** - * @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 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 ReposSetStatusCheckContexts - * @summary Set status check contexts - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @name ReposGetCommitActivityStats + * @summary Get the last year of commit activity + * @request GET:/repos/{owner}/{repo}/stats/commit_activity */ - export namespace ReposSetStatusCheckContexts { + export namespace ReposGetCommitActivityStats { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposSetStatusCheckContextsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposSetStatusCheckContextsData; + export type ResponseBody = ReposGetCommitActivityStatsData; } /** - * @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. | + * No description * @tags repos - * @name ReposSetTeamAccessRestrictions - * @summary Set team access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @name ReposGetCommitComment + * @summary Get a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id} */ - export namespace ReposSetTeamAccessRestrictions { + export namespace ReposGetCommitComment { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** comment_id parameter */ + commentId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposSetTeamAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposSetTeamAccessRestrictionsData; + export type ResponseBody = ReposGetCommitCommentData; } /** - * @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 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 ReposSetUserAccessRestrictions - * @summary Set user access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @name ReposGetCommitSignatureProtection + * @summary Get commit signature protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - export namespace ReposSetUserAccessRestrictions { + export namespace ReposGetCommitSignatureProtection { export type RequestParams = { /** The name of the branch. */ branch: string; @@ -46517,778 +47002,841 @@ export namespace Repos { repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposSetUserAccessRestrictionsPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposSetUserAccessRestrictionsData; + export type ResponseBody = ReposGetCommitSignatureProtectionData; } /** - * @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 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 ReposTestPushWebhook - * @summary Test the push repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests + * @name ReposGetCommunityProfileMetrics + * @summary Get community profile metrics + * @request GET:/repos/{owner}/{repo}/community/profile */ - export namespace ReposTestPushWebhook { + export namespace ReposGetCommunityProfileMetrics { export type RequestParams = { - hookId: number; owner: string; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposTestPushWebhookData; + export type ResponseBody = ReposGetCommunityProfileMetricsData; } /** - * @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 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 ReposTransfer - * @summary Transfer a repository - * @request POST:/repos/{owner}/{repo}/transfer + * @name ReposGetContent + * @summary Get repository content + * @request GET:/repos/{owner}/{repo}/contents/{path} */ - export namespace ReposTransfer { + export namespace ReposGetContent { export type RequestParams = { owner: string; + /** path+ parameter */ + path: string; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ReposTransferPayload; + export type RequestQuery = { + /** 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 = ReposTransferData; + export type ResponseBody = ReposGetContentData; } /** - * @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 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 ReposUpdate - * @summary Update a repository - * @request PATCH:/repos/{owner}/{repo} + * @name ReposGetContributorsStats + * @summary Get all contributor commit activity + * @request GET:/repos/{owner}/{repo}/stats/contributors */ - export namespace ReposUpdate { + export namespace ReposGetContributorsStats { export type RequestParams = { owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdatePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateData; + export type ResponseBody = ReposGetContributorsStatsData; } /** - * @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. + * No description * @tags repos - * @name ReposUpdateBranchProtection - * @summary Update branch protection - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection + * @name ReposGetDeployKey + * @summary Get a deploy key + * @request GET:/repos/{owner}/{repo}/keys/{key_id} */ - export namespace ReposUpdateBranchProtection { + export namespace ReposGetDeployKey { export type RequestParams = { - /** The name of the branch. */ - branch: string; + /** key_id parameter */ + keyId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateBranchProtectionPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateBranchProtectionData; + export type ResponseBody = ReposGetDeployKeyData; } /** * No description * @tags repos - * @name ReposUpdateCommitComment - * @summary Update a commit comment - * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} + * @name ReposGetDeployment + * @summary Get a deployment + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} */ - export namespace ReposUpdateCommitComment { + export namespace ReposGetDeployment { export type RequestParams = { - /** comment_id parameter */ - commentId: number; + /** deployment_id parameter */ + deploymentId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateCommitCommentPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateCommitCommentData; + export type ResponseBody = ReposGetDeploymentData; } /** - * @description Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). + * @description Users with pull access can view a deployment status for a deployment: * @tags repos - * @name ReposUpdateInformationAboutPagesSite - * @summary Update information about a GitHub Pages site - * @request PUT:/repos/{owner}/{repo}/pages + * @name ReposGetDeploymentStatus + * @summary Get a deployment status + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} */ - export namespace ReposUpdateInformationAboutPagesSite { + export namespace ReposGetDeploymentStatus { export type RequestParams = { + /** deployment_id parameter */ + deploymentId: number; owner: string; repo: string; + statusId: number; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateInformationAboutPagesSitePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateInformationAboutPagesSiteData; + export type ResponseBody = ReposGetDeploymentStatusData; } /** * No description * @tags repos - * @name ReposUpdateInvitation - * @summary Update a repository invitation - * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} + * @name ReposGetLatestPagesBuild + * @summary Get latest Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/latest */ - export namespace ReposUpdateInvitation { + export namespace ReposGetLatestPagesBuild { 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 = ReposGetLatestPagesBuildData; } /** - * @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 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 ReposUpdatePullRequestReviewProtection - * @summary Update pull request review protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @name ReposGetLatestRelease + * @summary Get the latest release + * @request GET:/repos/{owner}/{repo}/releases/latest */ - export namespace ReposUpdatePullRequestReviewProtection { + export namespace ReposGetLatestRelease { 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 = ReposGetLatestReleaseData; } /** - * @description Users with push access to the repository can edit a release. + * No description * @tags repos - * @name ReposUpdateRelease - * @summary Update a release - * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} + * @name ReposGetPages + * @summary Get a GitHub Pages site + * @request GET:/repos/{owner}/{repo}/pages */ - export namespace ReposUpdateRelease { + export namespace ReposGetPages { export type RequestParams = { owner: string; - /** release_id parameter */ - releaseId: number; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateReleasePayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateReleaseData; + export type ResponseBody = ReposGetPagesData; } /** - * @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} + * @name ReposGetPagesBuild + * @summary Get GitHub Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} */ - export namespace ReposUpdateReleaseAsset { + export namespace ReposGetPagesBuild { export type RequestParams = { - /** asset_id parameter */ - assetId: number; + buildId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateReleaseAssetPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateReleaseAssetData; + export type ResponseBody = ReposGetPagesBuildData; } /** - * @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 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 ReposUpdateStatusCheckProtection - * @summary Update status check protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @name ReposGetParticipationStats + * @summary Get the weekly commit count + * @request GET:/repos/{owner}/{repo}/stats/participation */ - export namespace ReposUpdateStatusCheckProtection { + export namespace ReposGetParticipationStats { export type RequestParams = { - /** The name of the branch. */ - branch: string; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateStatusCheckProtectionPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateStatusCheckProtectionData; + export type ResponseBody = ReposGetParticipationStatsData; } /** - * @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 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 ReposUpdateWebhook - * @summary Update a repository webhook - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} + * @name ReposGetPullRequestReviewProtection + * @summary Get pull request review protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - export namespace ReposUpdateWebhook { + export namespace ReposGetPullRequestReviewProtection { export type RequestParams = { - hookId: number; + /** The name of the branch. */ + branch: 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 = ReposGetPullRequestReviewProtectionData; } /** - * @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 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 ReposUpdateWebhookConfigForRepo - * @summary Update a webhook configuration for a repository - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @name ReposGetPunchCardStats + * @summary Get the hourly commit count for each day + * @request GET:/repos/{owner}/{repo}/stats/punch_card */ - export namespace ReposUpdateWebhookConfigForRepo { + export namespace ReposGetPunchCardStats { export type RequestParams = { - hookId: number; owner: string; repo: string; }; export type RequestQuery = {}; - export type RequestBody = ReposUpdateWebhookConfigForRepoPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUpdateWebhookConfigForRepoData; + export type ResponseBody = ReposGetPunchCardStatsData; } /** - * @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 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 ReposUploadReleaseAsset - * @summary Upload a release asset - * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets + * @name ReposGetReadme + * @summary Get a repository README + * @request GET:/repos/{owner}/{repo}/readme */ - export namespace ReposUploadReleaseAsset { + export namespace ReposGetReadme { export type RequestParams = { owner: string; - /** release_id parameter */ - releaseId: number; repo: string; }; export type RequestQuery = { - label?: string; - name?: string; + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ + ref?: string; }; - export type RequestBody = ReposUploadReleaseAssetPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposUploadReleaseAssetData; + export type ResponseBody = ReposGetReadmeData; } /** - * @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} + * @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 SecretScanningGetAlert { + export namespace ReposGetRelease { export type RequestParams = { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; owner: string; + /** release_id parameter */ + releaseId: number; repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SecretScanningGetAlertData; + export type ResponseBody = ReposGetReleaseData; } /** - * @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 + * @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 SecretScanningListAlertsForRepo { + export namespace ReposGetReleaseAsset { export type RequestParams = { + /** asset_id parameter */ + assetId: 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; - /** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ - state?: SecretScanningListAlertsForRepoParams1StateEnum; - }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SecretScanningListAlertsForRepoData; + export type ResponseBody = ReposGetReleaseAssetData; } /** - * @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} + * @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 SecretScanningUpdateAlert { + export namespace ReposGetReleaseByTag { export type RequestParams = { - /** The security alert number, found at the end of the security alert's URL. */ - alertNumber: AlertNumber; owner: string; repo: string; + /** tag+ parameter */ + tag: 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 type ResponseBody = ReposGetReleaseByTagData; } -} -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} + * @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 EnterpriseAdminDeleteScimGroupFromEnterprise { + export namespace ReposGetStatusChecksProtection { 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; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminDeleteScimGroupFromEnterpriseData; + export type ResponseBody = ReposGetStatusChecksProtectionData; } /** - * @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 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 EnterpriseAdminDeleteUserFromEnterprise { + export namespace ReposGetTeamsWithAccessToProtectedBranch { 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; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = EnterpriseAdminDeleteUserFromEnterpriseData; + export type ResponseBody = ReposGetTeamsWithAccessToProtectedBranchData; } /** - * @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} + * @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 EnterpriseAdminGetProvisioningInformationForEnterpriseGroup { + export namespace ReposGetTopPaths { 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; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData; + export type ResponseBody = ReposGetTopPathsData; } /** - * @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} + * @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 EnterpriseAdminGetProvisioningInformationForEnterpriseUser { + export namespace ReposGetTopReferrers { 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 = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminGetProvisioningInformationForEnterpriseUserData; + export type ResponseBody = ReposGetTopReferrersData; } /** - * @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 + * @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 EnterpriseAdminListProvisionedGroupsEnterprise { + export namespace ReposGetUsersWithAccessToProtectedBranch { 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; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListProvisionedGroupsEnterpriseData; + export type ResponseBody = ReposGetUsersWithAccessToProtectedBranchData; } /** - * @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 + * @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 EnterpriseAdminListProvisionedIdentitiesEnterprise { + export namespace ReposGetViews { 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 = { - /** Used for pagination: the number of results to return. */ - count?: number; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; + /** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ + per?: ReposGetViewsParams1PerEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminListProvisionedIdentitiesEnterpriseData; + export type ResponseBody = ReposGetViewsData; } /** - * @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 + * @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 EnterpriseAdminProvisionAndInviteEnterpriseGroup { + export namespace ReposGetWebhook { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; + hookId: 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 = ReposGetWebhookData; } /** - * @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 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 EnterpriseAdminProvisionAndInviteEnterpriseUser { + export namespace ReposGetWebhookConfigForRepo { export type RequestParams = { - /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ - enterprise: string; + hookId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminProvisionAndInviteEnterpriseUserPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminProvisionAndInviteEnterpriseUserData; + export type ResponseBody = ReposGetWebhookConfigForRepoData; } /** - * @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} + * No description + * @tags repos + * @name ReposListBranches + * @summary List branches + * @request GET:/repos/{owner}/{repo}/branches */ - export namespace EnterpriseAdminSetInformationForProvisionedEnterpriseGroup { + export namespace ReposListBranches { 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; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload; + 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 = - EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData; + export type ResponseBody = ReposListBranchesData; } /** - * @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 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 EnterpriseAdminSetInformationForProvisionedEnterpriseUser { + export namespace ReposListBranchesForHeadCommit { 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; + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - EnterpriseAdminSetInformationForProvisionedEnterpriseUserData; + export type ResponseBody = ReposListBranchesForHeadCommitData; } /** - * @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} + * @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 EnterpriseAdminUpdateAttributeForEnterpriseGroup { + export namespace ReposListCollaborators { 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; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload; + 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 = - EnterpriseAdminUpdateAttributeForEnterpriseGroupData; + export type ResponseBody = ReposListCollaboratorsData; } /** - * @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 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 EnterpriseAdminUpdateAttributeForEnterpriseUser { + export namespace ReposListCommentsForCommit { 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; + /** commit_sha parameter */ + commitSha: string; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = - EnterpriseAdminUpdateAttributeForEnterpriseUserPayload; + 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 = - EnterpriseAdminUpdateAttributeForEnterpriseUserData; + export type ResponseBody = ReposListCommentsForCommitData; } /** - * No description - * @tags scim - * @name ScimDeleteUserFromOrg - * @summary Delete a SCIM user from an organization - * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @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 ScimDeleteUserFromOrg { + export namespace ReposListCommitCommentsForRepo { export type RequestParams = { - org: string; - /** scim_user_id parameter */ - scimUserId: 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 = ScimDeleteUserFromOrgData; + export type ResponseBody = ReposListCommitCommentsForRepoData; } /** - * No description - * @tags scim - * @name ScimGetProvisioningInformationForUser - * @summary Get SCIM provisioning information for a user - * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @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 ScimGetProvisioningInformationForUser { + export namespace ReposListCommits { export type RequestParams = { - org: string; - /** scim_user_id parameter */ - scimUserId: string; + 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ScimGetProvisioningInformationForUserData; + export type ResponseBody = ReposListCommitsData; } /** - * @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 + * @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 ScimListProvisionedIdentities { + export namespace ReposListCommitStatusesForRef { export type RequestParams = { - org: string; + owner: string; + /** ref+ parameter */ + ref: 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 = ReposListCommitStatusesForRefData; } /** - * @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 + * @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 */ - export namespace ScimProvisionAndInviteUser { + export namespace ReposListContributors { export type RequestParams = { - org: string; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ScimProvisionAndInviteUserPayload; + 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 = ScimProvisionAndInviteUserData; + export type ResponseBody = ReposListContributorsData; } /** - * @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} + * No description + * @tags repos + * @name ReposListDeployKeys + * @summary List deploy keys + * @request GET:/repos/{owner}/{repo}/keys */ - export namespace ScimSetInformationForProvisionedUser { + export namespace ReposListDeployKeys { export type RequestParams = { - org: string; - /** scim_user_id parameter */ - scimUserId: string; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ScimSetInformationForProvisionedUserPayload; + 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 = ScimSetInformationForProvisionedUserData; + export type ResponseBody = ReposListDeployKeysData; } /** - * @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 Simple filtering of deployments is available via query parameters: + * @tags repos + * @name ReposListDeployments + * @summary List deployments + * @request GET:/repos/{owner}/{repo}/deployments */ - export namespace ScimUpdateAttributeForUser { + export namespace ReposListDeployments { export type RequestParams = { - org: string; - /** scim_user_id parameter */ - scimUserId: string; + owner: string; + repo: string; }; - export type RequestQuery = {}; - export type RequestBody = ScimUpdateAttributeForUserPayload; + 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 = ScimUpdateAttributeForUserData; + export type ResponseBody = ReposListDeploymentsData; } -} -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 + * @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 SearchCode { - export type RequestParams = {}; + export namespace ReposListDeploymentStatuses { + export type RequestParams = { + /** deployment_id parameter */ + deploymentId: 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?: SearchCodeParams1OrderEnum; /** * Page number of the results to fetch. * @default 1 @@ -47299,31 +47847,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 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; + export type ResponseBody = ReposListDeploymentStatusesData; } /** - * @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 repos + * @name ReposListForks + * @summary List forks + * @request GET:/repos/{owner}/{repo}/forks */ - export namespace SearchCommits { - export type RequestParams = {}; + export namespace ReposListForks { + 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?: SearchCommitsParams1OrderEnum; /** * Page number of the results to fetch. * @default 1 @@ -47334,31 +47876,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 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; + /** + * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. + * @default "newest" + */ + sort?: ReposListForksParams1SortEnum; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SearchCommitsData; + export type ResponseBody = ReposListForksData; } /** - * @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 + * @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 SearchIssuesAndPullRequests { - export type RequestParams = {}; + export namespace ReposListInvitations { + 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 @@ -47369,58 +47910,43 @@ 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 = ReposListInvitationsData; } /** - * @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 + * @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 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 ReposListLanguages { + export type RequestParams = { + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SearchLabelsData; + export type ResponseBody = ReposListLanguagesData; } /** - * @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 + * No description + * @tags repos + * @name ReposListPagesBuilds + * @summary List GitHub Pages builds + * @request GET:/repos/{owner}/{repo}/pages/builds */ - export namespace SearchRepos { - export type RequestParams = {}; + export namespace ReposListPagesBuilds { + 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?: SearchReposParams1OrderEnum; /** * Page number of the results to fetch. * @default 1 @@ -47431,49 +47957,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 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 = ReposListPagesBuildsData; } /** - * @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 + * @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 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 ReposListPullRequestsAssociatedWithCommit { + export type RequestParams = { + /** commit_sha parameter */ + commitSha: string; + 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" - */ - order?: SearchUsersParams1OrderEnum; /** * Page number of the results to fetch. * @default 1 @@ -47484,76 +47988,56 @@ 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; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = SearchUsersData; + export type ResponseBody = ReposListPullRequestsAssociatedWithCommitData; } -} -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 + * No description + * @tags repos + * @name ReposListReleaseAssets + * @summary List release assets + * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets */ - export namespace ReactionsCreateForTeamDiscussionCommentLegacy { + export namespace ReposListReleaseAssets { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; }; - 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 = { + /** + * 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 = ReactionsCreateForTeamDiscussionLegacyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsCreateForTeamDiscussionLegacyData; + export type ResponseBody = ReposListReleaseAssetsData; } /** - * @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 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 ReactionsListForTeamDiscussionCommentLegacy { + export namespace ReposListReleases { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: 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 team discussion comment. */ - content?: ReactionsListForTeamDiscussionCommentLegacyParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -47567,25 +48051,22 @@ export namespace Teams { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForTeamDiscussionCommentLegacyData; + export type ResponseBody = ReposListReleasesData; } /** - * @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 + * No description + * @tags repos + * @name ReposListTags + * @summary List repository tags + * @request GET:/repos/{owner}/{repo}/tags */ - export namespace ReactionsListForTeamDiscussionLegacy { + export namespace ReposListTags { export type RequestParams = { - discussionNumber: number; - teamId: 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 team discussion. */ - content?: ReactionsListForTeamDiscussionLegacyParams1ContentEnum; /** * Page number of the results to fetch. * @default 1 @@ -47599,773 +48080,685 @@ export namespace Teams { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReactionsListForTeamDiscussionLegacyData; + export type ResponseBody = ReposListTagsData; } /** - * @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 + * No description + * @tags repos + * @name ReposListTeams + * @summary List repository teams + * @request GET:/repos/{owner}/{repo}/teams */ - export namespace TeamsAddMemberLegacy { + export namespace ReposListTeams { export type RequestParams = { - teamId: number; - 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; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddMemberLegacyData; + export type ResponseBody = ReposListTeamsData; } /** - * @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 + * No description + * @tags repos + * @name ReposListWebhooks + * @summary List repository webhooks + * @request GET:/repos/{owner}/{repo}/hooks */ - export namespace TeamsAddOrUpdateMembershipForUserLegacy { + export namespace ReposListWebhooks { export type RequestParams = { - teamId: number; - username: string; + owner: string; + repo: 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 = { + /** + * 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 = TeamsAddOrUpdateProjectPermissionsLegacyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateProjectPermissionsLegacyData; + export type ResponseBody = ReposListWebhooksData; } /** - * @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 repos + * @name ReposMerge + * @summary Merge a branch + * @request POST:/repos/{owner}/{repo}/merges */ - export namespace TeamsAddOrUpdateRepoPermissionsLegacy { + export namespace ReposMerge { export type RequestParams = { owner: string; repo: string; - teamId: number; }; export type RequestQuery = {}; - export type RequestBody = TeamsAddOrUpdateRepoPermissionsLegacyPayload; + export type RequestBody = ReposMergePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsAddOrUpdateRepoPermissionsLegacyData; + export type ResponseBody = ReposMergeData; } /** - * @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 + * @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 TeamsCheckPermissionsForProjectLegacy { + export namespace ReposPingWebhook { export type RequestParams = { - projectId: number; - teamId: number; + hookId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsCheckPermissionsForProjectLegacyData; + export type ResponseBody = ReposPingWebhookData; } /** - * @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 + * @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 TeamsCheckPermissionsForRepoLegacy { + export namespace ReposRemoveAppAccessRestrictions { export type RequestParams = { + /** The name of the branch. */ + branch: string; owner: string; repo: string; - teamId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposRemoveAppAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsCheckPermissionsForRepoLegacyData; + export type ResponseBody = ReposRemoveAppAccessRestrictionsData; } /** - * @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 + * No description + * @tags repos + * @name ReposRemoveCollaborator + * @summary Remove a repository collaborator + * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} */ - export namespace TeamsCreateDiscussionCommentLegacy { + export namespace ReposRemoveCollaborator { export type RequestParams = { - discussionNumber: number; - teamId: number; + owner: string; + repo: string; + username: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreateDiscussionCommentLegacyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateDiscussionCommentLegacyData; + export type ResponseBody = ReposRemoveCollaboratorData; } /** - * @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 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 TeamsCreateDiscussionLegacy { + export namespace ReposRemoveStatusCheckContexts { export type RequestParams = { - teamId: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsCreateDiscussionLegacyPayload; + export type RequestBody = ReposRemoveStatusCheckContextsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateDiscussionLegacyData; + export type ResponseBody = ReposRemoveStatusCheckContextsData; } /** - * @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 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 TeamsCreateOrUpdateIdpGroupConnectionsLegacy { + export namespace ReposRemoveStatusCheckProtection { export type RequestParams = { - teamId: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = - TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsLegacyData; + export type ResponseBody = ReposRemoveStatusCheckProtectionData; } /** - * @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 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 TeamsDeleteDiscussionCommentLegacy { + export namespace ReposRemoveTeamAccessRestrictions { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposRemoveTeamAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteDiscussionCommentLegacyData; + export type ResponseBody = ReposRemoveTeamAccessRestrictionsData; } /** - * @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 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 TeamsDeleteDiscussionLegacy { + export namespace ReposRemoveUserAccessRestrictions { export type RequestParams = { - discussionNumber: number; - teamId: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposRemoveUserAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteDiscussionLegacyData; + export type ResponseBody = ReposRemoveUserAccessRestrictionsData; } /** - * @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 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 TeamsDeleteLegacy { + export namespace ReposRenameBranch { export type RequestParams = { - teamId: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposRenameBranchPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsDeleteLegacyData; + export type ResponseBody = ReposRenameBranchData; } /** - * @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 + * No description + * @tags repos + * @name ReposReplaceAllTopics + * @summary Replace all repository topics + * @request PUT:/repos/{owner}/{repo}/topics */ - export namespace TeamsGetDiscussionCommentLegacy { + export namespace ReposReplaceAllTopics { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposReplaceAllTopicsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetDiscussionCommentLegacyData; + export type ResponseBody = ReposReplaceAllTopicsData; } /** - * @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 + * @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 TeamsGetDiscussionLegacy { + export namespace ReposRequestPagesBuild { export type RequestParams = { - discussionNumber: number; - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetDiscussionLegacyData; + export type ResponseBody = ReposRequestPagesBuildData; } /** - * @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 + * @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 TeamsGetLegacy { + export namespace ReposSetAdminBranchProtection { export type RequestParams = { - teamId: 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 = TeamsGetLegacyData; + export type ResponseBody = ReposSetAdminBranchProtectionData; } /** - * @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 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 TeamsGetMemberLegacy { + export namespace ReposSetAppAccessRestrictions { export type RequestParams = { - teamId: number; - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposSetAppAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetMemberLegacyData; + export type ResponseBody = ReposSetAppAccessRestrictionsData; } /** - * @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 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 TeamsGetMembershipForUserLegacy { + export namespace ReposSetStatusCheckContexts { export type RequestParams = { - teamId: number; - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposSetStatusCheckContextsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsGetMembershipForUserLegacyData; + export type ResponseBody = ReposSetStatusCheckContextsData; } /** - * @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 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 TeamsListChildLegacy { + export namespace ReposSetTeamAccessRestrictions { 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; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposSetTeamAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsListChildLegacyData; + export type ResponseBody = ReposSetTeamAccessRestrictionsData; } /** - * @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 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 TeamsListDiscussionCommentsLegacy { + export namespace ReposSetUserAccessRestrictions { 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; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposSetUserAccessRestrictionsPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsListDiscussionCommentsLegacyData; + export type ResponseBody = ReposSetUserAccessRestrictionsData; } /** - * @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 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 TeamsListDiscussionsLegacy { + export namespace ReposTestPushWebhook { 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; + hookId: number; + owner: string; + repo: string; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListDiscussionsLegacyData; + export type ResponseBody = ReposTestPushWebhookData; } /** - * @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 + * @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 TeamsListIdpGroupsForLegacy { + export namespace ReposTransfer { export type RequestParams = { - teamId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposTransferPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsListIdpGroupsForLegacyData; + export type ResponseBody = ReposTransferData; } /** - * @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**: 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 TeamsListMembersLegacy { + export namespace ReposUpdate { 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; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposUpdatePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsListMembersLegacyData; + export type ResponseBody = ReposUpdateData; } /** - * @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 + * @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 TeamsListPendingInvitationsLegacy { + export namespace ReposUpdateBranchProtection { 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; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateBranchProtectionPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsListPendingInvitationsLegacyData; + export type ResponseBody = ReposUpdateBranchProtectionData; } /** - * @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 + * No description + * @tags repos + * @name ReposUpdateCommitComment + * @summary Update a commit comment + * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} */ - export namespace TeamsListProjectsLegacy { + export namespace ReposUpdateCommitComment { 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; + /** comment_id parameter */ + commentId: number; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateCommitCommentPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsListProjectsLegacyData; + export type ResponseBody = ReposUpdateCommitCommentData; } /** - * @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 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 TeamsListReposLegacy { + export namespace ReposUpdateInformationAboutPagesSite { 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; + owner: string; + repo: string; }; - export type RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReposUpdateInformationAboutPagesSitePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsListReposLegacyData; + export type ResponseBody = ReposUpdateInformationAboutPagesSiteData; } /** - * @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 + * No description + * @tags repos + * @name ReposUpdateInvitation + * @summary Update a repository invitation + * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} */ - export namespace TeamsRemoveMemberLegacy { + export namespace ReposUpdateInvitation { export type RequestParams = { - teamId: number; - username: string; + /** invitation_id parameter */ + invitationId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposUpdateInvitationPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveMemberLegacyData; + export type ResponseBody = ReposUpdateInvitationData; } /** - * @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 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 TeamsRemoveMembershipForUserLegacy { + export namespace ReposUpdatePullRequestReviewProtection { export type RequestParams = { - teamId: number; - username: string; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposUpdatePullRequestReviewProtectionPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveMembershipForUserLegacyData; + export type ResponseBody = ReposUpdatePullRequestReviewProtectionData; } /** - * @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 + * @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 TeamsRemoveProjectLegacy { + export namespace ReposUpdateRelease { export type RequestParams = { - projectId: number; - teamId: number; + owner: string; + /** release_id parameter */ + releaseId: number; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposUpdateReleasePayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveProjectLegacyData; + export type ResponseBody = ReposUpdateReleaseData; } /** - * @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 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 TeamsRemoveRepoLegacy { + export namespace ReposUpdateReleaseAsset { export type RequestParams = { + /** asset_id parameter */ + assetId: number; owner: string; repo: string; - teamId: number; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ReposUpdateReleaseAssetPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsRemoveRepoLegacyData; + export type ResponseBody = ReposUpdateReleaseAssetData; } /** - * @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 + * @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 TeamsUpdateDiscussionCommentLegacy { + export namespace ReposUpdateStatusCheckProtection { export type RequestParams = { - commentNumber: number; - discussionNumber: number; - teamId: number; + /** The name of the branch. */ + branch: string; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateDiscussionCommentLegacyPayload; + export type RequestBody = ReposUpdateStatusCheckProtectionPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateDiscussionCommentLegacyData; + export type ResponseBody = ReposUpdateStatusCheckProtectionData; } /** - * @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 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 TeamsUpdateDiscussionLegacy { + export namespace ReposUpdateWebhook { export type RequestParams = { - discussionNumber: number; - teamId: number; + hookId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateDiscussionLegacyPayload; + export type RequestBody = ReposUpdateWebhookPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateDiscussionLegacyData; + export type ResponseBody = ReposUpdateWebhookData; } /** - * @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 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 TeamsUpdateLegacy { + export namespace ReposUpdateWebhookConfigForRepo { export type RequestParams = { - teamId: number; + hookId: number; + owner: string; + repo: string; }; export type RequestQuery = {}; - export type RequestBody = TeamsUpdateLegacyPayload; + export type RequestBody = ReposUpdateWebhookConfigForRepoPayload; export type RequestHeaders = {}; - export type ResponseBody = TeamsUpdateLegacyData; + export type ResponseBody = ReposUpdateWebhookConfigForRepoData; } -} -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 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 ActivityCheckRepoIsStarredByAuthenticatedUser { + export namespace ReposUploadReleaseAsset { export type RequestParams = { owner: string; + /** release_id parameter */ + releaseId: number; repo: string; }; - export type RequestQuery = {}; - export type RequestBody = never; + export type RequestQuery = { + label?: string; + name?: string; + }; + export type RequestBody = ReposUploadReleaseAssetPayload; export type RequestHeaders = {}; - export type ResponseBody = - ActivityCheckRepoIsStarredByAuthenticatedUserData; + export type ResponseBody = ReposUploadReleaseAssetData; } /** - * @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 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 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 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 = ActivityListReposStarredByAuthenticatedUserData; + export type ResponseBody = SecretScanningGetAlertData; } /** - * @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 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 ActivityListWatchedReposForAuthenticatedUser { - export type RequestParams = {}; + export namespace SecretScanningListAlertsForRepo { + export type RequestParams = { + owner: string; + repo: string; + }; export type RequestQuery = { /** * Page number of the results to fetch. @@ -48377,471 +48770,456 @@ export namespace User { * @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 = ActivityListWatchedReposForAuthenticatedUserData; + export type ResponseBody = SecretScanningListAlertsForRepoData; } /** - * @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 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 ActivityStarRepoForAuthenticatedUser { + 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 = never; + export type RequestBody = SecretScanningUpdateAlertPayload; export type RequestHeaders = {}; - export type ResponseBody = ActivityStarRepoForAuthenticatedUserData; + export type ResponseBody = SecretScanningUpdateAlertData; } +} +export namespace Repositories { /** - * No description - * @tags activity - * @name ActivityUnstarRepoForAuthenticatedUser - * @summary Unstar a repository for the authenticated user - * @request DELETE:/user/starred/{owner}/{repo} + * @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 ActivityUnstarRepoForAuthenticatedUser { - export type RequestParams = { - owner: string; - repo: string; + 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityUnstarRepoForAuthenticatedUserData; + export type ResponseBody = ReposListPublicData; } +} +export namespace Scim { /** - * @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:** 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 AppsAddRepoToInstallation { + export namespace EnterpriseAdminDeleteScimGroupFromEnterprise { export type RequestParams = { - /** installation_id parameter */ - installationId: number; - repositoryId: number; + /** 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 = AppsAddRepoToInstallationData; + export type ResponseBody = EnterpriseAdminDeleteScimGroupFromEnterpriseData; } /** - * @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 **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 AppsListInstallationReposForAuthenticatedUser { + export namespace EnterpriseAdminDeleteUserFromEnterprise { 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; + /** 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 = - AppsListInstallationReposForAuthenticatedUserData; + export type ResponseBody = EnterpriseAdminDeleteUserFromEnterpriseData; } /** - * @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 **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 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 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 = AppsListInstallationsForAuthenticatedUserData; + export type ResponseBody = + EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData; } /** - * @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 **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 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 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 = AppsListSubscriptionsForAuthenticatedUserData; + export type ResponseBody = + EnterpriseAdminGetProvisioningInformationForEnterpriseUserData; } /** - * @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 **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 AppsListSubscriptionsForAuthenticatedUserStubbed { - export type RequestParams = {}; + 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 = { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + /** 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 = - AppsListSubscriptionsForAuthenticatedUserStubbedData; + EnterpriseAdminListProvisionedGroupsEnterpriseData; } /** - * @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 **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 AppsRemoveRepoFromInstallation { + export namespace EnterpriseAdminListProvisionedIdentitiesEnterprise { export type RequestParams = { - /** installation_id parameter */ - installationId: number; - repositoryId: number; + /** 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 RequestQuery = {}; - export type RequestBody = never; - export type RequestHeaders = {}; - export type ResponseBody = AppsRemoveRepoFromInstallationData; - } - - /** - * @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; + EnterpriseAdminListProvisionedIdentitiesEnterpriseData; } /** - * @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 **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 InteractionsRemoveRestrictionsForAuthenticatedUser { - export type RequestParams = {}; + 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 = never; + export type RequestBody = + EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload; export type RequestHeaders = {}; export type ResponseBody = - InteractionsRemoveRestrictionsForAuthenticatedUserData; + EnterpriseAdminProvisionAndInviteEnterpriseGroupData; } /** - * @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 **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 InteractionsSetRestrictionsForAuthenticatedUser { - export type RequestParams = {}; + 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 = InteractionLimit; + export type RequestBody = + EnterpriseAdminProvisionAndInviteEnterpriseUserPayload; export type RequestHeaders = {}; export type ResponseBody = - InteractionsSetRestrictionsForAuthenticatedUserData; + EnterpriseAdminProvisionAndInviteEnterpriseUserData; } /** - * @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; + * @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 RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload; export type RequestHeaders = {}; - export type ResponseBody = IssuesListForAuthenticatedUserData; + export type ResponseBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData; } /** - * @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 **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 MigrationsDeleteArchiveForAuthenticatedUser { + export namespace EnterpriseAdminSetInformationForProvisionedEnterpriseUser { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; + /** 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 RequestBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsDeleteArchiveForAuthenticatedUserData; + export type ResponseBody = + EnterpriseAdminSetInformationForProvisionedEnterpriseUserData; } /** - * @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 **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 MigrationsGetArchiveForAuthenticatedUser { + export namespace EnterpriseAdminUpdateAttributeForEnterpriseGroup { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; + /** 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 RequestBody = + EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload; export type RequestHeaders = {}; - export type ResponseBody = any; + export type ResponseBody = + EnterpriseAdminUpdateAttributeForEnterpriseGroupData; } /** - * @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 **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 MigrationsGetStatusForAuthenticatedUser { + export namespace EnterpriseAdminUpdateAttributeForEnterpriseUser { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; + /** 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 = { - exclude?: 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 = MigrationsGetStatusForAuthenticatedUserData; + export type ResponseBody = ScimDeleteUserFromOrgData; } /** - * @description Lists all migrations a user has started. - * @tags migrations - * @name MigrationsListForAuthenticatedUser - * @summary List user migrations - * @request GET:/user/migrations + * 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 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 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 = MigrationsListForAuthenticatedUserData; + export type ResponseBody = ScimGetProvisioningInformationForUserData; } /** - * @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 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 MigrationsListReposForUser { + export namespace ScimListProvisionedIdentities { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; + org: string; }; export type RequestQuery = { + /** 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; }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = MigrationsListReposForUserData; + export type ResponseBody = ScimListProvisionedIdentitiesData; } /** - * @description Initiates the generation of a user migration archive. - * @tags migrations - * @name MigrationsStartForAuthenticatedUser - * @summary Start a user migration - * @request POST:/user/migrations + * @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 MigrationsStartForAuthenticatedUser { - export type RequestParams = {}; + export namespace ScimProvisionAndInviteUser { + export type RequestParams = { + org: string; + }; export type RequestQuery = {}; - export type RequestBody = MigrationsStartForAuthenticatedUserPayload; + export type RequestBody = ScimProvisionAndInviteUserPayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsStartForAuthenticatedUserData; + export type ResponseBody = ScimProvisionAndInviteUserData; } /** - * @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 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 MigrationsUnlockRepoForAuthenticatedUser { + export namespace ScimSetInformationForProvisionedUser { export type RequestParams = { - /** migration_id parameter */ - migrationId: number; - /** repo_name parameter */ - repoName: string; + org: string; + /** scim_user_id parameter */ + scimUserId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ScimSetInformationForProvisionedUserPayload; export type RequestHeaders = {}; - export type ResponseBody = MigrationsUnlockRepoForAuthenticatedUserData; + export type ResponseBody = ScimSetInformationForProvisionedUserData; } /** - * No description - * @tags orgs - * @name OrgsGetMembershipForAuthenticatedUser - * @summary Get an organization membership for the authenticated user - * @request GET:/user/memberships/orgs/{org} + * @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 OrgsGetMembershipForAuthenticatedUser { + export namespace ScimUpdateAttributeForUser { export type RequestParams = { org: string; + /** scim_user_id parameter */ + scimUserId: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ScimUpdateAttributeForUserPayload; export type RequestHeaders = {}; - export type ResponseBody = OrgsGetMembershipForAuthenticatedUserData; + export type ResponseBody = ScimUpdateAttributeForUserData; } +} +export namespace Search { /** - * @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 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 OrgsListForAuthenticatedUser { + 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 @@ -48852,22 +49230,31 @@ export namespace User { * @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 = OrgsListForAuthenticatedUserData; + export type ResponseBody = SearchCodeData; } /** - * No description - * @tags orgs - * @name OrgsListMembershipsForAuthenticatedUser - * @summary List organization memberships for the authenticated user - * @request GET:/user/memberships/orgs + * @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 OrgsListMembershipsForAuthenticatedUser { + 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 @@ -48878,119 +49265,146 @@ export namespace User { * @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; + /** 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 = OrgsListMembershipsForAuthenticatedUserData; + export type ResponseBody = SearchCommitsData; } /** - * No description - * @tags orgs - * @name OrgsUpdateMembershipForAuthenticatedUser - * @summary Update an organization membership for the authenticated user - * @request PATCH:/user/memberships/orgs/{org} + * @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 OrgsUpdateMembershipForAuthenticatedUser { - export type RequestParams = { - org: string; + 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 RequestQuery = {}; - export type RequestBody = OrgsUpdateMembershipForAuthenticatedUserPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsUpdateMembershipForAuthenticatedUserData; + export type ResponseBody = SearchIssuesAndPullRequestsData; } /** - * No description - * @tags projects - * @name ProjectsCreateForAuthenticatedUser - * @summary Create a user project - * @request POST:/user/projects + * @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 ProjectsCreateForAuthenticatedUser { + export namespace SearchLabels { export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = ProjectsCreateForAuthenticatedUserPayload; - export type RequestHeaders = {}; - export type ResponseBody = ProjectsCreateForAuthenticatedUserData; - } - - /** - * 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 = { + /** + * 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposAcceptInvitationData; + export type ResponseBody = SearchLabelsData; } /** - * @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 + * @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 ReposCreateForAuthenticatedUser { + export namespace SearchRepos { export type RequestParams = {}; - export type RequestQuery = {}; - export type RequestBody = ReposCreateForAuthenticatedUserPayload; + 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 = ReposCreateForAuthenticatedUserData; + export type ResponseBody = SearchReposData; } /** - * No description - * @tags repos - * @name ReposDeclineInvitation - * @summary Decline a repository invitation - * @request DELETE:/user/repository_invitations/{invitation_id} + * @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 ReposDeclineInvitation { - export type RequestParams = { - /** invitation_id parameter */ - invitationId: number; + 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 RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposDeclineInvitationData; + export type ResponseBody = SearchTopicsData; } /** - * @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 + * @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 ReposListForAuthenticatedUser { + export namespace SearchUsers { 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" + * 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" */ - 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; + order?: SearchUsersParams1OrderEnum; /** * Page number of the results to fetch. * @default 1 @@ -49001,41 +49415,76 @@ export namespace User { * @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; + /** 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 RequestBody = never; + export type RequestQuery = {}; + export type RequestBody = ReactionsCreateForTeamDiscussionLegacyPayload; export type RequestHeaders = {}; - export type ResponseBody = ReposListForAuthenticatedUserData; + export type ResponseBody = ReactionsCreateForTeamDiscussionLegacyData; } /** - * @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 + * @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 ReposListInvitationsForAuthenticatedUser { - export type RequestParams = {}; + 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 @@ -49049,19 +49498,25 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ReposListInvitationsForAuthenticatedUserData; + export type ResponseBody = ReactionsListForTeamDiscussionCommentLegacyData; } /** - * @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 **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 TeamsListForAuthenticatedUser { - export type RequestParams = {}; + 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 @@ -49075,248 +49530,345 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = TeamsListForAuthenticatedUserData; + export type ResponseBody = ReactionsListForTeamDiscussionLegacyData; } /** - * @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 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 UsersAddEmailForAuthenticated { - export type RequestParams = {}; + export namespace TeamsAddMemberLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; export type RequestQuery = {}; - export type RequestBody = UsersAddEmailForAuthenticatedPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersAddEmailForAuthenticatedData; + export type ResponseBody = TeamsAddMemberLegacyData; } /** - * No description - * @tags users - * @name UsersBlock - * @summary Block a user - * @request PUT:/user/blocks/{username} + * @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 UsersBlock { + export namespace TeamsAddOrUpdateMembershipForUserLegacy { export type RequestParams = { + teamId: number; username: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = TeamsAddOrUpdateMembershipForUserLegacyPayload; export type RequestHeaders = {}; - export type ResponseBody = UsersBlockData; + export type ResponseBody = TeamsAddOrUpdateMembershipForUserLegacyData; } /** - * No description - * @tags users - * @name UsersCheckBlocked - * @summary Check if a user is blocked by the authenticated user - * @request GET:/user/blocks/{username} + * @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 UsersCheckBlocked { + export namespace TeamsAddOrUpdateProjectPermissionsLegacy { export type RequestParams = { - username: string; + 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 = UsersCheckBlockedData; + export type ResponseBody = TeamsCheckPermissionsForProjectLegacyData; } /** - * No description - * @tags users - * @name UsersCheckPersonIsFollowedByAuthenticated - * @summary Check if a person is followed by the authenticated user - * @request GET:/user/following/{username} + * @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 UsersCheckPersonIsFollowedByAuthenticated { + export namespace TeamsCheckPermissionsForRepoLegacy { export type RequestParams = { - username: string; + owner: string; + repo: string; + teamId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersCheckPersonIsFollowedByAuthenticatedData; + export type ResponseBody = TeamsCheckPermissionsForRepoLegacyData; } /** - * @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 **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 UsersCreateGpgKeyForAuthenticated { - export type RequestParams = {}; + export namespace TeamsCreateDiscussionCommentLegacy { + export type RequestParams = { + discussionNumber: number; + teamId: number; + }; export type RequestQuery = {}; - export type RequestBody = UsersCreateGpgKeyForAuthenticatedPayload; + export type RequestBody = TeamsCreateDiscussionCommentLegacyPayload; export type RequestHeaders = {}; - export type ResponseBody = UsersCreateGpgKeyForAuthenticatedData; + export type ResponseBody = TeamsCreateDiscussionCommentLegacyData; } /** - * @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 **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 UsersCreatePublicSshKeyForAuthenticated { - export type RequestParams = {}; + export namespace TeamsCreateDiscussionLegacy { + export type RequestParams = { + teamId: number; + }; export type RequestQuery = {}; - export type RequestBody = UsersCreatePublicSshKeyForAuthenticatedPayload; + export type RequestBody = TeamsCreateDiscussionLegacyPayload; export type RequestHeaders = {}; - export type ResponseBody = UsersCreatePublicSshKeyForAuthenticatedData; + export type ResponseBody = TeamsCreateDiscussionLegacyData; } /** - * @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 **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 UsersDeleteEmailForAuthenticated { - export type RequestParams = {}; + export namespace TeamsCreateOrUpdateIdpGroupConnectionsLegacy { + export type RequestParams = { + teamId: number; + }; export type RequestQuery = {}; - export type RequestBody = UsersDeleteEmailForAuthenticatedPayload; + export type RequestBody = + TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload; export type RequestHeaders = {}; - export type ResponseBody = UsersDeleteEmailForAuthenticatedData; + export type ResponseBody = TeamsCreateOrUpdateIdpGroupConnectionsLegacyData; } /** - * @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} + * @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 UsersDeleteGpgKeyForAuthenticated { + export namespace TeamsDeleteDiscussionCommentLegacy { export type RequestParams = { - /** gpg_key_id parameter */ - gpgKeyId: number; + commentNumber: number; + discussionNumber: number; + teamId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersDeleteGpgKeyForAuthenticatedData; + export type ResponseBody = TeamsDeleteDiscussionCommentLegacyData; } /** - * @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} + * @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 UsersDeletePublicSshKeyForAuthenticated { + export namespace TeamsDeleteDiscussionLegacy { export type RequestParams = { - /** key_id parameter */ - keyId: number; + discussionNumber: number; + teamId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersDeletePublicSshKeyForAuthenticatedData; + export type ResponseBody = TeamsDeleteDiscussionLegacyData; } /** - * @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 **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 UsersFollow { + export namespace TeamsDeleteLegacy { export type RequestParams = { - username: string; + teamId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersFollowData; + export type ResponseBody = TeamsDeleteLegacyData; } /** - * @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 **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 UsersGetAuthenticated { - export type RequestParams = {}; + 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 = UsersGetAuthenticatedData; + export type ResponseBody = TeamsGetDiscussionCommentLegacyData; } /** - * @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} + * @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 UsersGetGpgKeyForAuthenticated { + export namespace TeamsGetDiscussionLegacy { export type RequestParams = { - /** gpg_key_id parameter */ - gpgKeyId: number; + discussionNumber: number; + teamId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersGetGpgKeyForAuthenticatedData; + export type ResponseBody = TeamsGetDiscussionLegacyData; } /** - * @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} + * @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 UsersGetPublicSshKeyForAuthenticated { + export namespace TeamsGetLegacy { export type RequestParams = { - /** key_id parameter */ - keyId: number; + teamId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersGetPublicSshKeyForAuthenticatedData; + export type ResponseBody = TeamsGetLegacyData; } /** - * @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 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 UsersListBlockedByAuthenticated { - export type RequestParams = {}; + export namespace TeamsGetMemberLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListBlockedByAuthenticatedData; + export type ResponseBody = TeamsGetMemberLegacyData; } /** - * @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 **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 UsersListEmailsForAuthenticated { - export type RequestParams = {}; + 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 **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. @@ -49331,19 +49883,28 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListEmailsForAuthenticatedData; + export type ResponseBody = TeamsListChildLegacyData; } /** - * @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 **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 UsersListFollowedByAuthenticated { - export type RequestParams = {}; + 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 @@ -49357,18 +49918,73 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListFollowedByAuthenticatedData; + export type ResponseBody = TeamsListDiscussionCommentsLegacyData; } /** - * @description Lists the people following the authenticated user. - * @tags users - * @name UsersListFollowersForAuthenticatedUser - * @summary List followers of the authenticated user - * @request GET:/user/followers + * @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 UsersListFollowersForAuthenticatedUser { - export type RequestParams = {}; + 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:** 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:** 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. @@ -49379,22 +49995,33 @@ export namespace User { * Results per page (max 100) * @default 30 */ - per_page?: number; + 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 = UsersListFollowersForAuthenticatedUserData; + export type ResponseBody = TeamsListMembersLegacyData; } /** - * @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 **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 UsersListGpgKeysForAuthenticated { - export type RequestParams = {}; + export namespace TeamsListPendingInvitationsLegacy { + export type RequestParams = { + teamId: number; + }; export type RequestQuery = { /** * Page number of the results to fetch. @@ -49409,18 +50036,21 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListGpgKeysForAuthenticatedData; + export type ResponseBody = TeamsListPendingInvitationsLegacyData; } /** - * @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 **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 UsersListPublicEmailsForAuthenticated { - export type RequestParams = {}; + export namespace TeamsListProjectsLegacy { + export type RequestParams = { + teamId: number; + }; export type RequestQuery = { /** * Page number of the results to fetch. @@ -49435,18 +50065,21 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListPublicEmailsForAuthenticatedData; + export type ResponseBody = TeamsListProjectsLegacyData; } /** - * @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 **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 UsersListPublicSshKeysForAuthenticated { - export type RequestParams = {}; + export namespace TeamsListReposLegacy { + export type RequestParams = { + teamId: number; + }; export type RequestQuery = { /** * Page number of the results to fetch. @@ -49461,89 +50094,179 @@ export namespace User { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListPublicSshKeysForAuthenticatedData; + export type ResponseBody = TeamsListReposLegacyData; } /** - * @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 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 UsersSetPrimaryEmailVisibilityForAuthenticated { - export type RequestParams = {}; + export namespace TeamsRemoveMemberLegacy { + export type RequestParams = { + teamId: number; + username: string; + }; export type RequestQuery = {}; - export type RequestBody = - UsersSetPrimaryEmailVisibilityForAuthenticatedPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = - UsersSetPrimaryEmailVisibilityForAuthenticatedData; + export type ResponseBody = TeamsRemoveMemberLegacyData; } /** - * No description - * @tags users - * @name UsersUnblock - * @summary Unblock a user - * @request DELETE:/user/blocks/{username} + * @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 UsersUnblock { + export namespace TeamsRemoveMembershipForUserLegacy { export type RequestParams = { + teamId: number; username: string; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersUnblockData; + export type ResponseBody = TeamsRemoveMembershipForUserLegacyData; } /** - * @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 **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 UsersUnfollow { + export namespace TeamsRemoveProjectLegacy { export type RequestParams = { - username: string; + projectId: number; + teamId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersUnfollowData; + export type ResponseBody = TeamsRemoveProjectLegacyData; } /** - * @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 + * @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 UsersUpdateAuthenticated { - export type RequestParams = {}; + export namespace TeamsRemoveRepoLegacy { + export type RequestParams = { + owner: string; + repo: string; + teamId: number; + }; export type RequestQuery = {}; - export type RequestBody = UsersUpdateAuthenticatedPayload; + export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersUpdateAuthenticatedData; + export type ResponseBody = TeamsRemoveRepoLegacyData; + } + + /** + * @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 **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 **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; } } -export namespace Users { +export namespace User { /** - * @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 + * @name ActivityCheckRepoIsStarredByAuthenticatedUser + * @summary Check if a repository is starred by the authenticated user + * @request GET:/user/starred/{owner}/{repo} */ - export namespace ActivityListEventsForAuthenticatedUser { + export namespace ActivityCheckRepoIsStarredByAuthenticatedUser { export type RequestParams = { - username: string; + owner: string; + repo: string; }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = + ActivityCheckRepoIsStarredByAuthenticatedUserData; + } + + /** + * @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 @@ -49554,24 +50277,26 @@ export namespace Users { * @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 = ActivityListEventsForAuthenticatedUserData; + export type ResponseBody = ActivityListReposStarredByAuthenticatedUserData; } /** - * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * @description Lists repositories the authenticated user is watching. * @tags activity - * @name ActivityListOrgEventsForAuthenticatedUser - * @summary List organization events for the authenticated user - * @request GET:/users/{username}/events/orgs/{org} + * @name ActivityListWatchedReposForAuthenticatedUser + * @summary List repositories watched by the authenticated user + * @request GET:/user/subscriptions */ - export namespace ActivityListOrgEventsForAuthenticatedUser { - export type RequestParams = { - org: string; - username: string; - }; + export namespace ActivityListWatchedReposForAuthenticatedUser { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -49586,19 +50311,75 @@ export namespace Users { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListOrgEventsForAuthenticatedUserData; + export type ResponseBody = ActivityListWatchedReposForAuthenticatedUserData; + } + + /** + * @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; } /** * No description * @tags activity - * @name ActivityListPublicEventsForUser - * @summary List public events for a user - * @request GET:/users/{username}/events/public + * @name ActivityUnstarRepoForAuthenticatedUser + * @summary Unstar a repository for the authenticated user + * @request DELETE:/user/starred/{owner}/{repo} */ - export namespace ActivityListPublicEventsForUser { + export namespace ActivityUnstarRepoForAuthenticatedUser { export type RequestParams = { - username: string; + owner: string; + repo: string; + }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = ActivityUnstarRepoForAuthenticatedUserData; + } + + /** + * @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 = { /** @@ -49614,20 +50395,19 @@ export namespace Users { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListPublicEventsForUserData; + export type ResponseBody = + AppsListInstallationReposForAuthenticatedUserData; } /** - * @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 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 ActivityListReceivedEventsForUser { - export type RequestParams = { - username: string; - }; + export namespace AppsListInstallationsForAuthenticatedUser { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -49642,20 +50422,18 @@ export namespace Users { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListReceivedEventsForUserData; + export type ResponseBody = AppsListInstallationsForAuthenticatedUserData; } /** - * No description - * @tags activity - * @name ActivityListReceivedPublicEventsForUser - * @summary List public events received by a user - * @request GET:/users/{username}/received_events/public + * @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 ActivityListReceivedPublicEventsForUser { - export type RequestParams = { - username: string; - }; + export namespace AppsListSubscriptionsForAuthenticatedUser { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -49670,26 +50448,19 @@ export namespace Users { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = ActivityListReceivedPublicEventsForUserData; + export type ResponseBody = AppsListSubscriptionsForAuthenticatedUserData; } /** - * @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 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 ActivityListReposStarredByUser { - export type RequestParams = { - username: string; - }; + export namespace AppsListSubscriptionsForAuthenticatedUserStubbed { + export type RequestParams = {}; export type RequestQuery = { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: ActivityListReposStarredByUserParams1DirectionEnum; /** * Page number of the results to fetch. * @default 1 @@ -49700,29 +50471,107 @@ export namespace Users { * @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; + export type ResponseBody = + AppsListSubscriptionsForAuthenticatedUserStubbedData; } /** - * @description Lists repositories a user is watching. - * @tags activity - * @name ActivityListReposWatchedByUser - * @summary List repositories watched by a user - * @request GET:/users/{username}/subscriptions + * @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 ActivityListReposWatchedByUser { + export namespace AppsRemoveRepoFromInstallation { export type RequestParams = { - username: string; + /** installation_id parameter */ + installationId: number; + repositoryId: number; }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = AppsRemoveRepoFromInstallationData; + } + + /** + * @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 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 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 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 @@ -49733,91 +50582,89 @@ export namespace Users { * @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 = 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; + export type ResponseBody = IssuesListForAuthenticatedUserData; } /** - * @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 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 BillingGetGithubActionsBillingUser { + export namespace MigrationsDeleteArchiveForAuthenticatedUser { export type RequestParams = { - username: string; + /** migration_id parameter */ + migrationId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubActionsBillingUserData; + export type ResponseBody = MigrationsDeleteArchiveForAuthenticatedUserData; } /** - * @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 + * @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 BillingGetGithubPackagesBillingUser { + export namespace MigrationsGetArchiveForAuthenticatedUser { export type RequestParams = { - username: string; + /** migration_id parameter */ + migrationId: number; }; export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = BillingGetGithubPackagesBillingUserData; + export type ResponseBody = any; } /** - * @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 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 BillingGetSharedStorageBillingUser { + export namespace MigrationsGetStatusForAuthenticatedUser { export type RequestParams = { - username: string; + /** migration_id parameter */ + migrationId: number; + }; + export type RequestQuery = { + exclude?: string[]; }; - export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = BillingGetSharedStorageBillingUserData; + export type ResponseBody = MigrationsGetStatusForAuthenticatedUserData; } /** - * @description Lists public gists for the specified user: - * @tags gists - * @name GistsListForUser - * @summary List gists for a user - * @request GET:/users/{username}/gists + * @description Lists all migrations a user has started. + * @tags migrations + * @name MigrationsListForAuthenticatedUser + * @summary List user migrations + * @request GET:/user/migrations */ - export namespace GistsListForUser { - export type RequestParams = { - username: string; - }; + export namespace MigrationsListForAuthenticatedUser { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -49829,24 +50676,23 @@ export namespace Users { * @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; + export type ResponseBody = MigrationsListForAuthenticatedUserData; } /** - * @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 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 OrgsListForUser { + export namespace MigrationsListReposForUser { export type RequestParams = { - username: string; + /** migration_id parameter */ + migrationId: number; }; export type RequestQuery = { /** @@ -49862,20 +50708,70 @@ export namespace Users { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = OrgsListForUserData; + export type ResponseBody = MigrationsListReposForUserData; + } + + /** + * @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 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; } /** * No description - * @tags projects - * @name ProjectsListForUser - * @summary List user projects - * @request GET:/users/{username}/projects + * @tags orgs + * @name OrgsGetMembershipForAuthenticatedUser + * @summary Get an organization membership for the authenticated user + * @request GET:/user/memberships/orgs/{org} */ - export namespace ProjectsListForUser { + export namespace OrgsGetMembershipForAuthenticatedUser { export type RequestParams = { - username: string; + org: string; }; + export type RequestQuery = {}; + export type RequestBody = never; + export type RequestHeaders = {}; + export type ResponseBody = OrgsGetMembershipForAuthenticatedUserData; + } + + /** + * @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. @@ -49887,31 +50783,22 @@ export namespace Users { * @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; + export type ResponseBody = OrgsListForAuthenticatedUserData; } /** - * @description Lists public repositories for the specified user. - * @tags repos - * @name ReposListForUser - * @summary List repositories for a user - * @request GET:/users/{username}/repos + * No description + * @tags orgs + * @name OrgsListMembershipsForAuthenticatedUser + * @summary List organization memberships for the authenticated user + * @request GET:/user/memberships/orgs */ - export namespace ReposListForUser { - export type RequestParams = { - username: string; - }; + export namespace OrgsListMembershipsForAuthenticatedUser { + export type RequestParams = {}; 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 @@ -49922,142 +50809,119 @@ export namespace Users { * @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; + /** 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 = ReposListForUserData; + export type ResponseBody = OrgsListMembershipsForAuthenticatedUserData; } /** * No description - * @tags users - * @name UsersCheckFollowingForUser - * @summary Check if a user follows another user - * @request GET:/users/{username}/following/{target_user} + * @tags orgs + * @name OrgsUpdateMembershipForAuthenticatedUser + * @summary Update an organization membership for the authenticated user + * @request PATCH:/user/memberships/orgs/{org} */ - export namespace UsersCheckFollowingForUser { + export namespace OrgsUpdateMembershipForAuthenticatedUser { export type RequestParams = { - targetUser: string; - username: string; + org: string; }; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = OrgsUpdateMembershipForAuthenticatedUserPayload; export type RequestHeaders = {}; - export type ResponseBody = UsersCheckFollowingForUserData; + export type ResponseBody = OrgsUpdateMembershipForAuthenticatedUserData; } /** - * @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} + * No description + * @tags projects + * @name ProjectsCreateForAuthenticatedUser + * @summary Create a user project + * @request POST:/user/projects */ - export namespace UsersGetByUsername { - export type RequestParams = { - username: string; - }; + export namespace ProjectsCreateForAuthenticatedUser { + export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = ProjectsCreateForAuthenticatedUserPayload; export type RequestHeaders = {}; - export type ResponseBody = UsersGetByUsernameData; + export type ResponseBody = ProjectsCreateForAuthenticatedUserData; } /** - * @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 ReposAcceptInvitation + * @summary Accept a repository invitation + * @request PATCH:/user/repository_invitations/{invitation_id} */ - export namespace UsersGetContextForUser { + export namespace ReposAcceptInvitation { 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; + /** invitation_id parameter */ + invitationId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersGetContextForUserData; + export type ResponseBody = ReposAcceptInvitationData; } /** - * @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 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 UsersList { + export namespace ReposCreateForAuthenticatedUser { 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 RequestQuery = {}; + export type RequestBody = ReposCreateForAuthenticatedUserPayload; export type RequestHeaders = {}; - export type ResponseBody = UsersListData; + export type ResponseBody = ReposCreateForAuthenticatedUserData; } /** - * @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 ReposDeclineInvitation + * @summary Decline a repository invitation + * @request DELETE:/user/repository_invitations/{invitation_id} */ - export namespace UsersListFollowersForUser { + export namespace ReposDeclineInvitation { 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; + /** invitation_id parameter */ + invitationId: number; }; + export type RequestQuery = {}; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListFollowersForUserData; + export type ResponseBody = ReposDeclineInvitationData; } /** - * @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 + * @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 UsersListFollowingForUser { - export type RequestParams = { - username: string; - }; + 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 @@ -50068,23 +50932,40 @@ export namespace Users { * @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 = UsersListFollowingForUserData; + export type ResponseBody = ReposListForAuthenticatedUserData; } /** - * @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 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 UsersListGpgKeysForUser { - export type RequestParams = { - username: string; - }; + export namespace ReposListInvitationsForAuthenticatedUser { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -50099,20 +50980,18 @@ export namespace Users { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListGpgKeysForUserData; + export type ResponseBody = ReposListInvitationsForAuthenticatedUserData; } /** - * @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 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 UsersListPublicKeysForUser { - export type RequestParams = { - username: string; - }; + export namespace TeamsListForAuthenticatedUser { + export type RequestParams = {}; export type RequestQuery = { /** * Page number of the results to fetch. @@ -50127,2096 +51006,1485 @@ export namespace Users { }; export type RequestBody = never; export type RequestHeaders = {}; - export type ResponseBody = UsersListPublicKeysForUserData; + export type ResponseBody = TeamsListForAuthenticatedUserData; } -} -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 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 MetaGetZen { + export namespace UsersAddEmailForAuthenticated { export type RequestParams = {}; export type RequestQuery = {}; - export type RequestBody = never; + export type RequestBody = UsersAddEmailForAuthenticatedPayload; export type RequestHeaders = {}; - export type ResponseBody = MetaGetZenData; - } -} - -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); + export type ResponseBody = UsersAddEmailForAuthenticatedData; } - 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}\`)}\`; + /** + * 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; } - protected addQueryParam(query: QueryParamsType, key: string) { - return this.encodeQueryParam(key, query[key]); + /** + * 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; } - 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 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; } - 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 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; } - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? \`?\${queryString}\` : ""; + /** + * @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; } - 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) || {}), - }, - }; + /** + * @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; } - 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 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 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} */ - metaRoot = (params: RequestParams = {}) => - this.request({ - path: \`/\`, - method: "GET", - format: "json", - ...params, - }); - - 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, - }), - - /** - * @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, - }), - - /** - * @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 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 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 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 **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 **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, - }), + 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 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 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 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 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 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 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 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 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 **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 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; + } - /** - * @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 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 **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 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; + } - /** - * @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 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 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 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 **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 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; + } - /** - * @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 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 **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 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 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 **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, - }), + /** + * 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 **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 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 **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 **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 **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, - }), +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; + } - /** - * @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 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 **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, - }), + /** + * 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; + } - /** - * 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 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; + } + + /** + * 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 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 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; + } - /** - * @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 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 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 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 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, - }), + /** + * @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 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 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 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 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 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, - }), + /** + * 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 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, - }), + /** + * @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 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, - }), + /** + * 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 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 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 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 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 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 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 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 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 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 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 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 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, - }), +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 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, - }), +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; - /** - * @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, - }), +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 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, - }), +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; - /** - * @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, - }, - ), +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} - /** - * @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, - }), +export interface HttpResponse + extends Response { + data: D; + error: E; +} - /** - * @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, - }), +type CancelToken = Symbol | string | number; - /** - * @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, - }), +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 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, - }), +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 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, - }), + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; - /** - * @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, - }), + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } - /** - * @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, - }), + 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 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, - }), + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } - /** - * @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, - }), + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } - /** - * @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, - }), + 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 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, - }), + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? \`?\${queryString}\` : ""; + } - /** - * @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, - }), + 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), }; - 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, - }), + + 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; }; - 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, - }), + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } }; - 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 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, - }), + 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; - /** - * 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, - }), + 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; - /** - * 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, - }), + 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; + }); - /** - * 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, - }), + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } - /** - * @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, - }), + if (!response.ok) throw data; + return data; + }); + }; +} - /** - * 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, - }), +/** + * @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 = { /** - * No description + * @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 gists - * @name GistsGetComment - * @summary Get a gist comment - * @request GET:/gists/{gist_id}/comments/{comment_id} + * @tags apps + * @name AppsCreateInstallationAccessToken + * @summary Create an installation access token for an app + * @request POST:/app/installations/{installation_id}/access_tokens */ - gistsGetComment: ( - { gistId, commentId }: GistsGetCommentParams, + appsCreateInstallationAccessToken: ( + { installationId }: AppsCreateInstallationAccessTokenParams, + data: AppsCreateInstallationAccessTokenPayload, params: RequestParams = {}, ) => this.request< - GistsGetCommentData, + AppsCreateInstallationAccessTokenData, + | BasicError | { - block?: { - created_at?: string; - html_url?: string | null; - reason?: string; - }; - documentation_url?: string; - message?: string; + documentation_url: string; + message: string; } - | BasicError + | ValidationError >({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "GET", + path: \`/app/installations/\${installationId}/access_tokens\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @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 gists - * @name GistsGetRevision - * @summary Get a gist revision - * @request GET:/gists/{gist_id}/{sha} + * @tags apps + * @name AppsDeleteInstallation + * @summary Delete an installation for the authenticated app + * @request DELETE:/app/installations/{installation_id} */ - gistsGetRevision: ( - { gistId, sha }: GistsGetRevisionParams, + appsDeleteInstallation: ( + { installationId }: AppsDeleteInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/\${sha}\`, - method: "GET", - format: "json", + this.request({ + path: \`/app/installations/\${installationId}\`, + method: "DELETE", ...params, }), /** - * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: + * @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 gists - * @name GistsList - * @summary List gists for the authenticated user - * @request GET:/gists + * @tags apps + * @name AppsGetAuthenticated + * @summary Get the authenticated app + * @request GET:/app */ - gistsList: (query: GistsListParams, params: RequestParams = {}) => - this.request({ - path: \`/gists\`, + appsGetAuthenticated: (params: RequestParams = {}) => + this.request({ + path: \`/app\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @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 gists - * @name GistsListComments - * @summary List gist comments - * @request GET:/gists/{gist_id}/comments + * @tags apps + * @name AppsGetInstallation + * @summary Get an installation for the authenticated app + * @request GET:/app/installations/{installation_id} */ - gistsListComments: ( - { gistId, ...query }: GistsListCommentsParams, + appsGetInstallation: ( + { installationId }: AppsGetInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/comments\`, + this.request< + AppsGetInstallationData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/app/installations/\${installationId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @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 gists - * @name GistsListCommits - * @summary List gist commits - * @request GET:/gists/{gist_id}/commits + * @tags apps + * @name AppsGetWebhookConfigForApp + * @summary Get a webhook configuration for an app + * @request GET:/app/hook/config */ - gistsListCommits: ( - { gistId, ...query }: GistsListCommitsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/gists/\${gistId}/commits\`, + appsGetWebhookConfigForApp: (params: RequestParams = {}) => + this.request({ + path: \`/app/hook/config\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @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 gists - * @name GistsListForks - * @summary List gist forks - * @request GET:/gists/{gist_id}/forks + * @tags apps + * @name AppsListInstallations + * @summary List installations for the authenticated app + * @request GET:/app/installations */ - gistsListForks: ( - { gistId, ...query }: GistsListForksParams, + appsListInstallations: ( + query: AppsListInstallationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/forks\`, + this.request({ + path: \`/app/installations\`, method: "GET", query: query, format: "json", @@ -52224,521 +52492,494 @@ export class Api< }), /** - * @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. + * @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 gists - * @name GistsListPublic - * @summary List public gists - * @request GET:/gists/public + * @tags apps + * @name AppsSuspendInstallation + * @summary Suspend an app installation + * @request PUT:/app/installations/{installation_id}/suspended */ - gistsListPublic: ( - query: GistsListPublicParams, + appsSuspendInstallation: ( + { installationId }: AppsSuspendInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/public\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/app/installations/\${installationId}/suspended\`, + method: "PUT", ...params, }), /** - * @description List the authenticated user's starred gists: + * @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 gists - * @name GistsListStarred - * @summary List starred gists - * @request GET:/gists/starred + * @tags apps + * @name AppsUnsuspendInstallation + * @summary Unsuspend an app installation + * @request DELETE:/app/installations/{installation_id}/suspended */ - gistsListStarred: ( - query: GistsListStarredParams, + appsUnsuspendInstallation: ( + { installationId }: AppsUnsuspendInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/starred\`, - 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)." - * - * @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, - }), - - /** - * 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\`, + this.request({ + path: \`/app/installations/\${installationId}/suspended\`, method: "DELETE", ...params, }), /** - * @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. + * @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 gists - * @name GistsUpdate - * @summary Update a gist - * @request PATCH:/gists/{gist_id} + * @tags apps + * @name AppsUpdateWebhookConfigForApp + * @summary Update a webhook configuration for an app + * @request PATCH:/app/hook/config */ - gistsUpdate: ( - { gistId }: GistsUpdateParams, - data: GistsUpdatePayload, + appsUpdateWebhookConfigForApp: ( + data: AppsUpdateWebhookConfigForAppPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}\`, + this.request({ + path: \`/app/hook/config\`, method: "PATCH", body: data, type: ContentType.Json, format: "json", ...params, }), - + }; + appManifests = { /** - * No description + * @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 gists - * @name GistsUpdateComment - * @summary Update a gist comment - * @request PATCH:/gists/{gist_id}/comments/{comment_id} + * @tags apps + * @name AppsCreateFromManifest + * @summary Create a GitHub App from a manifest + * @request POST:/app-manifests/{code}/conversions */ - gistsUpdateComment: ( - { gistId, commentId }: GistsUpdateCommentParams, - data: GistsUpdateCommentPayload, + appsCreateFromManifest: ( + { code }: AppsCreateFromManifestParams, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request< + AppsCreateFromManifestData, + BasicError | ValidationErrorSimple + >({ + path: \`/app-manifests/\${code}/conversions\`, + method: "POST", format: "json", ...params, }), }; - gitignore = { + applications = { /** - * @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). + * @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 gitignore - * @name GitignoreGetAllTemplates - * @summary Get all gitignore templates - * @request GET:/gitignore/templates + * @tags apps + * @name AppsCheckAuthorization + * @summary Check an authorization + * @request GET:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - gitignoreGetAllTemplates: (params: RequestParams = {}) => - this.request({ - path: \`/gitignore/templates\`, + appsCheckAuthorization: ( + { clientId, accessToken }: AppsCheckAuthorizationParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "GET", format: "json", ...params, }), /** - * @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. + * @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 gitignore - * @name GitignoreGetTemplate - * @summary Get a gitignore template - * @request GET:/gitignore/templates/{name} + * @tags apps + * @name AppsCheckToken + * @summary Check a token + * @request POST:/applications/{client_id}/token */ - gitignoreGetTemplate: ( - { name }: GitignoreGetTemplateParams, + appsCheckToken: ( + { clientId }: AppsCheckTokenParams, + data: AppsCheckTokenPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/gitignore/templates/\${name}\`, - method: "GET", + this.request({ + path: \`/applications/\${clientId}/token\`, + method: "POST", + body: data, + type: ContentType.Json, 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. + * @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 AppsListReposAccessibleToInstallation - * @summary List repositories accessible to the app installation - * @request GET:/installation/repositories + * @name AppsDeleteAuthorization + * @summary Delete an app authorization + * @request DELETE:/applications/{client_id}/grant */ - appsListReposAccessibleToInstallation: ( - query: AppsListReposAccessibleToInstallationParams, + appsDeleteAuthorization: ( + { clientId }: AppsDeleteAuthorizationParams, + data: AppsDeleteAuthorizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/installation/repositories\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/applications/\${clientId}/grant\`, + method: "DELETE", + body: data, + type: ContentType.Json, ...params, }), /** - * @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. + * @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 AppsRevokeInstallationAccessToken - * @summary Revoke an installation access token - * @request DELETE:/installation/token + * @name AppsDeleteToken + * @summary Delete an app token + * @request DELETE:/applications/{client_id}/token */ - appsRevokeInstallationAccessToken: (params: RequestParams = {}) => - this.request({ - path: \`/installation/token\`, + appsDeleteToken: ( + { clientId }: AppsDeleteTokenParams, + data: AppsDeleteTokenPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/applications/\${clientId}/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", + body: data, + type: ContentType.Json, ...params, }), /** - * 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 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 licenses - * @name LicensesGetAllCommonlyUsed - * @summary Get all commonly used licenses - * @request GET:/licenses + * @tags apps + * @name AppsResetAuthorization + * @summary Reset an authorization + * @request POST:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - licensesGetAllCommonlyUsed: ( - query: LicensesGetAllCommonlyUsedParams, + appsResetAuthorization: ( + { clientId, accessToken }: AppsResetAuthorizationParams, 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\`, + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, method: "POST", - body: data, - type: ContentType.Json, + format: "json", ...params, }), /** - * @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. + * @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 markdown - * @name MarkdownRenderRaw - * @summary Render a Markdown document in raw mode - * @request POST:/markdown/raw + * @tags apps + * @name AppsResetToken + * @summary Reset a token + * @request PATCH:/applications/{client_id}/token */ - markdownRenderRaw: ( - data: MarkdownRenderRawPayload, + appsResetToken: ( + { clientId }: AppsResetTokenParams, + data: AppsResetTokenPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/markdown/raw\`, - method: "POST", + this.request({ + path: \`/applications/\${clientId}/token\`, + method: "PATCH", body: data, - type: ContentType.Text, + type: ContentType.Json, + format: "json", ...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. + * @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 AppsGetSubscriptionPlanForAccount - * @summary Get a subscription plan for an account - * @request GET:/marketplace_listing/accounts/{account_id} + * @name AppsRevokeAuthorizationForApplication + * @summary Revoke an authorization for an application + * @request DELETE:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - appsGetSubscriptionPlanForAccount: ( - { accountId }: AppsGetSubscriptionPlanForAccountParams, + appsRevokeAuthorizationForApplication: ( + { clientId, accessToken }: AppsRevokeAuthorizationForApplicationParams, params: RequestParams = {}, ) => - this.request< - AppsGetSubscriptionPlanForAccountData, - AppsGetSubscriptionPlanForAccountError - >({ - path: \`/marketplace_listing/accounts/\${accountId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, + method: "DELETE", ...params, }), /** - * @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. + * @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 AppsGetSubscriptionPlanForAccountStubbed - * @summary Get a subscription plan for an account (stubbed) - * @request GET:/marketplace_listing/stubbed/accounts/{account_id} + * @name AppsRevokeGrantForApplication + * @summary Revoke a grant for an application + * @request DELETE:/applications/{client_id}/grants/{access_token} + * @deprecated */ - appsGetSubscriptionPlanForAccountStubbed: ( - { accountId }: AppsGetSubscriptionPlanForAccountStubbedParams, + appsRevokeGrantForApplication: ( + { clientId, accessToken }: AppsRevokeGrantForApplicationParams, params: RequestParams = {}, ) => - this.request< - AppsGetSubscriptionPlanForAccountStubbedData, - BasicError | void - >({ - path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/applications/\${clientId}/grants/\${accessToken}\`, + method: "DELETE", ...params, }), /** - * @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. + * @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 AppsListAccountsForPlan - * @summary List accounts for a plan - * @request GET:/marketplace_listing/plans/{plan_id}/accounts + * @name AppsScopeToken + * @summary Create a scoped access token + * @request POST:/applications/{client_id}/token/scoped */ - appsListAccountsForPlan: ( - { planId, ...query }: AppsListAccountsForPlanParams, + appsScopeToken: ( + { clientId }: AppsScopeTokenParams, + data: AppsScopeTokenPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/marketplace_listing/plans/\${planId}/accounts\`, - method: "GET", - query: query, + this.request({ + path: \`/applications/\${clientId}/token/scoped\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @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. + * @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 apps - * @name AppsListAccountsForPlanStubbed - * @summary List accounts for a plan (stubbed) - * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteGrant + * @summary Delete a grant + * @request DELETE:/applications/grants/{grant_id} + * @deprecated */ - appsListAccountsForPlanStubbed: ( - { planId, ...query }: AppsListAccountsForPlanStubbedParams, + oauthAuthorizationsDeleteGrant: ( + { grantId }: OauthAuthorizationsDeleteGrantParams, params: RequestParams = {}, ) => - this.request({ - path: \`/marketplace_listing/stubbed/plans/\${planId}/accounts\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/applications/grants/\${grantId}\`, + method: "DELETE", ...params, }), /** - * @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. + * @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 apps - * @name AppsListPlans - * @summary List plans - * @request GET:/marketplace_listing/plans + * @tags oauth-authorizations + * @name OauthAuthorizationsGetGrant + * @summary Get a single grant + * @request GET:/applications/grants/{grant_id} + * @deprecated */ - appsListPlans: (query: AppsListPlansParams, params: RequestParams = {}) => - this.request({ - path: \`/marketplace_listing/plans\`, + oauthAuthorizationsGetGrant: ( + { grantId }: OauthAuthorizationsGetGrantParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/applications/grants/\${grantId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @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. + * @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 apps - * @name AppsListPlansStubbed - * @summary List plans (stubbed) - * @request GET:/marketplace_listing/stubbed/plans + * @tags oauth-authorizations + * @name OauthAuthorizationsListGrants + * @summary List your grants + * @request GET:/applications/grants + * @deprecated */ - appsListPlansStubbed: ( - query: AppsListPlansStubbedParams, + oauthAuthorizationsListGrants: ( + query: OauthAuthorizationsListGrantsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/marketplace_listing/stubbed/plans\`, + this.request({ + path: \`/applications/grants\`, method: "GET", query: query, format: "json", ...params, }), }; - meta = { + apps = { /** - * @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. + * @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 meta - * @name MetaGet - * @summary Get GitHub meta information - * @request GET:/meta + * @tags apps + * @name AppsGetBySlug + * @summary Get an app + * @request GET:/apps/{app_slug} */ - metaGet: (params: RequestParams = {}) => - this.request({ - path: \`/meta\`, + appsGetBySlug: ( + { appSlug }: AppsGetBySlugParams, + params: RequestParams = {}, + ) => + this.request< + AppsGetBySlugData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/apps/\${appSlug}\`, method: "GET", format: "json", ...params, }), }; - networks = { + authorizations = { /** - * 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). 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 activity - * @name ActivityListPublicEventsForRepoNetwork - * @summary List public events for a network of repositories - * @request GET:/networks/{owner}/{repo}/events + * @tags oauth-authorizations + * @name OauthAuthorizationsCreateAuthorization + * @summary Create a new authorization + * @request POST:/authorizations + * @deprecated */ - activityListPublicEventsForRepoNetwork: ( - { owner, repo, ...query }: ActivityListPublicEventsForRepoNetworkParams, + oauthAuthorizationsCreateAuthorization: ( + data: OauthAuthorizationsCreateAuthorizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/networks/\${owner}/\${repo}/events\`, - method: "GET", - query: query, + this.request< + OauthAuthorizationsCreateAuthorizationData, + BasicError | ValidationError + >({ + path: \`/authorizations\`, + method: "POST", + body: data, + type: ContentType.Json, 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\`. + * @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 activity - * @name ActivityDeleteThreadSubscription - * @summary Delete a thread subscription - * @request DELETE:/notifications/threads/{thread_id}/subscription + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteAuthorization + * @summary Delete an authorization + * @request DELETE:/authorizations/{authorization_id} + * @deprecated */ - activityDeleteThreadSubscription: ( - { threadId }: ActivityDeleteThreadSubscriptionParams, + oauthAuthorizationsDeleteAuthorization: ( + { authorizationId }: OauthAuthorizationsDeleteAuthorizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, + this.request({ + path: \`/authorizations/\${authorizationId}\`, method: "DELETE", ...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/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 activity - * @name ActivityGetThread - * @summary Get a thread - * @request GET:/notifications/threads/{thread_id} + * @tags oauth-authorizations + * @name OauthAuthorizationsGetAuthorization + * @summary Get a single authorization + * @request GET:/authorizations/{authorization_id} + * @deprecated */ - activityGetThread: ( - { threadId }: ActivityGetThreadParams, + oauthAuthorizationsGetAuthorization: ( + { authorizationId }: OauthAuthorizationsGetAuthorizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/notifications/threads/\${threadId}\`, + this.request({ + path: \`/authorizations/\${authorizationId}\`, method: "GET", format: "json", ...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. + * @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 activity - * @name ActivityGetThreadSubscriptionForAuthenticatedUser - * @summary Get a thread subscription for the authenticated user - * @request GET:/notifications/threads/{thread_id}/subscription + * @tags oauth-authorizations + * @name OauthAuthorizationsGetOrCreateAuthorizationForApp + * @summary Get-or-create an authorization for a specific app + * @request PUT:/authorizations/clients/{client_id} + * @deprecated */ - activityGetThreadSubscriptionForAuthenticatedUser: ( - { threadId }: ActivityGetThreadSubscriptionForAuthenticatedUserParams, + oauthAuthorizationsGetOrCreateAuthorizationForApp: ( + { clientId }: OauthAuthorizationsGetOrCreateAuthorizationForAppParams, + data: OauthAuthorizationsGetOrCreateAuthorizationForAppPayload, params: RequestParams = {}, ) => this.request< - ActivityGetThreadSubscriptionForAuthenticatedUserData, - BasicError + OauthAuthorizationsGetOrCreateAuthorizationForAppData, + BasicError | ValidationError >({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "GET", + path: \`/authorizations/clients/\${clientId}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List all notifications for the current user, sorted by most recently updated. + * @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 activity - * @name ActivityListNotificationsForAuthenticatedUser - * @summary List notifications for the authenticated user - * @request GET:/notifications + * @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 */ - activityListNotificationsForAuthenticatedUser: ( - query: ActivityListNotificationsForAuthenticatedUserParams, + oauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint: ( + { + clientId, + fingerprint, + }: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintParams, + data: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintPayload, params: RequestParams = {}, ) => this.request< - ActivityListNotificationsForAuthenticatedUserData, - BasicError | ValidationError + OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintData, + ValidationError >({ - path: \`/notifications\`, + 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 OauthAuthorizationsListAuthorizations + * @summary List your authorizations + * @request GET:/authorizations + * @deprecated + */ + oauthAuthorizationsListAuthorizations: ( + query: OauthAuthorizationsListAuthorizationsParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/authorizations\`, method: "GET", query: query, format: "json", @@ -52746,22 +52987,49 @@ export class Api< }), /** - * @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\`. + * @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 activity - * @name ActivityMarkNotificationsAsRead - * @summary Mark notifications as read - * @request PUT:/notifications + * @tags oauth-authorizations + * @name OauthAuthorizationsUpdateAuthorization + * @summary Update an existing authorization + * @request PATCH:/authorizations/{authorization_id} + * @deprecated */ - activityMarkNotificationsAsRead: ( - data: ActivityMarkNotificationsAsReadPayload, + oauthAuthorizationsUpdateAuthorization: ( + { authorizationId }: OauthAuthorizationsUpdateAuthorizationParams, + data: OauthAuthorizationsUpdateAuthorizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/notifications\`, - method: "PUT", - body: data, - type: ContentType.Json, + 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, }), @@ -52769,219 +53037,266 @@ export class Api< /** * No description * - * @tags activity - * @name ActivityMarkThreadAsRead - * @summary Mark a thread as read - * @request PATCH:/notifications/threads/{thread_id} + * @tags codes-of-conduct + * @name CodesOfConductGetConductCode + * @summary Get a code of conduct + * @request GET:/codes_of_conduct/{key} */ - activityMarkThreadAsRead: ( - { threadId }: ActivityMarkThreadAsReadParams, + codesOfConductGetConductCode: ( + { key }: CodesOfConductGetConductCodeParams, params: RequestParams = {}, ) => - this.request({ - path: \`/notifications/threads/\${threadId}\`, - method: "PATCH", + this.request< + CodesOfConductGetConductCodeData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/codes_of_conduct/\${key}\`, + method: "GET", + format: "json", ...params, }), - + }; + contentReferences = { /** - * @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. + * @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 activity - * @name ActivitySetThreadSubscription - * @summary Set a thread subscription - * @request PUT:/notifications/threads/{thread_id}/subscription + * @tags apps + * @name AppsCreateContentAttachment + * @summary Create a content attachment + * @request POST:/content_references/{content_reference_id}/attachments */ - activitySetThreadSubscription: ( - { threadId }: ActivitySetThreadSubscriptionParams, - data: ActivitySetThreadSubscriptionPayload, + appsCreateContentAttachment: ( + { contentReferenceId }: AppsCreateContentAttachmentParams, + data: AppsCreateContentAttachmentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "PUT", + 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, }), }; - octocat = { + emojis = { /** - * @description Get the octocat as ASCII art + * @description Lists all the emojis available to use on GitHub. * - * @tags meta - * @name MetaGetOctocat - * @summary Get Octocat - * @request GET:/octocat + * @tags emojis + * @name EmojisGet + * @summary Get emojis + * @request GET:/emojis */ - metaGetOctocat: (query: MetaGetOctocatParams, params: RequestParams = {}) => - this.request({ - path: \`/octocat\`, + emojisGet: (params: RequestParams = {}) => + this.request({ + path: \`/emojis\`, method: "GET", - query: query, + format: "json", ...params, }), }; - organizations = { + enterprises = { /** - * @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. + * @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 OrgsList - * @summary List organizations - * @request GET:/organizations + * @tags audit-log + * @name AuditLogGetAuditLog + * @summary Get the audit log for an enterprise + * @request GET:/enterprises/{enterprise}/audit-log */ - orgsList: (query: OrgsListParams, params: RequestParams = {}) => - this.request({ - path: \`/organizations\`, + auditLogGetAuditLog: ( + { enterprise, ...query }: AuditLogGetAuditLogParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/enterprises/\${enterprise}/audit-log\`, 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. + * @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 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} + * @tags billing + * @name BillingGetGithubActionsBillingGhe + * @summary Get GitHub Actions billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/actions */ - actionsAddRepoAccessToSelfHostedRunnerGroupInOrg: ( - { - org, - runnerGroupId, - repositoryId, - }: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgParams, + billingGetGithubActionsBillingGhe: ( + { enterprise }: BillingGetGithubActionsBillingGheParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, - method: "PUT", + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/actions\`, + method: "GET", + format: "json", ...params, }), /** - * @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 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 actions - * @name ActionsAddSelectedRepoToOrgSecret - * @summary Add selected repository to an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + * @tags billing + * @name BillingGetGithubPackagesBillingGhe + * @summary Get GitHub Packages billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/packages */ - actionsAddSelectedRepoToOrgSecret: ( - { - org, - secretName, - repositoryId, - }: ActionsAddSelectedRepoToOrgSecretParams, + billingGetGithubPackagesBillingGhe: ( + { enterprise }: BillingGetGithubPackagesBillingGheParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, - method: "PUT", + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/packages\`, + method: "GET", + 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. + * @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 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} + * @tags billing + * @name BillingGetSharedStorageBillingGhe + * @summary Get shared storage billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage */ - actionsAddSelfHostedRunnerToGroupForOrg: ( + billingGetSharedStorageBillingGhe: ( + { enterprise }: BillingGetSharedStorageBillingGheParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, + method: "GET", + format: "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: ( { - org, + enterprise, runnerGroupId, - runnerId, - }: ActionsAddSelfHostedRunnerToGroupForOrgParams, + orgId, + }: EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + this.request< + EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, method: "PUT", ...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 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 actions - * @name ActionsCreateOrUpdateOrgSecret - * @summary Create or update an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name} + * @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} */ - actionsCreateOrUpdateOrgSecret: ( - { org, secretName }: ActionsCreateOrUpdateOrgSecretParams, - data: ActionsCreateOrUpdateOrgSecretPayload, + enterpriseAdminAddSelfHostedRunnerToGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + runnerId, + }: EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + this.request< + EnterpriseAdminAddSelfHostedRunnerToGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "PUT", - body: data, - type: ContentType.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 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 actions - * @name ActionsCreateRegistrationTokenForOrg - * @summary Create a registration token for an organization - * @request POST:/orgs/{org}/actions/runners/registration-token - */ - actionsCreateRegistrationTokenForOrg: ( - { org }: ActionsCreateRegistrationTokenForOrgParams, + * @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({ - path: \`/orgs/\${org}/actions/runners/registration-token\`, + this.request< + EnterpriseAdminCreateRegistrationTokenForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runners/registration-token\`, 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 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 actions - * @name ActionsCreateRemoveTokenForOrg - * @summary Create a remove token for an organization - * @request POST:/orgs/{org}/actions/runners/remove-token + * @tags enterprise-admin + * @name EnterpriseAdminCreateRemoveTokenForEnterprise + * @summary Create a remove token for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runners/remove-token */ - actionsCreateRemoveTokenForOrg: ( - { org }: ActionsCreateRemoveTokenForOrgParams, + enterpriseAdminCreateRemoveTokenForEnterprise: ( + { enterprise }: EnterpriseAdminCreateRemoveTokenForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/remove-token\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/remove-token\`, method: "POST", 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 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 actions - * @name ActionsCreateSelfHostedRunnerGroupForOrg - * @summary Create a self-hosted runner group for an organization - * @request POST:/orgs/{org}/actions/runner-groups + * @tags enterprise-admin + * @name EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise + * @summary Create a self-hosted runner group for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runner-groups */ - actionsCreateSelfHostedRunnerGroupForOrg: ( - { org }: ActionsCreateSelfHostedRunnerGroupForOrgParams, - data: ActionsCreateSelfHostedRunnerGroupForOrgPayload, + enterpriseAdminCreateSelfHostedRunnerGroupForEnterprise: ( + { + enterprise, + }: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseParams, + data: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups\`, + this.request< + EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups\`, method: "POST", body: data, type: ContentType.Json, @@ -52990,235 +53305,335 @@ export class 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. + * @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 actions - * @name ActionsDeleteOrgSecret - * @summary Delete an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} + * @tags enterprise-admin + * @name EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise + * @summary Delete a self-hosted runner from an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runners/{runner_id} */ - actionsDeleteOrgSecret: ( - { org, secretName }: ActionsDeleteOrgSecretParams, + enterpriseAdminDeleteSelfHostedRunnerFromEnterprise: ( + { + enterprise, + runnerId, + }: EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + this.request< + EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, method: "DELETE", ...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 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 actions - * @name ActionsDeleteSelfHostedRunnerFromOrg - * @summary Delete a self-hosted runner from an organization - * @request DELETE:/orgs/{org}/actions/runners/{runner_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} */ - actionsDeleteSelfHostedRunnerFromOrg: ( - { org, runnerId }: ActionsDeleteSelfHostedRunnerFromOrgParams, + enterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise: ( + { + enterprise, + runnerGroupId, + }: EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + this.request< + EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, 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)." 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 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 actions - * @name ActionsDeleteSelfHostedRunnerGroupFromOrg - * @summary Delete a self-hosted runner group from an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_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} */ - actionsDeleteSelfHostedRunnerGroupFromOrg: ( - { org, runnerGroupId }: ActionsDeleteSelfHostedRunnerGroupFromOrgParams, + enterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise: ( + { + enterprise, + orgId, + }: EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, + this.request< + EnterpriseAdminDisableSelectedOrganizationGithubActionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, method: "DELETE", ...params, }), /** - * @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 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 actions - * @name ActionsDisableSelectedRepositoryGithubActionsOrganization - * @summary Disable a selected repository for GitHub Actions in an organization - * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} + * @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} */ - actionsDisableSelectedRepositoryGithubActionsOrganization: ( + enterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise: ( { - org, - repositoryId, - }: ActionsDisableSelectedRepositoryGithubActionsOrganizationParams, + enterprise, + orgId, + }: EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseParams, params: RequestParams = {}, ) => this.request< - ActionsDisableSelectedRepositoryGithubActionsOrganizationData, + EnterpriseAdminEnableSelectedOrganizationGithubActionsEnterpriseData, any >({ - path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, - method: "DELETE", + path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, + method: "PUT", ...params, }), /** - * @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. + * @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 actions - * @name ActionsEnableSelectedRepositoryGithubActionsOrganization - * @summary Enable a selected repository for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} + * @tags enterprise-admin + * @name EnterpriseAdminGetAllowedActionsEnterprise + * @summary Get allowed actions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/selected-actions */ - actionsEnableSelectedRepositoryGithubActionsOrganization: ( + enterpriseAdminGetAllowedActionsEnterprise: ( + { enterprise }: EnterpriseAdminGetAllowedActionsEnterpriseParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @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: ( { - org, - repositoryId, - }: ActionsEnableSelectedRepositoryGithubActionsOrganizationParams, + enterprise, + }: EnterpriseAdminGetGithubActionsPermissionsEnterpriseParams, params: RequestParams = {}, ) => this.request< - ActionsEnableSelectedRepositoryGithubActionsOrganizationData, + EnterpriseAdminGetGithubActionsPermissionsEnterpriseData, any >({ - path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, - method: "PUT", + path: \`/enterprises/\${enterprise}/actions/permissions\`, + 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 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 actions - * @name ActionsGetAllowedActionsOrganization - * @summary Get allowed actions for an organization - * @request GET:/orgs/{org}/actions/permissions/selected-actions + * @tags enterprise-admin + * @name EnterpriseAdminGetSelfHostedRunnerForEnterprise + * @summary Get a self-hosted runner for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/{runner_id} */ - actionsGetAllowedActionsOrganization: ( - { org }: ActionsGetAllowedActionsOrganizationParams, + enterpriseAdminGetSelfHostedRunnerForEnterprise: ( + { + enterprise, + runnerId, + }: EnterpriseAdminGetSelfHostedRunnerForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/selected-actions\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, method: "GET", format: "json", ...params, }), /** - * @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. + * @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 actions - * @name ActionsGetGithubActionsPermissionsOrganization - * @summary Get GitHub Actions permissions for an organization - * @request GET:/orgs/{org}/actions/permissions + * @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} */ - actionsGetGithubActionsPermissionsOrganization: ( - { org }: ActionsGetGithubActionsPermissionsOrganizationParams, + enterpriseAdminGetSelfHostedRunnerGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + }: EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions\`, + this.request< + EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", 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 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 actions - * @name ActionsGetOrgPublicKey - * @summary Get an organization public key - * @request GET:/orgs/{org}/actions/secrets/public-key + * @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 */ - actionsGetOrgPublicKey: ( - { org }: ActionsGetOrgPublicKeyParams, + enterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + { + enterprise, + runnerGroupId, + ...query + }: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/public-key\`, + this.request< + EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, method: "GET", + query: query, 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 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 actions - * @name ActionsGetOrgSecret - * @summary Get an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name} + * @tags enterprise-admin + * @name EnterpriseAdminListRunnerApplicationsForEnterprise + * @summary List runner applications for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/downloads */ - actionsGetOrgSecret: ( - { org, secretName }: ActionsGetOrgSecretParams, + enterpriseAdminListRunnerApplicationsForEnterprise: ( + { enterprise }: EnterpriseAdminListRunnerApplicationsForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + 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: ( + { + enterprise, + ...query + }: EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseParams, + params: RequestParams = {}, + ) => + this.request< + EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, method: "GET", + query: query, 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. + * @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 actions - * @name ActionsGetSelfHostedRunnerForOrg - * @summary Get a self-hosted runner for an organization - * @request GET:/orgs/{org}/actions/runners/{runner_id} + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise + * @summary List self-hosted runner groups for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups */ - actionsGetSelfHostedRunnerForOrg: ( - { org, runnerId }: ActionsGetSelfHostedRunnerForOrgParams, + enterpriseAdminListSelfHostedRunnerGroupsForEnterprise: ( + { + enterprise, + ...query + }: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + this.request< + EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups\`, 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)." 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 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 actions - * @name ActionsGetSelfHostedRunnerGroupForOrg - * @summary Get a self-hosted runner group for an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnersForEnterprise + * @summary List self-hosted runners for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners */ - actionsGetSelfHostedRunnerGroupForOrg: ( - { org, runnerGroupId }: ActionsGetSelfHostedRunnerGroupForOrgParams, + enterpriseAdminListSelfHostedRunnersForEnterprise: ( + { + enterprise, + ...query + }: EnterpriseAdminListSelfHostedRunnersForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners\`, method: "GET", + query: query, 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 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 actions - * @name ActionsListOrgSecrets - * @summary List organization secrets - * @request GET:/orgs/{org}/actions/secrets + * @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 */ - actionsListOrgSecrets: ( - { org, ...query }: ActionsListOrgSecretsParams, + enterpriseAdminListSelfHostedRunnersInGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + ...query + }: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets\`, + this.request< + EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, method: "GET", query: query, format: "json", @@ -53226,376 +53641,455 @@ export class Api< }), /** - * @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 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 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 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} */ - actionsListRepoAccessToSelfHostedRunnerGroupInOrg: ( + enterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise: ( { - org, + enterprise, runnerGroupId, - }: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgParams, + orgId, + }: EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, - method: "GET", - format: "json", + this.request< + EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, + method: "DELETE", ...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 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 actions - * @name ActionsListRunnerApplicationsForOrg - * @summary List runner applications for an organization - * @request GET:/orgs/{org}/actions/runners/downloads + * @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} */ - actionsListRunnerApplicationsForOrg: ( - { org }: ActionsListRunnerApplicationsForOrgParams, + enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + runnerId, + }: EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/downloads\`, - method: "GET", - format: "json", + this.request< + EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + 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. + * @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 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, + }), + + /** + * @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, + }), + + /** + * @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 actions - * @name ActionsListSelectedReposForOrgSecret - * @summary List selected repositories for an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories + * @tags enterprise-admin + * @name EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary Set selected organizations enabled for GitHub Actions in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations */ - actionsListSelectedReposForOrgSecret: ( - { org, secretName }: ActionsListSelectedReposForOrgSecretParams, + enterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise: ( + { + enterprise, + }: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseParams, + data: EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, - method: "GET", - format: "json", + this.request< + EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @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. + * @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 actions - * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization - * @summary List selected repositories enabled for GitHub Actions in an organization - * @request GET:/orgs/{org}/actions/permissions/repositories + * @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 */ - actionsListSelectedRepositoriesEnabledGithubActionsOrganization: ( + enterpriseAdminSetSelfHostedRunnersInGroupForEnterprise: ( { - org, - ...query - }: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationParams, + enterprise, + runnerGroupId, + }: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseParams, + data: EnterpriseAdminSetSelfHostedRunnersInGroupForEnterprisePayload, params: RequestParams = {}, ) => this.request< - ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData, + EnterpriseAdminSetSelfHostedRunnersInGroupForEnterpriseData, any >({ - path: \`/orgs/\${org}/actions/permissions/repositories\`, - method: "GET", - query: query, - format: "json", + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "PUT", + 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)." 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 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 actions - * @name ActionsListSelfHostedRunnerGroupsForOrg - * @summary List self-hosted runner groups for an organization - * @request GET:/orgs/{org}/actions/runner-groups + * @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} */ - actionsListSelfHostedRunnerGroupsForOrg: ( - { org, ...query }: ActionsListSelfHostedRunnerGroupsForOrgParams, + enterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise: ( + { + enterprise, + runnerGroupId, + }: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseParams, + data: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterprisePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups\`, - method: "GET", - query: query, + this.request< + EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseData, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), - + }; + events = { /** - * @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 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 actions - * @name ActionsListSelfHostedRunnersForOrg - * @summary List self-hosted runners for an organization - * @request GET:/orgs/{org}/actions/runners + * @tags activity + * @name ActivityListPublicEvents + * @summary List public events + * @request GET:/events */ - actionsListSelfHostedRunnersForOrg: ( - { org, ...query }: ActionsListSelfHostedRunnersForOrgParams, + activityListPublicEvents: ( + query: ActivityListPublicEventsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runners\`, + this.request< + ActivityListPublicEventsData, + | BasicError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/events\`, method: "GET", query: query, format: "json", ...params, }), - + }; + feeds = { /** - * @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 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 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 activity + * @name ActivityGetFeeds + * @summary Get feeds + * @request GET:/feeds */ - actionsListSelfHostedRunnersInGroupForOrg: ( - { - org, - runnerGroupId, - ...query - }: ActionsListSelfHostedRunnersInGroupForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, + activityGetFeeds: (params: RequestParams = {}) => + this.request({ + path: \`/feeds\`, method: "GET", - query: query, format: "json", ...params, }), - + }; + gists = { /** - * @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. + * No description * - * @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 gists + * @name GistsCheckIsStarred + * @summary Check if a gist is starred + * @request GET:/gists/{gist_id}/star */ - actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg: ( - { - org, - runnerGroupId, - repositoryId, - }: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgParams, + gistsCheckIsStarred: ( + { gistId }: GistsCheckIsStarredParams, params: RequestParams = {}, ) => - this.request< - ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData, - any - >({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, - method: "DELETE", + this.request({ + path: \`/gists/\${gistId}/star\`, + method: "GET", ...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 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 actions - * @name ActionsRemoveSelectedRepoFromOrgSecret - * @summary Remove selected repository from an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + * @tags gists + * @name GistsCreate + * @summary Create a gist + * @request POST:/gists */ - actionsRemoveSelectedRepoFromOrgSecret: ( - { - org, - secretName, - repositoryId, - }: ActionsRemoveSelectedRepoFromOrgSecretParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, - method: "DELETE", + gistsCreate: (data: GistsCreatePayload, params: RequestParams = {}) => + this.request({ + path: \`/gists\`, + 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)." 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. + * No description * - * @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 gists + * @name GistsCreateComment + * @summary Create a gist comment + * @request POST:/gists/{gist_id}/comments */ - actionsRemoveSelfHostedRunnerFromGroupForOrg: ( - { - org, - runnerGroupId, - runnerId, - }: ActionsRemoveSelfHostedRunnerFromGroupForOrgParams, + gistsCreateComment: ( + { gistId }: GistsCreateCommentParams, + data: GistsCreateCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "DELETE", + this.request({ + path: \`/gists/\${gistId}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, + 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. + * No description * - * @tags actions - * @name ActionsSetAllowedActionsOrganization - * @summary Set allowed actions for an organization - * @request PUT:/orgs/{org}/actions/permissions/selected-actions + * @tags gists + * @name GistsDelete + * @summary Delete a gist + * @request DELETE:/gists/{gist_id} */ - actionsSetAllowedActionsOrganization: ( - { org }: ActionsSetAllowedActionsOrganizationParams, - data: SelectedActions, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/selected-actions\`, - method: "PUT", - body: data, - type: ContentType.Json, + gistsDelete: ({ gistId }: GistsDeleteParams, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}\`, + method: "DELETE", ...params, }), /** - * @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. + * No description * - * @tags actions - * @name ActionsSetGithubActionsPermissionsOrganization - * @summary Set GitHub Actions permissions for an organization - * @request PUT:/orgs/{org}/actions/permissions + * @tags gists + * @name GistsDeleteComment + * @summary Delete a gist comment + * @request DELETE:/gists/{gist_id}/comments/{comment_id} */ - actionsSetGithubActionsPermissionsOrganization: ( - { org }: ActionsSetGithubActionsPermissionsOrganizationParams, - data: ActionsSetGithubActionsPermissionsOrganizationPayload, + gistsDeleteComment: ( + { gistId, commentId }: GistsDeleteCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + 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 **Note**: This was previously \`/gists/:gist_id/fork\`. * - * @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 gists + * @name GistsFork + * @summary Fork a gist + * @request POST:/gists/{gist_id}/forks */ - 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, + gistsFork: ({ gistId }: GistsForkParams, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/forks\`, + method: "POST", + format: "json", ...params, }), /** - * @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. + * No description * - * @tags actions - * @name ActionsSetSelectedReposForOrgSecret - * @summary Set selected repositories for an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories + * @tags gists + * @name GistsGet + * @summary Get a gist + * @request GET:/gists/{gist_id} */ - actionsSetSelectedReposForOrgSecret: ( - { org, secretName }: ActionsSetSelectedReposForOrgSecretParams, - data: ActionsSetSelectedReposForOrgSecretPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, - method: "PUT", - body: data, - type: ContentType.Json, + 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, }), /** - * @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. + * No description * - * @tags actions - * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization - * @summary Set selected repositories enabled for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories + * @tags gists + * @name GistsGetComment + * @summary Get a gist comment + * @request GET:/gists/{gist_id}/comments/{comment_id} */ - actionsSetSelectedRepositoriesEnabledGithubActionsOrganization: ( - { - org, - }: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParams, - data: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload, + gistsGetComment: ( + { gistId, commentId }: GistsGetCommentParams, params: RequestParams = {}, ) => this.request< - ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData, - any + GistsGetCommentData, + | { + block?: { + created_at?: string; + html_url?: string | null; + reason?: string; + }; + documentation_url?: string; + message?: string; + } + | BasicError >({ - path: \`/orgs/\${org}/actions/permissions/repositories\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "GET", + 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. + * No description * - * @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 gists + * @name GistsGetRevision + * @summary Get a gist revision + * @request GET:/gists/{gist_id}/{sha} */ - actionsSetSelfHostedRunnersInGroupForOrg: ( - { org, runnerGroupId }: ActionsSetSelfHostedRunnersInGroupForOrgParams, - data: ActionsSetSelfHostedRunnersInGroupForOrgPayload, + gistsGetRevision: ( + { gistId, sha }: GistsGetRevisionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/gists/\${gistId}/\${sha}\`, + method: "GET", + 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)." 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 Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: * - * @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 gists + * @name GistsList + * @summary List gists for the authenticated user + * @request GET:/gists */ - actionsUpdateSelfHostedRunnerGroupForOrg: ( - { org, runnerGroupId }: ActionsUpdateSelfHostedRunnerGroupForOrgParams, - data: ActionsUpdateSelfHostedRunnerGroupForOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + gistsList: (query: GistsListParams, params: RequestParams = {}) => + this.request({ + path: \`/gists\`, + method: "GET", + query: query, format: "json", ...params, }), @@ -53603,17 +54097,17 @@ export class Api< /** * No description * - * @tags activity - * @name ActivityListPublicOrgEvents - * @summary List public organization events - * @request GET:/orgs/{org}/events + * @tags gists + * @name GistsListComments + * @summary List gist comments + * @request GET:/gists/{gist_id}/comments */ - activityListPublicOrgEvents: ( - { org, ...query }: ActivityListPublicOrgEventsParams, + gistsListComments: ( + { gistId, ...query }: GistsListCommentsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/events\`, + this.request({ + path: \`/gists/\${gistId}/comments\`, method: "GET", query: query, format: "json", @@ -53621,134 +54115,131 @@ export class Api< }), /** - * @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. + * No description * - * @tags apps - * @name AppsGetOrgInstallation - * @summary Get an organization installation for the authenticated app - * @request GET:/orgs/{org}/installation + * @tags gists + * @name GistsListCommits + * @summary List gist commits + * @request GET:/gists/{gist_id}/commits */ - appsGetOrgInstallation: ( - { org }: AppsGetOrgInstallationParams, + gistsListCommits: ( + { gistId, ...query }: GistsListCommitsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/installation\`, + this.request({ + path: \`/gists/\${gistId}/commits\`, method: "GET", + query: query, 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 \`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 GistsListForks + * @summary List gist forks + * @request GET:/gists/{gist_id}/forks */ - billingGetGithubActionsBillingOrg: ( - { org }: BillingGetGithubActionsBillingOrgParams, + gistsListForks: ( + { gistId, ...query }: GistsListForksParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/actions\`, + this.request({ + path: \`/gists/\${gistId}/forks\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @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 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 billing - * @name BillingGetGithubPackagesBillingOrg - * @summary Get GitHub Packages billing for an organization - * @request GET:/orgs/{org}/settings/billing/packages + * @tags gists + * @name GistsListPublic + * @summary List public gists + * @request GET:/gists/public */ - billingGetGithubPackagesBillingOrg: ( - { org }: BillingGetGithubPackagesBillingOrgParams, + gistsListPublic: ( + query: GistsListPublicParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/packages\`, + this.request({ + path: \`/gists/public\`, method: "GET", + query: query, 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 List the authenticated user's starred gists: * - * @tags billing - * @name BillingGetSharedStorageBillingOrg - * @summary Get shared storage billing for an organization - * @request GET:/orgs/{org}/settings/billing/shared-storage - */ - billingGetSharedStorageBillingOrg: ( - { org }: BillingGetSharedStorageBillingOrgParams, + * @tags gists + * @name GistsListStarred + * @summary List starred gists + * @request GET:/gists/starred + */ + gistsListStarred: ( + query: GistsListStarredParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/shared-storage\`, + this.request({ + path: \`/gists/starred\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @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 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 interactions - * @name InteractionsGetRestrictionsForOrg - * @summary Get interaction restrictions for an organization - * @request GET:/orgs/{org}/interaction-limits + * @tags gists + * @name GistsStar + * @summary Star a gist + * @request PUT:/gists/{gist_id}/star */ - interactionsGetRestrictionsForOrg: ( - { org }: InteractionsGetRestrictionsForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, - method: "GET", - format: "json", + gistsStar: ({ gistId }: GistsStarParams, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, + method: "PUT", ...params, }), /** - * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. + * No description * - * @tags interactions - * @name InteractionsRemoveRestrictionsForOrg - * @summary Remove interaction restrictions for an organization - * @request DELETE:/orgs/{org}/interaction-limits + * @tags gists + * @name GistsUnstar + * @summary Unstar a gist + * @request DELETE:/gists/{gist_id}/star */ - interactionsRemoveRestrictionsForOrg: ( - { org }: InteractionsRemoveRestrictionsForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, + gistsUnstar: ({ gistId }: GistsUnstarParams, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, method: "DELETE", ...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 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 interactions - * @name InteractionsSetRestrictionsForOrg - * @summary Set interaction restrictions for an organization - * @request PUT:/orgs/{org}/interaction-limits + * @tags gists + * @name GistsUpdate + * @summary Update a gist + * @request PATCH:/gists/{gist_id} */ - interactionsSetRestrictionsForOrg: ( - { org }: InteractionsSetRestrictionsForOrgParams, - data: InteractionLimit, + gistsUpdate: ( + { gistId }: GistsUpdateParams, + data: GistsUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, - method: "PUT", + this.request({ + path: \`/gists/\${gistId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -53756,363 +54247,429 @@ 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. + * No description * - * @tags issues - * @name IssuesListForOrg - * @summary List organization issues assigned to the authenticated user - * @request GET:/orgs/{org}/issues + * @tags gists + * @name GistsUpdateComment + * @summary Update a gist comment + * @request PATCH:/gists/{gist_id}/comments/{comment_id} */ - issuesListForOrg: ( - { org, ...query }: IssuesListForOrgParams, + gistsUpdateComment: ( + { gistId, commentId }: GistsUpdateCommentParams, + data: GistsUpdateCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/issues\`, - method: "GET", - query: query, + this.request({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), - + }; + gitignore = { /** - * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. + * @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 migrations - * @name MigrationsDeleteArchiveForOrg - * @summary Delete an organization migration archive - * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive + * @tags gitignore + * @name GitignoreGetAllTemplates + * @summary Get all gitignore templates + * @request GET:/gitignore/templates */ - migrationsDeleteArchiveForOrg: ( - { org, migrationId }: MigrationsDeleteArchiveForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, - method: "DELETE", + gitignoreGetAllTemplates: (params: RequestParams = {}) => + this.request({ + path: \`/gitignore/templates\`, + method: "GET", + format: "json", ...params, }), /** - * @description Fetches the URL to a migration archive. + * @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 migrations - * @name MigrationsDownloadArchiveForOrg - * @summary Download an organization migration archive - * @request GET:/orgs/{org}/migrations/{migration_id}/archive + * @tags gitignore + * @name GitignoreGetTemplate + * @summary Get a gitignore template + * @request GET:/gitignore/templates/{name} */ - migrationsDownloadArchiveForOrg: ( - { org, migrationId }: MigrationsDownloadArchiveForOrgParams, + gitignoreGetTemplate: ( + { name }: GitignoreGetTemplateParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + this.request({ + path: \`/gitignore/templates/\${name}\`, method: "GET", + format: "json", ...params, }), - + }; + installation = { /** - * @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 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 migrations - * @name MigrationsGetStatusForOrg - * @summary Get an organization migration status - * @request GET:/orgs/{org}/migrations/{migration_id} + * @tags apps + * @name AppsListReposAccessibleToInstallation + * @summary List repositories accessible to the app installation + * @request GET:/installation/repositories */ - migrationsGetStatusForOrg: ( - { org, migrationId }: MigrationsGetStatusForOrgParams, + appsListReposAccessibleToInstallation: ( + query: AppsListReposAccessibleToInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}\`, + this.request({ + path: \`/installation/repositories\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Lists the most recent migrations. + * @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 migrations - * @name MigrationsListForOrg - * @summary List organization migrations - * @request GET:/orgs/{org}/migrations + * @tags apps + * @name AppsRevokeInstallationAccessToken + * @summary Revoke an installation access token + * @request DELETE:/installation/token */ - migrationsListForOrg: ( - { org, ...query }: MigrationsListForOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations\`, + 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 List all the repositories for this organization migration. + * No description * - * @tags migrations - * @name MigrationsListReposForOrg - * @summary List repositories in an organization migration - * @request GET:/orgs/{org}/migrations/{migration_id}/repositories + * @tags licenses + * @name LicensesGetAllCommonlyUsed + * @summary Get all commonly used licenses + * @request GET:/licenses */ - migrationsListReposForOrg: ( - { org, migrationId, ...query }: MigrationsListReposForOrgParams, + licensesGetAllCommonlyUsed: ( + query: LicensesGetAllCommonlyUsedParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/repositories\`, + this.request({ + path: \`/licenses\`, method: "GET", query: query, format: "json", ...params, }), - + }; + markdown = { /** - * @description Initiates the generation of a migration archive. + * No description * - * @tags migrations - * @name MigrationsStartForOrg - * @summary Start an organization migration - * @request POST:/orgs/{org}/migrations + * @tags markdown + * @name MarkdownRender + * @summary Render a Markdown document + * @request POST:/markdown */ - migrationsStartForOrg: ( - { org }: MigrationsStartForOrgParams, - data: MigrationsStartForOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/migrations\`, + markdownRender: (data: MarkdownRenderPayload, params: RequestParams = {}) => + this.request({ + path: \`/markdown\`, 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. + * @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 migrations - * @name MigrationsUnlockRepoForOrg - * @summary Unlock an organization repository - * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock + * @tags markdown + * @name MarkdownRenderRaw + * @summary Render a Markdown document in raw mode + * @request POST:/markdown/raw */ - migrationsUnlockRepoForOrg: ( - { org, migrationId, repoName }: MigrationsUnlockRepoForOrgParams, + markdownRenderRaw: ( + data: MarkdownRenderRawPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/repos/\${repoName}/lock\`, - method: "DELETE", + this.request({ + path: \`/markdown/raw\`, + method: "POST", + body: data, + 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 orgs - * @name OrgsBlockUser - * @summary Block a user from an organization - * @request PUT:/orgs/{org}/blocks/{username} + * @tags apps + * @name AppsGetSubscriptionPlanForAccount + * @summary Get a subscription plan for an account + * @request GET:/marketplace_listing/accounts/{account_id} */ - orgsBlockUser: ( - { org, username }: OrgsBlockUserParams, + appsGetSubscriptionPlanForAccount: ( + { accountId }: AppsGetSubscriptionPlanForAccountParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, - method: "PUT", + this.request< + AppsGetSubscriptionPlanForAccountData, + AppsGetSubscriptionPlanForAccountError + >({ + path: \`/marketplace_listing/accounts/\${accountId}\`, + method: "GET", + 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 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 orgs - * @name OrgsCancelInvitation - * @summary Cancel an organization invitation - * @request DELETE:/orgs/{org}/invitations/{invitation_id} + * @tags apps + * @name AppsGetSubscriptionPlanForAccountStubbed + * @summary Get a subscription plan for an account (stubbed) + * @request GET:/marketplace_listing/stubbed/accounts/{account_id} */ - orgsCancelInvitation: ( - { org, invitationId }: OrgsCancelInvitationParams, + appsGetSubscriptionPlanForAccountStubbed: ( + { accountId }: AppsGetSubscriptionPlanForAccountStubbedParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations/\${invitationId}\`, - method: "DELETE", + this.request< + AppsGetSubscriptionPlanForAccountStubbedData, + BasicError | void + >({ + path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 orgs - * @name OrgsCheckBlockedUser - * @summary Check if a user is blocked by an organization - * @request GET:/orgs/{org}/blocks/{username} + * @tags apps + * @name AppsListAccountsForPlan + * @summary List accounts for a plan + * @request GET:/marketplace_listing/plans/{plan_id}/accounts */ - orgsCheckBlockedUser: ( - { org, username }: OrgsCheckBlockedUserParams, + appsListAccountsForPlan: ( + { planId, ...query }: AppsListAccountsForPlanParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, + this.request({ + path: \`/marketplace_listing/plans/\${planId}/accounts\`, method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Check if a user is, publicly or privately, a member of the organization. + * @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 orgs - * @name OrgsCheckMembershipForUser - * @summary Check organization membership for a user - * @request GET:/orgs/{org}/members/{username} + * @tags apps + * @name AppsListAccountsForPlanStubbed + * @summary List accounts for a plan (stubbed) + * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts */ - orgsCheckMembershipForUser: ( - { org, username }: OrgsCheckMembershipForUserParams, + appsListAccountsForPlanStubbed: ( + { planId, ...query }: AppsListAccountsForPlanStubbedParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members/\${username}\`, + 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 orgs - * @name OrgsCheckPublicMembershipForUser - * @summary Check public organization membership for a user - * @request GET:/orgs/{org}/public_members/{username} + * @tags apps + * @name AppsListPlans + * @summary List plans + * @request GET:/marketplace_listing/plans */ - orgsCheckPublicMembershipForUser: ( - { org, username }: OrgsCheckPublicMembershipForUserParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, + appsListPlans: (query: AppsListPlansParams, params: RequestParams = {}) => + this.request({ + path: \`/marketplace_listing/plans\`, method: "GET", + query: query, + 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/)". + * @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 orgs - * @name OrgsConvertMemberToOutsideCollaborator - * @summary Convert an organization member to outside collaborator - * @request PUT:/orgs/{org}/outside_collaborators/{username} + * @tags apps + * @name AppsListPlansStubbed + * @summary List plans (stubbed) + * @request GET:/marketplace_listing/stubbed/plans */ - orgsConvertMemberToOutsideCollaborator: ( - { org, username }: OrgsConvertMemberToOutsideCollaboratorParams, + appsListPlansStubbed: ( + query: AppsListPlansStubbedParams, params: RequestParams = {}, ) => - this.request< - OrgsConvertMemberToOutsideCollaboratorData, - OrgsConvertMemberToOutsideCollaboratorError - >({ - path: \`/orgs/\${org}/outside_collaborators/\${username}\`, - method: "PUT", + this.request({ + path: \`/marketplace_listing/stubbed/plans\`, + method: "GET", + query: query, + format: "json", ...params, }), - + }; + meta = { /** - * @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 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 orgs - * @name OrgsCreateInvitation - * @summary Create an organization invitation - * @request POST:/orgs/{org}/invitations + * @tags meta + * @name MetaGet + * @summary Get GitHub meta information + * @request GET:/meta */ - orgsCreateInvitation: ( - { org }: OrgsCreateInvitationParams, - data: OrgsCreateInvitationPayload, + 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: \`/orgs/\${org}/invitations\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/networks/\${owner}/\${repo}/events\`, + method: "GET", + query: query, format: "json", ...params, }), - + }; + notifications = { /** - * @description Here's how you can create a hook that posts payloads in JSON format: + * @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 orgs - * @name OrgsCreateWebhook - * @summary Create an organization webhook - * @request POST:/orgs/{org}/hooks + * @tags activity + * @name ActivityDeleteThreadSubscription + * @summary Delete a thread subscription + * @request DELETE:/notifications/threads/{thread_id}/subscription */ - orgsCreateWebhook: ( - { org }: OrgsCreateWebhookParams, - data: OrgsCreateWebhookPayload, + activityDeleteThreadSubscription: ( + { threadId }: ActivityDeleteThreadSubscriptionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, + method: "DELETE", ...params, }), /** * No description * - * @tags orgs - * @name OrgsDeleteWebhook - * @summary Delete an organization webhook - * @request DELETE:/orgs/{org}/hooks/{hook_id} + * @tags activity + * @name ActivityGetThread + * @summary Get a thread + * @request GET:/notifications/threads/{thread_id} */ - orgsDeleteWebhook: ( - { org, hookId }: OrgsDeleteWebhookParams, + activityGetThread: ( + { threadId }: ActivityGetThreadParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, - method: "DELETE", + this.request({ + path: \`/notifications/threads/\${threadId}\`, + method: "GET", + format: "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." + * @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 orgs - * @name OrgsGet - * @summary Get an organization - * @request GET:/orgs/{org} + * @tags activity + * @name ActivityGetThreadSubscriptionForAuthenticatedUser + * @summary Get a thread subscription for the authenticated user + * @request GET:/notifications/threads/{thread_id}/subscription */ - orgsGet: ({ org }: OrgsGetParams, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}\`, + activityGetThreadSubscriptionForAuthenticatedUser: ( + { threadId }: ActivityGetThreadSubscriptionForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + ActivityGetThreadSubscriptionForAuthenticatedUserData, + BasicError + >({ + path: \`/notifications/threads/\${threadId}/subscription\`, 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 List all notifications for the current user, sorted by most recently updated. * - * @tags orgs - * @name OrgsGetAuditLog - * @summary Get the audit log for an organization - * @request GET:/orgs/{org}/audit-log + * @tags activity + * @name ActivityListNotificationsForAuthenticatedUser + * @summary List notifications for the authenticated user + * @request GET:/notifications */ - orgsGetAuditLog: ( - { org, ...query }: OrgsGetAuditLogParams, + activityListNotificationsForAuthenticatedUser: ( + query: ActivityListNotificationsForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/audit-log\`, + this.request< + ActivityListNotificationsForAuthenticatedUserData, + BasicError | ValidationError + >({ + path: \`/notifications\`, method: "GET", query: query, format: "json", @@ -54120,542 +54677,565 @@ export class Api< }), /** - * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. + * @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 orgs - * @name OrgsGetMembershipForUser - * @summary Get organization membership for a user - * @request GET:/orgs/{org}/memberships/{username} + * @tags activity + * @name ActivityMarkNotificationsAsRead + * @summary Mark notifications as read + * @request PUT:/notifications */ - orgsGetMembershipForUser: ( - { org, username }: OrgsGetMembershipForUserParams, + activityMarkNotificationsAsRead: ( + data: ActivityMarkNotificationsAsReadPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "GET", + this.request({ + path: \`/notifications\`, + method: "PUT", + 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)." + * No description * - * @tags orgs - * @name OrgsGetWebhook - * @summary Get an organization webhook - * @request GET:/orgs/{org}/hooks/{hook_id} + * @tags activity + * @name ActivityMarkThreadAsRead + * @summary Mark a thread as read + * @request PATCH:/notifications/threads/{thread_id} */ - orgsGetWebhook: ( - { org, hookId }: OrgsGetWebhookParams, + activityMarkThreadAsRead: ( + { threadId }: ActivityMarkThreadAsReadParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/notifications/threads/\${threadId}\`, + method: "PATCH", ...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 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 orgs - * @name OrgsGetWebhookConfigForOrg - * @summary Get a webhook configuration for an organization - * @request GET:/orgs/{org}/hooks/{hook_id}/config + * @tags activity + * @name ActivitySetThreadSubscription + * @summary Set a thread subscription + * @request PUT:/notifications/threads/{thread_id}/subscription */ - orgsGetWebhookConfigForOrg: ( - { org, hookId }: OrgsGetWebhookConfigForOrgParams, + activitySetThreadSubscription: ( + { threadId }: ActivitySetThreadSubscriptionParams, + data: ActivitySetThreadSubscriptionPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/config\`, - method: "GET", + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), - + }; + octocat = { /** - * @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 Get the octocat as ASCII art * - * @tags orgs - * @name OrgsListAppInstallations - * @summary List app installations for an organization - * @request GET:/orgs/{org}/installations + * @tags meta + * @name MetaGetOctocat + * @summary Get Octocat + * @request GET:/octocat */ - orgsListAppInstallations: ( - { org, ...query }: OrgsListAppInstallationsParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/installations\`, + metaGetOctocat: (query: MetaGetOctocatParams, params: RequestParams = {}) => + this.request({ + path: \`/octocat\`, method: "GET", query: query, - format: "json", ...params, }), - + }; + organizations = { /** - * @description List the users blocked by an organization. + * @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 OrgsListBlockedUsers - * @summary List users blocked by an organization - * @request GET:/orgs/{org}/blocks + * @name OrgsList + * @summary List organizations + * @request GET:/organizations */ - orgsListBlockedUsers: ( - { org }: OrgsListBlockedUsersParams, - params: RequestParams = {}, - ) => - this.request< - OrgsListBlockedUsersData, - { - documentation_url: string; - message: string; - } - >({ - path: \`/orgs/\${org}/blocks\`, + orgsList: (query: OrgsListParams, params: RequestParams = {}) => + this.request({ + path: \`/organizations\`, method: "GET", + query: query, format: "json", ...params, }), - + }; + orgs = { /** - * @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 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 orgs - * @name OrgsListFailedInvitations - * @summary List failed organization invitations - * @request GET:/orgs/{org}/failed_invitations + * @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} */ - orgsListFailedInvitations: ( - { org, ...query }: OrgsListFailedInvitationsParams, + actionsAddRepoAccessToSelfHostedRunnerGroupInOrg: ( + { + org, + runnerGroupId, + repositoryId, + }: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/failed_invitations\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, + method: "PUT", ...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 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 orgs - * @name OrgsListInvitationTeams - * @summary List organization invitation teams - * @request GET:/orgs/{org}/invitations/{invitation_id}/teams + * @tags actions + * @name ActionsAddSelectedRepoToOrgSecret + * @summary Add selected repository to an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - orgsListInvitationTeams: ( - { org, invitationId, ...query }: OrgsListInvitationTeamsParams, + actionsAddSelectedRepoToOrgSecret: ( + { + org, + secretName, + repositoryId, + }: ActionsAddSelectedRepoToOrgSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations/\${invitationId}/teams\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, + method: "PUT", ...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 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 orgs - * @name OrgsListMembers - * @summary List organization members - * @request GET:/orgs/{org}/members + * @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} */ - orgsListMembers: ( - { org, ...query }: OrgsListMembersParams, + actionsAddSelfHostedRunnerToGroupForOrg: ( + { + org, + runnerGroupId, + runnerId, + }: ActionsAddSelfHostedRunnerToGroupForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + method: "PUT", ...params, }), /** - * @description List all users who are outside collaborators of an organization. + * @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 orgs - * @name OrgsListOutsideCollaborators - * @summary List outside collaborators for an organization - * @request GET:/orgs/{org}/outside_collaborators + * @tags actions + * @name ActionsCreateOrUpdateOrgSecret + * @summary Create or update an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name} */ - orgsListOutsideCollaborators: ( - { org, ...query }: OrgsListOutsideCollaboratorsParams, + actionsCreateOrUpdateOrgSecret: ( + { org, secretName }: ActionsCreateOrUpdateOrgSecretParams, + data: ActionsCreateOrUpdateOrgSecretPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/outside_collaborators\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + method: "PUT", + body: data, + type: ContentType.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 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 orgs - * @name OrgsListPendingInvitations - * @summary List pending organization invitations - * @request GET:/orgs/{org}/invitations + * @tags actions + * @name ActionsCreateRegistrationTokenForOrg + * @summary Create a registration token for an organization + * @request POST:/orgs/{org}/actions/runners/registration-token */ - orgsListPendingInvitations: ( - { org, ...query }: OrgsListPendingInvitationsParams, + actionsCreateRegistrationTokenForOrg: ( + { org }: ActionsCreateRegistrationTokenForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/actions/runners/registration-token\`, + method: "POST", format: "json", ...params, }), /** - * @description Members of an organization can choose to have their membership publicized or not. + * @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 orgs - * @name OrgsListPublicMembers - * @summary List public organization members - * @request GET:/orgs/{org}/public_members + * @tags actions + * @name ActionsCreateRemoveTokenForOrg + * @summary Create a remove token for an organization + * @request POST:/orgs/{org}/actions/runners/remove-token */ - orgsListPublicMembers: ( - { org, ...query }: OrgsListPublicMembersParams, + actionsCreateRemoveTokenForOrg: ( + { org }: ActionsCreateRemoveTokenForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/actions/runners/remove-token\`, + method: "POST", 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 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 orgs - * @name OrgsListSamlSsoAuthorizations - * @summary List SAML SSO authorizations for an organization - * @request GET:/orgs/{org}/credential-authorizations + * @tags actions + * @name ActionsCreateSelfHostedRunnerGroupForOrg + * @summary Create a self-hosted runner group for an organization + * @request POST:/orgs/{org}/actions/runner-groups */ - orgsListSamlSsoAuthorizations: ( - { org }: OrgsListSamlSsoAuthorizationsParams, + actionsCreateSelfHostedRunnerGroupForOrg: ( + { org }: ActionsCreateSelfHostedRunnerGroupForOrgParams, + data: ActionsCreateSelfHostedRunnerGroupForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/credential-authorizations\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @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 orgs - * @name OrgsListWebhooks - * @summary List organization webhooks - * @request GET:/orgs/{org}/hooks + * @tags actions + * @name ActionsDeleteOrgSecret + * @summary Delete an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} */ - orgsListWebhooks: ( - { org, ...query }: OrgsListWebhooksParams, + actionsDeleteOrgSecret: ( + { org, secretName }: ActionsDeleteOrgSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + method: "DELETE", ...params, }), /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @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 orgs - * @name OrgsPingWebhook - * @summary Ping an organization webhook - * @request POST:/orgs/{org}/hooks/{hook_id}/pings + * @tags actions + * @name ActionsDeleteSelfHostedRunnerFromOrg + * @summary Delete a self-hosted runner from an organization + * @request DELETE:/orgs/{org}/actions/runners/{runner_id} */ - orgsPingWebhook: ( - { org, hookId }: OrgsPingWebhookParams, + actionsDeleteSelfHostedRunnerFromOrg: ( + { org, runnerId }: ActionsDeleteSelfHostedRunnerFromOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/pings\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + method: "DELETE", ...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 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 orgs - * @name OrgsRemoveMember - * @summary Remove an organization member - * @request DELETE:/orgs/{org}/members/{username} + * @tags actions + * @name ActionsDeleteSelfHostedRunnerGroupFromOrg + * @summary Delete a self-hosted runner group from an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - orgsRemoveMember: ( - { org, username }: OrgsRemoveMemberParams, + actionsDeleteSelfHostedRunnerGroupFromOrg: ( + { org, runnerGroupId }: ActionsDeleteSelfHostedRunnerGroupFromOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members/\${username}\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "DELETE", ...params, }), /** - * @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 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 orgs - * @name OrgsRemoveMembershipForUser - * @summary Remove organization membership for a user - * @request DELETE:/orgs/{org}/memberships/{username} + * @tags actions + * @name ActionsDisableSelectedRepositoryGithubActionsOrganization + * @summary Disable a selected repository for GitHub Actions in an organization + * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - orgsRemoveMembershipForUser: ( - { org, username }: OrgsRemoveMembershipForUserParams, + actionsDisableSelectedRepositoryGithubActionsOrganization: ( + { + org, + repositoryId, + }: ActionsDisableSelectedRepositoryGithubActionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, + this.request< + ActionsDisableSelectedRepositoryGithubActionsOrganizationData, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, method: "DELETE", ...params, }), /** - * @description Removing a user from this list will remove them from all the organization's repositories. + * @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 orgs - * @name OrgsRemoveOutsideCollaborator - * @summary Remove outside collaborator from an organization - * @request DELETE:/orgs/{org}/outside_collaborators/{username} + * @tags actions + * @name ActionsEnableSelectedRepositoryGithubActionsOrganization + * @summary Enable a selected repository for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - orgsRemoveOutsideCollaborator: ( - { org, username }: OrgsRemoveOutsideCollaboratorParams, + actionsEnableSelectedRepositoryGithubActionsOrganization: ( + { + org, + repositoryId, + }: ActionsEnableSelectedRepositoryGithubActionsOrganizationParams, params: RequestParams = {}, ) => this.request< - OrgsRemoveOutsideCollaboratorData, - OrgsRemoveOutsideCollaboratorError + ActionsEnableSelectedRepositoryGithubActionsOrganizationData, + any >({ - path: \`/orgs/\${org}/outside_collaborators/\${username}\`, - method: "DELETE", + path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, + method: "PUT", ...params, }), /** - * No description + * @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 orgs - * @name OrgsRemovePublicMembershipForAuthenticatedUser - * @summary Remove public organization membership for the authenticated user - * @request DELETE:/orgs/{org}/public_members/{username} + * @tags actions + * @name ActionsGetAllowedActionsOrganization + * @summary Get allowed actions for an organization + * @request GET:/orgs/{org}/actions/permissions/selected-actions */ - orgsRemovePublicMembershipForAuthenticatedUser: ( - { org, username }: OrgsRemovePublicMembershipForAuthenticatedUserParams, + actionsGetAllowedActionsOrganization: ( + { org }: ActionsGetAllowedActionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/permissions/selected-actions\`, + method: "GET", + 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 \`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 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 orgs - * @name OrgsRemoveSamlSsoAuthorization - * @summary Remove a SAML SSO authorization for an organization - * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} + * @tags actions + * @name ActionsGetGithubActionsPermissionsOrganization + * @summary Get GitHub Actions permissions for an organization + * @request GET:/orgs/{org}/actions/permissions */ - orgsRemoveSamlSsoAuthorization: ( - { org, credentialId }: OrgsRemoveSamlSsoAuthorizationParams, + actionsGetGithubActionsPermissionsOrganization: ( + { org }: ActionsGetGithubActionsPermissionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/permissions\`, + 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. + * @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 orgs - * @name OrgsSetMembershipForUser - * @summary Set organization membership for a user - * @request PUT:/orgs/{org}/memberships/{username} + * @tags actions + * @name ActionsGetOrgPublicKey + * @summary Get an organization public key + * @request GET:/orgs/{org}/actions/secrets/public-key */ - orgsSetMembershipForUser: ( - { org, username }: OrgsSetMembershipForUserParams, - data: OrgsSetMembershipForUserPayload, + actionsGetOrgPublicKey: ( + { org }: ActionsGetOrgPublicKeyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/secrets/public-key\`, + method: "GET", + 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. + * + * @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, }), /** - * @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 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 orgs - * @name OrgsSetPublicMembershipForAuthenticatedUser - * @summary Set public organization membership for the authenticated user - * @request PUT:/orgs/{org}/public_members/{username} + * @tags actions + * @name ActionsGetSelfHostedRunnerForOrg + * @summary Get a self-hosted runner for an organization + * @request GET:/orgs/{org}/actions/runners/{runner_id} */ - orgsSetPublicMembershipForAuthenticatedUser: ( - { org, username }: OrgsSetPublicMembershipForAuthenticatedUserParams, + actionsGetSelfHostedRunnerForOrg: ( + { org, runnerId }: ActionsGetSelfHostedRunnerForOrgParams, params: RequestParams = {}, ) => - this.request( - { - path: \`/orgs/\${org}/public_members/\${username}\`, - method: "PUT", - ...params, - }, - ), + this.request({ + path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + 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)." 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 orgs - * @name OrgsUnblockUser - * @summary Unblock a user from an organization - * @request DELETE:/orgs/{org}/blocks/{username} + * @tags actions + * @name ActionsGetSelfHostedRunnerGroupForOrg + * @summary Get a self-hosted runner group for an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - orgsUnblockUser: ( - { org, username }: OrgsUnblockUserParams, + actionsGetSelfHostedRunnerGroupForOrg: ( + { org, runnerGroupId }: ActionsGetSelfHostedRunnerGroupForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, + 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 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 orgs - * @name OrgsUpdate - * @summary Update an organization - * @request PATCH:/orgs/{org} + * @tags actions + * @name ActionsListOrgSecrets + * @summary List organization secrets + * @request GET:/orgs/{org}/actions/secrets */ - orgsUpdate: ( - { org }: OrgsUpdateParams, - data: OrgsUpdatePayload, + actionsListOrgSecrets: ( + { org, ...query }: ActionsListOrgSecretsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/secrets\`, + method: "GET", + query: query, 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 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 orgs - * @name OrgsUpdateWebhook - * @summary Update an organization webhook - * @request PATCH:/orgs/{org}/hooks/{hook_id} + * @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 */ - orgsUpdateWebhook: ( - { org, hookId }: OrgsUpdateWebhookParams, - data: OrgsUpdateWebhookPayload, + actionsListRepoAccessToSelfHostedRunnerGroupInOrg: ( + { + org, + runnerGroupId, + }: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, + method: "GET", 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 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 orgs - * @name OrgsUpdateWebhookConfigForOrg - * @summary Update a webhook configuration for an organization - * @request PATCH:/orgs/{org}/hooks/{hook_id}/config + * @tags actions + * @name ActionsListRunnerApplicationsForOrg + * @summary List runner applications for an organization + * @request GET:/orgs/{org}/actions/runners/downloads */ - orgsUpdateWebhookConfigForOrg: ( - { org, hookId }: OrgsUpdateWebhookConfigForOrgParams, - data: OrgsUpdateWebhookConfigForOrgPayload, + actionsListRunnerApplicationsForOrg: ( + { org }: ActionsListRunnerApplicationsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/runners/downloads\`, + method: "GET", format: "json", ...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 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 projects - * @name ProjectsCreateForOrg - * @summary Create an organization project - * @request POST:/orgs/{org}/projects + * @tags actions + * @name ActionsListSelectedReposForOrgSecret + * @summary List selected repositories for an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories */ - projectsCreateForOrg: ( - { org }: ProjectsCreateForOrgParams, - data: ProjectsCreateForOrgPayload, + actionsListSelectedReposForOrgSecret: ( + { org, secretName }: ActionsListSelectedReposForOrgSecretParams, params: RequestParams = {}, ) => - this.request< - ProjectsCreateForOrgData, - BasicError | ValidationErrorSimple - >({ - path: \`/orgs/\${org}/projects\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, + method: "GET", 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 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 projects - * @name ProjectsListForOrg - * @summary List organization projects - * @request GET:/orgs/{org}/projects + * @tags actions + * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization + * @summary List selected repositories enabled for GitHub Actions in an organization + * @request GET:/orgs/{org}/actions/permissions/repositories */ - projectsListForOrg: ( - { org, ...query }: ProjectsListForOrgParams, + actionsListSelectedRepositoriesEnabledGithubActionsOrganization: ( + { + org, + ...query + }: ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/projects\`, + this.request< + ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationData, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories\`, method: "GET", query: query, format: "json", @@ -54663,245 +55243,219 @@ 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 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 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 actions + * @name ActionsListSelfHostedRunnerGroupsForOrg + * @summary List self-hosted runner groups for an organization + * @request GET:/orgs/{org}/actions/runner-groups */ - reactionsCreateForTeamDiscussionCommentInOrg: ( - { - org, - teamSlug, - discussionNumber, - commentNumber, - }: ReactionsCreateForTeamDiscussionCommentInOrgParams, - data: ReactionsCreateForTeamDiscussionCommentInOrgPayload, + actionsListSelfHostedRunnerGroupsForOrg: ( + { org, ...query }: ActionsListSelfHostedRunnerGroupsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups\`, + 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 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 reactions - * @name ReactionsCreateForTeamDiscussionInOrg - * @summary Create reaction for a team discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * @tags actions + * @name ActionsListSelfHostedRunnersForOrg + * @summary List self-hosted runners for an organization + * @request GET:/orgs/{org}/actions/runners */ - reactionsCreateForTeamDiscussionInOrg: ( - { - org, - teamSlug, - discussionNumber, - }: ReactionsCreateForTeamDiscussionInOrgParams, - data: ReactionsCreateForTeamDiscussionInOrgPayload, + actionsListSelfHostedRunnersForOrg: ( + { org, ...query }: ActionsListSelfHostedRunnersForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/runners\`, + method: "GET", + query: query, format: "json", ...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 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 reactions - * @name ReactionsDeleteForTeamDiscussion - * @summary Delete team discussion reaction - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_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 */ - reactionsDeleteForTeamDiscussion: ( + actionsListSelfHostedRunnersInGroupForOrg: ( { org, - teamSlug, - discussionNumber, - reactionId, - }: ReactionsDeleteForTeamDiscussionParams, + runnerGroupId, + ...query + }: ActionsListSelfHostedRunnersInGroupForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "GET", + query: query, + format: "json", ...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 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 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 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} */ - reactionsDeleteForTeamDiscussionComment: ( + actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg: ( { org, - teamSlug, - discussionNumber, - commentNumber, - reactionId, - }: ReactionsDeleteForTeamDiscussionCommentParams, + runnerGroupId, + repositoryId, + }: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions/\${reactionId}\`, + this.request< + ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgData, + any + >({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, 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 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 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 actions + * @name ActionsRemoveSelectedRepoFromOrgSecret + * @summary Remove selected repository from an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - reactionsListForTeamDiscussionCommentInOrg: ( + actionsRemoveSelectedRepoFromOrgSecret: ( { org, - teamSlug, - discussionNumber, - commentNumber, - ...query - }: ReactionsListForTeamDiscussionCommentInOrgParams, + secretName, + repositoryId, + }: ActionsRemoveSelectedRepoFromOrgSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, + method: "DELETE", ...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 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 reactions - * @name ReactionsListForTeamDiscussionInOrg - * @summary List reactions for a team discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * @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} */ - reactionsListForTeamDiscussionInOrg: ( + actionsRemoveSelfHostedRunnerFromGroupForOrg: ( { org, - teamSlug, - discussionNumber, - ...query - }: ReactionsListForTeamDiscussionInOrgParams, + runnerGroupId, + runnerId, + }: ActionsRemoveSelfHostedRunnerFromGroupForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, + method: "DELETE", ...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 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 repos - * @name ReposCreateInOrg - * @summary Create an organization repository - * @request POST:/orgs/{org}/repos + * @tags actions + * @name ActionsSetAllowedActionsOrganization + * @summary Set allowed actions for an organization + * @request PUT:/orgs/{org}/actions/permissions/selected-actions */ - reposCreateInOrg: ( - { org }: ReposCreateInOrgParams, - data: ReposCreateInOrgPayload, + actionsSetAllowedActionsOrganization: ( + { org }: ActionsSetAllowedActionsOrganizationParams, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/repos\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/actions/permissions/selected-actions\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @description Lists repositories for the specified organization. + * @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 repos - * @name ReposListForOrg - * @summary List organization repositories - * @request GET:/orgs/{org}/repos + * @tags actions + * @name ActionsSetGithubActionsPermissionsOrganization + * @summary Set GitHub Actions permissions for an organization + * @request PUT:/orgs/{org}/actions/permissions */ - reposListForOrg: ( - { org, ...query }: ReposListForOrgParams, + actionsSetGithubActionsPermissionsOrganization: ( + { org }: ActionsSetGithubActionsPermissionsOrganizationParams, + data: ActionsSetGithubActionsPermissionsOrganizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/repos\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/permissions\`, + method: "PUT", + body: data, + type: ContentType.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 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 teams - * @name TeamsAddOrUpdateMembershipForUserInOrg - * @summary Add or update team membership for a user - * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @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 */ - teamsAddOrUpdateMembershipForUserInOrg: ( - { org, teamSlug, username }: TeamsAddOrUpdateMembershipForUserInOrgParams, - data: TeamsAddOrUpdateMembershipForUserInOrgPayload, + actionsSetRepoAccessToSelfHostedRunnerGroupInOrg: ( + { + org, + runnerGroupId, + }: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgParams, + data: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgPayload, params: RequestParams = {}, ) => - this.request< - TeamsAddOrUpdateMembershipForUserInOrgData, - TeamsAddOrUpdateMembershipForUserInOrgError - >({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, method: "PUT", body: data, type: ContentType.Json, - 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 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 teams - * @name TeamsAddOrUpdateProjectPermissionsInOrg - * @summary Add or update team project permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags actions + * @name ActionsSetSelectedReposForOrgSecret + * @summary Set selected repositories for an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories */ - teamsAddOrUpdateProjectPermissionsInOrg: ( - { - org, - teamSlug, - projectId, - }: TeamsAddOrUpdateProjectPermissionsInOrgParams, - data: TeamsAddOrUpdateProjectPermissionsInOrgPayload, + actionsSetSelectedReposForOrgSecret: ( + { org, secretName }: ActionsSetSelectedReposForOrgSecretParams, + data: ActionsSetSelectedReposForOrgSecretPayload, params: RequestParams = {}, ) => - this.request< - TeamsAddOrUpdateProjectPermissionsInOrgData, - TeamsAddOrUpdateProjectPermissionsInOrgError - >({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, method: "PUT", body: data, type: ContentType.Json, @@ -54909,25 +55463,25 @@ export class Api< }), /** - * @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 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 TeamsAddOrUpdateRepoPermissionsInOrg - * @summary Add or update team repository permissions - * @request PUT:/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 */ - teamsAddOrUpdateRepoPermissionsInOrg: ( + actionsSetSelectedRepositoriesEnabledGithubActionsOrganization: ( { org, - teamSlug, - owner, - repo, - }: TeamsAddOrUpdateRepoPermissionsInOrgParams, - data: TeamsAddOrUpdateRepoPermissionsInOrgPayload, + }: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParams, + data: ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + this.request< + ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationData, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories\`, method: "PUT", body: data, type: ContentType.Json, @@ -54935,309 +55489,292 @@ export class Api< }), /** - * @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 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 teams - * @name TeamsCheckPermissionsForProjectInOrg - * @summary Check team permissions for a project - * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @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 */ - teamsCheckPermissionsForProjectInOrg: ( - { org, teamSlug, projectId }: TeamsCheckPermissionsForProjectInOrgParams, + actionsSetSelfHostedRunnersInGroupForOrg: ( + { org, runnerGroupId }: ActionsSetSelfHostedRunnersInGroupForOrgParams, + data: ActionsSetSelfHostedRunnersInGroupForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "PUT", + body: data, + type: ContentType.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 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 teams - * @name TeamsCheckPermissionsForRepoInOrg - * @summary Check team permissions for a repository - * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags actions + * @name ActionsUpdateSelfHostedRunnerGroupForOrg + * @summary Update a self-hosted runner group for an organization + * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - teamsCheckPermissionsForRepoInOrg: ( - { org, teamSlug, owner, repo }: TeamsCheckPermissionsForRepoInOrgParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, - method: "GET", + 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, }), /** - * @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 activity + * @name ActivityListPublicOrgEvents + * @summary List public organization events + * @request GET:/orgs/{org}/events */ - teamsCreate: ( - { org }: TeamsCreateParams, - data: TeamsCreatePayload, + activityListPublicOrgEvents: ( + { org, ...query }: ActivityListPublicOrgEventsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/events\`, + 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 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 teams - * @name TeamsCreateDiscussionCommentInOrg - * @summary Create a discussion comment - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * @tags apps + * @name AppsGetOrgInstallation + * @summary Get an organization installation for the authenticated app + * @request GET:/orgs/{org}/installation */ - teamsCreateDiscussionCommentInOrg: ( - { - org, - teamSlug, - discussionNumber, - }: TeamsCreateDiscussionCommentInOrgParams, - data: TeamsCreateDiscussionCommentInOrgPayload, + appsGetOrgInstallation: ( + { org }: AppsGetOrgInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/installation\`, + method: "GET", format: "json", ...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 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 teams - * @name TeamsCreateDiscussionInOrg - * @summary Create a discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions + * @tags billing + * @name BillingGetGithubActionsBillingOrg + * @summary Get GitHub Actions billing for an organization + * @request GET:/orgs/{org}/settings/billing/actions */ - teamsCreateDiscussionInOrg: ( - { org, teamSlug }: TeamsCreateDiscussionInOrgParams, - data: TeamsCreateDiscussionInOrgPayload, + billingGetGithubActionsBillingOrg: ( + { org }: BillingGetGithubActionsBillingOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/settings/billing/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 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 teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg - * @summary Create or update IdP group connections - * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * @tags billing + * @name BillingGetGithubPackagesBillingOrg + * @summary Get GitHub Packages billing for an organization + * @request GET:/orgs/{org}/settings/billing/packages */ - teamsCreateOrUpdateIdpGroupConnectionsInOrg: ( - { org, teamSlug }: TeamsCreateOrUpdateIdpGroupConnectionsInOrgParams, - data: TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload, + billingGetGithubPackagesBillingOrg: ( + { org }: BillingGetGithubPackagesBillingOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/settings/billing/packages\`, + method: "GET", 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 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 teams - * @name TeamsDeleteDiscussionCommentInOrg - * @summary Delete a discussion comment - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags billing + * @name BillingGetSharedStorageBillingOrg + * @summary Get shared storage billing for an organization + * @request GET:/orgs/{org}/settings/billing/shared-storage */ - teamsDeleteDiscussionCommentInOrg: ( - { - org, - teamSlug, - discussionNumber, - commentNumber, - }: TeamsDeleteDiscussionCommentInOrgParams, + billingGetSharedStorageBillingOrg: ( + { org }: BillingGetSharedStorageBillingOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/settings/billing/shared-storage\`, + 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}\`. + * @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 teams - * @name TeamsDeleteDiscussionInOrg - * @summary Delete a discussion - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags interactions + * @name InteractionsGetRestrictionsForOrg + * @summary Get interaction restrictions for an organization + * @request GET:/orgs/{org}/interaction-limits */ - teamsDeleteDiscussionInOrg: ( - { org, teamSlug, discussionNumber }: TeamsDeleteDiscussionInOrgParams, + interactionsGetRestrictionsForOrg: ( + { org }: InteractionsGetRestrictionsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, + method: "GET", + 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 Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. * - * @tags teams - * @name TeamsDeleteInOrg - * @summary Delete a team - * @request DELETE:/orgs/{org}/teams/{team_slug} + * @tags interactions + * @name InteractionsRemoveRestrictionsForOrg + * @summary Remove interaction restrictions for an organization + * @request DELETE:/orgs/{org}/interaction-limits */ - teamsDeleteInOrg: ( - { org, teamSlug }: TeamsDeleteInOrgParams, + interactionsRemoveRestrictionsForOrg: ( + { org }: InteractionsRemoveRestrictionsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, method: "DELETE", ...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 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 teams - * @name TeamsGetByName - * @summary Get a team by name - * @request GET:/orgs/{org}/teams/{team_slug} + * @tags interactions + * @name InteractionsSetRestrictionsForOrg + * @summary Set interaction restrictions for an organization + * @request PUT:/orgs/{org}/interaction-limits */ - teamsGetByName: ( - { org, teamSlug }: TeamsGetByNameParams, + interactionsSetRestrictionsForOrg: ( + { org }: InteractionsSetRestrictionsForOrgParams, + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "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 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 teams - * @name TeamsGetDiscussionCommentInOrg - * @summary Get a discussion comment - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags issues + * @name IssuesListForOrg + * @summary List organization issues assigned to the authenticated user + * @request GET:/orgs/{org}/issues */ - teamsGetDiscussionCommentInOrg: ( - { - org, - teamSlug, - discussionNumber, - commentNumber, - }: TeamsGetDiscussionCommentInOrgParams, + issuesListForOrg: ( + { org, ...query }: IssuesListForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + this.request({ + path: \`/orgs/\${org}/issues\`, method: "GET", + query: query, 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}\`. + * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. * - * @tags teams - * @name TeamsGetDiscussionInOrg - * @summary Get a discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags migrations + * @name MigrationsDeleteArchiveForOrg + * @summary Delete an organization migration archive + * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive */ - teamsGetDiscussionInOrg: ( - { org, teamSlug, discussionNumber }: TeamsGetDiscussionInOrgParams, + migrationsDeleteArchiveForOrg: ( + { org, migrationId }: MigrationsDeleteArchiveForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + method: "DELETE", ...params, }), /** - * @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 Fetches the URL to a migration archive. * - * @tags teams - * @name TeamsGetMembershipForUserInOrg - * @summary Get team membership for a user - * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags migrations + * @name MigrationsDownloadArchiveForOrg + * @summary Download an organization migration archive + * @request GET:/orgs/{org}/migrations/{migration_id}/archive */ - teamsGetMembershipForUserInOrg: ( - { org, teamSlug, username }: TeamsGetMembershipForUserInOrgParams, + migrationsDownloadArchiveForOrg: ( + { org, migrationId }: MigrationsDownloadArchiveForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, method: "GET", - format: "json", ...params, }), /** - * @description Lists all teams in an organization that are visible to the authenticated user. + * @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 teams - * @name TeamsList - * @summary List teams - * @request GET:/orgs/{org}/teams + * @tags migrations + * @name MigrationsGetStatusForOrg + * @summary Get an organization migration status + * @request GET:/orgs/{org}/migrations/{migration_id} */ - teamsList: ( - { org, ...query }: TeamsListParams, + migrationsGetStatusForOrg: ( + { org, migrationId }: MigrationsGetStatusForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}\`, 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 Lists the most recent migrations. * - * @tags teams - * @name TeamsListChildInOrg - * @summary List child teams - * @request GET:/orgs/{org}/teams/{team_slug}/teams + * @tags migrations + * @name MigrationsListForOrg + * @summary List organization migrations + * @request GET:/orgs/{org}/migrations */ - teamsListChildInOrg: ( - { org, teamSlug, ...query }: TeamsListChildInOrgParams, + migrationsListForOrg: ( + { org, ...query }: MigrationsListForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, + this.request({ + path: \`/orgs/\${org}/migrations\`, method: "GET", query: query, format: "json", @@ -55245,24 +55782,19 @@ export class Api< }), /** - * @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 List all the repositories for this organization migration. * - * @tags teams - * @name TeamsListDiscussionCommentsInOrg - * @summary List discussion comments - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * @tags migrations + * @name MigrationsListReposForOrg + * @summary List repositories in an organization migration + * @request GET:/orgs/{org}/migrations/{migration_id}/repositories */ - teamsListDiscussionCommentsInOrg: ( - { - org, - teamSlug, - discussionNumber, - ...query - }: TeamsListDiscussionCommentsInOrgParams, + migrationsListReposForOrg: ( + { org, migrationId, ...query }: MigrationsListReposForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/repositories\`, method: "GET", query: query, format: "json", @@ -55270,498 +55802,470 @@ export class Api< }), /** - * @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 Initiates the generation of a migration archive. * - * @tags teams - * @name TeamsListDiscussionsInOrg - * @summary List discussions - * @request GET:/orgs/{org}/teams/{team_slug}/discussions + * @tags migrations + * @name MigrationsStartForOrg + * @summary Start an organization migration + * @request POST:/orgs/{org}/migrations */ - teamsListDiscussionsInOrg: ( - { org, teamSlug, ...query }: TeamsListDiscussionsInOrgParams, + migrationsStartForOrg: ( + { org }: MigrationsStartForOrgParams, + data: MigrationsStartForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/migrations\`, + method: "POST", + 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. 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 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 teams - * @name TeamsListIdpGroupsForOrg - * @summary List IdP groups for an organization - * @request GET:/orgs/{org}/team-sync/groups + * @tags migrations + * @name MigrationsUnlockRepoForOrg + * @summary Unlock an organization repository + * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock */ - teamsListIdpGroupsForOrg: ( - { org, ...query }: TeamsListIdpGroupsForOrgParams, + migrationsUnlockRepoForOrg: ( + { org, migrationId, repoName }: MigrationsUnlockRepoForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/team-sync/groups\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/repos/\${repoName}/lock\`, + 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\`. + * No description * - * @tags teams - * @name TeamsListIdpGroupsInOrg - * @summary List IdP groups for a team - * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * @tags orgs + * @name OrgsBlockUser + * @summary Block a user from an organization + * @request PUT:/orgs/{org}/blocks/{username} */ - teamsListIdpGroupsInOrg: ( - { org, teamSlug }: TeamsListIdpGroupsInOrgParams, + orgsBlockUser: ( + { org, username }: OrgsBlockUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, + method: "PUT", ...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. + * @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 teams - * @name TeamsListMembersInOrg - * @summary List team members - * @request GET:/orgs/{org}/teams/{team_slug}/members + * @tags orgs + * @name OrgsCancelInvitation + * @summary Cancel an organization invitation + * @request DELETE:/orgs/{org}/invitations/{invitation_id} */ - teamsListMembersInOrg: ( - { org, teamSlug, ...query }: TeamsListMembersInOrgParams, + orgsCancelInvitation: ( + { org, invitationId }: OrgsCancelInvitationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/invitations/\${invitationId}\`, + 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\`. **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 orgs + * @name OrgsCheckBlockedUser + * @summary Check if a user is blocked by an organization + * @request GET:/orgs/{org}/blocks/{username} */ - teamsListPendingInvitationsInOrg: ( - { org, teamSlug, ...query }: TeamsListPendingInvitationsInOrgParams, + orgsCheckBlockedUser: ( + { org, username }: OrgsCheckBlockedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/invitations\`, + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, 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\`. + * @description Check if a user is, publicly or privately, a member of the organization. * - * @tags teams - * @name TeamsListProjectsInOrg - * @summary List team projects - * @request GET:/orgs/{org}/teams/{team_slug}/projects + * @tags orgs + * @name OrgsCheckMembershipForUser + * @summary Check organization membership for a user + * @request GET:/orgs/{org}/members/{username} */ - teamsListProjectsInOrg: ( - { org, teamSlug, ...query }: TeamsListProjectsInOrgParams, + orgsCheckMembershipForUser: ( + { org, username }: OrgsCheckMembershipForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects\`, + this.request({ + path: \`/orgs/\${org}/members/\${username}\`, 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\`. + * No description * - * @tags teams - * @name TeamsListReposInOrg - * @summary List team repositories - * @request GET:/orgs/{org}/teams/{team_slug}/repos + * @tags orgs + * @name OrgsCheckPublicMembershipForUser + * @summary Check public organization membership for a user + * @request GET:/orgs/{org}/public_members/{username} */ - teamsListReposInOrg: ( - { org, teamSlug, ...query }: TeamsListReposInOrgParams, + orgsCheckPublicMembershipForUser: ( + { org, username }: OrgsCheckPublicMembershipForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, 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. 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}\`. + * @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 teams - * @name TeamsRemoveMembershipForUserInOrg - * @summary Remove team membership for a user - * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags orgs + * @name OrgsConvertMemberToOutsideCollaborator + * @summary Convert an organization member to outside collaborator + * @request PUT:/orgs/{org}/outside_collaborators/{username} */ - teamsRemoveMembershipForUserInOrg: ( - { org, teamSlug, username }: TeamsRemoveMembershipForUserInOrgParams, + orgsConvertMemberToOutsideCollaborator: ( + { org, username }: OrgsConvertMemberToOutsideCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, - method: "DELETE", + this.request< + OrgsConvertMemberToOutsideCollaboratorData, + OrgsConvertMemberToOutsideCollaboratorError + >({ + path: \`/orgs/\${org}/outside_collaborators/\${username}\`, + method: "PUT", ...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}\`. + * @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 teams - * @name TeamsRemoveProjectInOrg - * @summary Remove a project from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags orgs + * @name OrgsCreateInvitation + * @summary Create an organization invitation + * @request POST:/orgs/{org}/invitations */ - teamsRemoveProjectInOrg: ( - { org, teamSlug, projectId }: TeamsRemoveProjectInOrgParams, + orgsCreateInvitation: ( + { org }: OrgsCreateInvitationParams, + data: OrgsCreateInvitationPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/invitations\`, + method: "POST", + body: data, + type: ContentType.Json, + 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}\`. + * @description Here's how you can create a hook that posts payloads in JSON format: * - * @tags teams - * @name TeamsRemoveRepoInOrg - * @summary Remove a repository from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags orgs + * @name OrgsCreateWebhook + * @summary Create an organization webhook + * @request POST:/orgs/{org}/hooks */ - teamsRemoveRepoInOrg: ( - { org, teamSlug, owner, repo }: TeamsRemoveRepoInOrgParams, + orgsCreateWebhook: ( + { org }: OrgsCreateWebhookParams, + data: OrgsCreateWebhookPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/hooks\`, + method: "POST", + body: data, + type: ContentType.Json, + 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}\`. + * 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 orgs + * @name OrgsDeleteWebhook + * @summary Delete an organization webhook + * @request DELETE:/orgs/{org}/hooks/{hook_id} */ - teamsUpdateDiscussionCommentInOrg: ( - { - org, - teamSlug, - discussionNumber, - commentNumber, - }: TeamsUpdateDiscussionCommentInOrgParams, - data: TeamsUpdateDiscussionCommentInOrgPayload, + orgsDeleteWebhook: ( + { org, hookId }: OrgsDeleteWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, + method: "DELETE", ...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 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 TeamsUpdateDiscussionInOrg - * @summary Update a discussion - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags orgs + * @name OrgsGet + * @summary Get an organization + * @request GET:/orgs/{org} */ - teamsUpdateDiscussionInOrg: ( - { org, teamSlug, discussionNumber }: TeamsUpdateDiscussionInOrgParams, - data: TeamsUpdateDiscussionInOrgPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + orgsGet: ({ org }: OrgsGetParams, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}\`, + method: "GET", 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:** 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 teams - * @name TeamsUpdateInOrg - * @summary Update a team - * @request PATCH:/orgs/{org}/teams/{team_slug} + * @tags orgs + * @name OrgsGetAuditLog + * @summary Get the audit log for an organization + * @request GET:/orgs/{org}/audit-log */ - teamsUpdateInOrg: ( - { org, teamSlug }: TeamsUpdateInOrgParams, - data: TeamsUpdateInOrgPayload, + orgsGetAuditLog: ( + { org, ...query }: OrgsGetAuditLogParams, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/audit-log\`, + method: "GET", + query: query, format: "json", ...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. + * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. * - * @tags projects - * @name ProjectsAddCollaborator - * @summary Add project collaborator - * @request PUT:/projects/{project_id}/collaborators/{username} + * @tags orgs + * @name OrgsGetMembershipForUser + * @summary Get organization membership for a user + * @request GET:/orgs/{org}/memberships/{username} */ - projectsAddCollaborator: ( - { projectId, username }: ProjectsAddCollaboratorParams, - data: ProjectsAddCollaboratorPayload, + orgsGetMembershipForUser: ( + { org, username }: OrgsGetMembershipForUserParams, params: RequestParams = {}, ) => - this.request< - ProjectsAddCollaboratorData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, + method: "GET", + 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 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 projects - * @name ProjectsCreateCard - * @summary Create a project card - * @request POST:/projects/columns/{column_id}/cards + * @tags orgs + * @name OrgsGetWebhook + * @summary Get an organization webhook + * @request GET:/orgs/{org}/hooks/{hook_id} */ - projectsCreateCard: ( - { columnId }: ProjectsCreateCardParams, - data: ProjectsCreateCardPayload, + orgsGetWebhook: ( + { org, hookId }: OrgsGetWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}/cards\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @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 projects - * @name ProjectsCreateColumn - * @summary Create a project column - * @request POST:/projects/{project_id}/columns + * @tags orgs + * @name OrgsGetWebhookConfigForOrg + * @summary Get a webhook configuration for an organization + * @request GET:/orgs/{org}/hooks/{hook_id}/config */ - projectsCreateColumn: ( - { projectId }: ProjectsCreateColumnParams, - data: ProjectsCreateColumnPayload, + orgsGetWebhookConfigForOrg: ( + { org, hookId }: OrgsGetWebhookConfigForOrgParams, params: RequestParams = {}, ) => - this.request< - ProjectsCreateColumnData, - BasicError | ValidationErrorSimple - >({ - path: \`/projects/\${projectId}/columns\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/config\`, + method: "GET", format: "json", ...params, }), /** - * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. + * @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 projects - * @name ProjectsDelete - * @summary Delete a project - * @request DELETE:/projects/{project_id} + * @tags orgs + * @name OrgsListAppInstallations + * @summary List app installations for an organization + * @request GET:/orgs/{org}/installations */ - projectsDelete: ( - { projectId }: ProjectsDeleteParams, + orgsListAppInstallations: ( + { org, ...query }: OrgsListAppInstallationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/\${projectId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/installations\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * No description + * @description List the users blocked by an organization. * - * @tags projects - * @name ProjectsDeleteCard - * @summary Delete a project card - * @request DELETE:/projects/columns/cards/{card_id} + * @tags orgs + * @name OrgsListBlockedUsers + * @summary List users blocked by an organization + * @request GET:/orgs/{org}/blocks */ - projectsDeleteCard: ( - { cardId }: ProjectsDeleteCardParams, + orgsListBlockedUsers: ( + { org }: OrgsListBlockedUsersParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "DELETE", + this.request< + OrgsListBlockedUsersData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/orgs/\${org}/blocks\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 projects - * @name ProjectsDeleteColumn - * @summary Delete a project column - * @request DELETE:/projects/columns/{column_id} + * @tags orgs + * @name OrgsListFailedInvitations + * @summary List failed organization invitations + * @request GET:/orgs/{org}/failed_invitations */ - projectsDeleteColumn: ( - { columnId }: ProjectsDeleteColumnParams, + orgsListFailedInvitations: ( + { org, ...query }: OrgsListFailedInvitationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/failed_invitations\`, + method: "GET", + query: query, + 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 List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. * - * @tags projects - * @name ProjectsGet - * @summary Get a project - * @request GET:/projects/{project_id} + * @tags orgs + * @name OrgsListInvitationTeams + * @summary List organization invitation teams + * @request GET:/orgs/{org}/invitations/{invitation_id}/teams */ - projectsGet: ( - { projectId }: ProjectsGetParams, + orgsListInvitationTeams: ( + { org, invitationId, ...query }: OrgsListInvitationTeamsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/\${projectId}\`, + this.request({ + path: \`/orgs/\${org}/invitations/\${invitationId}/teams\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @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 projects - * @name ProjectsGetCard - * @summary Get a project card - * @request GET:/projects/columns/cards/{card_id} + * @tags orgs + * @name OrgsListMembers + * @summary List organization members + * @request GET:/orgs/{org}/members */ - projectsGetCard: ( - { cardId }: ProjectsGetCardParams, + orgsListMembers: ( + { org, ...query }: OrgsListMembersParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, + this.request({ + path: \`/orgs/\${org}/members\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description List all users who are outside collaborators of an organization. * - * @tags projects - * @name ProjectsGetColumn - * @summary Get a project column - * @request GET:/projects/columns/{column_id} + * @tags orgs + * @name OrgsListOutsideCollaborators + * @summary List outside collaborators for an organization + * @request GET:/orgs/{org}/outside_collaborators */ - projectsGetColumn: ( - { columnId }: ProjectsGetColumnParams, + orgsListOutsideCollaborators: ( + { org, ...query }: OrgsListOutsideCollaboratorsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}\`, + this.request({ + path: \`/orgs/\${org}/outside_collaborators\`, method: "GET", + query: query, 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 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 projects - * @name ProjectsGetPermissionForUser - * @summary Get project permission for a user - * @request GET:/projects/{project_id}/collaborators/{username}/permission + * @tags orgs + * @name OrgsListPendingInvitations + * @summary List pending organization invitations + * @request GET:/orgs/{org}/invitations */ - projectsGetPermissionForUser: ( - { projectId, username }: ProjectsGetPermissionForUserParams, + orgsListPendingInvitations: ( + { org, ...query }: OrgsListPendingInvitationsParams, params: RequestParams = {}, ) => - this.request< - ProjectsGetPermissionForUserData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators/\${username}/permission\`, + this.request({ + path: \`/orgs/\${org}/invitations\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Members of an organization can choose to have their membership publicized or not. * - * @tags projects - * @name ProjectsListCards - * @summary List project cards - * @request GET:/projects/columns/{column_id}/cards + * @tags orgs + * @name OrgsListPublicMembers + * @summary List public organization members + * @request GET:/orgs/{org}/public_members */ - projectsListCards: ( - { columnId, ...query }: ProjectsListCardsParams, + orgsListPublicMembers: ( + { org, ...query }: OrgsListPublicMembersParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}/cards\`, + this.request({ + path: \`/orgs/\${org}/public_members\`, method: "GET", query: query, format: "json", @@ -55769,29 +56273,20 @@ export class Api< }), /** - * @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 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 projects - * @name ProjectsListCollaborators - * @summary List project collaborators - * @request GET:/projects/{project_id}/collaborators + * @tags orgs + * @name OrgsListSamlSsoAuthorizations + * @summary List SAML SSO authorizations for an organization + * @request GET:/orgs/{org}/credential-authorizations */ - projectsListCollaborators: ( - { projectId, ...query }: ProjectsListCollaboratorsParams, + orgsListSamlSsoAuthorizations: ( + { org }: OrgsListSamlSsoAuthorizationsParams, params: RequestParams = {}, ) => - this.request< - ProjectsListCollaboratorsData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators\`, + this.request({ + path: \`/orgs/\${org}/credential-authorizations\`, method: "GET", - query: query, format: "json", ...params, }), @@ -55799,17 +56294,17 @@ export class Api< /** * No description * - * @tags projects - * @name ProjectsListColumns - * @summary List project columns - * @request GET:/projects/{project_id}/columns + * @tags orgs + * @name OrgsListWebhooks + * @summary List organization webhooks + * @request GET:/orgs/{org}/hooks */ - projectsListColumns: ( - { projectId, ...query }: ProjectsListColumnsParams, + orgsListWebhooks: ( + { org, ...query }: OrgsListWebhooksParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/\${projectId}/columns\`, + this.request({ + path: \`/orgs/\${org}/hooks\`, method: "GET", query: query, format: "json", @@ -55817,786 +56312,863 @@ export class Api< }), /** - * No description + * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. * - * @tags projects - * @name ProjectsMoveCard - * @summary Move a project card - * @request POST:/projects/columns/cards/{card_id}/moves + * @tags orgs + * @name OrgsPingWebhook + * @summary Ping an organization webhook + * @request POST:/orgs/{org}/hooks/{hook_id}/pings */ - projectsMoveCard: ( - { cardId }: ProjectsMoveCardParams, - data: ProjectsMoveCardPayload, + orgsPingWebhook: ( + { org, hookId }: OrgsPingWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}/moves\`, + 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 projects - * @name ProjectsMoveColumn - * @summary Move a project column - * @request POST:/projects/columns/{column_id}/moves + * @tags orgs + * @name OrgsRemoveMember + * @summary Remove an organization member + * @request DELETE:/orgs/{org}/members/{username} */ - projectsMoveColumn: ( - { columnId }: ProjectsMoveColumnParams, - data: ProjectsMoveColumnPayload, + orgsRemoveMember: ( + { org, username }: OrgsRemoveMemberParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}/moves\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/members/\${username}\`, + method: "DELETE", ...params, }), /** - * @description Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. + * @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 projects - * @name ProjectsRemoveCollaborator - * @summary Remove user as a collaborator - * @request DELETE:/projects/{project_id}/collaborators/{username} + * @tags orgs + * @name OrgsRemoveMembershipForUser + * @summary Remove organization membership for a user + * @request DELETE:/orgs/{org}/memberships/{username} */ - projectsRemoveCollaborator: ( - { projectId, username }: ProjectsRemoveCollaboratorParams, + orgsRemoveMembershipForUser: ( + { org, username }: OrgsRemoveMembershipForUserParams, params: RequestParams = {}, ) => - this.request< - ProjectsRemoveCollaboratorData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators/\${username}\`, + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, 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 Removing a user from this list will remove them from all the organization's repositories. * - * @tags projects - * @name ProjectsUpdate - * @summary Update a project - * @request PATCH:/projects/{project_id} + * @tags orgs + * @name OrgsRemoveOutsideCollaborator + * @summary Remove outside collaborator from an organization + * @request DELETE:/orgs/{org}/outside_collaborators/{username} */ - projectsUpdate: ( - { projectId }: ProjectsUpdateParams, - data: ProjectsUpdatePayload, + orgsRemoveOutsideCollaborator: ( + { org, username }: OrgsRemoveOutsideCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/\${projectId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request< + OrgsRemoveOutsideCollaboratorData, + OrgsRemoveOutsideCollaboratorError + >({ + path: \`/orgs/\${org}/outside_collaborators/\${username}\`, + method: "DELETE", ...params, }), /** * No description * - * @tags projects - * @name ProjectsUpdateCard - * @summary Update an existing project card - * @request PATCH:/projects/columns/cards/{card_id} + * @tags orgs + * @name OrgsRemovePublicMembershipForAuthenticatedUser + * @summary Remove public organization membership for the authenticated user + * @request DELETE:/orgs/{org}/public_members/{username} */ - projectsUpdateCard: ( - { cardId }: ProjectsUpdateCardParams, - data: ProjectsUpdateCardPayload, + orgsRemovePublicMembershipForAuthenticatedUser: ( + { org, username }: OrgsRemovePublicMembershipForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, + method: "DELETE", ...params, }), /** - * No description + * @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 projects - * @name ProjectsUpdateColumn - * @summary Update an existing project column - * @request PATCH:/projects/columns/{column_id} + * @tags orgs + * @name OrgsRemoveSamlSsoAuthorization + * @summary Remove a SAML SSO authorization for an organization + * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} */ - projectsUpdateColumn: ( - { columnId }: ProjectsUpdateColumnParams, - data: ProjectsUpdateColumnPayload, + orgsRemoveSamlSsoAuthorization: ( + { org, credentialId }: OrgsRemoveSamlSsoAuthorizationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, + method: "DELETE", ...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 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 rate-limit - * @name RateLimitGet - * @summary Get rate limit status for the authenticated user - * @request GET:/rate_limit + * @tags orgs + * @name OrgsSetMembershipForUser + * @summary Set organization membership for a user + * @request PUT:/orgs/{org}/memberships/{username} */ - rateLimitGet: (params: RequestParams = {}) => - this.request({ - path: \`/rate_limit\`, - method: "GET", + orgsSetMembershipForUser: ( + { org, username }: OrgsSetMembershipForUserParams, + data: OrgsSetMembershipForUserPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, 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). + * @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 reactions - * @name ReactionsDeleteLegacy - * @summary Delete a reaction (Legacy) - * @request DELETE:/reactions/{reaction_id} - * @deprecated + * @tags orgs + * @name OrgsSetPublicMembershipForAuthenticatedUser + * @summary Set public organization membership for the authenticated user + * @request PUT:/orgs/{org}/public_members/{username} */ - reactionsDeleteLegacy: ( - { reactionId }: ReactionsDeleteLegacyParams, + orgsSetPublicMembershipForAuthenticatedUser: ( + { org, username }: OrgsSetPublicMembershipForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request< - ReactionsDeleteLegacyData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/reactions/\${reactionId}\`, - method: "DELETE", - ...params, - }), - }; - repos = { + this.request( + { + path: \`/orgs/\${org}/public_members/\${username}\`, + method: "PUT", + ...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. + * No description * - * @tags actions - * @name ActionsCancelWorkflowRun - * @summary Cancel a workflow run - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel + * @tags orgs + * @name OrgsUnblockUser + * @summary Unblock a user from an organization + * @request DELETE:/orgs/{org}/blocks/{username} */ - actionsCancelWorkflowRun: ( - { owner, repo, runId }: ActionsCancelWorkflowRunParams, + orgsUnblockUser: ( + { org, username }: OrgsUnblockUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, + 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 **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 actions - * @name ActionsCreateOrUpdateRepoSecret - * @summary Create or update a repository secret - * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags orgs + * @name OrgsUpdate + * @summary Update an organization + * @request PATCH:/orgs/{org} */ - actionsCreateOrUpdateRepoSecret: ( - { owner, repo, secretName }: ActionsCreateOrUpdateRepoSecretParams, - data: ActionsCreateOrUpdateRepoSecretPayload, + orgsUpdate: ( + { org }: OrgsUpdateParams, + data: OrgsUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}\`, + method: "PATCH", body: data, type: ContentType.Json, + 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 \`\`\` + * @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 ActionsCreateRegistrationTokenForRepo - * @summary Create a registration token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token + * @tags orgs + * @name OrgsUpdateWebhook + * @summary Update an organization webhook + * @request PATCH:/orgs/{org}/hooks/{hook_id} */ - actionsCreateRegistrationTokenForRepo: ( - { owner, repo }: ActionsCreateRegistrationTokenForRepoParams, + orgsUpdateWebhook: ( + { org, hookId }: OrgsUpdateWebhookParams, + data: OrgsUpdateWebhookPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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 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 ActionsCreateRemoveTokenForRepo - * @summary Create a remove token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token + * @tags orgs + * @name OrgsUpdateWebhookConfigForOrg + * @summary Update a webhook configuration for an organization + * @request PATCH:/orgs/{org}/hooks/{hook_id}/config */ - actionsCreateRemoveTokenForRepo: ( - { owner, repo }: ActionsCreateRemoveTokenForRepoParams, + orgsUpdateWebhookConfigForOrg: ( + { org, hookId }: OrgsUpdateWebhookConfigForOrgParams, + data: OrgsUpdateWebhookConfigForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/config\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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 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 actions - * @name ActionsCreateWorkflowDispatch - * @summary Create a workflow dispatch event - * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + * @tags projects + * @name ProjectsCreateForOrg + * @summary Create an organization project + * @request POST:/orgs/{org}/projects */ - actionsCreateWorkflowDispatch: ( - { owner, repo, workflowId }: ActionsCreateWorkflowDispatchParams, - data: ActionsCreateWorkflowDispatchPayload, + projectsCreateForOrg: ( + { org }: ProjectsCreateForOrgParams, + data: ProjectsCreateForOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/dispatches\`, + this.request< + ProjectsCreateForOrgData, + BasicError | ValidationErrorSimple + >({ + path: \`/orgs/\${org}/projects\`, method: "POST", body: data, type: ContentType.Json, + 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 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 actions - * @name ActionsDeleteArtifact - * @summary Delete an artifact - * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @tags projects + * @name ProjectsListForOrg + * @summary List organization projects + * @request GET:/orgs/{org}/projects */ - actionsDeleteArtifact: ( - { owner, repo, artifactId }: ActionsDeleteArtifactParams, + projectsListForOrg: ( + { org, ...query }: ProjectsListForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/projects\`, + 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 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 actions - * @name ActionsDeleteRepoSecret - * @summary Delete a repository secret - * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @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 */ - actionsDeleteRepoSecret: ( - { owner, repo, secretName }: ActionsDeleteRepoSecretParams, + reactionsCreateForTeamDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + }: ReactionsCreateForTeamDiscussionCommentInOrgParams, + data: ReactionsCreateForTeamDiscussionCommentInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + 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. + * @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 actions - * @name ActionsDeleteSelfHostedRunnerFromRepo - * @summary Delete a self-hosted runner from a repository - * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @tags reactions + * @name ReactionsCreateForTeamDiscussionInOrg + * @summary Create reaction for a team discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - actionsDeleteSelfHostedRunnerFromRepo: ( - { owner, repo, runnerId }: ActionsDeleteSelfHostedRunnerFromRepoParams, + reactionsCreateForTeamDiscussionInOrg: ( + { + org, + teamSlug, + discussionNumber, + }: ReactionsCreateForTeamDiscussionInOrgParams, + data: ReactionsCreateForTeamDiscussionInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + 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. + * @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 actions - * @name ActionsDeleteWorkflowRun - * @summary Delete a workflow run - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} + * @tags reactions + * @name ReactionsDeleteForTeamDiscussion + * @summary Delete team discussion reaction + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} */ - actionsDeleteWorkflowRun: ( - { owner, repo, runId }: ActionsDeleteWorkflowRunParams, + reactionsDeleteForTeamDiscussion: ( + { + org, + teamSlug, + discussionNumber, + reactionId, + }: ReactionsDeleteForTeamDiscussionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions/\${reactionId}\`, method: "DELETE", ...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. + * @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 actions - * @name ActionsDeleteWorkflowRunLogs - * @summary Delete workflow run logs - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs + * @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} */ - actionsDeleteWorkflowRunLogs: ( - { owner, repo, runId }: ActionsDeleteWorkflowRunLogsParams, + reactionsDeleteForTeamDiscussionComment: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + reactionId, + }: ReactionsDeleteForTeamDiscussionCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions/\${reactionId}\`, method: "DELETE", ...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 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 actions - * @name ActionsDisableWorkflow - * @summary Disable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable + * @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 */ - actionsDisableWorkflow: ( - { owner, repo, workflowId }: ActionsDisableWorkflowParams, + reactionsListForTeamDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + ...query + }: ReactionsListForTeamDiscussionCommentInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + method: "GET", + query: query, + format: "json", ...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 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 actions - * @name ActionsDownloadArtifact - * @summary Download an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} + * @tags reactions + * @name ReactionsListForTeamDiscussionInOrg + * @summary List reactions for a team discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - actionsDownloadArtifact: ( - { owner, repo, artifactId, archiveFormat }: ActionsDownloadArtifactParams, + reactionsListForTeamDiscussionInOrg: ( + { + org, + teamSlug, + discussionNumber, + ...query + }: ReactionsListForTeamDiscussionInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}/\${archiveFormat}\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, 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 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 actions - * @name ActionsDownloadJobLogsForWorkflowRun - * @summary Download job logs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs + * @tags repos + * @name ReposCreateInOrg + * @summary Create an organization repository + * @request POST:/orgs/{org}/repos */ - actionsDownloadJobLogsForWorkflowRun: ( - { owner, repo, jobId }: ActionsDownloadJobLogsForWorkflowRunParams, + reposCreateInOrg: ( + { org }: ReposCreateInOrgParams, + data: ReposCreateInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}/logs\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/repos\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...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 Lists repositories for the specified organization. * - * @tags actions - * @name ActionsDownloadWorkflowRunLogs - * @summary Download workflow run logs - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs + * @tags repos + * @name ReposListForOrg + * @summary List organization repositories + * @request GET:/orgs/{org}/repos */ - actionsDownloadWorkflowRunLogs: ( - { owner, repo, runId }: ActionsDownloadWorkflowRunLogsParams, + reposListForOrg: ( + { org, ...query }: ReposListForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, + this.request({ + path: \`/orgs/\${org}/repos\`, method: "GET", + query: query, + 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 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 actions - * @name ActionsEnableWorkflow - * @summary Enable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserInOrg + * @summary Add or update team membership for a user + * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - actionsEnableWorkflow: ( - { owner, repo, workflowId }: ActionsEnableWorkflowParams, + teamsAddOrUpdateMembershipForUserInOrg: ( + { org, teamSlug, username }: TeamsAddOrUpdateMembershipForUserInOrgParams, + data: TeamsAddOrUpdateMembershipForUserInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, + this.request< + TeamsAddOrUpdateMembershipForUserInOrgData, + TeamsAddOrUpdateMembershipForUserInOrgError + >({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, method: "PUT", + body: data, + type: ContentType.Json, + 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 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 actions - * @name ActionsGetAllowedActionsRepository - * @summary Get allowed actions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsInOrg + * @summary Add or update team project permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - actionsGetAllowedActionsRepository: ( - { owner, repo }: ActionsGetAllowedActionsRepositoryParams, + teamsAddOrUpdateProjectPermissionsInOrg: ( + { + org, + teamSlug, + projectId, + }: TeamsAddOrUpdateProjectPermissionsInOrgParams, + data: TeamsAddOrUpdateProjectPermissionsInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, - method: "GET", - format: "json", + this.request< + TeamsAddOrUpdateProjectPermissionsInOrgData, + TeamsAddOrUpdateProjectPermissionsInOrgError + >({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "PUT", + body: data, + type: ContentType.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 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 actions - * @name ActionsGetArtifact - * @summary Get an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsInOrg + * @summary Add or update team repository permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - actionsGetArtifact: ( - { owner, repo, artifactId }: ActionsGetArtifactParams, + teamsAddOrUpdateRepoPermissionsInOrg: ( + { + org, + teamSlug, + owner, + repo, + }: TeamsAddOrUpdateRepoPermissionsInOrgParams, + data: TeamsAddOrUpdateRepoPermissionsInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + method: "PUT", + body: data, + type: ContentType.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 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 actions - * @name ActionsGetGithubActionsPermissionsRepository - * @summary Get GitHub Actions permissions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions + * @tags teams + * @name TeamsCheckPermissionsForProjectInOrg + * @summary Check team permissions for a project + * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - actionsGetGithubActionsPermissionsRepository: ( - { owner, repo }: ActionsGetGithubActionsPermissionsRepositoryParams, + teamsCheckPermissionsForProjectInOrg: ( + { org, teamSlug, projectId }: TeamsCheckPermissionsForProjectInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, method: "GET", format: "json", ...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 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 actions - * @name ActionsGetJobForWorkflowRun - * @summary Get a job for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} + * @tags teams + * @name TeamsCheckPermissionsForRepoInOrg + * @summary Check team permissions for a repository + * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - actionsGetJobForWorkflowRun: ( - { owner, repo, jobId }: ActionsGetJobForWorkflowRunParams, + teamsCheckPermissionsForRepoInOrg: ( + { org, teamSlug, owner, repo }: TeamsCheckPermissionsForRepoInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, method: "GET", 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. 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 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 actions - * @name ActionsGetRepoPublicKey - * @summary Get a repository public key - * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key + * @tags teams + * @name TeamsCreate + * @summary Create a team + * @request POST:/orgs/{org}/teams */ - actionsGetRepoPublicKey: ( - { owner, repo }: ActionsGetRepoPublicKeyParams, + teamsCreate: ( + { org }: TeamsCreateParams, + data: TeamsCreatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams\`, + 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 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 actions - * @name ActionsGetRepoSecret - * @summary Get a repository secret - * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags teams + * @name TeamsCreateDiscussionCommentInOrg + * @summary Create a discussion comment + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - actionsGetRepoSecret: ( - { owner, repo, secretName }: ActionsGetRepoSecretParams, + teamsCreateDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + }: TeamsCreateDiscussionCommentInOrgParams, + data: TeamsCreateDiscussionCommentInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, + 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 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 actions - * @name ActionsGetSelfHostedRunnerForRepo - * @summary Get a self-hosted runner for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @tags teams + * @name TeamsCreateDiscussionInOrg + * @summary Create a discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions */ - actionsGetSelfHostedRunnerForRepo: ( - { owner, repo, runnerId }: ActionsGetSelfHostedRunnerForRepoParams, + teamsCreateDiscussionInOrg: ( + { org, teamSlug }: TeamsCreateDiscussionInOrgParams, + data: TeamsCreateDiscussionInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...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 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 actions - * @name ActionsGetWorkflow - * @summary Get a workflow - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg + * @summary Create or update IdP group connections + * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - actionsGetWorkflow: ( - { owner, repo, workflowId }: ActionsGetWorkflowParams, + teamsCreateOrUpdateIdpGroupConnectionsInOrg: ( + { org, teamSlug }: TeamsCreateOrUpdateIdpGroupConnectionsInOrgParams, + data: TeamsCreateOrUpdateIdpGroupConnectionsInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, + 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. + * @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 actions - * @name ActionsGetWorkflowRun - * @summary Get a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} + * @tags teams + * @name TeamsDeleteDiscussionCommentInOrg + * @summary Delete a discussion comment + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - actionsGetWorkflowRun: ( - { owner, repo, runId }: ActionsGetWorkflowRunParams, + teamsDeleteDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + }: TeamsDeleteDiscussionCommentInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "DELETE", ...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 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 actions - * @name ActionsGetWorkflowRunUsage - * @summary Get workflow run usage - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing + * @tags teams + * @name TeamsDeleteDiscussionInOrg + * @summary Delete a discussion + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - actionsGetWorkflowRunUsage: ( - { owner, repo, runId }: ActionsGetWorkflowRunUsageParams, + teamsDeleteDiscussionInOrg: ( + { org, teamSlug, discussionNumber }: TeamsDeleteDiscussionInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "DELETE", ...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 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 actions - * @name ActionsGetWorkflowUsage - * @summary Get workflow usage - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + * @tags teams + * @name TeamsDeleteInOrg + * @summary Delete a team + * @request DELETE:/orgs/{org}/teams/{team_slug} */ - actionsGetWorkflowUsage: ( - { owner, repo, workflowId }: ActionsGetWorkflowUsageParams, + teamsDeleteInOrg: ( + { org, teamSlug }: TeamsDeleteInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, + 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 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 actions - * @name ActionsListArtifactsForRepo - * @summary List artifacts for a repository - * @request GET:/repos/{owner}/{repo}/actions/artifacts + * @tags teams + * @name TeamsGetByName + * @summary Get a team by name + * @request GET:/orgs/{org}/teams/{team_slug} */ - actionsListArtifactsForRepo: ( - { owner, repo, ...query }: ActionsListArtifactsForRepoParams, + teamsGetByName: ( + { org, teamSlug }: TeamsGetByNameParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, 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 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 actions - * @name ActionsListJobsForWorkflowRun - * @summary List jobs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs + * @tags teams + * @name TeamsGetDiscussionCommentInOrg + * @summary Get a discussion comment + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - actionsListJobsForWorkflowRun: ( - { owner, repo, runId, ...query }: ActionsListJobsForWorkflowRunParams, + teamsGetDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + }: TeamsGetDiscussionCommentInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/jobs\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, 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 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 actions - * @name ActionsListRepoSecrets - * @summary List repository secrets - * @request GET:/repos/{owner}/{repo}/actions/secrets + * @tags teams + * @name TeamsGetDiscussionInOrg + * @summary Get a discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - actionsListRepoSecrets: ( - { owner, repo, ...query }: ActionsListRepoSecretsParams, + teamsGetDiscussionInOrg: ( + { org, teamSlug, discussionNumber }: TeamsGetDiscussionInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, 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 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 actions - * @name ActionsListRepoWorkflows - * @summary List repository workflows - * @request GET:/repos/{owner}/{repo}/actions/workflows + * @tags teams + * @name TeamsGetMembershipForUserInOrg + * @summary Get team membership for a user + * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - actionsListRepoWorkflows: ( - { owner, repo, ...query }: ActionsListRepoWorkflowsParams, + teamsGetMembershipForUserInOrg: ( + { org, teamSlug, username }: TeamsGetMembershipForUserInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, 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 all teams in an organization that are visible to the authenticated user. * - * @tags actions - * @name ActionsListRunnerApplicationsForRepo - * @summary List runner applications for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/downloads + * @tags teams + * @name TeamsList + * @summary List teams + * @request GET:/orgs/{org}/teams */ - actionsListRunnerApplicationsForRepo: ( - { owner, repo }: ActionsListRunnerApplicationsForRepoParams, + teamsList: ( + { org, ...query }: TeamsListParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, + this.request({ + path: \`/orgs/\${org}/teams\`, method: "GET", + query: query, 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 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 actions - * @name ActionsListSelfHostedRunnersForRepo - * @summary List self-hosted runners for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners + * @tags teams + * @name TeamsListChildInOrg + * @summary List child teams + * @request GET:/orgs/{org}/teams/{team_slug}/teams */ - actionsListSelfHostedRunnersForRepo: ( - { owner, repo, ...query }: ActionsListSelfHostedRunnersForRepoParams, + teamsListChildInOrg: ( + { org, teamSlug, ...query }: TeamsListChildInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, method: "GET", query: query, format: "json", @@ -56604,19 +57176,24 @@ export class Api< }), /** - * @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 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 actions - * @name ActionsListWorkflowRunArtifacts - * @summary List workflow run artifacts - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + * @tags teams + * @name TeamsListDiscussionCommentsInOrg + * @summary List discussion comments + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - actionsListWorkflowRunArtifacts: ( - { owner, repo, runId, ...query }: ActionsListWorkflowRunArtifactsParams, + teamsListDiscussionCommentsInOrg: ( + { + org, + teamSlug, + discussionNumber, + ...query + }: TeamsListDiscussionCommentsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/artifacts\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, method: "GET", query: query, format: "json", @@ -56624,19 +57201,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 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 actions - * @name ActionsListWorkflowRuns - * @summary List workflow runs - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + * @tags teams + * @name TeamsListDiscussionsInOrg + * @summary List discussions + * @request GET:/orgs/{org}/teams/{team_slug}/discussions */ - actionsListWorkflowRuns: ( - { owner, repo, workflowId, ...query }: ActionsListWorkflowRunsParams, + teamsListDiscussionsInOrg: ( + { org, teamSlug, ...query }: TeamsListDiscussionsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/runs\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, method: "GET", query: query, format: "json", @@ -56644,19 +57221,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 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 actions - * @name ActionsListWorkflowRunsForRepo - * @summary List workflow runs for a repository - * @request GET:/repos/{owner}/{repo}/actions/runs + * @tags teams + * @name TeamsListIdpGroupsForOrg + * @summary List IdP groups for an organization + * @request GET:/orgs/{org}/team-sync/groups */ - actionsListWorkflowRunsForRepo: ( - { owner, repo, ...query }: ActionsListWorkflowRunsForRepoParams, + teamsListIdpGroupsForOrg: ( + { org, ...query }: TeamsListIdpGroupsForOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs\`, + this.request({ + path: \`/orgs/\${org}/team-sync/groups\`, method: "GET", query: query, format: "json", @@ -56664,116 +57241,98 @@ 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. - * - * @tags actions - * @name ActionsReRunWorkflow - * @summary Re-run a workflow - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun - */ - actionsReRunWorkflow: ( - { owner, repo, runId }: ActionsReRunWorkflowParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, - method: "POST", - ...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 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 actions - * @name ActionsSetAllowedActionsRepository - * @summary Set allowed actions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @tags teams + * @name TeamsListIdpGroupsInOrg + * @summary List IdP groups for a team + * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - actionsSetAllowedActionsRepository: ( - { owner, repo }: ActionsSetAllowedActionsRepositoryParams, - data: SelectedActions, + teamsListIdpGroupsInOrg: ( + { org, teamSlug }: TeamsListIdpGroupsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, + 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. + * @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 actions - * @name ActionsSetGithubActionsPermissionsRepository - * @summary Set GitHub Actions permissions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions + * @tags teams + * @name TeamsListMembersInOrg + * @summary List team members + * @request GET:/orgs/{org}/teams/{team_slug}/members */ - actionsSetGithubActionsPermissionsRepository: ( - { owner, repo }: ActionsSetGithubActionsPermissionsRepositoryParams, - data: ActionsSetGithubActionsPermissionsRepositoryPayload, + teamsListMembersInOrg: ( + { org, teamSlug, ...query }: TeamsListMembersInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, + method: "GET", + query: query, + format: "json", ...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 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 activity - * @name ActivityDeleteRepoSubscription - * @summary Delete a repository subscription - * @request DELETE:/repos/{owner}/{repo}/subscription + * @tags teams + * @name TeamsListPendingInvitationsInOrg + * @summary List pending team invitations + * @request GET:/orgs/{org}/teams/{team_slug}/invitations */ - activityDeleteRepoSubscription: ( - { owner, repo }: ActivityDeleteRepoSubscriptionParams, + teamsListPendingInvitationsInOrg: ( + { org, teamSlug, ...query }: TeamsListPendingInvitationsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/invitations\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * No description + * @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 activity - * @name ActivityGetRepoSubscription - * @summary Get a repository subscription - * @request GET:/repos/{owner}/{repo}/subscription + * @tags teams + * @name TeamsListProjectsInOrg + * @summary List team projects + * @request GET:/orgs/{org}/teams/{team_slug}/projects */ - activityGetRepoSubscription: ( - { owner, repo }: ActivityGetRepoSubscriptionParams, + teamsListProjectsInOrg: ( + { org, teamSlug, ...query }: TeamsListProjectsInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @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 activity - * @name ActivityListRepoEvents - * @summary List repository events - * @request GET:/repos/{owner}/{repo}/events + * @tags teams + * @name TeamsListReposInOrg + * @summary List team repositories + * @request GET:/orgs/{org}/teams/{team_slug}/repos */ - activityListRepoEvents: ( - { owner, repo, ...query }: ActivityListRepoEventsParams, + teamsListReposInOrg: ( + { org, teamSlug, ...query }: TeamsListReposInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/events\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, method: "GET", query: query, format: "json", @@ -56781,106 +57340,102 @@ export class Api< }), /** - * @description List all notifications for the current user. + * @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 activity - * @name ActivityListRepoNotificationsForAuthenticatedUser - * @summary List repository notifications for the authenticated user - * @request GET:/repos/{owner}/{repo}/notifications + * @tags teams + * @name TeamsRemoveMembershipForUserInOrg + * @summary Remove team membership for a user + * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - activityListRepoNotificationsForAuthenticatedUser: ( - { - owner, - repo, - ...query - }: ActivityListRepoNotificationsForAuthenticatedUserParams, + teamsRemoveMembershipForUserInOrg: ( + { org, teamSlug, username }: TeamsRemoveMembershipForUserInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/notifications\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + method: "DELETE", ...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 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 activity - * @name ActivityListStargazersForRepo - * @summary List stargazers - * @request GET:/repos/{owner}/{repo}/stargazers + * @tags teams + * @name TeamsRemoveProjectInOrg + * @summary Remove a project from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - activityListStargazersForRepo: ( - { owner, repo, ...query }: ActivityListStargazersForRepoParams, + teamsRemoveProjectInOrg: ( + { org, teamSlug, projectId }: TeamsRemoveProjectInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stargazers\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "DELETE", ...params, }), /** - * @description Lists the people watching the specified repository. + * @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 activity - * @name ActivityListWatchersForRepo - * @summary List watchers - * @request GET:/repos/{owner}/{repo}/subscribers + * @tags teams + * @name TeamsRemoveRepoInOrg + * @summary Remove a repository from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - activityListWatchersForRepo: ( - { owner, repo, ...query }: ActivityListWatchersForRepoParams, + teamsRemoveRepoInOrg: ( + { org, teamSlug, owner, repo }: TeamsRemoveRepoInOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscribers\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + method: "DELETE", ...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 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 activity - * @name ActivityMarkRepoNotificationsAsRead - * @summary Mark repository notifications as read - * @request PUT:/repos/{owner}/{repo}/notifications + * @tags teams + * @name TeamsUpdateDiscussionCommentInOrg + * @summary Update a discussion comment + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - activityMarkRepoNotificationsAsRead: ( - { owner, repo }: ActivityMarkRepoNotificationsAsReadParams, - data: ActivityMarkRepoNotificationsAsReadPayload, + teamsUpdateDiscussionCommentInOrg: ( + { + org, + teamSlug, + discussionNumber, + commentNumber, + }: TeamsUpdateDiscussionCommentInOrgParams, + data: TeamsUpdateDiscussionCommentInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/notifications\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, + 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. + * @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 activity - * @name ActivitySetRepoSubscription - * @summary Set a repository subscription - * @request PUT:/repos/{owner}/{repo}/subscription + * @tags teams + * @name TeamsUpdateDiscussionInOrg + * @summary Update a discussion + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - activitySetRepoSubscription: ( - { owner, repo }: ActivitySetRepoSubscriptionParams, - data: ActivitySetRepoSubscriptionPayload, + teamsUpdateDiscussionInOrg: ( + { org, teamSlug, discussionNumber }: TeamsUpdateDiscussionInOrgParams, + data: TeamsUpdateDiscussionInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -56888,61 +57443,72 @@ 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 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 apps - * @name AppsGetRepoInstallation - * @summary Get a repository installation for the authenticated app - * @request GET:/repos/{owner}/{repo}/installation + * @tags teams + * @name TeamsUpdateInOrg + * @summary Update a team + * @request PATCH:/orgs/{org}/teams/{team_slug} */ - appsGetRepoInstallation: ( - { owner, repo }: AppsGetRepoInstallationParams, + teamsUpdateInOrg: ( + { org, teamSlug }: TeamsUpdateInOrgParams, + data: TeamsUpdateInOrgPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/installation\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), - + }; + projects = { /** - * @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 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 checks - * @name ChecksCreate - * @summary Create a check run - * @request POST:/repos/{owner}/{repo}/check-runs + * @tags projects + * @name ProjectsAddCollaborator + * @summary Add project collaborator + * @request PUT:/projects/{project_id}/collaborators/{username} */ - checksCreate: ( - { owner, repo }: ChecksCreateParams, - data: ChecksCreatePayload, + projectsAddCollaborator: ( + { projectId, username }: ProjectsAddCollaboratorParams, + data: ProjectsAddCollaboratorPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs\`, - method: "POST", + this.request< + ProjectsAddCollaboratorData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators/\${username}\`, + 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\`. 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 **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 ChecksCreateSuite - * @summary Create a check suite - * @request POST:/repos/{owner}/{repo}/check-suites + * @tags projects + * @name ProjectsCreateCard + * @summary Create a project card + * @request POST:/projects/columns/{column_id}/cards */ - checksCreateSuite: ( - { owner, repo }: ChecksCreateSuiteParams, - data: ChecksCreateSuitePayload, + projectsCreateCard: ( + { columnId }: ProjectsCreateCardParams, + data: ProjectsCreateCardPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites\`, + this.request({ + path: \`/projects/columns/\${columnId}/cards\`, method: "POST", body: data, type: ContentType.Json, @@ -56951,234 +57517,210 @@ 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. + * No description * - * @tags checks - * @name ChecksGet - * @summary Get a check run - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} + * @tags projects + * @name ProjectsCreateColumn + * @summary Create a project column + * @request POST:/projects/{project_id}/columns */ - checksGet: ( - { owner, repo, checkRunId }: ChecksGetParams, + projectsCreateColumn: ( + { projectId }: ProjectsCreateColumnParams, + data: ProjectsCreateColumnPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, - method: "GET", + this.request< + ProjectsCreateColumnData, + BasicError | ValidationErrorSimple + >({ + path: \`/projects/\${projectId}/columns\`, + method: "POST", + 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\`. 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 Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. * - * @tags checks - * @name ChecksGetSuite - * @summary Get a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} + * @tags projects + * @name ProjectsDelete + * @summary Delete a project + * @request DELETE:/projects/{project_id} */ - checksGetSuite: ( - { owner, repo, checkSuiteId }: ChecksGetSuiteParams, + projectsDelete: ( + { projectId }: ProjectsDeleteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/projects/\${projectId}\`, + method: "DELETE", ...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. + * No description * - * @tags checks - * @name ChecksListAnnotations - * @summary List check run annotations - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations + * @tags projects + * @name ProjectsDeleteCard + * @summary Delete a project card + * @request DELETE:/projects/columns/cards/{card_id} */ - checksListAnnotations: ( - { owner, repo, checkRunId, ...query }: ChecksListAnnotationsParams, + projectsDeleteCard: ( + { cardId }: ProjectsDeleteCardParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}/annotations\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, + 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. + * No description * - * @tags checks - * @name ChecksListForRef - * @summary List check runs for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs + * @tags projects + * @name ProjectsDeleteColumn + * @summary Delete a project column + * @request DELETE:/projects/columns/{column_id} */ - checksListForRef: ( - { owner, repo, ref, ...query }: ChecksListForRefParams, + projectsDeleteColumn: ( + { columnId }: ProjectsDeleteColumnParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/projects/columns/\${columnId}\`, + 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 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 checks - * @name ChecksListForSuite - * @summary List check runs in a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs + * @tags projects + * @name ProjectsGet + * @summary Get a project + * @request GET:/projects/{project_id} */ - checksListForSuite: ( - { owner, repo, checkSuiteId, ...query }: ChecksListForSuiteParams, + projectsGet: ( + { projectId }: ProjectsGetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/check-runs\`, + this.request({ + path: \`/projects/\${projectId}\`, 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 ProjectsGetCard + * @summary Get a project card + * @request GET:/projects/columns/cards/{card_id} */ - checksListSuitesForRef: ( - { owner, repo, ref, ...query }: ChecksListSuitesForRefParams, + projectsGetCard: ( + { cardId }: ProjectsGetCardParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-suites\`, + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @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. + * No description * - * @tags checks - * @name ChecksRerequestSuite - * @summary Rerequest a check suite - * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest + * @tags projects + * @name ProjectsGetColumn + * @summary Get a project column + * @request GET:/projects/columns/{column_id} */ - checksRerequestSuite: ( - { owner, repo, checkSuiteId }: ChecksRerequestSuiteParams, + projectsGetColumn: ( + { columnId }: ProjectsGetColumnParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, - method: "POST", + this.request({ + path: \`/projects/columns/\${columnId}\`, + 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 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 ChecksSetSuitesPreferences - * @summary Update repository preferences for check suites - * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences + * @tags projects + * @name ProjectsGetPermissionForUser + * @summary Get project permission for a user + * @request GET:/projects/{project_id}/collaborators/{username}/permission */ - checksSetSuitesPreferences: ( - { owner, repo }: ChecksSetSuitesPreferencesParams, - data: ChecksSetSuitesPreferencesPayload, + projectsGetPermissionForUser: ( + { projectId, username }: ProjectsGetPermissionForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/preferences\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request< + ProjectsGetPermissionForUserData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators/\${username}/permission\`, + 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. Updates a check run for a specific commit in a repository. Your GitHub App must have the \`checks:write\` permission to edit check runs. + * No description * - * @tags checks - * @name ChecksUpdate - * @summary Update a check run - * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} + * @tags projects + * @name ProjectsListCards + * @summary List project cards + * @request GET:/projects/columns/{column_id}/cards */ - checksUpdate: ( - { owner, repo, checkRunId }: ChecksUpdateParams, - data: ChecksUpdatePayload, + projectsListCards: ( + { columnId, ...query }: ProjectsListCardsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/projects/columns/\${columnId}/cards\`, + method: "GET", + query: query, 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 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 code-scanning - * @name CodeScanningGetAlert - * @summary Get a code scanning alert - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @tags projects + * @name ProjectsListCollaborators + * @summary List project collaborators + * @request GET:/projects/{project_id}/collaborators */ - codeScanningGetAlert: ( - { owner, repo, alertNumber }: CodeScanningGetAlertParams, + projectsListCollaborators: ( + { projectId, ...query }: ProjectsListCollaboratorsParams, params: RequestParams = {}, ) => this.request< - CodeScanningGetAlertData, - | void + ProjectsListCollaboratorsData, | BasicError | { - code?: string; - documentation_url?: string; - message?: string; + documentation_url: string; + message: string; } + | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, - 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. - * - * @tags code-scanning - * @name CodeScanningListAlertsForRepo - * @summary List code scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts - */ - codeScanningListAlertsForRepo: ( - { owner, repo, ...query }: CodeScanningListAlertsForRepoParams, - params: RequestParams = {}, - ) => - this.request< - CodeScanningListAlertsForRepoData, - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts\`, + path: \`/projects/\${projectId}/collaborators\`, method: "GET", query: query, format: "json", @@ -57186,19 +57728,19 @@ 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. + * No description * - * @tags code-scanning - * @name CodeScanningListRecentAnalyses - * @summary List recent code scanning analyses for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/analyses + * @tags projects + * @name ProjectsListColumns + * @summary List project columns + * @request GET:/projects/{project_id}/columns */ - codeScanningListRecentAnalyses: ( - { owner, repo, ...query }: CodeScanningListRecentAnalysesParams, + projectsListColumns: ( + { projectId, ...query }: ProjectsListColumnsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/analyses\`, + this.request({ + path: \`/projects/\${projectId}/columns\`, method: "GET", query: query, format: "json", @@ -57206,21 +57748,21 @@ export class Api< }), /** - * @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. + * No description * - * @tags code-scanning - * @name CodeScanningUpdateAlert - * @summary Update a code scanning alert - * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @tags projects + * @name ProjectsMoveCard + * @summary Move a project card + * @request POST:/projects/columns/cards/{card_id}/moves */ - codeScanningUpdateAlert: ( - { owner, repo, alertNumber }: CodeScanningUpdateAlertParams, - data: CodeScanningUpdateAlertPayload, + projectsMoveCard: ( + { cardId }: ProjectsMoveCardParams, + data: ProjectsMoveCardPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, - method: "PATCH", + this.request({ + path: \`/projects/columns/cards/\${cardId}/moves\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -57228,61 +57770,69 @@ export class Api< }), /** - * @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. + * No description * - * @tags code-scanning - * @name CodeScanningUploadSarif - * @summary Upload a SARIF file - * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs + * @tags projects + * @name ProjectsMoveColumn + * @summary Move a project column + * @request POST:/projects/columns/{column_id}/moves */ - codeScanningUploadSarif: ( - { owner, repo }: CodeScanningUploadSarifParams, - data: CodeScanningUploadSarifPayload, + projectsMoveColumn: ( + { columnId }: ProjectsMoveColumnParams, + data: ProjectsMoveColumnPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/sarifs\`, + this.request({ + path: \`/projects/columns/\${columnId}/moves\`, method: "POST", 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 Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. * - * @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 projects + * @name ProjectsRemoveCollaborator + * @summary Remove user as a collaborator + * @request DELETE:/projects/{project_id}/collaborators/{username} */ - codesOfConductGetForRepo: ( - { owner, repo }: CodesOfConductGetForRepoParams, + projectsRemoveCollaborator: ( + { projectId, username }: ProjectsRemoveCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, - method: "GET", - format: "json", + this.request< + ProjectsRemoveCollaboratorData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators/\${username}\`, + method: "DELETE", ...params, }), /** - * No description + * @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 git - * @name GitCreateBlob - * @summary Create a blob - * @request POST:/repos/{owner}/{repo}/git/blobs + * @tags projects + * @name ProjectsUpdate + * @summary Update a project + * @request PATCH:/projects/{project_id} */ - gitCreateBlob: ( - { owner, repo }: GitCreateBlobParams, - data: GitCreateBlobPayload, + projectsUpdate: ( + { projectId }: ProjectsUpdateParams, + data: ProjectsUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/blobs\`, - method: "POST", + this.request({ + path: \`/projects/\${projectId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -57290,21 +57840,21 @@ export class Api< }), /** - * @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 projects + * @name ProjectsUpdateCard + * @summary Update an existing project card + * @request PATCH:/projects/columns/cards/{card_id} */ - gitCreateCommit: ( - { owner, repo }: GitCreateCommitParams, - data: GitCreateCommitPayload, + projectsUpdateCard: ( + { cardId }: ProjectsUpdateCardParams, + data: ProjectsUpdateCardPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/commits\`, - method: "POST", + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -57312,611 +57862,573 @@ export class Api< }), /** - * @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. + * No description * - * @tags git - * @name GitCreateRef - * @summary Create a reference - * @request POST:/repos/{owner}/{repo}/git/refs + * @tags projects + * @name ProjectsUpdateColumn + * @summary Update an existing project column + * @request PATCH:/projects/columns/{column_id} */ - gitCreateRef: ( - { owner, repo }: GitCreateRefParams, - data: GitCreateRefPayload, + projectsUpdateColumn: ( + { columnId }: ProjectsUpdateColumnParams, + data: ProjectsUpdateColumnPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs\`, - method: "POST", + this.request({ + path: \`/projects/columns/\${columnId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", ...params, }), - + }; + rateLimit = { /** - * @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 **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 git - * @name GitCreateTag - * @summary Create a tag object - * @request POST:/repos/{owner}/{repo}/git/tags + * @tags rate-limit + * @name RateLimitGet + * @summary Get rate limit status for the authenticated user + * @request GET:/rate_limit */ - gitCreateTag: ( - { owner, repo }: GitCreateTagParams, - data: GitCreateTagPayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/tags\`, - method: "POST", - body: data, - type: ContentType.Json, + rateLimitGet: (params: RequestParams = {}) => + this.request({ + path: \`/rate_limit\`, + method: "GET", format: "json", ...params, }), - + }; + reactions = { /** - * @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 **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 git - * @name GitCreateTree - * @summary Create a tree - * @request POST:/repos/{owner}/{repo}/git/trees + * @tags reactions + * @name ReactionsDeleteLegacy + * @summary Delete a reaction (Legacy) + * @request DELETE:/reactions/{reaction_id} + * @deprecated */ - gitCreateTree: ( - { owner, repo }: GitCreateTreeParams, - data: GitCreateTreePayload, + reactionsDeleteLegacy: ( + { reactionId }: ReactionsDeleteLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/trees\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request< + ReactionsDeleteLegacyData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), - + }; + repos = { /** - * No description + * @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 git - * @name GitDeleteRef - * @summary Delete a reference - * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} + * @tags actions + * @name ActionsCancelWorkflowRun + * @summary Cancel a workflow run + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel */ - gitDeleteRef: ( - { owner, repo, ref }: GitDeleteRefParams, + actionsCancelWorkflowRun: ( + { owner, repo, runId }: ActionsCancelWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, + method: "POST", ...params, }), /** - * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. + * @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 GitGetBlob - * @summary Get a blob - * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} + * @tags actions + * @name ActionsCreateOrUpdateRepoSecret + * @summary Create or update a repository secret + * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - gitGetBlob: ( - { owner, repo, fileSha }: GitGetBlobParams, + actionsCreateOrUpdateRepoSecret: ( + { owner, repo, secretName }: ActionsCreateOrUpdateRepoSecretParams, + data: ActionsCreateOrUpdateRepoSecretPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "PUT", + body: data, + type: ContentType.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 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 git - * @name GitGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} + * @tags actions + * @name ActionsCreateRegistrationTokenForRepo + * @summary Create a registration token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token */ - gitGetCommit: ( - { owner, repo, commitSha }: GitGetCommitParams, + actionsCreateRegistrationTokenForRepo: ( + { owner, repo }: ActionsCreateRegistrationTokenForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, + method: "POST", 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 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 git - * @name GitGetRef - * @summary Get a reference - * @request GET:/repos/{owner}/{repo}/git/ref/{ref} + * @tags actions + * @name ActionsCreateRemoveTokenForRepo + * @summary Create a remove token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token */ - gitGetRef: ( - { owner, repo, ref }: GitGetRefParams, + actionsCreateRemoveTokenForRepo: ( + { owner, repo }: ActionsCreateRemoveTokenForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, + method: "POST", 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 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 GitGetTag - * @summary Get a tag - * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} + * @tags actions + * @name ActionsCreateWorkflowDispatch + * @summary Create a workflow dispatch event + * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches */ - gitGetTag: ( - { owner, repo, tagSha }: GitGetTagParams, + actionsCreateWorkflowDispatch: ( + { owner, repo, workflowId }: ActionsCreateWorkflowDispatchParams, + data: ActionsCreateWorkflowDispatchPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/dispatches\`, + method: "POST", + body: data, + type: ContentType.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 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 git - * @name GitGetTree - * @summary Get a tree - * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} + * @tags actions + * @name ActionsDeleteArtifact + * @summary Delete an artifact + * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - gitGetTree: ( - { owner, repo, treeSha, ...query }: GitGetTreeParams, + actionsDeleteArtifact: ( + { owner, repo, artifactId }: ActionsDeleteArtifactParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, + method: "DELETE", ...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 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 GitListMatchingRefs - * @summary List matching references - * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} + * @tags actions + * @name ActionsDeleteRepoSecret + * @summary Delete a repository secret + * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - gitListMatchingRefs: ( - { owner, repo, ref, ...query }: GitListMatchingRefsParams, + actionsDeleteRepoSecret: ( + { owner, repo, secretName }: ActionsDeleteRepoSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "DELETE", ...params, }), /** - * No description + * @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 git - * @name GitUpdateRef - * @summary Update a reference - * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + * @tags actions + * @name ActionsDeleteSelfHostedRunnerFromRepo + * @summary Delete a self-hosted runner from a repository + * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} */ - gitUpdateRef: ( - { owner, repo, ref }: GitUpdateRefParams, - data: GitUpdateRefPayload, + actionsDeleteSelfHostedRunnerFromRepo: ( + { owner, repo, runnerId }: ActionsDeleteSelfHostedRunnerFromRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, + 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 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 interactions - * @name InteractionsGetRestrictionsForRepo - * @summary Get interaction restrictions for a repository - * @request GET:/repos/{owner}/{repo}/interaction-limits + * @tags actions + * @name ActionsDeleteWorkflowRun + * @summary Delete a workflow run + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} */ - interactionsGetRestrictionsForRepo: ( - { owner, repo }: InteractionsGetRestrictionsForRepoParams, + actionsDeleteWorkflowRun: ( + { owner, repo, runId }: ActionsDeleteWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + method: "DELETE", ...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 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 interactions - * @name InteractionsRemoveRestrictionsForRepo - * @summary Remove interaction restrictions for a repository - * @request DELETE:/repos/{owner}/{repo}/interaction-limits + * @tags actions + * @name ActionsDeleteWorkflowRunLogs + * @summary Delete workflow run logs + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - interactionsRemoveRestrictionsForRepo: ( - { owner, repo }: InteractionsRemoveRestrictionsForRepoParams, + actionsDeleteWorkflowRunLogs: ( + { owner, repo, runId }: ActionsDeleteWorkflowRunLogsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, method: "DELETE", ...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 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 interactions - * @name InteractionsSetRestrictionsForRepo - * @summary Set interaction restrictions for a repository - * @request PUT:/repos/{owner}/{repo}/interaction-limits + * @tags actions + * @name ActionsDisableWorkflow + * @summary Disable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable */ - interactionsSetRestrictionsForRepo: ( - { owner, repo }: InteractionsSetRestrictionsForRepoParams, - data: InteractionLimit, + actionsDisableWorkflow: ( + { owner, repo, workflowId }: ActionsDisableWorkflowParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, method: "PUT", - body: data, - type: ContentType.Json, - format: "json", ...params, }), /** - * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. + * @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 issues - * @name IssuesAddAssignees - * @summary Add assignees to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @tags actions + * @name ActionsDownloadArtifact + * @summary Download an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} */ - issuesAddAssignees: ( - { owner, repo, issueNumber }: IssuesAddAssigneesParams, - data: IssuesAddAssigneesPayload, + actionsDownloadArtifact: ( + { owner, repo, artifactId, archiveFormat }: ActionsDownloadArtifactParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}/\${archiveFormat}\`, + method: "GET", ...params, }), /** - * No description + * @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 issues - * @name IssuesAddLabels - * @summary Add labels to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags actions + * @name ActionsDownloadJobLogsForWorkflowRun + * @summary Download job logs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs */ - issuesAddLabels: ( - { owner, repo, issueNumber }: IssuesAddLabelsParams, - data: IssuesAddLabelsPayload, + actionsDownloadJobLogsForWorkflowRun: ( + { owner, repo, jobId }: ActionsDownloadJobLogsForWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}/logs\`, + method: "GET", ...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 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 issues - * @name IssuesCheckUserCanBeAssigned - * @summary Check if a user can be assigned - * @request GET:/repos/{owner}/{repo}/assignees/{assignee} + * @tags actions + * @name ActionsDownloadWorkflowRunLogs + * @summary Download workflow run logs + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - issuesCheckUserCanBeAssigned: ( - { owner, repo, assignee }: IssuesCheckUserCanBeAssignedParams, + actionsDownloadWorkflowRunLogs: ( + { owner, repo, runId }: ActionsDownloadWorkflowRunLogsParams, params: RequestParams = {}, ) => - this.request< - IssuesCheckUserCanBeAssignedData, - IssuesCheckUserCanBeAssignedError - >({ - path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, method: "GET", ...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 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 issues - * @name IssuesCreate - * @summary Create an issue - * @request POST:/repos/{owner}/{repo}/issues + * @tags actions + * @name ActionsEnableWorkflow + * @summary Enable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable */ - issuesCreate: ( - { owner, repo }: IssuesCreateParams, - data: IssuesCreatePayload, + actionsEnableWorkflow: ( + { owner, repo, workflowId }: ActionsEnableWorkflowParams, 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, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, + method: "PUT", ...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 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 issues - * @name IssuesCreateComment - * @summary Create an issue comment - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @tags actions + * @name ActionsGetAllowedActionsRepository + * @summary Get allowed actions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - issuesCreateComment: ( - { owner, repo, issueNumber }: IssuesCreateCommentParams, - data: IssuesCreateCommentPayload, + actionsGetAllowedActionsRepository: ( + { owner, repo }: ActionsGetAllowedActionsRepositoryParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesCreateLabel - * @summary Create a label - * @request POST:/repos/{owner}/{repo}/labels + * @tags actions + * @name ActionsGetArtifact + * @summary Get an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - issuesCreateLabel: ( - { owner, repo }: IssuesCreateLabelParams, - data: IssuesCreateLabelPayload, + actionsGetArtifact: ( + { owner, repo, artifactId }: ActionsGetArtifactParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesCreateMilestone - * @summary Create a milestone - * @request POST:/repos/{owner}/{repo}/milestones + * @tags actions + * @name ActionsGetGithubActionsPermissionsRepository + * @summary Get GitHub Actions permissions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions */ - issuesCreateMilestone: ( - { owner, repo }: IssuesCreateMilestoneParams, - data: IssuesCreateMilestonePayload, + actionsGetGithubActionsPermissionsRepository: ( + { owner, repo }: ActionsGetGithubActionsPermissionsRepositoryParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesDeleteComment - * @summary Delete an issue comment - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags actions + * @name ActionsGetJobForWorkflowRun + * @summary Get a job for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} */ - issuesDeleteComment: ( - { owner, repo, commentId }: IssuesDeleteCommentParams, + actionsGetJobForWorkflowRun: ( + { owner, repo, jobId }: ActionsGetJobForWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesDeleteLabel - * @summary Delete a label - * @request DELETE:/repos/{owner}/{repo}/labels/{name} + * @tags actions + * @name ActionsGetRepoPublicKey + * @summary Get a repository public key + * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key */ - issuesDeleteLabel: ( - { owner, repo, name }: IssuesDeleteLabelParams, + actionsGetRepoPublicKey: ( + { owner, repo }: ActionsGetRepoPublicKeyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesDeleteMilestone - * @summary Delete a milestone - * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags actions + * @name ActionsGetRepoSecret + * @summary Get a repository secret + * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - issuesDeleteMilestone: ( - { owner, repo, milestoneNumber }: IssuesDeleteMilestoneParams, + actionsGetRepoSecret: ( + { owner, repo, secretName }: ActionsGetRepoSecretParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "GET", + 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 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 issues - * @name IssuesGet - * @summary Get an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number} + * @tags actions + * @name ActionsGetSelfHostedRunnerForRepo + * @summary Get a self-hosted runner for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} */ - issuesGet: ( - { owner, repo, issueNumber }: IssuesGetParams, + actionsGetSelfHostedRunnerForRepo: ( + { owner, repo, runnerId }: ActionsGetSelfHostedRunnerForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, method: "GET", format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesGetComment - * @summary Get an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags actions + * @name ActionsGetWorkflow + * @summary Get a workflow + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} */ - issuesGetComment: ( - { owner, repo, commentId }: IssuesGetCommentParams, + actionsGetWorkflow: ( + { owner, repo, workflowId }: ActionsGetWorkflowParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, method: "GET", format: "json", ...params, }), /** - * 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 issues - * @name IssuesGetEvent - * @summary Get an issue event - * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} + * @tags actions + * @name ActionsGetWorkflowRun + * @summary Get a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} */ - issuesGetEvent: ( - { owner, repo, eventId }: IssuesGetEventParams, + actionsGetWorkflowRun: ( + { owner, repo, runId }: ActionsGetWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, method: "GET", format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesGetLabel - * @summary Get a label - * @request GET:/repos/{owner}/{repo}/labels/{name} + * @tags actions + * @name ActionsGetWorkflowRunUsage + * @summary Get workflow run usage + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing */ - issuesGetLabel: ( - { owner, repo, name }: IssuesGetLabelParams, + actionsGetWorkflowRunUsage: ( + { owner, repo, runId }: ActionsGetWorkflowRunUsageParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, method: "GET", format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesGetMilestone - * @summary Get a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags actions + * @name ActionsGetWorkflowUsage + * @summary Get workflow usage + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing */ - issuesGetMilestone: ( - { owner, repo, milestoneNumber }: IssuesGetMilestoneParams, + actionsGetWorkflowUsage: ( + { owner, repo, workflowId }: ActionsGetWorkflowUsageParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, method: "GET", 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 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 issues - * @name IssuesListAssignees - * @summary List assignees - * @request GET:/repos/{owner}/{repo}/assignees + * @tags actions + * @name ActionsListArtifactsForRepo + * @summary List artifacts for a repository + * @request GET:/repos/{owner}/{repo}/actions/artifacts */ - issuesListAssignees: ( - { owner, repo, ...query }: IssuesListAssigneesParams, + actionsListArtifactsForRepo: ( + { owner, repo, ...query }: ActionsListArtifactsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/assignees\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts\`, method: "GET", query: query, format: "json", @@ -57924,19 +58436,19 @@ export class Api< }), /** - * @description Issue Comments are ordered by ascending ID. + * @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 issues - * @name IssuesListComments - * @summary List issue comments - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @tags actions + * @name ActionsListJobsForWorkflowRun + * @summary List jobs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs */ - issuesListComments: ( - { owner, repo, issueNumber, ...query }: IssuesListCommentsParams, + actionsListJobsForWorkflowRun: ( + { owner, repo, runId, ...query }: ActionsListJobsForWorkflowRunParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/jobs\`, method: "GET", query: query, format: "json", @@ -57944,41 +58456,39 @@ export class Api< }), /** - * @description By default, Issue Comments are ordered by ascending 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 issues - * @name IssuesListCommentsForRepo - * @summary List issue comments for a repository - * @request GET:/repos/{owner}/{repo}/issues/comments + * @tags actions + * @name ActionsListRepoSecrets + * @summary List repository secrets + * @request GET:/repos/{owner}/{repo}/actions/secrets */ - issuesListCommentsForRepo: ( - { owner, repo, ...query }: IssuesListCommentsForRepoParams, + actionsListRepoSecrets: ( + { owner, repo, ...query }: ActionsListRepoSecretsParams, params: RequestParams = {}, ) => - this.request( - { - path: \`/repos/\${owner}/\${repo}/issues/comments\`, - method: "GET", - query: query, - format: "json", - ...params, - }, - ), + 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 issues - * @name IssuesListEvents - * @summary List issue events - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events + * @tags actions + * @name ActionsListRepoWorkflows + * @summary List repository workflows + * @request GET:/repos/{owner}/{repo}/actions/workflows */ - issuesListEvents: ( - { owner, repo, issueNumber, ...query }: IssuesListEventsParams, + actionsListRepoWorkflows: ( + { owner, repo, ...query }: ActionsListRepoWorkflowsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows\`, method: "GET", query: query, format: "json", @@ -57986,46 +58496,38 @@ export class Api< }), /** - * No description + * @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 issues - * @name IssuesListEventsForRepo - * @summary List issue events for a repository - * @request GET:/repos/{owner}/{repo}/issues/events + * @tags actions + * @name ActionsListRunnerApplicationsForRepo + * @summary List runner applications for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/downloads */ - issuesListEventsForRepo: ( - { owner, repo, ...query }: IssuesListEventsForRepoParams, + actionsListRunnerApplicationsForRepo: ( + { owner, repo }: ActionsListRunnerApplicationsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/events\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesListEventsForTimeline - * @summary List timeline events for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline + * @tags actions + * @name ActionsListSelfHostedRunnersForRepo + * @summary List self-hosted runners for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners */ - issuesListEventsForTimeline: ( - { owner, repo, issueNumber, ...query }: IssuesListEventsForTimelineParams, + actionsListSelfHostedRunnersForRepo: ( + { owner, repo, ...query }: ActionsListSelfHostedRunnersForRepoParams, params: RequestParams = {}, ) => - this.request< - IssuesListEventsForTimelineData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/timeline\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners\`, method: "GET", query: query, format: "json", @@ -58033,19 +58535,19 @@ export class Api< }), /** - * @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 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 issues - * @name IssuesListForRepo - * @summary List repository issues - * @request GET:/repos/{owner}/{repo}/issues + * @tags actions + * @name ActionsListWorkflowRunArtifacts + * @summary List workflow run artifacts + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts */ - issuesListForRepo: ( - { owner, repo, ...query }: IssuesListForRepoParams, + actionsListWorkflowRunArtifacts: ( + { owner, repo, runId, ...query }: ActionsListWorkflowRunArtifactsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/artifacts\`, method: "GET", query: query, format: "json", @@ -58053,24 +58555,19 @@ export class Api< }), /** - * 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 issues - * @name IssuesListLabelsForMilestone - * @summary List labels for issues in a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels + * @tags actions + * @name ActionsListWorkflowRuns + * @summary List workflow runs + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs */ - issuesListLabelsForMilestone: ( - { - owner, - repo, - milestoneNumber, - ...query - }: IssuesListLabelsForMilestoneParams, + actionsListWorkflowRuns: ( + { owner, repo, workflowId, ...query }: ActionsListWorkflowRunsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}/labels\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/runs\`, method: "GET", query: query, format: "json", @@ -58078,19 +58575,19 @@ export class Api< }), /** - * 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 issues - * @name IssuesListLabelsForRepo - * @summary List labels for a repository - * @request GET:/repos/{owner}/{repo}/labels + * @tags actions + * @name ActionsListWorkflowRunsForRepo + * @summary List workflow runs for a repository + * @request GET:/repos/{owner}/{repo}/actions/runs */ - issuesListLabelsForRepo: ( - { owner, repo, ...query }: IssuesListLabelsForRepoParams, + actionsListWorkflowRunsForRepo: ( + { owner, repo, ...query }: ActionsListWorkflowRunsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs\`, method: "GET", query: query, format: "json", @@ -58098,190 +58595,223 @@ export class Api< }), /** - * 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 issues - * @name IssuesListLabelsOnIssue - * @summary List labels for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags actions + * @name ActionsReRunWorkflow + * @summary Re-run a workflow + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun */ - issuesListLabelsOnIssue: ( - { owner, repo, issueNumber, ...query }: IssuesListLabelsOnIssueParams, + actionsReRunWorkflow: ( + { owner, repo, runId }: ActionsReRunWorkflowParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, + method: "POST", ...params, }), /** - * No description + * @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 issues - * @name IssuesListMilestones - * @summary List milestones - * @request GET:/repos/{owner}/{repo}/milestones + * @tags actions + * @name ActionsSetAllowedActionsRepository + * @summary Set allowed actions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - issuesListMilestones: ( - { owner, repo, ...query }: IssuesListMilestonesParams, + actionsSetAllowedActionsRepository: ( + { owner, repo }: ActionsSetAllowedActionsRepositoryParams, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, + method: "PUT", + body: data, + type: ContentType.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 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 issues - * @name IssuesLock - * @summary Lock an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @tags actions + * @name ActionsSetGithubActionsPermissionsRepository + * @summary Set GitHub Actions permissions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions */ - issuesLock: ( - { owner, repo, issueNumber }: IssuesLockParams, - data: IssuesLockPayload, + actionsSetGithubActionsPermissionsRepository: ( + { owner, repo }: ActionsSetGithubActionsPermissionsRepositoryParams, + data: ActionsSetGithubActionsPermissionsRepositoryPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions\`, method: "PUT", body: data, type: ContentType.Json, ...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). + * + * @tags activity + * @name ActivityDeleteRepoSubscription + * @summary Delete a repository subscription + * @request DELETE:/repos/{owner}/{repo}/subscription + */ + activityDeleteRepoSubscription: ( + { owner, repo }: ActivityDeleteRepoSubscriptionParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, + method: "DELETE", + ...params, + }), + /** * No description * - * @tags issues - * @name IssuesRemoveAllLabels - * @summary Remove all labels from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags activity + * @name ActivityGetRepoSubscription + * @summary Get a repository subscription + * @request GET:/repos/{owner}/{repo}/subscription */ - issuesRemoveAllLabels: ( - { owner, repo, issueNumber }: IssuesRemoveAllLabelsParams, + activityGetRepoSubscription: ( + { owner, repo }: ActivityGetRepoSubscriptionParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags activity + * @name ActivityListRepoEvents + * @summary List repository events + * @request GET:/repos/{owner}/{repo}/events + */ + activityListRepoEvents: ( + { owner, repo, ...query }: ActivityListRepoEventsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/events\`, + method: "GET", + query: query, + format: "json", ...params, }), /** - * @description Removes one or more assignees from an issue. + * @description List all notifications for the current user. * - * @tags issues - * @name IssuesRemoveAssignees - * @summary Remove assignees from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @tags activity + * @name ActivityListRepoNotificationsForAuthenticatedUser + * @summary List repository notifications for the authenticated user + * @request GET:/repos/{owner}/{repo}/notifications */ - issuesRemoveAssignees: ( - { owner, repo, issueNumber }: IssuesRemoveAssigneesParams, - data: IssuesRemoveAssigneesPayload, + activityListRepoNotificationsForAuthenticatedUser: ( + { + owner, + repo, + ...query + }: ActivityListRepoNotificationsForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, - method: "DELETE", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/notifications\`, + method: "GET", + query: query, format: "json", ...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 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 issues - * @name IssuesRemoveLabel - * @summary Remove a label from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} + * @tags activity + * @name ActivityListStargazersForRepo + * @summary List stargazers + * @request GET:/repos/{owner}/{repo}/stargazers */ - issuesRemoveLabel: ( - { owner, repo, issueNumber, name }: IssuesRemoveLabelParams, + activityListStargazersForRepo: ( + { owner, repo, ...query }: ActivityListStargazersForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/stargazers\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Removes any previous labels and sets the new labels for an issue. + * @description Lists the people watching the specified repository. * - * @tags issues - * @name IssuesSetLabels - * @summary Set labels for an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags activity + * @name ActivityListWatchersForRepo + * @summary List watchers + * @request GET:/repos/{owner}/{repo}/subscribers */ - issuesSetLabels: ( - { owner, repo, issueNumber }: IssuesSetLabelsParams, - data: IssuesSetLabelsPayload, + activityListWatchersForRepo: ( + { owner, repo, ...query }: ActivityListWatchersForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscribers\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Users with push access can unlock an issue's conversation. + * @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 issues - * @name IssuesUnlock - * @summary Unlock an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @tags activity + * @name ActivityMarkRepoNotificationsAsRead + * @summary Mark repository notifications as read + * @request PUT:/repos/{owner}/{repo}/notifications */ - issuesUnlock: ( - { owner, repo, issueNumber }: IssuesUnlockParams, + activityMarkRepoNotificationsAsRead: ( + { owner, repo }: ActivityMarkRepoNotificationsAsReadParams, + data: ActivityMarkRepoNotificationsAsReadPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/notifications\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Issue owners and users with push access can edit an issue. + * @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 issues - * @name IssuesUpdate - * @summary Update an issue - * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} + * @tags activity + * @name ActivitySetRepoSubscription + * @summary Set a repository subscription + * @request PUT:/repos/{owner}/{repo}/subscription */ - issuesUpdate: ( - { owner, repo, issueNumber }: IssuesUpdateParams, - data: IssuesUpdatePayload, + activitySetRepoSubscription: ( + { owner, repo }: ActivitySetRepoSubscriptionParams, + data: ActivitySetRepoSubscriptionPayload, params: RequestParams = {}, ) => - this.request< - IssuesUpdateData, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -58289,43 +58819,40 @@ export class Api< }), /** - * No description + * @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 issues - * @name IssuesUpdateComment - * @summary Update an issue comment - * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags apps + * @name AppsGetRepoInstallation + * @summary Get a repository installation for the authenticated app + * @request GET:/repos/{owner}/{repo}/installation */ - issuesUpdateComment: ( - { owner, repo, commentId }: IssuesUpdateCommentParams, - data: IssuesUpdateCommentPayload, + appsGetRepoInstallation: ( + { owner, repo }: AppsGetRepoInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/installation\`, + 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. 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 IssuesUpdateLabel - * @summary Update a label - * @request PATCH:/repos/{owner}/{repo}/labels/{name} + * @tags checks + * @name ChecksCreate + * @summary Create a check run + * @request POST:/repos/{owner}/{repo}/check-runs */ - issuesUpdateLabel: ( - { owner, repo, name }: IssuesUpdateLabelParams, - data: IssuesUpdateLabelPayload, + checksCreate: ( + { owner, repo }: ChecksCreateParams, + data: ChecksCreatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -58333,21 +58860,21 @@ 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 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 issues - * @name IssuesUpdateMilestone - * @summary Update a milestone - * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags checks + * @name ChecksCreateSuite + * @summary Create a check suite + * @request POST:/repos/{owner}/{repo}/check-suites */ - issuesUpdateMilestone: ( - { owner, repo, milestoneNumber }: IssuesUpdateMilestoneParams, - data: IssuesUpdateMilestonePayload, + checksCreateSuite: ( + { owner, repo }: ChecksCreateSuiteParams, + data: ChecksCreateSuitePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -58355,56 +58882,57 @@ 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 **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 licenses - * @name LicensesGetForRepo - * @summary Get the license for a repository - * @request GET:/repos/{owner}/{repo}/license + * @tags checks + * @name ChecksGet + * @summary Get a check run + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - licensesGetForRepo: ( - { owner, repo }: LicensesGetForRepoParams, + checksGet: ( + { owner, repo, checkRunId }: ChecksGetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/license\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, method: "GET", format: "json", ...params, }), /** - * @description Stop an import for 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\`. 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 migrations - * @name MigrationsCancelImport - * @summary Cancel an import - * @request DELETE:/repos/{owner}/{repo}/import + * @tags checks + * @name ChecksGetSuite + * @summary Get a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} */ - migrationsCancelImport: ( - { owner, repo }: MigrationsCancelImportParams, + checksGetSuite: ( + { owner, repo, checkSuiteId }: ChecksGetSuiteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, + 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 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 migrations - * @name MigrationsGetCommitAuthors - * @summary Get commit authors - * @request GET:/repos/{owner}/{repo}/import/authors + * @tags checks + * @name ChecksListAnnotations + * @summary List check run annotations + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations */ - migrationsGetCommitAuthors: ( - { owner, repo, ...query }: MigrationsGetCommitAuthorsParams, + checksListAnnotations: ( + { owner, repo, checkRunId, ...query }: ChecksListAnnotationsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/authors\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}/annotations\`, method: "GET", query: query, format: "json", @@ -58412,126 +58940,98 @@ export class Api< }), /** - * @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 **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 migrations - * @name MigrationsGetImportStatus - * @summary Get an import status - * @request GET:/repos/{owner}/{repo}/import + * @tags checks + * @name ChecksListForRef + * @summary List check runs for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs */ - migrationsGetImportStatus: ( - { owner, repo }: MigrationsGetImportStatusParams, + checksListForRef: ( + { owner, repo, ref, ...query }: ChecksListForRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description List files larger than 100MB found during the import + * @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 migrations - * @name MigrationsGetLargeFiles - * @summary Get large files - * @request GET:/repos/{owner}/{repo}/import/large_files + * @tags checks + * @name ChecksListForSuite + * @summary List check runs in a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs */ - migrationsGetLargeFiles: ( - { owner, repo }: MigrationsGetLargeFilesParams, + checksListForSuite: ( + { owner, repo, checkSuiteId, ...query }: ChecksListForSuiteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/large_files\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/check-runs\`, method: "GET", + query: query, 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 **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 migrations - * @name MigrationsSetLfsPreference - * @summary Update Git LFS preference - * @request PATCH:/repos/{owner}/{repo}/import/lfs + * @tags checks + * @name ChecksListSuitesForRef + * @summary List check suites for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites */ - migrationsSetLfsPreference: ( - { owner, repo }: MigrationsSetLfsPreferenceParams, - data: MigrationsSetLfsPreferencePayload, + checksListSuitesForRef: ( + { owner, repo, ref, ...query }: ChecksListSuitesForRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/lfs\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-suites\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Start a source import to a GitHub repository using GitHub Importer. + * @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 migrations - * @name MigrationsStartImport - * @summary Start an import - * @request PUT:/repos/{owner}/{repo}/import + * @tags checks + * @name ChecksRerequestSuite + * @summary Rerequest a check suite + * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest */ - migrationsStartImport: ( - { owner, repo }: MigrationsStartImportParams, - data: MigrationsStartImportPayload, + checksRerequestSuite: ( + { owner, repo, checkSuiteId }: ChecksRerequestSuiteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, + method: "POST", ...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 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 migrations - * @name MigrationsUpdateImport - * @summary Update an import - * @request PATCH:/repos/{owner}/{repo}/import + * @tags checks + * @name ChecksSetSuitesPreferences + * @summary Update repository preferences for check suites + * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences */ - migrationsUpdateImport: ( - { owner, repo }: MigrationsUpdateImportParams, - data: MigrationsUpdateImportPayload, + checksSetSuitesPreferences: ( + { owner, repo }: ChecksSetSuitesPreferencesParams, + data: ChecksSetSuitesPreferencesPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/preferences\`, method: "PATCH", body: data, type: ContentType.Json, @@ -58540,24 +59040,21 @@ 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 **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 projects - * @name ProjectsCreateForRepo - * @summary Create a repository project - * @request POST:/repos/{owner}/{repo}/projects + * @tags checks + * @name ChecksUpdate + * @summary Update a check run + * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - projectsCreateForRepo: ( - { owner, repo }: ProjectsCreateForRepoParams, - data: ProjectsCreateForRepoPayload, + checksUpdate: ( + { owner, repo, checkRunId }: ChecksUpdateParams, + data: ChecksUpdatePayload, params: RequestParams = {}, ) => - this.request< - ProjectsCreateForRepoData, - BasicError | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/projects\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -58565,132 +59062,96 @@ export class Api< }), /** - * @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 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 pulls - * @name PullsCheckIfMerged - * @summary Check if a pull request has been merged - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge + * @tags code-scanning + * @name CodeScanningGetAlert + * @summary Get a code scanning alert + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - pullsCheckIfMerged: ( - { owner, repo, pullNumber }: PullsCheckIfMergedParams, + codeScanningGetAlert: ( + { owner, repo, alertNumber }: CodeScanningGetAlertParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, + this.request< + CodeScanningGetAlertData, + | void + | BasicError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, method: "GET", - ...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. - * - * @tags pulls - * @name PullsCreate - * @summary Create a pull request - * @request POST:/repos/{owner}/{repo}/pulls - */ - pullsCreate: ( - { owner, repo }: PullsCreateParams, - data: PullsCreatePayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls\`, - method: "POST", - body: data, - type: ContentType.Json, 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 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 pulls - * @name PullsCreateReplyForReviewComment - * @summary Create a reply for a review comment - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies + * @tags code-scanning + * @name CodeScanningListAlertsForRepo + * @summary List code scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts */ - pullsCreateReplyForReviewComment: ( - { - owner, - repo, - pullNumber, - commentId, - }: PullsCreateReplyForReviewCommentParams, - data: PullsCreateReplyForReviewCommentPayload, + codeScanningListAlertsForRepo: ( + { owner, repo, ...query }: CodeScanningListAlertsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments/\${commentId}/replies\`, - method: "POST", - body: data, - type: ContentType.Json, + 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 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 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 pulls - * @name PullsCreateReview - * @summary Create a review for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + * @tags code-scanning + * @name CodeScanningListRecentAnalyses + * @summary List recent code scanning analyses for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/analyses */ - pullsCreateReview: ( - { owner, repo, pullNumber }: PullsCreateReviewParams, - data: PullsCreateReviewPayload, + codeScanningListRecentAnalyses: ( + { owner, repo, ...query }: CodeScanningListRecentAnalysesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/analyses\`, + 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 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 pulls - * @name PullsCreateReviewComment - * @summary Create a review comment for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @tags code-scanning + * @name CodeScanningUpdateAlert + * @summary Update a code scanning alert + * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - pullsCreateReviewComment: ( - { owner, repo, pullNumber }: PullsCreateReviewCommentParams, - data: PullsCreateReviewCommentPayload, + codeScanningUpdateAlert: ( + { owner, repo, alertNumber }: CodeScanningUpdateAlertParams, + data: CodeScanningUpdateAlertPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -58698,61 +59159,61 @@ export class Api< }), /** - * No description + * @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 pulls - * @name PullsDeletePendingReview - * @summary Delete a pending review for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags code-scanning + * @name CodeScanningUploadSarif + * @summary Upload a SARIF file + * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs */ - pullsDeletePendingReview: ( - { owner, repo, pullNumber, reviewId }: PullsDeletePendingReviewParams, + codeScanningUploadSarif: ( + { owner, repo }: CodeScanningUploadSarifParams, + data: CodeScanningUploadSarifPayload, params: RequestParams = {}, ) => - this.request< - PullsDeletePendingReviewData, - BasicError | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "DELETE", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/sarifs\`, + method: "POST", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Deletes a review comment. + * @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 pulls - * @name PullsDeleteReviewComment - * @summary Delete a review comment for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags codes-of-conduct + * @name CodesOfConductGetForRepo + * @summary Get the code of conduct for a repository + * @request GET:/repos/{owner}/{repo}/community/code_of_conduct */ - pullsDeleteReviewComment: ( - { owner, repo, commentId }: PullsDeleteReviewCommentParams, + codesOfConductGetForRepo: ( + { owner, repo }: CodesOfConductGetForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, + method: "GET", + 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. + * No description * - * @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 GitCreateBlob + * @summary Create a blob + * @request POST:/repos/{owner}/{repo}/git/blobs */ - pullsDismissReview: ( - { owner, repo, pullNumber, reviewId }: PullsDismissReviewParams, - data: PullsDismissReviewPayload, + gitCreateBlob: ( + { owner, repo }: GitCreateBlobParams, + data: GitCreateBlobPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/dismissals\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/blobs\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -58760,202 +59221,201 @@ export class Api< }), /** - * @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 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 PullsGet - * @summary Get a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} + * @tags git + * @name GitCreateCommit + * @summary Create a commit + * @request POST:/repos/{owner}/{repo}/git/commits */ - pullsGet: ( - { owner, repo, pullNumber }: PullsGetParams, + gitCreateCommit: ( + { owner, repo }: GitCreateCommitParams, + data: GitCreateCommitPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/commits\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @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 PullsGetReview - * @summary Get a review for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags git + * @name GitCreateRef + * @summary Create a reference + * @request POST:/repos/{owner}/{repo}/git/refs */ - pullsGetReview: ( - { owner, repo, pullNumber, reviewId }: PullsGetReviewParams, + gitCreateRef: ( + { owner, repo }: GitCreateRefParams, + data: GitCreateRefPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Provides details for a review comment. + * @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 PullsGetReviewComment - * @summary Get a review comment for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags git + * @name GitCreateTag + * @summary Create a tag object + * @request POST:/repos/{owner}/{repo}/git/tags */ - pullsGetReviewComment: ( - { owner, repo, commentId }: PullsGetReviewCommentParams, + gitCreateTag: ( + { owner, repo }: GitCreateTagParams, + data: GitCreateTagPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/tags\`, + method: "POST", + body: data, + type: ContentType.Json, 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 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 PullsList - * @summary List pull requests - * @request GET:/repos/{owner}/{repo}/pulls + * @tags git + * @name GitCreateTree + * @summary Create a tree + * @request POST:/repos/{owner}/{repo}/git/trees */ - pullsList: ( - { owner, repo, ...query }: PullsListParams, + gitCreateTree: ( + { owner, repo }: GitCreateTreeParams, + data: GitCreateTreePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/trees\`, + method: "POST", + 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: ( - { - owner, - repo, - pullNumber, - reviewId, - ...query - }: PullsListCommentsForReviewParams, + gitDeleteRef: ( + { owner, repo, ref }: GitDeleteRefParams, 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 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 The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. * - * @tags pulls - * @name PullsListCommits - * @summary List commits on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits + * @tags git + * @name GitGetBlob + * @summary Get a blob + * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} */ - pullsListCommits: ( - { owner, repo, pullNumber, ...query }: PullsListCommitsParams, + gitGetBlob: ( + { owner, repo, fileSha }: GitGetBlobParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. + * @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 PullsListFiles - * @summary List pull requests files - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files + * @tags git + * @name GitGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} */ - pullsListFiles: ( - { owner, repo, pullNumber, ...query }: PullsListFilesParams, + gitGetCommit: ( + { owner, repo, commitSha }: GitGetCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, 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 PullsListRequestedReviewers - * @summary List requested reviewers for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags git + * @name GitGetRef + * @summary Get a reference + * @request GET:/repos/{owner}/{repo}/git/ref/{ref} */ - pullsListRequestedReviewers: ( - { owner, repo, pullNumber, ...query }: PullsListRequestedReviewersParams, + gitGetRef: ( + { owner, repo, ref }: GitGetRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. + * @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 PullsListReviewComments - * @summary List review comments on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @tags git + * @name GitGetTag + * @summary Get a tag + * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} */ - pullsListReviewComments: ( - { owner, repo, pullNumber, ...query }: PullsListReviewCommentsParams, + gitGetTag: ( + { owner, repo, tagSha }: GitGetTagParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, method: "GET", - query: query, 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 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 pulls - * @name PullsListReviewCommentsForRepo - * @summary List review comments in a repository - * @request GET:/repos/{owner}/{repo}/pulls/comments + * @tags git + * @name GitGetTree + * @summary Get a tree + * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} */ - pullsListReviewCommentsForRepo: ( - { owner, repo, ...query }: PullsListReviewCommentsForRepoParams, + gitGetTree: ( + { owner, repo, treeSha, ...query }: GitGetTreeParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, method: "GET", query: query, format: "json", @@ -58963,128 +59423,100 @@ export class Api< }), /** - * @description The list of reviews returns in chronological order. + * @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 PullsListReviews - * @summary List reviews for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews + * @tags git + * @name GitListMatchingRefs + * @summary List matching references + * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} */ - pullsListReviews: ( - { owner, repo, pullNumber, ...query }: PullsListReviewsParams, + gitListMatchingRefs: ( + { owner, repo, ref, ...query }: GitListMatchingRefsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, method: "GET", query: query, 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. - * - * @tags pulls - * @name PullsMerge - * @summary Merge a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge - */ - pullsMerge: ( - { owner, repo, pullNumber }: PullsMergeParams, - data: PullsMergePayload, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, - method: "PUT", - body: data, - type: ContentType.Json, - format: "json", - ...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 git + * @name GitUpdateRef + * @summary Update a reference + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} */ - pullsRemoveRequestedReviewers: ( - { owner, repo, pullNumber }: PullsRemoveRequestedReviewersParams, - data: PullsRemoveRequestedReviewersPayload, + gitUpdateRef: ( + { owner, repo, ref }: GitUpdateRefParams, + data: GitUpdateRefPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + method: "PATCH", 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 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 pulls - * @name PullsRequestReviewers - * @summary Request reviewers for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags interactions + * @name InteractionsGetRestrictionsForRepo + * @summary Get interaction restrictions for a repository + * @request GET:/repos/{owner}/{repo}/interaction-limits */ - pullsRequestReviewers: ( - { owner, repo, pullNumber }: PullsRequestReviewersParams, - data: PullsRequestReviewersPayload, + interactionsGetRestrictionsForRepo: ( + { owner, repo }: InteractionsGetRestrictionsForRepoParams, 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}/interaction-limits\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @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 pulls - * @name PullsSubmitReview - * @summary Submit a review for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events + * @tags interactions + * @name InteractionsRemoveRestrictionsForRepo + * @summary Remove interaction restrictions for a repository + * @request DELETE:/repos/{owner}/{repo}/interaction-limits */ - pullsSubmitReview: ( - { owner, repo, pullNumber, reviewId }: PullsSubmitReviewParams, - data: PullsSubmitReviewPayload, + interactionsRemoveRestrictionsForRepo: ( + { owner, repo }: InteractionsRemoveRestrictionsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/events\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + 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. 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 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 pulls - * @name PullsUpdate - * @summary Update a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} + * @tags interactions + * @name InteractionsSetRestrictionsForRepo + * @summary Set interaction restrictions for a repository + * @request PUT:/repos/{owner}/{repo}/interaction-limits */ - pullsUpdate: ( - { owner, repo, pullNumber }: PullsUpdateParams, - data: PullsUpdatePayload, + interactionsSetRestrictionsForRepo: ( + { owner, repo }: InteractionsSetRestrictionsForRepoParams, + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -59092,29 +59524,21 @@ export class Api< }), /** - * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. * - * @tags pulls - * @name PullsUpdateBranch - * @summary Update a pull request branch - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch + * @tags issues + * @name IssuesAddAssignees + * @summary Add assignees to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - pullsUpdateBranch: ( - { owner, repo, pullNumber }: PullsUpdateBranchParams, - data: PullsUpdateBranchPayload, + issuesAddAssignees: ( + { owner, repo, issueNumber }: IssuesAddAssigneesParams, + data: IssuesAddAssigneesPayload, params: RequestParams = {}, ) => - this.request< - PullsUpdateBranchData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/update-branch\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -59122,21 +59546,21 @@ export class Api< }), /** - * @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 issues + * @name IssuesAddLabels + * @summary Add labels to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - pullsUpdateReview: ( - { owner, repo, pullNumber, reviewId }: PullsUpdateReviewParams, - data: PullsUpdateReviewPayload, + issuesAddLabels: ( + { owner, repo, issueNumber }: IssuesAddLabelsParams, + data: IssuesAddLabelsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -59144,49 +59568,50 @@ export class Api< }), /** - * @description Enables you to edit a review comment. + * @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 pulls - * @name PullsUpdateReviewComment - * @summary Update a review comment for a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags issues + * @name IssuesCheckUserCanBeAssigned + * @summary Check if a user can be assigned + * @request GET:/repos/{owner}/{repo}/assignees/{assignee} */ - pullsUpdateReviewComment: ( - { owner, repo, commentId }: PullsUpdateReviewCommentParams, - data: PullsUpdateReviewCommentPayload, + issuesCheckUserCanBeAssigned: ( + { owner, repo, assignee }: IssuesCheckUserCanBeAssignedParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request< + IssuesCheckUserCanBeAssignedData, + IssuesCheckUserCanBeAssignedError + >({ + path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, + method: "GET", ...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. + * @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 reactions - * @name ReactionsCreateForCommitComment - * @summary Create reaction for a commit comment - * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @tags issues + * @name IssuesCreate + * @summary Create an issue + * @request POST:/repos/{owner}/{repo}/issues */ - reactionsCreateForCommitComment: ( - { owner, repo, commentId }: ReactionsCreateForCommitCommentParams, - data: ReactionsCreateForCommitCommentPayload, + issuesCreate: ( + { owner, repo }: IssuesCreateParams, + data: IssuesCreatePayload, params: RequestParams = {}, ) => this.request< - ReactionsCreateForCommitCommentData, + IssuesCreateData, + | BasicError + | ValidationError | { - documentation_url: string; - message: string; + code?: string; + documentation_url?: string; + message?: string; } - | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + path: \`/repos/\${owner}/\${repo}/issues\`, method: "POST", body: data, type: ContentType.Json, @@ -59195,27 +59620,20 @@ 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 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 reactions - * @name ReactionsCreateForIssue - * @summary Create reaction for an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @tags issues + * @name IssuesCreateComment + * @summary Create an issue comment + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - reactionsCreateForIssue: ( - { owner, repo, issueNumber }: ReactionsCreateForIssueParams, - data: ReactionsCreateForIssuePayload, + issuesCreateComment: ( + { owner, repo, issueNumber }: IssuesCreateCommentParams, + data: IssuesCreateCommentPayload, params: RequestParams = {}, ) => - this.request< - ReactionsCreateForIssueData, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, method: "POST", body: data, type: ContentType.Json, @@ -59224,27 +59642,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 issues + * @name IssuesCreateLabel + * @summary Create a label + * @request POST:/repos/{owner}/{repo}/labels */ - reactionsCreateForIssueComment: ( - { owner, repo, commentId }: ReactionsCreateForIssueCommentParams, - data: ReactionsCreateForIssueCommentPayload, + issuesCreateLabel: ( + { owner, repo }: IssuesCreateLabelParams, + data: IssuesCreateLabelPayload, params: RequestParams = {}, ) => - this.request< - ReactionsCreateForIssueCommentData, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", body: data, type: ContentType.Json, @@ -59253,31 +59664,20 @@ 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. + * No description * - * @tags reactions - * @name ReactionsCreateForPullRequestReviewComment - * @summary Create reaction for a pull request review comment - * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @tags issues + * @name IssuesCreateMilestone + * @summary Create a milestone + * @request POST:/repos/{owner}/{repo}/milestones */ - reactionsCreateForPullRequestReviewComment: ( - { - owner, - repo, - commentId, - }: ReactionsCreateForPullRequestReviewCommentParams, - data: ReactionsCreateForPullRequestReviewCommentPayload, + issuesCreateMilestone: ( + { owner, repo }: IssuesCreateMilestoneParams, + data: IssuesCreateMilestonePayload, params: RequestParams = {}, ) => - this.request< - ReactionsCreateForPullRequestReviewCommentData, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones\`, method: "POST", body: data, type: ContentType.Json, @@ -59286,167 +59686,168 @@ 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 issues + * @name IssuesDeleteComment + * @summary Delete an issue comment + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - reactionsDeleteForCommitComment: ( - { - owner, - repo, - commentId, - reactionId, - }: ReactionsDeleteForCommitCommentParams, + issuesDeleteComment: ( + { owner, repo, commentId }: IssuesDeleteCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions/\${reactionId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", ...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 issues + * @name IssuesDeleteLabel + * @summary Delete a label + * @request DELETE:/repos/{owner}/{repo}/labels/{name} */ - reactionsDeleteForIssue: ( - { owner, repo, issueNumber, reactionId }: ReactionsDeleteForIssueParams, + issuesDeleteLabel: ( + { owner, repo, name }: IssuesDeleteLabelParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions/\${reactionId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", ...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 issues + * @name IssuesDeleteMilestone + * @summary Delete a milestone + * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} */ - reactionsDeleteForIssueComment: ( - { - owner, - repo, - commentId, - reactionId, - }: ReactionsDeleteForIssueCommentParams, + issuesDeleteMilestone: ( + { owner, repo, milestoneNumber }: IssuesDeleteMilestoneParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions/\${reactionId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, method: "DELETE", ...params, }), /** - * @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 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 reactions - * @name ReactionsDeleteForPullRequestComment - * @summary Delete a pull request comment reaction - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} + * @tags issues + * @name IssuesGet + * @summary Get an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number} */ - reactionsDeleteForPullRequestComment: ( - { - owner, - repo, - commentId, - reactionId, - }: ReactionsDeleteForPullRequestCommentParams, + issuesGet: ( + { owner, repo, issueNumber }: IssuesGetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, + method: "GET", + format: "json", ...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 issues + * @name IssuesGetComment + * @summary Get an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - reactionsListForCommitComment: ( - { owner, repo, commentId, ...query }: ReactionsListForCommitCommentParams, + issuesGetComment: ( + { owner, repo, commentId }: IssuesGetCommentParams, params: RequestParams = {}, ) => - this.request< - ReactionsListForCommitCommentData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). + * No description * - * @tags reactions - * @name ReactionsListForIssue - * @summary List reactions for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @tags issues + * @name IssuesGetEvent + * @summary Get an issue event + * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} */ - reactionsListForIssue: ( - { owner, repo, issueNumber, ...query }: ReactionsListForIssueParams, + issuesGetEvent: ( + { owner, repo, eventId }: IssuesGetEventParams, params: RequestParams = {}, ) => - this.request< - ReactionsListForIssueData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * No description * - * @tags reactions - * @name ReactionsListForIssueComment - * @summary List reactions for an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * @tags issues + * @name IssuesGetLabel + * @summary Get a label + * @request GET:/repos/{owner}/{repo}/labels/{name} */ - reactionsListForIssueComment: ( - { owner, repo, commentId, ...query }: ReactionsListForIssueCommentParams, + issuesGetLabel: ( + { owner, repo, name }: IssuesGetLabelParams, params: RequestParams = {}, ) => - this.request< - ReactionsListForIssueCommentData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + method: "GET", + format: "json", + ...params, + }), + + /** + * No description + * + * @tags issues + * @name IssuesGetMilestone + * @summary Get a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} + */ + issuesGetMilestone: ( + { owner, repo, milestoneNumber }: IssuesGetMilestoneParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + method: "GET", + 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. + * + * @tags issues + * @name IssuesListAssignees + * @summary List assignees + * @request GET:/repos/{owner}/{repo}/assignees + */ + issuesListAssignees: ( + { owner, repo, ...query }: IssuesListAssigneesParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/assignees\`, method: "GET", query: query, format: "json", @@ -59454,31 +59855,19 @@ export class Api< }), /** - * @description List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + * @description Issue Comments are ordered by ascending ID. * - * @tags reactions - * @name ReactionsListForPullRequestReviewComment - * @summary List reactions for a pull request review comment - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @tags issues + * @name IssuesListComments + * @summary List issue comments + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - reactionsListForPullRequestReviewComment: ( - { - owner, - repo, - commentId, - ...query - }: ReactionsListForPullRequestReviewCommentParams, + issuesListComments: ( + { owner, repo, issueNumber, ...query }: IssuesListCommentsParams, params: RequestParams = {}, ) => - this.request< - ReactionsListForPullRequestReviewCommentData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, method: "GET", query: query, format: "json", @@ -59486,230 +59875,254 @@ 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. 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 By default, Issue Comments are ordered by ascending ID. * - * @tags repos - * @name ReposAddAppAccessRestrictions - * @summary Add app access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags issues + * @name IssuesListCommentsForRepo + * @summary List issue comments for a repository + * @request GET:/repos/{owner}/{repo}/issues/comments */ - reposAddAppAccessRestrictions: ( - { owner, repo, branch }: ReposAddAppAccessRestrictionsParams, - data: ReposAddAppAccessRestrictionsPayload, + issuesListCommentsForRepo: ( + { owner, repo, ...query }: IssuesListCommentsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request( + { + path: \`/repos/\${owner}/\${repo}/issues/comments\`, + method: "GET", + query: query, + format: "json", + ...params, + }, + ), + + /** + * No description + * + * @tags issues + * @name IssuesListEvents + * @summary List issue events + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events + */ + issuesListEvents: ( + { owner, repo, issueNumber, ...query }: IssuesListEventsParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, + 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. 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 issues + * @name IssuesListEventsForRepo + * @summary List issue events for a repository + * @request GET:/repos/{owner}/{repo}/issues/events */ - reposAddCollaborator: ( - { owner, repo, username }: ReposAddCollaboratorParams, - data: ReposAddCollaboratorPayload, + issuesListEventsForRepo: ( + { owner, repo, ...query }: IssuesListEventsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/events\`, + 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 ReposAddStatusCheckContexts - * @summary Add status check contexts - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags issues + * @name IssuesListEventsForTimeline + * @summary List timeline events for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline */ - reposAddStatusCheckContexts: ( - { owner, repo, branch }: ReposAddStatusCheckContextsParams, - data: ReposAddStatusCheckContextsPayload, + issuesListEventsForTimeline: ( + { owner, repo, issueNumber, ...query }: IssuesListEventsForTimelineParams, params: RequestParams = {}, ) => this.request< - ReposAddStatusCheckContextsData, - BasicError | ValidationError + IssuesListEventsForTimelineData, + | BasicError + | { + documentation_url: string; + message: string; + } >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, - method: "POST", - body: data, - type: ContentType.Json, + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/timeline\`, + 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 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 ReposAddTeamAccessRestrictions - * @summary Add team access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags issues + * @name IssuesListForRepo + * @summary List repository issues + * @request GET:/repos/{owner}/{repo}/issues */ - reposAddTeamAccessRestrictions: ( - { owner, repo, branch }: ReposAddTeamAccessRestrictionsParams, - data: ReposAddTeamAccessRestrictionsPayload, + issuesListForRepo: ( + { owner, repo, ...query }: IssuesListForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues\`, + 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 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. | + * No description * - * @tags repos - * @name ReposAddUserAccessRestrictions - * @summary Add user access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags issues + * @name IssuesListLabelsForMilestone + * @summary List labels for issues in a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels */ - reposAddUserAccessRestrictions: ( - { owner, repo, branch }: ReposAddUserAccessRestrictionsParams, - data: ReposAddUserAccessRestrictionsPayload, + issuesListLabelsForMilestone: ( + { + owner, + repo, + milestoneNumber, + ...query + }: IssuesListLabelsForMilestoneParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}/labels\`, + method: "GET", + query: query, 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. + * No description * - * @tags repos - * @name ReposCheckCollaborator - * @summary Check if a user is a repository collaborator - * @request GET:/repos/{owner}/{repo}/collaborators/{username} + * @tags issues + * @name IssuesListLabelsForRepo + * @summary List labels for a repository + * @request GET:/repos/{owner}/{repo}/labels */ - reposCheckCollaborator: ( - { owner, repo, username }: ReposCheckCollaboratorParams, + issuesListLabelsForRepo: ( + { owner, repo, ...query }: IssuesListLabelsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels\`, method: "GET", + query: query, + format: "json", ...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)". + * No description * - * @tags repos - * @name ReposCheckVulnerabilityAlerts - * @summary Check if vulnerability alerts are enabled for a repository - * @request GET:/repos/{owner}/{repo}/vulnerability-alerts + * @tags issues + * @name IssuesListLabelsOnIssue + * @summary List labels for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposCheckVulnerabilityAlerts: ( - { owner, repo }: ReposCheckVulnerabilityAlertsParams, + issuesListLabelsOnIssue: ( + { owner, repo, issueNumber, ...query }: IssuesListLabelsOnIssueParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, 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. | + * No description * - * @tags repos - * @name ReposCompareCommits - * @summary Compare two commits - * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} + * @tags issues + * @name IssuesListMilestones + * @summary List milestones + * @request GET:/repos/{owner}/{repo}/milestones */ - reposCompareCommits: ( - { owner, repo, base, head }: ReposCompareCommitsParams, + issuesListMilestones: ( + { owner, repo, ...query }: IssuesListMilestonesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones\`, method: "GET", + query: query, 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 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 ReposCreateCommitComment - * @summary Create a commit comment - * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @tags issues + * @name IssuesLock + * @summary Lock an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - reposCreateCommitComment: ( - { owner, repo, commitSha }: ReposCreateCommitCommentParams, - data: ReposCreateCommitCommentPayload, + issuesLock: ( + { owner, repo, issueNumber }: IssuesLockParams, + data: IssuesLockPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, + 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. 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. + * No description * - * @tags repos - * @name ReposCreateCommitSignatureProtection - * @summary Create commit signature protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags issues + * @name IssuesRemoveAllLabels + * @summary Remove all labels from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposCreateCommitSignatureProtection: ( - { owner, repo, branch }: ReposCreateCommitSignatureProtectionParams, + issuesRemoveAllLabels: ( + { owner, repo, issueNumber }: IssuesRemoveAllLabelsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, - method: "POST", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "DELETE", ...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 Removes one or more assignees from an issue. * - * @tags repos - * @name ReposCreateCommitStatus - * @summary Create a commit status - * @request POST:/repos/{owner}/{repo}/statuses/{sha} + * @tags issues + * @name IssuesRemoveAssignees + * @summary Remove assignees from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - reposCreateCommitStatus: ( - { owner, repo, sha }: ReposCreateCommitStatusParams, - data: ReposCreateCommitStatusPayload, + issuesRemoveAssignees: ( + { owner, repo, issueNumber }: IssuesRemoveAssigneesParams, + data: IssuesRemoveAssigneesPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/statuses/\${sha}\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + method: "DELETE", body: data, type: ContentType.Json, format: "json", @@ -59717,43 +60130,40 @@ export class Api< }), /** - * @description You can create a read-only deploy key. + * @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 ReposCreateDeployKey - * @summary Create a deploy key - * @request POST:/repos/{owner}/{repo}/keys + * @tags issues + * @name IssuesRemoveLabel + * @summary Remove a label from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} */ - reposCreateDeployKey: ( - { owner, repo }: ReposCreateDeployKeyParams, - data: ReposCreateDeployKeyPayload, + issuesRemoveLabel: ( + { owner, repo, issueNumber, name }: IssuesRemoveLabelParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, + method: "DELETE", 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 Removes any previous labels and sets the new labels for an issue. * - * @tags repos - * @name ReposCreateDeployment - * @summary Create a deployment - * @request POST:/repos/{owner}/{repo}/deployments + * @tags issues + * @name IssuesSetLabels + * @summary Set labels for an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - reposCreateDeployment: ( - { owner, repo }: ReposCreateDeploymentParams, - data: ReposCreateDeploymentPayload, + issuesSetLabels: ( + { owner, repo, issueNumber }: IssuesSetLabelsParams, + data: IssuesSetLabelsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -59761,64 +60171,70 @@ 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 Users with push access can unlock an issue's conversation. * - * @tags repos - * @name ReposCreateDeploymentStatus - * @summary Create a deployment status - * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @tags issues + * @name IssuesUnlock + * @summary Unlock an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - reposCreateDeploymentStatus: ( - { owner, repo, deploymentId }: ReposCreateDeploymentStatusParams, - data: ReposCreateDeploymentStatusPayload, + issuesUnlock: ( + { owner, repo, issueNumber }: IssuesUnlockParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, + method: "DELETE", ...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 Issue owners and users with push access can edit an issue. * - * @tags repos - * @name ReposCreateDispatchEvent - * @summary Create a repository dispatch event - * @request POST:/repos/{owner}/{repo}/dispatches + * @tags issues + * @name IssuesUpdate + * @summary Update an issue + * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} */ - reposCreateDispatchEvent: ( - { owner, repo }: ReposCreateDispatchEventParams, - data: ReposCreateDispatchEventPayload, + issuesUpdate: ( + { owner, repo, issueNumber }: IssuesUpdateParams, + data: IssuesUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/dispatches\`, - method: "POST", + 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, + 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). + * No description * - * @tags repos - * @name ReposCreateFork - * @summary Create a fork - * @request POST:/repos/{owner}/{repo}/forks + * @tags issues + * @name IssuesUpdateComment + * @summary Update an issue comment + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - reposCreateFork: ( - { owner, repo }: ReposCreateForkParams, - data: ReposCreateForkPayload, + issuesUpdateComment: ( + { owner, repo, commentId }: IssuesUpdateCommentParams, + data: IssuesUpdateCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/forks\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -59826,24 +60242,21 @@ export class Api< }), /** - * @description Creates a new file or replaces an existing file in a repository. + * No description * - * @tags repos - * @name ReposCreateOrUpdateFileContents - * @summary Create or update file contents - * @request PUT:/repos/{owner}/{repo}/contents/{path} + * @tags issues + * @name IssuesUpdateLabel + * @summary Update a label + * @request PATCH:/repos/{owner}/{repo}/labels/{name} */ - reposCreateOrUpdateFileContents: ( - { owner, repo, path }: ReposCreateOrUpdateFileContentsParams, - data: ReposCreateOrUpdateFileContentsPayload, + issuesUpdateLabel: ( + { owner, repo, name }: IssuesUpdateLabelParams, + data: IssuesUpdateLabelPayload, params: RequestParams = {}, ) => - this.request< - ReposCreateOrUpdateFileContentsData, - BasicError | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -59851,29 +60264,21 @@ export class Api< }), /** - * @description Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." + * No description * - * @tags repos - * @name ReposCreatePagesSite - * @summary Create a GitHub Pages site - * @request POST:/repos/{owner}/{repo}/pages + * @tags issues + * @name IssuesUpdateMilestone + * @summary Update a milestone + * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} */ - reposCreatePagesSite: ( - { owner, repo }: ReposCreatePagesSiteParams, - data: ReposCreatePagesSitePayload, + issuesUpdateMilestone: ( + { owner, repo, milestoneNumber }: IssuesUpdateMilestoneParams, + data: IssuesUpdateMilestonePayload, params: RequestParams = {}, ) => - this.request< - ReposCreatePagesSiteData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -59881,243 +60286,271 @@ 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 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 ReposCreateRelease - * @summary Create a release - * @request POST:/repos/{owner}/{repo}/releases + * @tags licenses + * @name LicensesGetForRepo + * @summary Get the license for a repository + * @request GET:/repos/{owner}/{repo}/license */ - reposCreateRelease: ( - { owner, repo }: ReposCreateReleaseParams, - data: ReposCreateReleasePayload, + licensesGetForRepo: ( + { owner, repo }: LicensesGetForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/license\`, + 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 Stop an import for a repository. * - * @tags repos - * @name ReposCreateUsingTemplate - * @summary Create a repository using a template - * @request POST:/repos/{template_owner}/{template_repo}/generate + * @tags migrations + * @name MigrationsCancelImport + * @summary Cancel an import + * @request DELETE:/repos/{owner}/{repo}/import */ - reposCreateUsingTemplate: ( - { templateOwner, templateRepo }: ReposCreateUsingTemplateParams, - data: ReposCreateUsingTemplatePayload, + migrationsCancelImport: ( + { owner, repo }: MigrationsCancelImportParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${templateOwner}/\${templateRepo}/generate\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "DELETE", ...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 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 ReposCreateWebhook - * @summary Create a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks + * @tags migrations + * @name MigrationsGetCommitAuthors + * @summary Get commit authors + * @request GET:/repos/{owner}/{repo}/import/authors */ - reposCreateWebhook: ( - { owner, repo }: ReposCreateWebhookParams, - data: ReposCreateWebhookPayload, + migrationsGetCommitAuthors: ( + { owner, repo, ...query }: MigrationsGetCommitAuthorsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/import/authors\`, + method: "GET", + query: query, 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 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 ReposDelete - * @summary Delete a repository - * @request DELETE:/repos/{owner}/{repo} + * @tags migrations + * @name MigrationsGetImportStatus + * @summary Get an import status + * @request GET:/repos/{owner}/{repo}/import */ - reposDelete: ( - { owner, repo }: ReposDeleteParams, + migrationsGetImportStatus: ( + { owner, repo }: MigrationsGetImportStatusParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, - method: "DELETE", + 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. Disables the ability to restrict who can push to this branch. + * @description List files larger than 100MB found during the import * - * @tags repos - * @name ReposDeleteAccessRestrictions - * @summary Delete access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @tags migrations + * @name MigrationsGetLargeFiles + * @summary Get large files + * @request GET:/repos/{owner}/{repo}/import/large_files */ - reposDeleteAccessRestrictions: ( - { owner, repo, branch }: ReposDeleteAccessRestrictionsParams, + migrationsGetLargeFiles: ( + { owner, repo }: MigrationsGetLargeFilesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, - method: "DELETE", + 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. Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * @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 ReposDeleteAdminBranchProtection - * @summary Delete admin branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags migrations + * @name MigrationsMapCommitAuthor + * @summary Map a commit author + * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} */ - reposDeleteAdminBranchProtection: ( - { owner, repo, branch }: ReposDeleteAdminBranchProtectionParams, + migrationsMapCommitAuthor: ( + { owner, repo, authorId }: MigrationsMapCommitAuthorParams, + data: MigrationsMapCommitAuthorPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, - method: "DELETE", - ...params, - }), + this.request( + { + path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, + 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. + * @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 repos - * @name ReposDeleteBranchProtection - * @summary Delete branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags migrations + * @name MigrationsSetLfsPreference + * @summary Update Git LFS preference + * @request PATCH:/repos/{owner}/{repo}/import/lfs */ - reposDeleteBranchProtection: ( - { owner, repo, branch }: ReposDeleteBranchProtectionParams, + migrationsSetLfsPreference: ( + { owner, repo }: MigrationsSetLfsPreferenceParams, + data: MigrationsSetLfsPreferencePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/import/lfs\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @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 + */ + migrationsStartImport: ( + { owner, repo }: MigrationsStartImportParams, + data: MigrationsStartImportPayload, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * No description + * @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 ReposDeleteCommitComment - * @summary Delete a commit comment - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} + * @tags migrations + * @name MigrationsUpdateImport + * @summary Update an import + * @request PATCH:/repos/{owner}/{repo}/import */ - reposDeleteCommitComment: ( - { owner, repo, commentId }: ReposDeleteCommitCommentParams, + migrationsUpdateImport: ( + { owner, repo }: MigrationsUpdateImportParams, + data: MigrationsUpdateImportPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + 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. 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 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 ReposDeleteCommitSignatureProtection - * @summary Delete commit signature protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags projects + * @name ProjectsCreateForRepo + * @summary Create a repository project + * @request POST:/repos/{owner}/{repo}/projects */ - reposDeleteCommitSignatureProtection: ( - { owner, repo, branch }: ReposDeleteCommitSignatureProtectionParams, + projectsCreateForRepo: ( + { owner, repo }: ProjectsCreateForRepoParams, + data: ProjectsCreateForRepoPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, - method: "DELETE", + this.request< + ProjectsCreateForRepoData, + BasicError | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/projects\`, + method: "POST", + body: data, + type: ContentType.Json, + 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 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 ReposDeleteDeployKey - * @summary Delete a deploy key - * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} + * @tags projects + * @name ProjectsListForRepo + * @summary List repository projects + * @request GET:/repos/{owner}/{repo}/projects */ - reposDeleteDeployKey: ( - { owner, repo, keyId }: ReposDeleteDeployKeyParams, + projectsListForRepo: ( + { owner, repo, ...query }: ProjectsListForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, - method: "DELETE", - ...params, - }), + this.request( + { + path: \`/repos/\${owner}/\${repo}/projects\`, + 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)." + * No description * - * @tags repos - * @name ReposDeleteDeployment - * @summary Delete a deployment - * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} + * @tags pulls + * @name PullsCheckIfMerged + * @summary Check if a pull request has been merged + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - reposDeleteDeployment: ( - { owner, repo, deploymentId }: ReposDeleteDeploymentParams, + pullsCheckIfMerged: ( + { owner, repo, pullNumber }: PullsCheckIfMergedParams, params: RequestParams = {}, ) => - this.request< - ReposDeleteDeploymentData, - BasicError | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, + 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 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 ReposDeleteFile - * @summary Delete a file - * @request DELETE:/repos/{owner}/{repo}/contents/{path} + * @tags pulls + * @name PullsCreate + * @summary Create a pull request + * @request POST:/repos/{owner}/{repo}/pulls */ - reposDeleteFile: ( - { owner, repo, path }: ReposDeleteFileParams, - data: ReposDeleteFilePayload, + pullsCreate: ( + { owner, repo }: PullsCreateParams, + data: PullsCreatePayload, params: RequestParams = {}, ) => - this.request< - ReposDeleteFileData, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -60125,343 +60558,379 @@ export class Api< }), /** - * No description + * @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 ReposDeleteInvitation - * @summary Delete a repository invitation - * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} + * @tags pulls + * @name PullsCreateReplyForReviewComment + * @summary Create a reply for a review comment + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies */ - reposDeleteInvitation: ( - { owner, repo, invitationId }: ReposDeleteInvitationParams, + pullsCreateReplyForReviewComment: ( + { + owner, + repo, + pullNumber, + commentId, + }: PullsCreateReplyForReviewCommentParams, + data: PullsCreateReplyForReviewCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments/\${commentId}/replies\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...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. 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 ReposDeletePagesSite - * @summary Delete a GitHub Pages site - * @request DELETE:/repos/{owner}/{repo}/pages + * @tags pulls + * @name PullsCreateReview + * @summary Create a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews */ - reposDeletePagesSite: ( - { owner, repo }: ReposDeletePagesSiteParams, + pullsCreateReview: ( + { owner, repo, pullNumber }: PullsCreateReviewParams, + data: PullsCreateReviewPayload, 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}/pulls/\${pullNumber}/reviews\`, + 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 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 ReposDeletePullRequestReviewProtection - * @summary Delete pull request review protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @tags pulls + * @name PullsCreateReviewComment + * @summary Create a review comment for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - reposDeletePullRequestReviewProtection: ( - { owner, repo, branch }: ReposDeletePullRequestReviewProtectionParams, + pullsCreateReviewComment: ( + { owner, repo, pullNumber }: PullsCreateReviewCommentParams, + data: PullsCreateReviewCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Users with push access to the repository can delete a release. + * No description * - * @tags repos - * @name ReposDeleteRelease - * @summary Delete a release - * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} + * @tags pulls + * @name PullsDeletePendingReview + * @summary Delete a pending review for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - reposDeleteRelease: ( - { owner, repo, releaseId }: ReposDeleteReleaseParams, + pullsDeletePendingReview: ( + { owner, repo, pullNumber, reviewId }: PullsDeletePendingReviewParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + this.request< + PullsDeletePendingReviewData, + BasicError | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, method: "DELETE", + format: "json", ...params, }), /** - * No description + * @description Deletes a review comment. * - * @tags repos - * @name ReposDeleteReleaseAsset - * @summary Delete a release asset - * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @tags pulls + * @name PullsDeleteReviewComment + * @summary Delete a review comment for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reposDeleteReleaseAsset: ( - { owner, repo, assetId }: ReposDeleteReleaseAssetParams, + pullsDeleteReviewComment: ( + { owner, repo, commentId }: PullsDeleteReviewCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "DELETE", ...params, }), /** - * No description + * @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 ReposDeleteWebhook - * @summary Delete a repository webhook - * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags pulls + * @name PullsDismissReview + * @summary Dismiss a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals */ - reposDeleteWebhook: ( - { owner, repo, hookId }: ReposDeleteWebhookParams, + pullsDismissReview: ( + { owner, repo, pullNumber, reviewId }: PullsDismissReviewParams, + data: PullsDismissReviewPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/dismissals\`, + method: "PUT", + body: data, + type: ContentType.Json, + 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)". + * @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 ReposDisableAutomatedSecurityFixes - * @summary Disable automated security fixes - * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes + * @tags pulls + * @name PullsGet + * @summary Get a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} */ - reposDisableAutomatedSecurityFixes: ( - { owner, repo }: ReposDisableAutomatedSecurityFixesParams, + pullsGet: ( + { owner, repo, pullNumber }: PullsGetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, + method: "GET", + 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 pulls + * @name PullsGetReview + * @summary Get a review for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - reposDisableVulnerabilityAlerts: ( - { owner, repo }: ReposDisableVulnerabilityAlertsParams, + pullsGetReview: ( + { owner, repo, pullNumber, reviewId }: PullsGetReviewParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "GET", + 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 Provides details for a review comment. * - * @tags repos - * @name ReposDownloadTarballArchive - * @summary Download a repository archive (tar) - * @request GET:/repos/{owner}/{repo}/tarball/{ref} + * @tags pulls + * @name PullsGetReviewComment + * @summary Get a review comment for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reposDownloadTarballArchive: ( - { owner, repo, ref }: ReposDownloadTarballArchiveParams, + pullsGetReviewComment: ( + { owner, repo, commentId }: PullsGetReviewCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", + 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 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 ReposDownloadZipballArchive - * @summary Download a repository archive (zip) - * @request GET:/repos/{owner}/{repo}/zipball/{ref} + * @tags pulls + * @name PullsList + * @summary List pull requests + * @request GET:/repos/{owner}/{repo}/pulls */ - reposDownloadZipballArchive: ( - { owner, repo, ref }: ReposDownloadZipballArchiveParams, + pullsList: ( + { owner, repo, ...query }: PullsListParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls\`, 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 List comments for a specific pull request review. * - * @tags repos - * @name ReposEnableAutomatedSecurityFixes - * @summary Enable automated security fixes - * @request PUT:/repos/{owner}/{repo}/automated-security-fixes + * @tags pulls + * @name PullsListCommentsForReview + * @summary List comments for a pull request review + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments */ - reposEnableAutomatedSecurityFixes: ( - { owner, repo }: ReposEnableAutomatedSecurityFixesParams, + pullsListCommentsForReview: ( + { + owner, + repo, + pullNumber, + reviewId, + ...query + }: PullsListCommentsForReviewParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/comments\`, + method: "GET", + query: query, + format: "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 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 ReposEnableVulnerabilityAlerts - * @summary Enable vulnerability alerts - * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts + * @tags pulls + * @name PullsListCommits + * @summary List commits on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits */ - reposEnableVulnerabilityAlerts: ( - { owner, repo }: ReposEnableVulnerabilityAlertsParams, + pullsListCommits: ( + { owner, repo, pullNumber, ...query }: PullsListCommitsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, + method: "GET", + query: query, + format: "json", ...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. + * @description **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. * - * @tags repos - * @name ReposGet - * @summary Get a repository - * @request GET:/repos/{owner}/{repo} + * @tags pulls + * @name PullsListFiles + * @summary List pull requests files + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files */ - reposGet: ({ owner, repo }: ReposGetParams, params: RequestParams = {}) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, + pullsListFiles: ( + { owner, repo, pullNumber, ...query }: PullsListFilesParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, 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. Lists who has access to this protected branch. **Note**: Users, apps, and teams \`restrictions\` are only available for organization-owned repositories. + * No description * - * @tags repos - * @name ReposGetAccessRestrictions - * @summary Get access restrictions - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @tags pulls + * @name PullsListRequestedReviewers + * @summary List requested reviewers for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - reposGetAccessRestrictions: ( - { owner, repo, branch }: ReposGetAccessRestrictionsParams, + pullsListRequestedReviewers: ( + { owner, repo, pullNumber, ...query }: PullsListRequestedReviewersParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, 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 review comments for a pull request. By default, review comments are in ascending order by ID. * - * @tags repos - * @name ReposGetAdminBranchProtection - * @summary Get admin branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags pulls + * @name PullsListReviewComments + * @summary List review comments on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - reposGetAdminBranchProtection: ( - { owner, repo, branch }: ReposGetAdminBranchProtectionParams, + pullsListReviewComments: ( + { owner, repo, pullNumber, ...query }: PullsListReviewCommentsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/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. + * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. * - * @tags repos - * @name ReposGetAllStatusCheckContexts - * @summary Get all status check contexts - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags pulls + * @name PullsListReviewCommentsForRepo + * @summary List review comments in a repository + * @request GET:/repos/{owner}/{repo}/pulls/comments */ - reposGetAllStatusCheckContexts: ( - { owner, repo, branch }: ReposGetAllStatusCheckContextsParams, + pullsListReviewCommentsForRepo: ( + { owner, repo, ...query }: PullsListReviewCommentsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description The list of reviews returns in chronological order. * - * @tags repos - * @name ReposGetAllTopics - * @summary Get all repository topics - * @request GET:/repos/{owner}/{repo}/topics + * @tags pulls + * @name PullsListReviews + * @summary List reviews for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews */ - reposGetAllTopics: ( - { owner, repo }: ReposGetAllTopicsParams, + pullsListReviews: ( + { owner, repo, pullNumber, ...query }: PullsListReviewsParams, params: RequestParams = {}, ) => - this.request< - ReposGetAllTopicsData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/topics\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, 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. 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 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 repos - * @name ReposGetAppsWithAccessToProtectedBranch - * @summary Get apps with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags pulls + * @name PullsMerge + * @summary Merge a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - reposGetAppsWithAccessToProtectedBranch: ( - { owner, repo, branch }: ReposGetAppsWithAccessToProtectedBranchParams, + pullsMerge: ( + { owner, repo, pullNumber }: PullsMergeParams, + data: PullsMergePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -60469,414 +60938,524 @@ export class Api< /** * No description * - * @tags repos - * @name ReposGetBranch - * @summary Get a branch - * @request GET:/repos/{owner}/{repo}/branches/{branch} + * @tags pulls + * @name PullsRemoveRequestedReviewers + * @summary Remove requested reviewers from a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - reposGetBranch: ( - { owner, repo, branch }: ReposGetBranchParams, + pullsRemoveRequestedReviewers: ( + { owner, repo, pullNumber }: PullsRemoveRequestedReviewersParams, + data: PullsRemoveRequestedReviewersPayload, params: RequestParams = {}, ) => - this.request< - ReposGetBranchData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, + method: "DELETE", + body: data, + type: ContentType.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 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 repos - * @name ReposGetBranchProtection - * @summary Get branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags pulls + * @name PullsRequestReviewers + * @summary Request reviewers for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - reposGetBranchProtection: ( - { owner, repo, branch }: ReposGetBranchProtectionParams, + pullsRequestReviewers: ( + { owner, repo, pullNumber }: PullsRequestReviewersParams, + data: PullsRequestReviewersPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, + method: "POST", + 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. + * No description * - * @tags repos - * @name ReposGetClones - * @summary Get repository clones - * @request GET:/repos/{owner}/{repo}/traffic/clones + * @tags pulls + * @name PullsSubmitReview + * @summary Submit a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events */ - reposGetClones: ( - { owner, repo, ...query }: ReposGetClonesParams, + pullsSubmitReview: ( + { owner, repo, pullNumber, reviewId }: PullsSubmitReviewParams, + data: PullsSubmitReviewPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/clones\`, - 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 Returns a weekly aggregate of the number of additions and deletions pushed to 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. 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 repos - * @name ReposGetCodeFrequencyStats - * @summary Get the weekly commit activity - * @request GET:/repos/{owner}/{repo}/stats/code_frequency + * @tags pulls + * @name PullsUpdate + * @summary Update a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} */ - reposGetCodeFrequencyStats: ( - { owner, repo }: ReposGetCodeFrequencyStatsParams, + pullsUpdate: ( + { owner, repo, pullNumber }: PullsUpdateParams, + data: PullsUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. + * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. * - * @tags repos - * @name ReposGetCollaboratorPermissionLevel - * @summary Get repository permissions for a user - * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission + * @tags pulls + * @name PullsUpdateBranch + * @summary Update a pull request branch + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch */ - reposGetCollaboratorPermissionLevel: ( - { owner, repo, username }: ReposGetCollaboratorPermissionLevelParams, + pullsUpdateBranch: ( + { owner, repo, pullNumber }: PullsUpdateBranchParams, + data: PullsUpdateBranchPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, - method: "GET", + 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", ...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 Update the review summary comment with new text. * - * @tags repos - * @name ReposGetCombinedStatusForRef - * @summary Get the combined status for a specific reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/status + * @tags pulls + * @name PullsUpdateReview + * @summary Update a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - reposGetCombinedStatusForRef: ( - { owner, repo, ref }: ReposGetCombinedStatusForRefParams, + pullsUpdateReview: ( + { owner, repo, pullNumber, reviewId }: PullsUpdateReviewParams, + data: PullsUpdateReviewPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "PUT", + 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 Enables you to edit a review comment. * - * @tags repos - * @name ReposGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/commits/{ref} + * @tags pulls + * @name PullsUpdateReviewComment + * @summary Update a review comment for a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reposGetCommit: ( - { owner, repo, ref }: ReposGetCommitParams, + pullsUpdateReviewComment: ( + { owner, repo, commentId }: PullsUpdateReviewCommentParams, + data: PullsUpdateReviewCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + 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 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 repos - * @name ReposGetCommitActivityStats - * @summary Get the last year of commit activity - * @request GET:/repos/{owner}/{repo}/stats/commit_activity + * @tags reactions + * @name ReactionsCreateForCommitComment + * @summary Create reaction for a commit comment + * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - reposGetCommitActivityStats: ( - { owner, repo }: ReposGetCommitActivityStatsParams, + reactionsCreateForCommitComment: ( + { owner, repo, commentId }: ReactionsCreateForCommitCommentParams, + data: ReactionsCreateForCommitCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, - method: "GET", + this.request< + ReactionsCreateForCommitCommentData, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @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 repos - * @name ReposGetCommitComment - * @summary Get a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id} + * @tags reactions + * @name ReactionsCreateForIssue + * @summary Create reaction for an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - reposGetCommitComment: ( - { owner, repo, commentId }: ReposGetCommitCommentParams, + reactionsCreateForIssue: ( + { owner, repo, issueNumber }: ReactionsCreateForIssueParams, + data: ReactionsCreateForIssuePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, - method: "GET", + 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", ...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 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 ReposGetCommitSignatureProtection - * @summary Get commit signature protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags reactions + * @name ReactionsCreateForIssueComment + * @summary Create reaction for an issue comment + * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions */ - reposGetCommitSignatureProtection: ( - { owner, repo, branch }: ReposGetCommitSignatureProtectionParams, + reactionsCreateForIssueComment: ( + { owner, repo, commentId }: ReactionsCreateForIssueCommentParams, + data: ReactionsCreateForIssueCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, - method: "GET", + 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", ...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 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 repos - * @name ReposGetCommunityProfileMetrics - * @summary Get community profile metrics - * @request GET:/repos/{owner}/{repo}/community/profile + * @tags reactions + * @name ReactionsCreateForPullRequestReviewComment + * @summary Create reaction for a pull request review comment + * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions */ - reposGetCommunityProfileMetrics: ( - { owner, repo }: ReposGetCommunityProfileMetricsParams, + reactionsCreateForPullRequestReviewComment: ( + { + owner, + repo, + commentId, + }: ReactionsCreateForPullRequestReviewCommentParams, + data: ReactionsCreateForPullRequestReviewCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/community/profile\`, - method: "GET", + 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, }), /** - * @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 **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 repos - * @name ReposGetContent - * @summary Get repository content - * @request GET:/repos/{owner}/{repo}/contents/{path} + * @tags reactions + * @name ReactionsDeleteForCommitComment + * @summary Delete a commit comment reaction + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} */ - reposGetContent: ( - { owner, repo, path, ...query }: ReposGetContentParams, + reactionsDeleteForCommitComment: ( + { + owner, + repo, + commentId, + reactionId, + }: ReactionsDeleteForCommitCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions/\${reactionId}\`, + method: "DELETE", ...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 **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 repos - * @name ReposGetContributorsStats - * @summary Get all contributor commit activity - * @request GET:/repos/{owner}/{repo}/stats/contributors + * @tags reactions + * @name ReactionsDeleteForIssue + * @summary Delete an issue reaction + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} */ - reposGetContributorsStats: ( - { owner, repo }: ReposGetContributorsStatsParams, + reactionsDeleteForIssue: ( + { owner, repo, issueNumber, reactionId }: ReactionsDeleteForIssueParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/contributors\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * No description + * @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 repos - * @name ReposGetDeployKey - * @summary Get a deploy key - * @request GET:/repos/{owner}/{repo}/keys/{key_id} + * @tags reactions + * @name ReactionsDeleteForIssueComment + * @summary Delete an issue comment reaction + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} */ - reposGetDeployKey: ( - { owner, repo, keyId }: ReposGetDeployKeyParams, + reactionsDeleteForIssueComment: ( + { + owner, + repo, + commentId, + reactionId, + }: ReactionsDeleteForIssueCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * No description + * @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 repos - * @name ReposGetDeployment - * @summary Get a deployment - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} + * @tags reactions + * @name ReactionsDeleteForPullRequestComment + * @summary Delete a pull request comment reaction + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} */ - reposGetDeployment: ( - { owner, repo, deploymentId }: ReposGetDeploymentParams, + reactionsDeleteForPullRequestComment: ( + { + owner, + repo, + commentId, + reactionId, + }: ReactionsDeleteForPullRequestCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions/\${reactionId}\`, + method: "DELETE", ...params, }), /** - * @description Users with pull access can view a deployment status for a deployment: + * @description List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). * - * @tags repos - * @name ReposGetDeploymentStatus - * @summary Get a deployment status - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + * @tags reactions + * @name ReactionsListForCommitComment + * @summary List reactions for a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - reposGetDeploymentStatus: ( - { owner, repo, deploymentId, statusId }: ReposGetDeploymentStatusParams, + reactionsListForCommitComment: ( + { owner, repo, commentId, ...query }: ReactionsListForCommitCommentParams, params: RequestParams = {}, ) => this.request< - ReposGetDeploymentStatusData, + ReactionsListForCommitCommentData, | BasicError | { documentation_url: string; message: string; } >({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses/\${statusId}\`, + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). * - * @tags repos - * @name ReposGetLatestPagesBuild - * @summary Get latest Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/latest + * @tags reactions + * @name ReactionsListForIssue + * @summary List reactions for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - reposGetLatestPagesBuild: ( - { owner, repo }: ReposGetLatestPagesBuildParams, + reactionsListForIssue: ( + { owner, repo, issueNumber, ...query }: ReactionsListForIssueParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, + this.request< + ReactionsListForIssueData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, method: "GET", + query: query, 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 List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). * - * @tags repos - * @name ReposGetLatestRelease - * @summary Get the latest release - * @request GET:/repos/{owner}/{repo}/releases/latest + * @tags reactions + * @name ReactionsListForIssueComment + * @summary List reactions for an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions */ - reposGetLatestRelease: ( - { owner, repo }: ReposGetLatestReleaseParams, + reactionsListForIssueComment: ( + { owner, repo, commentId, ...query }: ReactionsListForIssueCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/latest\`, + this.request< + ReactionsListForIssueCommentData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description - * - * @tags repos - * @name ReposGetPages - * @summary Get a GitHub Pages site - * @request GET:/repos/{owner}/{repo}/pages + * @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 */ - reposGetPages: ( - { owner, repo }: ReposGetPagesParams, + reactionsListForPullRequestReviewComment: ( + { + owner, + repo, + commentId, + ...query + }: ReactionsListForPullRequestReviewCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages\`, + this.request< + ReactionsListForPullRequestReviewCommentData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, 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. 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 ReposGetPagesBuild - * @summary Get GitHub Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} + * @name ReposAddAppAccessRestrictions + * @summary Add app access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - reposGetPagesBuild: ( - { owner, repo, buildId }: ReposGetPagesBuildParams, + reposAddAppAccessRestrictions: ( + { owner, repo, branch }: ReposAddAppAccessRestrictionsParams, + data: ReposAddAppAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "POST", + body: data, + type: ContentType.Json, 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 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 ReposGetParticipationStats - * @summary Get the weekly commit count - * @request GET:/repos/{owner}/{repo}/stats/participation + * @name ReposAddCollaborator + * @summary Add a repository collaborator + * @request PUT:/repos/{owner}/{repo}/collaborators/{username} */ - reposGetParticipationStats: ( - { owner, repo }: ReposGetParticipationStatsParams, + reposAddCollaborator: ( + { owner, repo, username }: ReposAddCollaboratorParams, + data: ReposAddCollaboratorPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/participation\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -60885,563 +61464,593 @@ 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. * * @tags repos - * @name ReposGetPullRequestReviewProtection - * @summary Get pull request review protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @name ReposAddStatusCheckContexts + * @summary Add status check contexts + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - reposGetPullRequestReviewProtection: ( - { owner, repo, branch }: ReposGetPullRequestReviewProtectionParams, + reposAddStatusCheckContexts: ( + { owner, repo, branch }: ReposAddStatusCheckContextsParams, + data: ReposAddStatusCheckContextsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, - method: "GET", + 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", ...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 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 ReposGetPunchCardStats - * @summary Get the hourly commit count for each day - * @request GET:/repos/{owner}/{repo}/stats/punch_card + * @name ReposAddTeamAccessRestrictions + * @summary Add team access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - reposGetPunchCardStats: ( - { owner, repo }: ReposGetPunchCardStatsParams, + reposAddTeamAccessRestrictions: ( + { owner, repo, branch }: ReposAddTeamAccessRestrictionsParams, + data: ReposAddTeamAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "POST", + body: data, + type: ContentType.Json, 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 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 ReposGetReadme - * @summary Get a repository README - * @request GET:/repos/{owner}/{repo}/readme + * @name ReposAddUserAccessRestrictions + * @summary Add user access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - reposGetReadme: ( - { owner, repo, ...query }: ReposGetReadmeParams, + reposAddUserAccessRestrictions: ( + { owner, repo, branch }: ReposAddUserAccessRestrictionsParams, + data: ReposAddUserAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/readme\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "POST", + body: data, + type: ContentType.Json, 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 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 ReposGetRelease - * @summary Get a release - * @request GET:/repos/{owner}/{repo}/releases/{release_id} + * @name ReposCheckCollaborator + * @summary Check if a user is a repository collaborator + * @request GET:/repos/{owner}/{repo}/collaborators/{username} */ - reposGetRelease: ( - { owner, repo, releaseId }: ReposGetReleaseParams, + reposCheckCollaborator: ( + { owner, repo, username }: ReposCheckCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, method: "GET", - 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. + * @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 ReposGetReleaseAsset - * @summary Get a release asset - * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @name ReposCheckVulnerabilityAlerts + * @summary Check if vulnerability alerts are enabled for a repository + * @request GET:/repos/{owner}/{repo}/vulnerability-alerts */ - reposGetReleaseAsset: ( - { owner, repo, assetId }: ReposGetReleaseAssetParams, + reposCheckVulnerabilityAlerts: ( + { owner, repo }: ReposCheckVulnerabilityAlertsParams, params: RequestParams = {}, ) => - this.request< - ReposGetReleaseAssetData, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, method: "GET", - format: "json", ...params, }), /** - * @description Get a published release with the specified tag. + * @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 ReposGetReleaseByTag - * @summary Get a release by tag name - * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} + * @name ReposCompareCommits + * @summary Compare two commits + * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} */ - reposGetReleaseByTag: ( - { owner, repo, tag }: ReposGetReleaseByTagParams, + reposCompareCommits: ( + { owner, repo, base, head }: ReposCompareCommitsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, 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 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 ReposGetStatusChecksProtection - * @summary Get status checks protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @name ReposCreateCommitComment + * @summary Create a commit comment + * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - reposGetStatusChecksProtection: ( - { owner, repo, branch }: ReposGetStatusChecksProtectionParams, + reposCreateCommitComment: ( + { owner, repo, commitSha }: ReposCreateCommitCommentParams, + data: ReposCreateCommitCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, + 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 teams who have push access to this branch. The list includes child 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. 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 ReposGetTeamsWithAccessToProtectedBranch - * @summary Get teams with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @name ReposCreateCommitSignatureProtection + * @summary Create commit signature protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - reposGetTeamsWithAccessToProtectedBranch: ( - { owner, repo, branch }: ReposGetTeamsWithAccessToProtectedBranchParams, + reposCreateCommitSignatureProtection: ( + { owner, repo, branch }: ReposCreateCommitSignatureProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "POST", format: "json", ...params, }), /** - * @description Get the top 10 popular contents over the last 14 days. + * @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 ReposGetTopPaths - * @summary Get top referral paths - * @request GET:/repos/{owner}/{repo}/traffic/popular/paths + * @name ReposCreateCommitStatus + * @summary Create a commit status + * @request POST:/repos/{owner}/{repo}/statuses/{sha} */ - reposGetTopPaths: ( - { owner, repo }: ReposGetTopPathsParams, + reposCreateCommitStatus: ( + { owner, repo, sha }: ReposCreateCommitStatusParams, + data: ReposCreateCommitStatusPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/statuses/\${sha}\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Get the top 10 referrers over the last 14 days. + * @description You can create a read-only deploy key. * * @tags repos - * @name ReposGetTopReferrers - * @summary Get top referral sources - * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers + * @name ReposCreateDeployKey + * @summary Create a deploy key + * @request POST:/repos/{owner}/{repo}/keys */ - reposGetTopReferrers: ( - { owner, repo }: ReposGetTopReferrersParams, + reposCreateDeployKey: ( + { owner, repo }: ReposCreateDeployKeyParams, + data: ReposCreateDeployKeyPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/keys\`, + 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 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 ReposGetUsersWithAccessToProtectedBranch - * @summary Get users with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @name ReposCreateDeployment + * @summary Create a deployment + * @request POST:/repos/{owner}/{repo}/deployments */ - reposGetUsersWithAccessToProtectedBranch: ( - { owner, repo, branch }: ReposGetUsersWithAccessToProtectedBranchParams, + reposCreateDeployment: ( + { owner, repo }: ReposCreateDeploymentParams, + data: ReposCreateDeploymentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments\`, + method: "POST", + 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 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 ReposGetViews - * @summary Get page views - * @request GET:/repos/{owner}/{repo}/traffic/views + * @name ReposCreateDeploymentStatus + * @summary Create a deployment status + * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - reposGetViews: ( - { owner, repo, ...query }: ReposGetViewsParams, + reposCreateDeploymentStatus: ( + { owner, repo, deploymentId }: ReposCreateDeploymentStatusParams, + data: ReposCreateDeploymentStatusPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/views\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, + 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 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 ReposGetWebhook - * @summary Get a repository webhook - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} + * @name ReposCreateDispatchEvent + * @summary Create a repository dispatch event + * @request POST:/repos/{owner}/{repo}/dispatches */ - reposGetWebhook: ( - { owner, repo, hookId }: ReposGetWebhookParams, + reposCreateDispatchEvent: ( + { owner, repo }: ReposCreateDispatchEventParams, + data: ReposCreateDispatchEventPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/dispatches\`, + method: "POST", + body: data, + type: ContentType.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. + * @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 ReposGetWebhookConfigForRepo - * @summary Get a webhook configuration for a repository - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @name ReposCreateFork + * @summary Create a fork + * @request POST:/repos/{owner}/{repo}/forks */ - reposGetWebhookConfigForRepo: ( - { owner, repo, hookId }: ReposGetWebhookConfigForRepoParams, + reposCreateFork: ( + { owner, repo }: ReposCreateForkParams, + data: ReposCreateForkPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/forks\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description Creates a new file or replaces an existing file in a repository. * * @tags repos - * @name ReposListBranches - * @summary List branches - * @request GET:/repos/{owner}/{repo}/branches + * @name ReposCreateOrUpdateFileContents + * @summary Create or update file contents + * @request PUT:/repos/{owner}/{repo}/contents/{path} */ - reposListBranches: ( - { owner, repo, ...query }: ReposListBranchesParams, + reposCreateOrUpdateFileContents: ( + { owner, repo, path }: ReposCreateOrUpdateFileContentsParams, + data: ReposCreateOrUpdateFileContentsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches\`, - method: "GET", - query: query, + this.request< + ReposCreateOrUpdateFileContentsData, + BasicError | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, + 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. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. + * @description Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." * * @tags repos - * @name ReposListBranchesForHeadCommit - * @summary List branches for HEAD commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + * @name ReposCreatePagesSite + * @summary Create a GitHub Pages site + * @request POST:/repos/{owner}/{repo}/pages */ - reposListBranchesForHeadCommit: ( - { owner, repo, commitSha }: ReposListBranchesForHeadCommitParams, + reposCreatePagesSite: ( + { owner, repo }: ReposCreatePagesSiteParams, + data: ReposCreatePagesSitePayload, params: RequestParams = {}, ) => this.request< - ReposListBranchesForHeadCommitData, + ReposCreatePagesSiteData, + | BasicError | { documentation_url: string; message: string; } | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/branches-where-head\`, - method: "GET", + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "POST", + 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 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 ReposListCollaborators - * @summary List repository collaborators - * @request GET:/repos/{owner}/{repo}/collaborators + * @name ReposCreateRelease + * @summary Create a release + * @request POST:/repos/{owner}/{repo}/releases */ - reposListCollaborators: ( - { owner, repo, ...query }: ReposListCollaboratorsParams, + reposCreateRelease: ( + { owner, repo }: ReposCreateReleaseParams, + data: ReposCreateReleasePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. + * @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 ReposListCommentsForCommit - * @summary List commit comments - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @name ReposCreateUsingTemplate + * @summary Create a repository using a template + * @request POST:/repos/{template_owner}/{template_repo}/generate */ - reposListCommentsForCommit: ( - { owner, repo, commitSha, ...query }: ReposListCommentsForCommitParams, + reposCreateUsingTemplate: ( + { templateOwner, templateRepo }: ReposCreateUsingTemplateParams, + data: ReposCreateUsingTemplatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${templateOwner}/\${templateRepo}/generate\`, + method: "POST", + body: data, + type: ContentType.Json, 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. + * @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 ReposListCommitCommentsForRepo - * @summary List commit comments for a repository - * @request GET:/repos/{owner}/{repo}/comments + * @name ReposCreateWebhook + * @summary Create a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks */ - reposListCommitCommentsForRepo: ( - { owner, repo, ...query }: ReposListCommitCommentsForRepoParams, + reposCreateWebhook: ( + { owner, repo }: ReposCreateWebhookParams, + data: ReposCreateWebhookPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks\`, + 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 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 ReposListCommits - * @summary List commits - * @request GET:/repos/{owner}/{repo}/commits + * @name ReposDelete + * @summary Delete a repository + * @request DELETE:/repos/{owner}/{repo} */ - reposListCommits: ( - { owner, repo, ...query }: ReposListCommitsParams, + reposDelete: ( + { owner, repo }: ReposDeleteParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}\`, + method: "DELETE", ...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 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 ReposListCommitStatusesForRef - * @summary List commit statuses for a reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses + * @name ReposDeleteAccessRestrictions + * @summary Delete access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - reposListCommitStatusesForRef: ( - { owner, repo, ref, ...query }: ReposListCommitStatusesForRefParams, + reposDeleteAccessRestrictions: ( + { owner, repo, branch }: ReposDeleteAccessRestrictionsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/statuses\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + method: "DELETE", ...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 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 ReposListContributors - * @summary List repository contributors - * @request GET:/repos/{owner}/{repo}/contributors + * @name ReposDeleteAdminBranchProtection + * @summary Delete admin branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - reposListContributors: ( - { owner, repo, ...query }: ReposListContributorsParams, + reposDeleteAdminBranchProtection: ( + { owner, repo, branch }: ReposDeleteAdminBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contributors\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + 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. * * @tags repos - * @name ReposListDeployKeys - * @summary List deploy keys - * @request GET:/repos/{owner}/{repo}/keys + * @name ReposDeleteBranchProtection + * @summary Delete branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection */ - reposListDeployKeys: ( - { owner, repo, ...query }: ReposListDeployKeysParams, + reposDeleteBranchProtection: ( + { owner, repo, branch }: ReposDeleteBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + method: "DELETE", ...params, }), /** - * @description Simple filtering of deployments is available via query parameters: + * No description * * @tags repos - * @name ReposListDeployments - * @summary List deployments - * @request GET:/repos/{owner}/{repo}/deployments + * @name ReposDeleteCommitComment + * @summary Delete a commit comment + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} */ - reposListDeployments: ( - { owner, repo, ...query }: ReposListDeploymentsParams, + reposDeleteCommitComment: ( + { owner, repo, commentId }: ReposDeleteCommitCommentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + method: "DELETE", ...params, }), /** - * @description Users with pull access can view deployment statuses for a deployment: + * @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 ReposListDeploymentStatuses - * @summary List deployment statuses - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @name ReposDeleteCommitSignatureProtection + * @summary Delete commit signature protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - reposListDeploymentStatuses: ( - { - owner, - repo, - deploymentId, - ...query - }: ReposListDeploymentStatusesParams, + reposDeleteCommitSignatureProtection: ( + { owner, repo, branch }: ReposDeleteCommitSignatureProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "DELETE", ...params, }), /** - * No description + * @description Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. * * @tags repos - * @name ReposListForks - * @summary List forks - * @request GET:/repos/{owner}/{repo}/forks + * @name ReposDeleteDeployKey + * @summary Delete a deploy key + * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} */ - reposListForks: ( - { owner, repo, ...query }: ReposListForksParams, + reposDeleteDeployKey: ( + { owner, repo, keyId }: ReposDeleteDeployKeyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/forks\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, + 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 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 ReposListInvitations - * @summary List repository invitations - * @request GET:/repos/{owner}/{repo}/invitations + * @name ReposDeleteDeployment + * @summary Delete a deployment + * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} */ - reposListInvitations: ( - { owner, repo, ...query }: ReposListInvitationsParams, + reposDeleteDeployment: ( + { owner, repo, deploymentId }: ReposDeleteDeploymentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations\`, - method: "GET", - query: query, - format: "json", + this.request< + ReposDeleteDeploymentData, + BasicError | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + method: "DELETE", ...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 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 ReposListLanguages - * @summary List repository languages - * @request GET:/repos/{owner}/{repo}/languages + * @name ReposDeleteFile + * @summary Delete a file + * @request DELETE:/repos/{owner}/{repo}/contents/{path} */ - reposListLanguages: ( - { owner, repo }: ReposListLanguagesParams, + reposDeleteFile: ( + { owner, repo, path }: ReposDeleteFileParams, + data: ReposDeleteFilePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/languages\`, - method: "GET", + 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, }), @@ -61450,90 +62059,79 @@ export class Api< * No description * * @tags repos - * @name ReposListPagesBuilds - * @summary List GitHub Pages builds - * @request GET:/repos/{owner}/{repo}/pages/builds + * @name ReposDeleteInvitation + * @summary Delete a repository invitation + * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} */ - reposListPagesBuilds: ( - { owner, repo, ...query }: ReposListPagesBuildsParams, + reposDeleteInvitation: ( + { owner, repo, invitationId }: ReposDeleteInvitationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + method: "DELETE", ...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. + * No description * * @tags repos - * @name ReposListPullRequestsAssociatedWithCommit - * @summary List pull requests associated with a commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls + * @name ReposDeletePagesSite + * @summary Delete a GitHub Pages site + * @request DELETE:/repos/{owner}/{repo}/pages */ - reposListPullRequestsAssociatedWithCommit: ( - { - owner, - repo, - commitSha, - ...query - }: ReposListPullRequestsAssociatedWithCommitParams, + reposDeletePagesSite: ( + { owner, repo }: ReposDeletePagesSiteParams, params: RequestParams = {}, ) => this.request< - ReposListPullRequestsAssociatedWithCommitData, - { - documentation_url: string; - message: string; - } + ReposDeletePagesSiteData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/pulls\`, - method: "GET", - query: query, - format: "json", + path: \`/repos/\${owner}/\${repo}/pages\`, + 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. * * @tags repos - * @name ReposListReleaseAssets - * @summary List release assets - * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets + * @name ReposDeletePullRequestReviewProtection + * @summary Delete pull request review protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - reposListReleaseAssets: ( - { owner, repo, releaseId, ...query }: ReposListReleaseAssetsParams, + reposDeletePullRequestReviewProtection: ( + { owner, repo, branch }: ReposDeletePullRequestReviewProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + method: "DELETE", ...params, }), /** - * @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. + * @description Users with push access to the repository can delete a release. * * @tags repos - * @name ReposListReleases - * @summary List releases - * @request GET:/repos/{owner}/{repo}/releases + * @name ReposDeleteRelease + * @summary Delete a release + * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} */ - reposListReleases: ( - { owner, repo, ...query }: ReposListReleasesParams, + reposDeleteRelease: ( + { owner, repo, releaseId }: ReposDeleteReleaseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + method: "DELETE", ...params, }), @@ -61541,19 +62139,17 @@ export class Api< * No description * * @tags repos - * @name ReposListTags - * @summary List repository tags - * @request GET:/repos/{owner}/{repo}/tags + * @name ReposDeleteReleaseAsset + * @summary Delete a release asset + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - reposListTags: ( - { owner, repo, ...query }: ReposListTagsParams, + reposDeleteReleaseAsset: ( + { owner, repo, assetId }: ReposDeleteReleaseAssetParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/tags\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + method: "DELETE", ...params, }), @@ -61561,227 +62157,197 @@ export class Api< * No description * * @tags repos - * @name ReposListTeams - * @summary List repository teams - * @request GET:/repos/{owner}/{repo}/teams + * @name ReposDeleteWebhook + * @summary Delete a repository webhook + * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} */ - reposListTeams: ( - { owner, repo, ...query }: ReposListTeamsParams, + reposDeleteWebhook: ( + { owner, repo, hookId }: ReposDeleteWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/teams\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + method: "DELETE", ...params, }), /** - * No description + * @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 ReposListWebhooks - * @summary List repository webhooks - * @request GET:/repos/{owner}/{repo}/hooks + * @name ReposDisableAutomatedSecurityFixes + * @summary Disable automated security fixes + * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes */ - reposListWebhooks: ( - { owner, repo, ...query }: ReposListWebhooksParams, + reposDisableAutomatedSecurityFixes: ( + { owner, repo }: ReposDisableAutomatedSecurityFixesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + method: "DELETE", ...params, }), /** - * No description + * @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 ReposMerge - * @summary Merge a branch - * @request POST:/repos/{owner}/{repo}/merges + * @name ReposDisableVulnerabilityAlerts + * @summary Disable vulnerability alerts + * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts */ - reposMerge: ( - { owner, repo }: ReposMergeParams, - data: ReposMergePayload, + reposDisableVulnerabilityAlerts: ( + { owner, repo }: ReposDisableVulnerabilityAlertsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/merges\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + method: "DELETE", ...params, }), /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @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 ReposPingWebhook - * @summary Ping a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings + * @name ReposDownloadTarballArchive + * @summary Download a repository archive (tar) + * @request GET:/repos/{owner}/{repo}/tarball/{ref} */ - reposPingWebhook: ( - { owner, repo, hookId }: ReposPingWebhookParams, + reposDownloadTarballArchive: ( + { owner, repo, ref }: ReposDownloadTarballArchiveParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, + 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. 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 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 ReposRemoveAppAccessRestrictions - * @summary Remove app access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @name ReposDownloadZipballArchive + * @summary Download a repository archive (zip) + * @request GET:/repos/{owner}/{repo}/zipball/{ref} */ - reposRemoveAppAccessRestrictions: ( - { owner, repo, branch }: ReposRemoveAppAccessRestrictionsParams, - data: ReposRemoveAppAccessRestrictionsPayload, + reposDownloadZipballArchive: ( + { owner, repo, ref }: ReposDownloadZipballArchiveParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "DELETE", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, + method: "GET", ...params, }), /** - * 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 repos - * @name ReposRemoveCollaborator - * @summary Remove a repository collaborator - * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} + * @name ReposEnableAutomatedSecurityFixes + * @summary Enable automated security fixes + * @request PUT:/repos/{owner}/{repo}/automated-security-fixes */ - reposRemoveCollaborator: ( - { owner, repo, username }: ReposRemoveCollaboratorParams, + reposEnableAutomatedSecurityFixes: ( + { owner, repo }: ReposEnableAutomatedSecurityFixesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + 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. + * @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 ReposRemoveStatusCheckContexts - * @summary Remove status check contexts - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @name ReposEnableVulnerabilityAlerts + * @summary Enable vulnerability alerts + * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts */ - reposRemoveStatusCheckContexts: ( - { owner, repo, branch }: ReposRemoveStatusCheckContextsParams, - data: ReposRemoveStatusCheckContextsPayload, + reposEnableVulnerabilityAlerts: ( + { owner, repo }: ReposEnableVulnerabilityAlertsParams, params: RequestParams = {}, ) => - 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", + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + 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. + * @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 ReposRemoveStatusCheckProtection - * @summary Remove status check protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @name ReposGet + * @summary Get a repository + * @request GET:/repos/{owner}/{repo} */ - reposRemoveStatusCheckProtection: ( - { owner, repo, branch }: ReposRemoveStatusCheckProtectionParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, - method: "DELETE", + reposGet: ({ owner, repo }: ReposGetParams, params: RequestParams = {}) => + this.request({ + path: \`/repos/\${owner}/\${repo}\`, + 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 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 ReposRemoveTeamAccessRestrictions - * @summary Remove team access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @name ReposGetAccessRestrictions + * @summary Get access restrictions + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - reposRemoveTeamAccessRestrictions: ( - { owner, repo, branch }: ReposRemoveTeamAccessRestrictionsParams, - data: ReposRemoveTeamAccessRestrictionsPayload, + reposGetAccessRestrictions: ( + { owner, repo, branch }: ReposGetAccessRestrictionsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "DELETE", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + 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 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 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 ReposRemoveUserAccessRestrictions - * @summary Remove user access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @name ReposGetAdminBranchProtection + * @summary Get admin branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - reposRemoveUserAccessRestrictions: ( - { owner, repo, branch }: ReposRemoveUserAccessRestrictionsParams, - data: ReposRemoveUserAccessRestrictionsPayload, + reposGetAdminBranchProtection: ( + { owner, repo, branch }: ReposGetAdminBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "DELETE", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + method: "GET", 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 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 ReposRenameBranch - * @summary Rename a branch - * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename + * @name ReposGetAllStatusCheckContexts + * @summary Get all status check contexts + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - reposRenameBranch: ( - { owner, repo, branch }: ReposRenameBranchParams, - data: ReposRenameBranchPayload, + reposGetAllStatusCheckContexts: ( + { owner, repo, branch }: ReposGetAllStatusCheckContextsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/rename\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "GET", format: "json", ...params, }), @@ -61790,867 +62356,733 @@ export class Api< * No description * * @tags repos - * @name ReposReplaceAllTopics - * @summary Replace all repository topics - * @request PUT:/repos/{owner}/{repo}/topics + * @name ReposGetAllTopics + * @summary Get all repository topics + * @request GET:/repos/{owner}/{repo}/topics */ - reposReplaceAllTopics: ( - { owner, repo }: ReposReplaceAllTopicsParams, - data: ReposReplaceAllTopicsPayload, + reposGetAllTopics: ( + { owner, repo }: ReposGetAllTopicsParams, params: RequestParams = {}, ) => this.request< - ReposReplaceAllTopicsData, + ReposGetAllTopicsData, | BasicError | { documentation_url: string; message: string; } - | ValidationErrorSimple >({ - path: \`/repos/\${owner}/\${repo}/topics\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/repos/\${owner}/\${repo}/topics\`, + method: "GET", 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 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 ReposRequestPagesBuild - * @summary Request a GitHub Pages build - * @request POST:/repos/{owner}/{repo}/pages/builds + * @name ReposGetAppsWithAccessToProtectedBranch + * @summary Get apps with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - reposRequestPagesBuild: ( - { owner, repo }: ReposRequestPagesBuildParams, + reposGetAppsWithAccessToProtectedBranch: ( + { owner, repo, branch }: ReposGetAppsWithAccessToProtectedBranchParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + 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. + * No description * * @tags repos - * @name ReposSetAdminBranchProtection - * @summary Set admin branch protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @name ReposGetBranch + * @summary Get a branch + * @request GET:/repos/{owner}/{repo}/branches/{branch} */ - reposSetAdminBranchProtection: ( - { owner, repo, branch }: ReposSetAdminBranchProtectionParams, + reposGetBranch: ( + { owner, repo, branch }: ReposGetBranchParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, - method: "POST", + this.request< + ReposGetBranchData, + | 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. 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 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 ReposSetAppAccessRestrictions - * @summary Set app access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @name ReposGetBranchProtection + * @summary Get branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection */ - reposSetAppAccessRestrictions: ( - { owner, repo, branch }: ReposSetAppAccessRestrictionsParams, - data: ReposSetAppAccessRestrictionsPayload, + reposGetBranchProtection: ( + { owner, repo, branch }: ReposGetBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + 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 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 ReposSetStatusCheckContexts - * @summary Set status check contexts - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @name ReposGetClones + * @summary Get repository clones + * @request GET:/repos/{owner}/{repo}/traffic/clones */ - reposSetStatusCheckContexts: ( - { owner, repo, branch }: ReposSetStatusCheckContextsParams, - data: ReposSetStatusCheckContextsPayload, + reposGetClones: ( + { owner, repo, ...query }: ReposGetClonesParams, params: RequestParams = {}, ) => - this.request< - ReposSetStatusCheckContextsData, - BasicError | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/clones\`, + 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 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 Returns a weekly aggregate of the number of additions and deletions pushed to a repository. * * @tags repos - * @name ReposSetTeamAccessRestrictions - * @summary Set team access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @name ReposGetCodeFrequencyStats + * @summary Get the weekly commit activity + * @request GET:/repos/{owner}/{repo}/stats/code_frequency */ - reposSetTeamAccessRestrictions: ( - { owner, repo, branch }: ReposSetTeamAccessRestrictionsParams, - data: ReposSetTeamAccessRestrictionsPayload, + reposGetCodeFrequencyStats: ( + { owner, repo }: ReposGetCodeFrequencyStatsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, + 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 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 Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. * * @tags repos - * @name ReposSetUserAccessRestrictions - * @summary Set user access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @name ReposGetCollaboratorPermissionLevel + * @summary Get repository permissions for a user + * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission */ - reposSetUserAccessRestrictions: ( - { owner, repo, branch }: ReposSetUserAccessRestrictionsParams, - data: ReposSetUserAccessRestrictionsPayload, + reposGetCollaboratorPermissionLevel: ( + { owner, repo, username }: ReposGetCollaboratorPermissionLevelParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, + method: "GET", 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\` + * @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 ReposTestPushWebhook - * @summary Test the push repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests + * @name ReposGetCombinedStatusForRef + * @summary Get the combined status for a specific reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status */ - reposTestPushWebhook: ( - { owner, repo, hookId }: ReposTestPushWebhookParams, + reposGetCombinedStatusForRef: ( + { owner, repo, ref }: ReposGetCombinedStatusForRefParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, + method: "GET", + format: "json", ...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 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 ReposTransfer - * @summary Transfer a repository - * @request POST:/repos/{owner}/{repo}/transfer + * @name ReposGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/commits/{ref} */ - reposTransfer: ( - { owner, repo }: ReposTransferParams, - data: ReposTransferPayload, + reposGetCommit: ( + { owner, repo, ref }: ReposGetCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/transfer\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, + 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 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 ReposUpdate - * @summary Update a repository - * @request PATCH:/repos/{owner}/{repo} + * @name ReposGetCommitActivityStats + * @summary Get the last year of commit activity + * @request GET:/repos/{owner}/{repo}/stats/commit_activity */ - reposUpdate: ( - { owner, repo }: ReposUpdateParams, - data: ReposUpdatePayload, + reposGetCommitActivityStats: ( + { owner, repo }: ReposGetCommitActivityStatsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, + 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. 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. + * No description * * @tags repos - * @name ReposUpdateBranchProtection - * @summary Update branch protection - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection + * @name ReposGetCommitComment + * @summary Get a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id} */ - reposUpdateBranchProtection: ( - { owner, repo, branch }: ReposUpdateBranchProtectionParams, - data: ReposUpdateBranchProtectionPayload, + reposGetCommitComment: ( + { owner, repo, commentId }: ReposGetCommitCommentParams, 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, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + 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. 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 ReposUpdateCommitComment - * @summary Update a commit comment - * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} + * @name ReposGetCommitSignatureProtection + * @summary Get commit signature protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - reposUpdateCommitComment: ( - { owner, repo, commentId }: ReposUpdateCommitCommentParams, - data: ReposUpdateCommitCommentPayload, + reposGetCommitSignatureProtection: ( + { owner, repo, branch }: ReposGetCommitSignatureProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "GET", 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 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 ReposUpdateInformationAboutPagesSite - * @summary Update information about a GitHub Pages site - * @request PUT:/repos/{owner}/{repo}/pages + * @name ReposGetCommunityProfileMetrics + * @summary Get community profile metrics + * @request GET:/repos/{owner}/{repo}/community/profile */ - reposUpdateInformationAboutPagesSite: ( - { owner, repo }: ReposUpdateInformationAboutPagesSiteParams, - data: ReposUpdateInformationAboutPagesSitePayload, + reposGetCommunityProfileMetrics: ( + { owner, repo }: ReposGetCommunityProfileMetricsParams, params: RequestParams = {}, ) => - this.request< - ReposUpdateInformationAboutPagesSiteData, - BasicError | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/community/profile\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 ReposUpdateInvitation - * @summary Update a repository invitation - * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} + * @name ReposGetContent + * @summary Get repository content + * @request GET:/repos/{owner}/{repo}/contents/{path} */ - reposUpdateInvitation: ( - { owner, repo, invitationId }: ReposUpdateInvitationParams, - data: ReposUpdateInvitationPayload, + reposGetContent: ( + { owner, repo, path, ...query }: ReposGetContentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, + 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. 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 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 ReposUpdatePullRequestReviewProtection - * @summary Update pull request review protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @name ReposGetContributorsStats + * @summary Get all contributor commit activity + * @request GET:/repos/{owner}/{repo}/stats/contributors */ - reposUpdatePullRequestReviewProtection: ( - { owner, repo, branch }: ReposUpdatePullRequestReviewProtectionParams, - data: ReposUpdatePullRequestReviewProtectionPayload, + reposGetContributorsStats: ( + { owner, repo }: ReposGetContributorsStatsParams, 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}/stats/contributors\`, + method: "GET", + format: "json", + ...params, + }), /** - * @description Users with push access to the repository can edit a release. + * No description * * @tags repos - * @name ReposUpdateRelease - * @summary Update a release - * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} + * @name ReposGetDeployKey + * @summary Get a deploy key + * @request GET:/repos/{owner}/{repo}/keys/{key_id} */ - reposUpdateRelease: ( - { owner, repo, releaseId }: ReposUpdateReleaseParams, - data: ReposUpdateReleasePayload, + reposGetDeployKey: ( + { owner, repo, keyId }: ReposGetDeployKeyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, + 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} + * @name ReposGetDeployment + * @summary Get a deployment + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} */ - reposUpdateReleaseAsset: ( - { owner, repo, assetId }: ReposUpdateReleaseAssetParams, - data: ReposUpdateReleaseAssetPayload, + reposGetDeployment: ( + { owner, repo, deploymentId }: ReposGetDeploymentParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + 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 Users with pull access can view a deployment status for a deployment: * * @tags repos - * @name ReposUpdateStatusCheckProtection - * @summary Update status check protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @name ReposGetDeploymentStatus + * @summary Get a deployment status + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} */ - reposUpdateStatusCheckProtection: ( - { owner, repo, branch }: ReposUpdateStatusCheckProtectionParams, - data: ReposUpdateStatusCheckProtectionPayload, + reposGetDeploymentStatus: ( + { owner, repo, deploymentId, statusId }: ReposGetDeploymentStatusParams, params: RequestParams = {}, ) => this.request< - ReposUpdateStatusCheckProtectionData, - BasicError | ValidationError + ReposGetDeploymentStatusData, + | BasicError + | { + documentation_url: string; + message: string; + } >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, - method: "PATCH", - body: data, - type: ContentType.Json, + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses/\${statusId}\`, + 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)." + * No description * * @tags repos - * @name ReposUpdateWebhook - * @summary Update a repository webhook - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} + * @name ReposGetLatestPagesBuild + * @summary Get latest Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/latest */ - reposUpdateWebhook: ( - { owner, repo, hookId }: ReposUpdateWebhookParams, - data: ReposUpdateWebhookPayload, + reposGetLatestPagesBuild: ( + { owner, repo }: ReposGetLatestPagesBuildParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, + 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. + * @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 ReposUpdateWebhookConfigForRepo - * @summary Update a webhook configuration for a repository - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @name ReposGetLatestRelease + * @summary Get the latest release + * @request GET:/repos/{owner}/{repo}/releases/latest */ - reposUpdateWebhookConfigForRepo: ( - { owner, repo, hookId }: ReposUpdateWebhookConfigForRepoParams, - data: ReposUpdateWebhookConfigForRepoPayload, + reposGetLatestRelease: ( + { owner, repo }: ReposGetLatestReleaseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/latest\`, + method: "GET", 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. + * No description * * @tags repos - * @name ReposUploadReleaseAsset - * @summary Upload a release asset - * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets + * @name ReposGetPages + * @summary Get a GitHub Pages site + * @request GET:/repos/{owner}/{repo}/pages */ - reposUploadReleaseAsset: ( - { owner, repo, releaseId, ...query }: ReposUploadReleaseAssetParams, - data: ReposUploadReleaseAssetPayload, + reposGetPages: ( + { owner, repo }: ReposGetPagesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, - method: "POST", - query: query, - body: data, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "GET", 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. + * No description * - * @tags secret-scanning - * @name SecretScanningGetAlert - * @summary Get a secret scanning alert - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * @tags repos + * @name ReposGetPagesBuild + * @summary Get GitHub Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} */ - secretScanningGetAlert: ( - { owner, repo, alertNumber }: SecretScanningGetAlertParams, + reposGetPagesBuild: ( + { owner, repo, buildId }: ReposGetPagesBuildParams, 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}/pages/builds/\${buildId}\`, method: "GET", 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. + * @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 secret-scanning - * @name SecretScanningListAlertsForRepo - * @summary List secret scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts + * @tags repos + * @name ReposGetParticipationStats + * @summary Get the weekly commit count + * @request GET:/repos/{owner}/{repo}/stats/participation */ - secretScanningListAlertsForRepo: ( - { owner, repo, ...query }: SecretScanningListAlertsForRepoParams, + reposGetParticipationStats: ( + { owner, repo }: ReposGetParticipationStatsParams, 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}/stats/participation\`, method: "GET", - query: query, 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 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 secret-scanning - * @name SecretScanningUpdateAlert - * @summary Update a secret scanning alert - * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * @tags repos + * @name ReposGetPullRequestReviewProtection + * @summary Get pull request review protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - secretScanningUpdateAlert: ( - { owner, repo, alertNumber }: SecretScanningUpdateAlertParams, - data: SecretScanningUpdateAlertPayload, + reposGetPullRequestReviewProtection: ( + { owner, repo, branch }: ReposGetPullRequestReviewProtectionParams, 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}/branches/\${branch}/protection/required_pull_request_reviews\`, + method: "GET", 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 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 ReposListPublic - * @summary List public repositories - * @request GET:/repositories + * @name ReposGetPunchCardStats + * @summary Get the hourly commit count for each day + * @request GET:/repos/{owner}/{repo}/stats/punch_card */ - reposListPublic: ( - query: ReposListPublicParams, + reposGetPunchCardStats: ( + { owner, repo }: ReposGetPunchCardStatsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/repositories\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, 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 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 enterprise-admin - * @name EnterpriseAdminDeleteScimGroupFromEnterprise - * @summary Delete a SCIM group from an enterprise - * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags repos + * @name ReposGetReadme + * @summary Get a repository README + * @request GET:/repos/{owner}/{repo}/readme */ - enterpriseAdminDeleteScimGroupFromEnterprise: ( - { - enterprise, - scimGroupId, - }: EnterpriseAdminDeleteScimGroupFromEnterpriseParams, + reposGetReadme: ( + { owner, repo, ...query }: ReposGetReadmeParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/readme\`, + 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 **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 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 ReposGetRelease + * @summary Get a release + * @request GET:/repos/{owner}/{repo}/releases/{release_id} */ - enterpriseAdminDeleteUserFromEnterprise: ( - { enterprise, scimUserId }: EnterpriseAdminDeleteUserFromEnterpriseParams, + reposGetRelease: ( + { owner, repo, releaseId }: ReposGetReleaseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + method: "GET", + format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @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 enterprise-admin - * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup - * @summary Get SCIM provisioning information for an enterprise group - * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags repos + * @name ReposGetReleaseAsset + * @summary Get a release asset + * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - enterpriseAdminGetProvisioningInformationForEnterpriseGroup: ( - { - enterprise, - scimGroupId, - }: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupParams, + reposGetReleaseAsset: ( + { owner, repo, assetId }: ReposGetReleaseAssetParams, params: RequestParams = {}, ) => this.request< - EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData, - any + ReposGetReleaseAssetData, + | BasicError + | { + documentation_url: string; + message: string; + } >({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, method: "GET", format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @description Get a published release with the specified tag. * - * @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 repos + * @name ReposGetReleaseByTag + * @summary Get a release by tag name + * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} */ - enterpriseAdminGetProvisioningInformationForEnterpriseUser: ( - { - enterprise, - scimUserId, - }: EnterpriseAdminGetProvisioningInformationForEnterpriseUserParams, + reposGetReleaseByTag: ( + { owner, repo, tag }: ReposGetReleaseByTagParams, params: RequestParams = {}, ) => - this.request< - EnterpriseAdminGetProvisioningInformationForEnterpriseUserData, - any - >({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, method: "GET", format: "json", ...params, }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @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 enterprise-admin - * @name EnterpriseAdminListProvisionedGroupsEnterprise - * @summary List provisioned SCIM groups for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Groups + * @tags repos + * @name ReposGetStatusChecksProtection + * @summary Get status checks protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - enterpriseAdminListProvisionedGroupsEnterprise: ( - { - enterprise, - ...query - }: EnterpriseAdminListProvisionedGroupsEnterpriseParams, + reposGetStatusChecksProtection: ( + { owner, repo, branch }: ReposGetStatusChecksProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, 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. 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 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 enterprise-admin - * @name EnterpriseAdminListProvisionedIdentitiesEnterprise - * @summary List SCIM provisioned identities for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Users + * @tags repos + * @name ReposGetTeamsWithAccessToProtectedBranch + * @summary Get teams with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - enterpriseAdminListProvisionedIdentitiesEnterprise: ( - { - enterprise, - ...query - }: EnterpriseAdminListProvisionedIdentitiesEnterpriseParams, + reposGetTeamsWithAccessToProtectedBranch: ( + { owner, repo, branch }: ReposGetTeamsWithAccessToProtectedBranchParams, params: RequestParams = {}, ) => - this.request( - { - path: \`/scim/v2/enterprises/\${enterprise}/Users\`, - method: "GET", - query: query, - format: "json", - ...params, - }, - ), + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "GET", + 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 Get the top 10 popular contents over the last 14 days. * - * @tags enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup - * @summary Provision a SCIM enterprise group and invite users - * @request POST:/scim/v2/enterprises/{enterprise}/Groups + * @tags repos + * @name ReposGetTopPaths + * @summary Get top referral paths + * @request GET:/repos/{owner}/{repo}/traffic/popular/paths */ - enterpriseAdminProvisionAndInviteEnterpriseGroup: ( - { enterprise }: EnterpriseAdminProvisionAndInviteEnterpriseGroupParams, - data: EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload, + reposGetTopPaths: ( + { owner, repo }: ReposGetTopPathsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, + method: "GET", format: "json", ...params, }), /** - * @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 Get the top 10 referrers over the last 14 days. * - * @tags enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseUser - * @summary Provision and invite a SCIM enterprise user - * @request POST:/scim/v2/enterprises/{enterprise}/Users + * @tags repos + * @name ReposGetTopReferrers + * @summary Get top referral sources + * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers */ - enterpriseAdminProvisionAndInviteEnterpriseUser: ( - { enterprise }: EnterpriseAdminProvisionAndInviteEnterpriseUserParams, - data: EnterpriseAdminProvisionAndInviteEnterpriseUserPayload, + reposGetTopReferrers: ( + { owner, repo }: ReposGetTopReferrersParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, + method: "GET", 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 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 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 enterprise-admin - * @name EnterpriseAdminSetInformationForProvisionedEnterpriseGroup - * @summary Set SCIM information for a provisioned enterprise group - * @request PUT:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags repos + * @name ReposGetUsersWithAccessToProtectedBranch + * @summary Get users with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - enterpriseAdminSetInformationForProvisionedEnterpriseGroup: ( - { - enterprise, - scimGroupId, - }: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupParams, - data: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload, + reposGetUsersWithAccessToProtectedBranch: ( + { owner, repo, branch }: ReposGetUsersWithAccessToProtectedBranchParams, params: RequestParams = {}, ) => - this.request< - EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData, - any - >({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "GET", 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}\`. + * @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 enterprise-admin - * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser - * @summary Set SCIM information for a provisioned enterprise user - * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @tags repos + * @name ReposGetViews + * @summary Get page views + * @request GET:/repos/{owner}/{repo}/traffic/views */ - enterpriseAdminSetInformationForProvisionedEnterpriseUser: ( - { - enterprise, - scimUserId, - }: EnterpriseAdminSetInformationForProvisionedEnterpriseUserParams, - data: EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload, + reposGetViews: ( + { owner, repo, ...query }: ReposGetViewsParams, params: RequestParams = {}, ) => - this.request< - EnterpriseAdminSetInformationForProvisionedEnterpriseUserData, - any - >({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/views\`, + 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 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 enterprise-admin - * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup - * @summary Update an attribute for a SCIM enterprise group - * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags repos + * @name ReposGetWebhook + * @summary Get a repository webhook + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} */ - enterpriseAdminUpdateAttributeForEnterpriseGroup: ( - { - enterprise, - scimGroupId, - }: EnterpriseAdminUpdateAttributeForEnterpriseGroupParams, - data: EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload, + reposGetWebhook: ( + { owner, repo, hookId }: ReposGetWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + method: "GET", 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 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 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 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 ReposGetWebhookConfigForRepo + * @summary Get a webhook configuration for a repository + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config */ - enterpriseAdminUpdateAttributeForEnterpriseUser: ( - { - enterprise, - scimUserId, - }: EnterpriseAdminUpdateAttributeForEnterpriseUserParams, - data: EnterpriseAdminUpdateAttributeForEnterpriseUserPayload, + reposGetWebhookConfigForRepo: ( + { owner, repo, hookId }: ReposGetWebhookConfigForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, + method: "GET", format: "json", ...params, }), @@ -62658,54 +63090,63 @@ export class Api< /** * No description * - * @tags scim - * @name ScimDeleteUserFromOrg - * @summary Delete a SCIM user from an organization - * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags repos + * @name ReposListBranches + * @summary List branches + * @request GET:/repos/{owner}/{repo}/branches */ - scimDeleteUserFromOrg: ( - { org, scimUserId }: ScimDeleteUserFromOrgParams, + reposListBranches: ( + { owner, repo, ...query }: ReposListBranchesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches\`, + 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. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. * - * @tags scim - * @name ScimGetProvisioningInformationForUser - * @summary Get SCIM provisioning information for a user - * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags repos + * @name ReposListBranchesForHeadCommit + * @summary List branches for HEAD commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head */ - scimGetProvisioningInformationForUser: ( - { org, scimUserId }: ScimGetProvisioningInformationForUserParams, + reposListBranchesForHeadCommit: ( + { owner, repo, commitSha }: ReposListBranchesForHeadCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + this.request< + ReposListBranchesForHeadCommitData, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/branches-where-head\`, method: "GET", format: "json", ...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 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 scim - * @name ScimListProvisionedIdentities - * @summary List SCIM provisioned identities - * @request GET:/scim/v2/organizations/{org}/Users + * @tags repos + * @name ReposListCollaborators + * @summary List repository collaborators + * @request GET:/repos/{owner}/{repo}/collaborators */ - scimListProvisionedIdentities: ( - { org, ...query }: ScimListProvisionedIdentitiesParams, + reposListCollaborators: ( + { owner, repo, ...query }: ReposListCollaboratorsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators\`, method: "GET", query: query, format: "json", @@ -62713,95 +63154,79 @@ export class Api< }), /** - * @description Provision organization membership for a user, and send an activation email to the email address. + * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. * - * @tags scim - * @name ScimProvisionAndInviteUser - * @summary Provision and invite a SCIM user - * @request POST:/scim/v2/organizations/{org}/Users + * @tags repos + * @name ReposListCommentsForCommit + * @summary List commit comments + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - scimProvisionAndInviteUser: ( - { org }: ScimProvisionAndInviteUserParams, - data: ScimProvisionAndInviteUserPayload, + reposListCommentsForCommit: ( + { owner, repo, commitSha, ...query }: ReposListCommentsForCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, + method: "GET", + query: query, 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}\`. + * @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 scim - * @name ScimSetInformationForProvisionedUser - * @summary Update a provisioned organization membership - * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags repos + * @name ReposListCommitCommentsForRepo + * @summary List commit comments for a repository + * @request GET:/repos/{owner}/{repo}/comments */ - scimSetInformationForProvisionedUser: ( - { org, scimUserId }: ScimSetInformationForProvisionedUserParams, - data: ScimSetInformationForProvisionedUserPayload, + reposListCommitCommentsForRepo: ( + { owner, repo, ...query }: ReposListCommitCommentsForRepoParams, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments\`, + method: "GET", + query: query, format: "json", ...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 **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 scim - * @name ScimUpdateAttributeForUser - * @summary Update an attribute for a SCIM user - * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags repos + * @name ReposListCommits + * @summary List commits + * @request GET:/repos/{owner}/{repo}/commits */ - scimUpdateAttributeForUser: ( - { org, scimUserId }: ScimUpdateAttributeForUserParams, - data: ScimUpdateAttributeForUserPayload, + reposListCommits: ( + { owner, repo, ...query }: ReposListCommitsParams, params: RequestParams = {}, ) => - this.request< - ScimUpdateAttributeForUserData, - ScimUpdateAttributeForUserError - >({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits\`, + 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. - * - * @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\`, + * @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 + */ + reposListCommitStatusesForRef: ( + { owner, repo, ref, ...query }: ReposListCommitStatusesForRefParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/statuses\`, method: "GET", query: query, format: "json", @@ -62809,22 +63234,19 @@ 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 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 search - * @name SearchCommits - * @summary Search commits - * @request GET:/search/commits + * @tags repos + * @name ReposListContributors + * @summary List repository contributors + * @request GET:/repos/{owner}/{repo}/contributors */ - searchCommits: (query: SearchCommitsParams, params: RequestParams = {}) => - this.request< - SearchCommitsData, - { - documentation_url: string; - message: string; - } - >({ - path: \`/search/commits\`, + reposListContributors: ( + { owner, repo, ...query }: ReposListContributorsParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/contributors\`, method: "GET", query: query, format: "json", @@ -62832,28 +63254,19 @@ 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 repos + * @name ReposListDeployKeys + * @summary List deploy keys + * @request GET:/repos/{owner}/{repo}/keys */ - searchIssuesAndPullRequests: ( - query: SearchIssuesAndPullRequestsParams, + reposListDeployKeys: ( + { owner, repo, ...query }: ReposListDeployKeysParams, params: RequestParams = {}, ) => - this.request< - SearchIssuesAndPullRequestsData, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/search/issues\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/keys\`, method: "GET", query: query, format: "json", @@ -62861,16 +63274,19 @@ 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 Simple filtering of deployments is available via query parameters: * - * @tags search - * @name SearchLabels - * @summary Search labels - * @request GET:/search/labels + * @tags repos + * @name ReposListDeployments + * @summary List deployments + * @request GET:/repos/{owner}/{repo}/deployments */ - searchLabels: (query: SearchLabelsParams, params: RequestParams = {}) => - this.request({ - path: \`/search/labels\`, + reposListDeployments: ( + { owner, repo, ...query }: ReposListDeploymentsParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", query: query, format: "json", @@ -62878,24 +63294,24 @@ export class Api< }), /** - * @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 Users with pull access can view deployment statuses for a deployment: * - * @tags search - * @name SearchRepos - * @summary Search repositories - * @request GET:/search/repositories + * @tags repos + * @name ReposListDeploymentStatuses + * @summary List deployment statuses + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - searchRepos: (query: SearchReposParams, params: RequestParams = {}) => - this.request< - SearchReposData, - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/search/repositories\`, + reposListDeploymentStatuses: ( + { + owner, + repo, + deploymentId, + ...query + }: ReposListDeploymentStatusesParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, method: "GET", query: query, format: "json", @@ -62903,22 +63319,19 @@ export class Api< }), /** - * @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. + * No description * - * @tags search - * @name SearchTopics - * @summary Search topics - * @request GET:/search/topics + * @tags repos + * @name ReposListForks + * @summary List forks + * @request GET:/repos/{owner}/{repo}/forks */ - searchTopics: (query: SearchTopicsParams, params: RequestParams = {}) => - this.request< - SearchTopicsData, - { - documentation_url: string; - message: string; - } - >({ - path: \`/search/topics\`, + reposListForks: ( + { owner, repo, ...query }: ReposListForksParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/forks\`, method: "GET", query: query, format: "json", @@ -62926,104 +63339,89 @@ 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 When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. * - * @tags search - * @name SearchUsers - * @summary Search users - * @request GET:/search/users + * @tags repos + * @name ReposListInvitations + * @summary List repository invitations + * @request GET:/repos/{owner}/{repo}/invitations */ - searchUsers: (query: SearchUsersParams, params: RequestParams = {}) => - this.request< - SearchUsersData, - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/search/users\`, + reposListInvitations: ( + { owner, repo, ...query }: ReposListInvitationsParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations\`, 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. + * @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 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 ReposListLanguages + * @summary List repository languages + * @request GET:/repos/{owner}/{repo}/languages */ - reactionsCreateForTeamDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - }: ReactionsCreateForTeamDiscussionCommentLegacyParams, - data: ReactionsCreateForTeamDiscussionCommentLegacyPayload, + reposListLanguages: ( + { owner, repo }: ReposListLanguagesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/languages\`, + 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 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. + * No description * - * @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 ReposListPagesBuilds + * @summary List GitHub Pages builds + * @request GET:/repos/{owner}/{repo}/pages/builds */ - reactionsCreateForTeamDiscussionLegacy: ( - { - teamId, - discussionNumber, - }: ReactionsCreateForTeamDiscussionLegacyParams, - data: ReactionsCreateForTeamDiscussionLegacyPayload, + reposListPagesBuilds: ( + { owner, repo, ...query }: ReposListPagesBuildsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds\`, + 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 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 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 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 ReposListPullRequestsAssociatedWithCommit + * @summary List pull requests associated with a commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls */ - reactionsListForTeamDiscussionCommentLegacy: ( + reposListPullRequestsAssociatedWithCommit: ( { - teamId, - discussionNumber, - commentNumber, + owner, + repo, + commitSha, ...query - }: ReactionsListForTeamDiscussionCommentLegacyParams, + }: ReposListPullRequestsAssociatedWithCommitParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + this.request< + ReposListPullRequestsAssociatedWithCommitData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/pulls\`, method: "GET", query: query, format: "json", @@ -63031,24 +63429,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 [\`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/). + * No description * - * @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 ReposListReleaseAssets + * @summary List release assets + * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets */ - reactionsListForTeamDiscussionLegacy: ( - { - teamId, - discussionNumber, - ...query - }: ReactionsListForTeamDiscussionLegacyParams, + reposListReleaseAssets: ( + { owner, repo, releaseId, ...query }: ReposListReleaseAssetsParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, method: "GET", query: query, format: "json", @@ -63056,163 +63449,141 @@ export class Api< }), /** - * @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 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 teams - * @name TeamsAddMemberLegacy - * @summary Add team member (Legacy) - * @request PUT:/teams/{team_id}/members/{username} - * @deprecated + * @tags repos + * @name ReposListReleases + * @summary List releases + * @request GET:/repos/{owner}/{repo}/releases */ - teamsAddMemberLegacy: ( - { teamId, username }: TeamsAddMemberLegacyParams, + reposListReleases: ( + { owner, repo, ...query }: ReposListReleasesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members/\${username}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/releases\`, + 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 [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. + * No description * - * @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 ReposListTags + * @summary List repository tags + * @request GET:/repos/{owner}/{repo}/tags */ - teamsAddOrUpdateMembershipForUserLegacy: ( - { teamId, username }: TeamsAddOrUpdateMembershipForUserLegacyParams, - data: TeamsAddOrUpdateMembershipForUserLegacyPayload, + reposListTags: ( + { owner, repo, ...query }: ReposListTagsParams, params: RequestParams = {}, ) => - this.request< - TeamsAddOrUpdateMembershipForUserLegacyData, - TeamsAddOrUpdateMembershipForUserLegacyError - >({ - path: \`/teams/\${teamId}/memberships/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/tags\`, + 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 [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. + * No description * - * @tags teams - * @name TeamsAddOrUpdateProjectPermissionsLegacy - * @summary Add or update team project permissions (Legacy) - * @request PUT:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags repos + * @name ReposListTeams + * @summary List repository teams + * @request GET:/repos/{owner}/{repo}/teams */ - teamsAddOrUpdateProjectPermissionsLegacy: ( - { teamId, projectId }: TeamsAddOrUpdateProjectPermissionsLegacyParams, - data: TeamsAddOrUpdateProjectPermissionsLegacyPayload, + reposListTeams: ( + { owner, repo, ...query }: ReposListTeamsParams, params: RequestParams = {}, ) => - this.request< - TeamsAddOrUpdateProjectPermissionsLegacyData, - TeamsAddOrUpdateProjectPermissionsLegacyError - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/teams\`, + 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 "[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 repos + * @name ReposListWebhooks + * @summary List repository webhooks + * @request GET:/repos/{owner}/{repo}/hooks */ - teamsAddOrUpdateRepoPermissionsLegacy: ( - { teamId, owner, repo }: TeamsAddOrUpdateRepoPermissionsLegacyParams, - data: TeamsAddOrUpdateRepoPermissionsLegacyPayload, + reposListWebhooks: ( + { owner, repo, ...query }: ReposListWebhooksParams, params: RequestParams = {}, ) => - this.request< - TeamsAddOrUpdateRepoPermissionsLegacyData, - BasicError | ValidationError - >({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks\`, + 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 [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 repos + * @name ReposMerge + * @summary Merge a branch + * @request POST:/repos/{owner}/{repo}/merges */ - teamsCheckPermissionsForProjectLegacy: ( - { teamId, projectId }: TeamsCheckPermissionsForProjectLegacyParams, + reposMerge: ( + { owner, repo }: ReposMergeParams, + data: ReposMergePayload, params: RequestParams = {}, ) => - this.request< - TeamsCheckPermissionsForProjectLegacyData, - void | { - documentation_url: string; - message: string; - } - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/merges\`, + 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 This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. * - * @tags teams - * @name TeamsCheckPermissionsForRepoLegacy - * @summary Check team permissions for a repository (Legacy) - * @request GET:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags repos + * @name ReposPingWebhook + * @summary Ping a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings */ - teamsCheckPermissionsForRepoLegacy: ( - { teamId, owner, repo }: TeamsCheckPermissionsForRepoLegacyParams, + reposPingWebhook: ( + { owner, repo, hookId }: ReposPingWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, + method: "POST", ...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 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 teams - * @name TeamsCreateDiscussionCommentLegacy - * @summary Create a discussion comment (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @tags repos + * @name ReposRemoveAppAccessRestrictions + * @summary Remove app access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - teamsCreateDiscussionCommentLegacy: ( - { teamId, discussionNumber }: TeamsCreateDiscussionCommentLegacyParams, - data: TeamsCreateDiscussionCommentLegacyPayload, + reposRemoveAppAccessRestrictions: ( + { owner, repo, branch }: ReposRemoveAppAccessRestrictionsParams, + data: ReposRemoveAppAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "DELETE", body: data, type: ContentType.Json, format: "json", @@ -63220,48 +63591,42 @@ 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. + * No description * - * @tags teams - * @name TeamsCreateDiscussionLegacy - * @summary Create a discussion (Legacy) - * @request POST:/teams/{team_id}/discussions - * @deprecated + * @tags repos + * @name ReposRemoveCollaborator + * @summary Remove a repository collaborator + * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} */ - teamsCreateDiscussionLegacy: ( - { teamId }: TeamsCreateDiscussionLegacyParams, - data: TeamsCreateDiscussionLegacyPayload, + reposRemoveCollaborator: ( + { owner, repo, username }: ReposRemoveCollaboratorParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${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 [\`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 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 TeamsCreateOrUpdateIdpGroupConnectionsLegacy - * @summary Create or update IdP group connections (Legacy) - * @request PATCH:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @tags repos + * @name ReposRemoveStatusCheckContexts + * @summary Remove status check contexts + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - teamsCreateOrUpdateIdpGroupConnectionsLegacy: ( - { teamId }: TeamsCreateOrUpdateIdpGroupConnectionsLegacyParams, - data: TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload, + reposRemoveStatusCheckContexts: ( + { owner, repo, branch }: ReposRemoveStatusCheckContextsParams, + data: ReposRemoveStatusCheckContextsPayload, params: RequestParams = {}, ) => this.request< - TeamsCreateOrUpdateIdpGroupConnectionsLegacyData, + ReposRemoveStatusCheckContextsData, BasicError | ValidationError >({ - path: \`/teams/\${teamId}/team-sync/group-mappings\`, - method: "PATCH", + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "DELETE", body: data, type: ContentType.Json, format: "json", @@ -63269,451 +63634,447 @@ 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 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 TeamsDeleteDiscussionCommentLegacy - * @summary Delete a discussion comment (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags repos + * @name ReposRemoveStatusCheckProtection + * @summary Remove status check protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - teamsDeleteDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - }: TeamsDeleteDiscussionCommentLegacyParams, + reposRemoveStatusCheckProtection: ( + { owner, repo, branch }: ReposRemoveStatusCheckProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, 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 [\`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 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 teams - * @name TeamsDeleteDiscussionLegacy - * @summary Delete a discussion (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags repos + * @name ReposRemoveTeamAccessRestrictions + * @summary Remove team access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - teamsDeleteDiscussionLegacy: ( - { teamId, discussionNumber }: TeamsDeleteDiscussionLegacyParams, + reposRemoveTeamAccessRestrictions: ( + { owner, repo, branch }: ReposRemoveTeamAccessRestrictionsParams, + data: ReposRemoveTeamAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, 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 [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 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 teams - * @name TeamsDeleteLegacy - * @summary Delete a team (Legacy) - * @request DELETE:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposRemoveUserAccessRestrictions + * @summary Remove user access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - teamsDeleteLegacy: ( - { teamId }: TeamsDeleteLegacyParams, + reposRemoveUserAccessRestrictions: ( + { owner, repo, branch }: ReposRemoveUserAccessRestrictionsParams, + data: ReposRemoveUserAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, 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 [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 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 teams - * @name TeamsGetDiscussionCommentLegacy - * @summary Get a discussion comment (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags repos + * @name ReposRenameBranch + * @summary Rename a branch + * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename */ - teamsGetDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - }: TeamsGetDiscussionCommentLegacyParams, + reposRenameBranch: ( + { owner, repo, branch }: ReposRenameBranchParams, + data: ReposRenameBranchPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/rename\`, + 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/). + * No description * - * @tags teams - * @name TeamsGetDiscussionLegacy - * @summary Get a discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags repos + * @name ReposReplaceAllTopics + * @summary Replace all repository topics + * @request PUT:/repos/{owner}/{repo}/topics */ - teamsGetDiscussionLegacy: ( - { teamId, discussionNumber }: TeamsGetDiscussionLegacyParams, + reposReplaceAllTopics: ( + { owner, repo }: ReposReplaceAllTopicsParams, + data: ReposReplaceAllTopicsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "GET", + this.request< + ReposReplaceAllTopicsData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationErrorSimple + >({ + path: \`/repos/\${owner}/\${repo}/topics\`, + 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 [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. + * @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 TeamsGetLegacy - * @summary Get a team (Legacy) - * @request GET:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposRequestPagesBuild + * @summary Request a GitHub Pages build + * @request POST:/repos/{owner}/{repo}/pages/builds */ - teamsGetLegacy: ( - { teamId }: TeamsGetLegacyParams, + reposRequestPagesBuild: ( + { owner, repo }: ReposRequestPagesBuildParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds\`, + method: "POST", 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. + * @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 teams - * @name TeamsGetMemberLegacy - * @summary Get team member (Legacy) - * @request GET:/teams/{team_id}/members/{username} - * @deprecated + * @tags repos + * @name ReposSetAdminBranchProtection + * @summary Set admin branch protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - teamsGetMemberLegacy: ( - { teamId, username }: TeamsGetMemberLegacyParams, + reposSetAdminBranchProtection: ( + { owner, repo, branch }: ReposSetAdminBranchProtectionParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members/\${username}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + 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 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. 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 teams - * @name TeamsGetMembershipForUserLegacy - * @summary Get team membership for a user (Legacy) - * @request GET:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags repos + * @name ReposSetAppAccessRestrictions + * @summary Set app access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - teamsGetMembershipForUserLegacy: ( - { teamId, username }: TeamsGetMembershipForUserLegacyParams, + reposSetAppAccessRestrictions: ( + { owner, repo, branch }: ReposSetAppAccessRestrictionsParams, + data: ReposSetAppAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/memberships/\${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 **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. + * @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 TeamsListChildLegacy - * @summary List child teams (Legacy) - * @request GET:/teams/{team_id}/teams - * @deprecated + * @tags repos + * @name ReposSetStatusCheckContexts + * @summary Set status check contexts + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - teamsListChildLegacy: ( - { teamId, ...query }: TeamsListChildLegacyParams, + reposSetStatusCheckContexts: ( + { owner, repo, branch }: ReposSetStatusCheckContextsParams, + data: ReposSetStatusCheckContextsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/teams\`, - 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 **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. 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 teams - * @name TeamsListDiscussionCommentsLegacy - * @summary List discussion comments (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @tags repos + * @name ReposSetTeamAccessRestrictions + * @summary Set team access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - teamsListDiscussionCommentsLegacy: ( - { - teamId, - discussionNumber, - ...query - }: TeamsListDiscussionCommentsLegacyParams, + reposSetTeamAccessRestrictions: ( + { owner, repo, branch }: ReposSetTeamAccessRestrictionsParams, + data: ReposSetTeamAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + 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 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 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 teams - * @name TeamsListDiscussionsLegacy - * @summary List discussions (Legacy) - * @request GET:/teams/{team_id}/discussions - * @deprecated + * @tags repos + * @name ReposSetUserAccessRestrictions + * @summary Set user access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - teamsListDiscussionsLegacy: ( - { teamId, ...query }: TeamsListDiscussionsLegacyParams, + reposSetUserAccessRestrictions: ( + { owner, repo, branch }: ReposSetUserAccessRestrictionsParams, + data: ReposSetUserAccessRestrictionsPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions\`, - 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 **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 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 teams - * @name TeamsListIdpGroupsForLegacy - * @summary List IdP groups for a team (Legacy) - * @request GET:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @tags repos + * @name ReposTestPushWebhook + * @summary Test the push repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests */ - teamsListIdpGroupsForLegacy: ( - { teamId }: TeamsListIdpGroupsForLegacyParams, + reposTestPushWebhook: ( + { owner, repo, hookId }: ReposTestPushWebhookParams, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/team-sync/group-mappings\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, + method: "POST", ...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 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 teams - * @name TeamsListMembersLegacy - * @summary List team members (Legacy) - * @request GET:/teams/{team_id}/members - * @deprecated + * @tags repos + * @name ReposTransfer + * @summary Transfer a repository + * @request POST:/repos/{owner}/{repo}/transfer */ - teamsListMembersLegacy: ( - { teamId, ...query }: TeamsListMembersLegacyParams, + reposTransfer: ( + { owner, repo }: ReposTransferParams, + data: ReposTransferPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/transfer\`, + 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 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**: 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 teams - * @name TeamsListPendingInvitationsLegacy - * @summary List pending team invitations (Legacy) - * @request GET:/teams/{team_id}/invitations - * @deprecated + * @tags repos + * @name ReposUpdate + * @summary Update a repository + * @request PATCH:/repos/{owner}/{repo} */ - teamsListPendingInvitationsLegacy: ( - { teamId, ...query }: TeamsListPendingInvitationsLegacyParams, + reposUpdate: ( + { owner, repo }: ReposUpdateParams, + data: ReposUpdatePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/invitations\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}\`, + 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 [\`List team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for 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. 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 teams - * @name TeamsListProjectsLegacy - * @summary List team projects (Legacy) - * @request GET:/teams/{team_id}/projects - * @deprecated + * @tags repos + * @name ReposUpdateBranchProtection + * @summary Update branch protection + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection */ - teamsListProjectsLegacy: ( - { teamId, ...query }: TeamsListProjectsLegacyParams, + reposUpdateBranchProtection: ( + { owner, repo, branch }: ReposUpdateBranchProtectionParams, + data: ReposUpdateBranchProtectionPayload, params: RequestParams = {}, ) => this.request< - TeamsListProjectsLegacyData, + ReposUpdateBranchProtectionData, | BasicError | { documentation_url: string; message: string; } + | ValidationErrorSimple >({ - path: \`/teams/\${teamId}/projects\`, - method: "GET", - query: query, + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + 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. + * No description * - * @tags teams - * @name TeamsListReposLegacy - * @summary List team repositories (Legacy) - * @request GET:/teams/{team_id}/repos - * @deprecated + * @tags repos + * @name ReposUpdateCommitComment + * @summary Update a commit comment + * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} */ - teamsListReposLegacy: ( - { teamId, ...query }: TeamsListReposLegacyParams, + reposUpdateCommitComment: ( + { owner, repo, commentId }: ReposUpdateCommitCommentParams, + data: ReposUpdateCommitCommentPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + 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/)." - * - * @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/)." + * @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 TeamsRemoveMembershipForUserLegacy - * @summary Remove team membership for a user (Legacy) - * @request DELETE:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags repos + * @name ReposUpdateInformationAboutPagesSite + * @summary Update information about a GitHub Pages site + * @request PUT:/repos/{owner}/{repo}/pages */ - teamsRemoveMembershipForUserLegacy: ( - { teamId, username }: TeamsRemoveMembershipForUserLegacyParams, + reposUpdateInformationAboutPagesSite: ( + { owner, repo }: ReposUpdateInformationAboutPagesSiteParams, + data: ReposUpdateInformationAboutPagesSitePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/memberships/\${username}\`, - method: "DELETE", + this.request< + ReposUpdateInformationAboutPagesSiteData, + BasicError | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pages\`, + 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 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 ReposUpdateInvitation + * @summary Update a repository invitation + * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} */ - teamsRemoveProjectLegacy: ( - { teamId, projectId }: TeamsRemoveProjectLegacyParams, + reposUpdateInvitation: ( + { owner, repo, invitationId }: ReposUpdateInvitationParams, + data: ReposUpdateInvitationPayload, params: RequestParams = {}, ) => - this.request< - TeamsRemoveProjectLegacyData, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + 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 [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 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 teams - * @name TeamsRemoveRepoLegacy - * @summary Remove a repository from a team (Legacy) - * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags repos + * @name ReposUpdatePullRequestReviewProtection + * @summary Update pull request review protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - teamsRemoveRepoLegacy: ( - { teamId, owner, repo }: TeamsRemoveRepoLegacyParams, + reposUpdatePullRequestReviewProtection: ( + { owner, repo, branch }: ReposUpdatePullRequestReviewProtectionParams, + data: ReposUpdatePullRequestReviewProtectionPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "DELETE", - ...params, - }), + this.request( + { + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + 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 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 Users with push access to the repository can edit a release. * - * @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 ReposUpdateRelease + * @summary Update a release + * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} */ - teamsUpdateDiscussionCommentLegacy: ( - { - teamId, - discussionNumber, - commentNumber, - }: TeamsUpdateDiscussionCommentLegacyParams, - data: TeamsUpdateDiscussionCommentLegacyPayload, + reposUpdateRelease: ( + { owner, repo, releaseId }: ReposUpdateReleaseParams, + data: ReposUpdateReleasePayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -63722,21 +64083,20 @@ 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 [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 Users with push access to the repository can edit a release asset. * - * @tags teams - * @name TeamsUpdateDiscussionLegacy - * @summary Update a discussion (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags repos + * @name ReposUpdateReleaseAsset + * @summary Update a release asset + * @request PATCH:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - teamsUpdateDiscussionLegacy: ( - { teamId, discussionNumber }: TeamsUpdateDiscussionLegacyParams, - data: TeamsUpdateDiscussionLegacyPayload, + reposUpdateReleaseAsset: ( + { owner, repo, assetId }: ReposUpdateReleaseAssetParams, + data: ReposUpdateReleaseAssetPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -63745,169 +64105,143 @@ 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 [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 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 teams - * @name TeamsUpdateLegacy - * @summary Update a team (Legacy) - * @request PATCH:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposUpdateStatusCheckProtection + * @summary Update status check protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - teamsUpdateLegacy: ( - { teamId }: TeamsUpdateLegacyParams, - data: TeamsUpdateLegacyPayload, + reposUpdateStatusCheckProtection: ( + { owner, repo, branch }: ReposUpdateStatusCheckProtectionParams, + data: ReposUpdateStatusCheckProtectionPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}\`, + 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, }), - }; - user = { - /** - * 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, repo }: ActivityCheckRepoIsStarredByAuthenticatedUserParams, - params: RequestParams = {}, - ) => - this.request< - ActivityCheckRepoIsStarredByAuthenticatedUserData, - ActivityCheckRepoIsStarredByAuthenticatedUserError - >({ - path: \`/user/starred/\${owner}/\${repo}\`, - method: "GET", - ...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 - */ - activityListReposStarredByAuthenticatedUser: ( - query: ActivityListReposStarredByAuthenticatedUserParams, - params: RequestParams = {}, - ) => - this.request( - { - path: \`/user/starred\`, - method: "GET", - query: query, - format: "json", - ...params, - }, - ), /** - * @description Lists repositories the authenticated user is watching. + * @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 activity - * @name ActivityListWatchedReposForAuthenticatedUser - * @summary List repositories watched by the authenticated user - * @request GET:/user/subscriptions + * @tags repos + * @name ReposUpdateWebhook + * @summary Update a repository webhook + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} */ - activityListWatchedReposForAuthenticatedUser: ( - query: ActivityListWatchedReposForAuthenticatedUserParams, + reposUpdateWebhook: ( + { owner, repo, hookId }: ReposUpdateWebhookParams, + data: ReposUpdateWebhookPayload, params: RequestParams = {}, ) => - this.request< - ActivityListWatchedReposForAuthenticatedUserData, - BasicError - >({ - path: \`/user/subscriptions\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + method: "PATCH", + 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 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 activity - * @name ActivityStarRepoForAuthenticatedUser - * @summary Star a repository for the authenticated user - * @request PUT:/user/starred/{owner}/{repo} + * @tags repos + * @name ReposUpdateWebhookConfigForRepo + * @summary Update a webhook configuration for a repository + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config */ - activityStarRepoForAuthenticatedUser: ( - { owner, repo }: ActivityStarRepoForAuthenticatedUserParams, + reposUpdateWebhookConfigForRepo: ( + { owner, repo, hookId }: ReposUpdateWebhookConfigForRepoParams, + data: ReposUpdateWebhookConfigForRepoPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * No description + * @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 activity - * @name ActivityUnstarRepoForAuthenticatedUser - * @summary Unstar a repository for the authenticated user - * @request DELETE:/user/starred/{owner}/{repo} + * @tags repos + * @name ReposUploadReleaseAsset + * @summary Upload a release asset + * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets */ - activityUnstarRepoForAuthenticatedUser: ( - { owner, repo }: ActivityUnstarRepoForAuthenticatedUserParams, + reposUploadReleaseAsset: ( + { owner, repo, releaseId, ...query }: ReposUploadReleaseAssetParams, + data: ReposUploadReleaseAssetPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, + method: "POST", + query: query, + body: data, + 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 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 apps - * @name AppsAddRepoToInstallation - * @summary Add a repository to an app installation - * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} + * @tags secret-scanning + * @name SecretScanningGetAlert + * @summary Get a secret scanning alert + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} */ - appsAddRepoToInstallation: ( - { installationId, repositoryId }: AppsAddRepoToInstallationParams, + secretScanningGetAlert: ( + { owner, repo, alertNumber }: SecretScanningGetAlertParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, - method: "PUT", + this.request< + SecretScanningGetAlertData, + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, + 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. + * @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 apps - * @name AppsListInstallationReposForAuthenticatedUser - * @summary List repositories accessible to the user access token - * @request GET:/user/installations/{installation_id}/repositories + * @tags secret-scanning + * @name SecretScanningListAlertsForRepo + * @summary List secret scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts */ - appsListInstallationReposForAuthenticatedUser: ( - { - installationId, - ...query - }: AppsListInstallationReposForAuthenticatedUserParams, + secretScanningListAlertsForRepo: ( + { owner, repo, ...query }: SecretScanningListAlertsForRepoParams, params: RequestParams = {}, ) => this.request< - AppsListInstallationReposForAuthenticatedUserData, - BasicError + SecretScanningListAlertsForRepoData, + void | { + code?: string; + documentation_url?: string; + message?: string; + } >({ - path: \`/user/installations/\${installationId}/repositories\`, + path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts\`, method: "GET", query: query, format: "json", @@ -63915,168 +64249,162 @@ export class Api< }), /** - * @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: AppsListInstallationsForAuthenticatedUserParams, + secretScanningUpdateAlert: ( + { owner, repo, alertNumber }: SecretScanningUpdateAlertParams, + data: SecretScanningUpdateAlertPayload, params: RequestParams = {}, ) => this.request< - AppsListInstallationsForAuthenticatedUserData, - | BasicError - | { - documentation_url: string; - message: string; - } + SecretScanningUpdateAlertData, + 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, }), - + }; + repositories = { /** - * @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 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 apps - * @name AppsListSubscriptionsForAuthenticatedUser - * @summary List subscriptions for the authenticated user - * @request GET:/user/marketplace_purchases + * @tags repos + * @name ReposListPublic + * @summary List public repositories + * @request GET:/repositories */ - appsListSubscriptionsForAuthenticatedUser: ( - query: AppsListSubscriptionsForAuthenticatedUserParams, + reposListPublic: ( + query: ReposListPublicParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/marketplace_purchases\`, + this.request({ + path: \`/repositories\`, method: "GET", query: query, format: "json", ...params, }), - + }; + scim = { /** - * @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 **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags apps - * @name AppsListSubscriptionsForAuthenticatedUserStubbed - * @summary List subscriptions for the authenticated user (stubbed) - * @request GET:/user/marketplace_purchases/stubbed + * @tags enterprise-admin + * @name EnterpriseAdminDeleteScimGroupFromEnterprise + * @summary Delete a SCIM group from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - appsListSubscriptionsForAuthenticatedUserStubbed: ( - query: AppsListSubscriptionsForAuthenticatedUserStubbedParams, + enterpriseAdminDeleteScimGroupFromEnterprise: ( + { + enterprise, + scimGroupId, + }: EnterpriseAdminDeleteScimGroupFromEnterpriseParams, params: RequestParams = {}, ) => - this.request< - AppsListSubscriptionsForAuthenticatedUserStubbedData, - BasicError - >({ - path: \`/user/marketplace_purchases/stubbed\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "DELETE", ...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 **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags apps - * @name AppsRemoveRepoFromInstallation - * @summary Remove a repository from an app installation - * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} + * @tags enterprise-admin + * @name EnterpriseAdminDeleteUserFromEnterprise + * @summary Delete a SCIM user from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - appsRemoveRepoFromInstallation: ( - { installationId, repositoryId }: AppsRemoveRepoFromInstallationParams, + enterpriseAdminDeleteUserFromEnterprise: ( + { enterprise, scimUserId }: EnterpriseAdminDeleteUserFromEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, method: "DELETE", ...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 **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags interactions - * @name InteractionsGetRestrictionsForAuthenticatedUser - * @summary Get interaction restrictions for your public repositories - * @request GET:/user/interaction-limits + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup + * @summary Get SCIM provisioning information for an enterprise group + * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - interactionsGetRestrictionsForAuthenticatedUser: ( + enterpriseAdminGetProvisioningInformationForEnterpriseGroup: ( + { + enterprise, + scimGroupId, + }: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/interaction-limits\`, + this.request< + EnterpriseAdminGetProvisioningInformationForEnterpriseGroupData, + any + >({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, 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 - */ - interactionsRemoveRestrictionsForAuthenticatedUser: ( - params: RequestParams = {}, - ) => - this.request( - { - path: \`/user/interaction-limits\`, - method: "DELETE", - ...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 **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags interactions - * @name InteractionsSetRestrictionsForAuthenticatedUser - * @summary Set interaction restrictions for your public repositories - * @request PUT:/user/interaction-limits + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseUser + * @summary Get SCIM provisioning information for an enterprise user + * @request GET:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - interactionsSetRestrictionsForAuthenticatedUser: ( - data: InteractionLimit, + enterpriseAdminGetProvisioningInformationForEnterpriseUser: ( + { + enterprise, + scimUserId, + }: EnterpriseAdminGetProvisioningInformationForEnterpriseUserParams, params: RequestParams = {}, ) => this.request< - InteractionsSetRestrictionsForAuthenticatedUserData, - ValidationError + EnterpriseAdminGetProvisioningInformationForEnterpriseUserData, + any >({ - path: \`/user/interaction-limits\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + 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 **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags issues - * @name IssuesListForAuthenticatedUser - * @summary List user account issues assigned to the authenticated user - * @request GET:/user/issues + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedGroupsEnterprise + * @summary List provisioned SCIM groups for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Groups */ - issuesListForAuthenticatedUser: ( - query: IssuesListForAuthenticatedUserParams, + enterpriseAdminListProvisionedGroupsEnterprise: ( + { + enterprise, + ...query + }: EnterpriseAdminListProvisionedGroupsEnterpriseParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/issues\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, method: "GET", query: query, format: "json", @@ -64084,121 +64412,174 @@ export class Api< }), /** - * @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 **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 migrations - * @name MigrationsDeleteArchiveForAuthenticatedUser - * @summary Delete a user migration archive - * @request DELETE:/user/migrations/{migration_id}/archive + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedIdentitiesEnterprise + * @summary List SCIM provisioned identities for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Users */ - migrationsDeleteArchiveForAuthenticatedUser: ( - { migrationId }: MigrationsDeleteArchiveForAuthenticatedUserParams, + enterpriseAdminListProvisionedIdentitiesEnterprise: ( + { + enterprise, + ...query + }: EnterpriseAdminListProvisionedIdentitiesEnterpriseParams, params: RequestParams = {}, ) => - this.request( + this.request( { - path: \`/user/migrations/\${migrationId}/archive\`, - method: "DELETE", + path: \`/scim/v2/enterprises/\${enterprise}/Users\`, + 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 **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 migrations - * @name MigrationsGetArchiveForAuthenticatedUser - * @summary Download a user migration archive - * @request GET:/user/migrations/{migration_id}/archive + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup + * @summary Provision a SCIM enterprise group and invite users + * @request POST:/scim/v2/enterprises/{enterprise}/Groups */ - migrationsGetArchiveForAuthenticatedUser: ( - { migrationId }: MigrationsGetArchiveForAuthenticatedUserParams, + enterpriseAdminProvisionAndInviteEnterpriseGroup: ( + { enterprise }: EnterpriseAdminProvisionAndInviteEnterpriseGroupParams, + data: EnterpriseAdminProvisionAndInviteEnterpriseGroupPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/archive\`, - method: "GET", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, + method: "POST", + body: data, + type: ContentType.Json, + 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 **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 migrations - * @name MigrationsGetStatusForAuthenticatedUser - * @summary Get a user migration status - * @request GET:/user/migrations/{migration_id} + * @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 **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} */ - migrationsGetStatusForAuthenticatedUser: ( - { migrationId, ...query }: MigrationsGetStatusForAuthenticatedUserParams, + enterpriseAdminSetInformationForProvisionedEnterpriseGroup: ( + { + enterprise, + scimGroupId, + }: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupParams, + data: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}\`, - method: "GET", - query: query, + this.request< + EnterpriseAdminSetInformationForProvisionedEnterpriseGroupData, + any + >({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists all migrations a user has started. + * @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 migrations - * @name MigrationsListForAuthenticatedUser - * @summary List user migrations - * @request GET:/user/migrations + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser + * @summary Set SCIM information for a provisioned enterprise user + * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - migrationsListForAuthenticatedUser: ( - query: MigrationsListForAuthenticatedUserParams, + enterpriseAdminSetInformationForProvisionedEnterpriseUser: ( + { + enterprise, + scimUserId, + }: EnterpriseAdminSetInformationForProvisionedEnterpriseUserParams, + data: EnterpriseAdminSetInformationForProvisionedEnterpriseUserPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations\`, - method: "GET", - query: query, + this.request< + EnterpriseAdminSetInformationForProvisionedEnterpriseUserData, + any + >({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists all the repositories for this user migration. + * @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 migrations - * @name MigrationsListReposForUser - * @summary List repositories for a user migration - * @request GET:/user/migrations/{migration_id}/repositories + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup + * @summary Update an attribute for a SCIM enterprise group + * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - migrationsListReposForUser: ( - { migrationId, ...query }: MigrationsListReposForUserParams, + enterpriseAdminUpdateAttributeForEnterpriseGroup: ( + { + enterprise, + scimGroupId, + }: EnterpriseAdminUpdateAttributeForEnterpriseGroupParams, + data: EnterpriseAdminUpdateAttributeForEnterpriseGroupPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/repositories\`, - method: "GET", - query: query, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Initiates the generation of a user migration archive. + * @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 migrations - * @name MigrationsStartForAuthenticatedUser - * @summary Start a user migration - * @request POST:/user/migrations + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseUser + * @summary Update an attribute for a SCIM enterprise user + * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - migrationsStartForAuthenticatedUser: ( - data: MigrationsStartForAuthenticatedUserPayload, + enterpriseAdminUpdateAttributeForEnterpriseUser: ( + { + enterprise, + scimUserId, + }: EnterpriseAdminUpdateAttributeForEnterpriseUserParams, + data: EnterpriseAdminUpdateAttributeForEnterpriseUserPayload, params: RequestParams = {}, ) => - this.request< - MigrationsStartForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/user/migrations\`, - method: "POST", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -64206,19 +64587,19 @@ export class Api< }), /** - * @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. + * No description * - * @tags migrations - * @name MigrationsUnlockRepoForAuthenticatedUser - * @summary Unlock a user repository - * @request DELETE:/user/migrations/{migration_id}/repos/{repo_name}/lock + * @tags scim + * @name ScimDeleteUserFromOrg + * @summary Delete a SCIM user from an organization + * @request DELETE:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - migrationsUnlockRepoForAuthenticatedUser: ( - { migrationId, repoName }: MigrationsUnlockRepoForAuthenticatedUserParams, + scimDeleteUserFromOrg: ( + { org, scimUserId }: ScimDeleteUserFromOrgParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/repos/\${repoName}/lock\`, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, method: "DELETE", ...params, }), @@ -64226,36 +64607,36 @@ export class Api< /** * No description * - * @tags orgs - * @name OrgsGetMembershipForAuthenticatedUser - * @summary Get an organization membership for the authenticated user - * @request GET:/user/memberships/orgs/{org} + * @tags scim + * @name ScimGetProvisioningInformationForUser + * @summary Get SCIM provisioning information for a user + * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - orgsGetMembershipForAuthenticatedUser: ( - { org }: OrgsGetMembershipForAuthenticatedUserParams, + scimGetProvisioningInformationForUser: ( + { org, scimUserId }: ScimGetProvisioningInformationForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/memberships/orgs/\${org}\`, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, 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 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 orgs - * @name OrgsListForAuthenticatedUser - * @summary List organizations for the authenticated user - * @request GET:/user/orgs + * @tags scim + * @name ScimListProvisionedIdentities + * @summary List SCIM provisioned identities + * @request GET:/scim/v2/organizations/{org}/Users */ - orgsListForAuthenticatedUser: ( - query: OrgsListForAuthenticatedUserParams, + scimListProvisionedIdentities: ( + { org, ...query }: ScimListProvisionedIdentitiesParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/orgs\`, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users\`, method: "GET", query: query, format: "json", @@ -64263,47 +64644,43 @@ export class Api< }), /** - * No description + * @description Provision organization membership for a user, and send an activation email to the email address. * - * @tags orgs - * @name OrgsListMembershipsForAuthenticatedUser - * @summary List organization memberships for the authenticated user - * @request GET:/user/memberships/orgs + * @tags scim + * @name ScimProvisionAndInviteUser + * @summary Provision and invite a SCIM user + * @request POST:/scim/v2/organizations/{org}/Users */ - orgsListMembershipsForAuthenticatedUser: ( - query: OrgsListMembershipsForAuthenticatedUserParams, + scimProvisionAndInviteUser: ( + { org }: ScimProvisionAndInviteUserParams, + data: ScimProvisionAndInviteUserPayload, params: RequestParams = {}, ) => - this.request< - OrgsListMembershipsForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/user/memberships/orgs\`, - method: "GET", - query: query, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @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 orgs - * @name OrgsUpdateMembershipForAuthenticatedUser - * @summary Update an organization membership for the authenticated user - * @request PATCH:/user/memberships/orgs/{org} + * @tags scim + * @name ScimSetInformationForProvisionedUser + * @summary Update a provisioned organization membership + * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - orgsUpdateMembershipForAuthenticatedUser: ( - { org }: OrgsUpdateMembershipForAuthenticatedUserParams, - data: OrgsUpdateMembershipForAuthenticatedUserPayload, + scimSetInformationForProvisionedUser: ( + { org, scimUserId }: ScimSetInformationForProvisionedUserParams, + data: ScimSetInformationForProvisionedUserPayload, params: RequestParams = {}, ) => - this.request< - OrgsUpdateMembershipForAuthenticatedUserData, - BasicError | ValidationError - >({ - path: \`/user/memberships/orgs/\${org}\`, - method: "PATCH", + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -64311,111 +64688,145 @@ export class Api< }), /** - * No description + * @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 projects - * @name ProjectsCreateForAuthenticatedUser - * @summary Create a user project - * @request POST:/user/projects + * @tags scim + * @name ScimUpdateAttributeForUser + * @summary Update an attribute for a SCIM user + * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - projectsCreateForAuthenticatedUser: ( - data: ProjectsCreateForAuthenticatedUserPayload, + scimUpdateAttributeForUser: ( + { org, scimUserId }: ScimUpdateAttributeForUserParams, + data: ScimUpdateAttributeForUserPayload, params: RequestParams = {}, ) => this.request< - ProjectsCreateForAuthenticatedUserData, + 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 | { - documentation_url: string; - message: string; + code?: string; + documentation_url?: string; + message?: string; } - | ValidationErrorSimple >({ - path: \`/user/projects\`, - method: "POST", - body: data, - type: ContentType.Json, + path: \`/search/code\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @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 repos - * @name ReposAcceptInvitation - * @summary Accept a repository invitation - * @request PATCH:/user/repository_invitations/{invitation_id} + * @tags search + * @name SearchCommits + * @summary Search commits + * @request GET:/search/commits */ - reposAcceptInvitation: ( - { invitationId }: ReposAcceptInvitationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/user/repository_invitations/\${invitationId}\`, - method: "PATCH", + searchCommits: (query: SearchCommitsParams, params: RequestParams = {}) => + this.request< + SearchCommitsData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/search/commits\`, + method: "GET", + query: query, + 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 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 repos - * @name ReposCreateForAuthenticatedUser - * @summary Create a repository for the authenticated user - * @request POST:/user/repos + * @tags search + * @name SearchIssuesAndPullRequests + * @summary Search issues and pull requests + * @request GET:/search/issues */ - reposCreateForAuthenticatedUser: ( - data: ReposCreateForAuthenticatedUserPayload, + searchIssuesAndPullRequests: ( + query: SearchIssuesAndPullRequestsParams, params: RequestParams = {}, ) => this.request< - ReposCreateForAuthenticatedUserData, - BasicError | ValidationError + SearchIssuesAndPullRequestsData, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } >({ - path: \`/user/repos\`, - method: "POST", - body: data, - type: ContentType.Json, + path: \`/search/issues\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @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 repos - * @name ReposDeclineInvitation - * @summary Decline a repository invitation - * @request DELETE:/user/repository_invitations/{invitation_id} + * @tags search + * @name SearchLabels + * @summary Search labels + * @request GET:/search/labels */ - reposDeclineInvitation: ( - { invitationId }: ReposDeclineInvitationParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/user/repository_invitations/\${invitationId}\`, - method: "DELETE", + searchLabels: (query: SearchLabelsParams, params: RequestParams = {}) => + this.request({ + path: \`/search/labels\`, + 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 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 repos - * @name ReposListForAuthenticatedUser - * @summary List repositories for the authenticated user - * @request GET:/user/repos + * @tags search + * @name SearchRepos + * @summary Search repositories + * @request GET:/search/repositories */ - reposListForAuthenticatedUser: ( - query: ReposListForAuthenticatedUserParams, - params: RequestParams = {}, - ) => + searchRepos: (query: SearchReposParams, params: RequestParams = {}) => this.request< - ReposListForAuthenticatedUserData, - BasicError | ValidationError + SearchReposData, + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } >({ - path: \`/user/repos\`, + path: \`/search/repositories\`, method: "GET", query: query, format: "json", @@ -64423,19 +64834,22 @@ export class Api< }), /** - * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that 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 repos - * @name ReposListInvitationsForAuthenticatedUser - * @summary List repository invitations for the authenticated user - * @request GET:/user/repository_invitations + * @tags search + * @name SearchTopics + * @summary Search topics + * @request GET:/search/topics */ - reposListInvitationsForAuthenticatedUser: ( - query: ReposListInvitationsForAuthenticatedUserParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/user/repository_invitations\`, + searchTopics: (query: SearchTopicsParams, params: RequestParams = {}) => + this.request< + SearchTopicsData, + { + documentation_url: string; + message: string; + } + >({ + path: \`/search/topics\`, method: "GET", query: query, format: "json", @@ -64443,42 +64857,51 @@ 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 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 teams - * @name TeamsListForAuthenticatedUser - * @summary List teams for the authenticated user - * @request GET:/user/teams + * @tags search + * @name SearchUsers + * @summary Search users + * @request GET:/search/users */ - teamsListForAuthenticatedUser: ( - query: TeamsListForAuthenticatedUserParams, - params: RequestParams = {}, - ) => - this.request({ - path: \`/user/teams\`, + 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 This endpoint is accessible with 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 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 users - * @name UsersAddEmailForAuthenticated - * @summary Add an email address for the authenticated user - * @request POST:/user/emails + * @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 */ - usersAddEmailForAuthenticated: ( - data: UsersAddEmailForAuthenticatedPayload, + reactionsCreateForTeamDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + }: ReactionsCreateForTeamDiscussionCommentLegacyParams, + data: ReactionsCreateForTeamDiscussionCommentLegacyPayload, params: RequestParams = {}, ) => - this.request< - UsersAddEmailForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/emails\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, method: "POST", body: data, type: ContentType.Json, @@ -64487,101 +64910,121 @@ export class Api< }), /** - * 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 [\`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 users - * @name UsersBlock - * @summary Block a user - * @request PUT:/user/blocks/{username} + * @tags reactions + * @name ReactionsCreateForTeamDiscussionLegacy + * @summary Create reaction for a team discussion (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated */ - usersBlock: ({ username }: UsersBlockParams, params: RequestParams = {}) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "PUT", + 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, }), /** - * 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 [\`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 users - * @name UsersCheckBlocked - * @summary Check if a user is blocked by the authenticated user - * @request GET:/user/blocks/{username} + * @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 */ - usersCheckBlocked: ( - { username }: UsersCheckBlockedParams, + reactionsListForTeamDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + ...query + }: ReactionsListForTeamDiscussionCommentLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/blocks/\${username}\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, method: "GET", + query: query, + 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 [\`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 users - * @name UsersCheckPersonIsFollowedByAuthenticated - * @summary Check if a person is followed by the authenticated user - * @request GET:/user/following/{username} + * @tags reactions + * @name ReactionsListForTeamDiscussionLegacy + * @summary List reactions for a team discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated */ - usersCheckPersonIsFollowedByAuthenticated: ( - { username }: UsersCheckPersonIsFollowedByAuthenticatedParams, + reactionsListForTeamDiscussionLegacy: ( + { + teamId, + discussionNumber, + ...query + }: ReactionsListForTeamDiscussionLegacyParams, params: RequestParams = {}, ) => - this.request< - UsersCheckPersonIsFollowedByAuthenticatedData, - UsersCheckPersonIsFollowedByAuthenticatedError - >({ - path: \`/user/following/\${username}\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, 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/). + * @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 users - * @name UsersCreateGpgKeyForAuthenticated - * @summary Create a GPG key for the authenticated user - * @request POST:/user/gpg_keys + * @tags teams + * @name TeamsAddMemberLegacy + * @summary Add team member (Legacy) + * @request PUT:/teams/{team_id}/members/{username} + * @deprecated */ - usersCreateGpgKeyForAuthenticated: ( - data: UsersCreateGpgKeyForAuthenticatedPayload, + teamsAddMemberLegacy: ( + { teamId, username }: TeamsAddMemberLegacyParams, params: RequestParams = {}, ) => - this.request< - UsersCreateGpgKeyForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/gpg_keys\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "PUT", ...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 **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 users - * @name UsersCreatePublicSshKeyForAuthenticated - * @summary Create a public SSH key for the authenticated user - * @request POST:/user/keys + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserLegacy + * @summary Add or update team membership for a user (Legacy) + * @request PUT:/teams/{team_id}/memberships/{username} + * @deprecated */ - usersCreatePublicSshKeyForAuthenticated: ( - data: UsersCreatePublicSshKeyForAuthenticatedPayload, + teamsAddOrUpdateMembershipForUserLegacy: ( + { teamId, username }: TeamsAddOrUpdateMembershipForUserLegacyParams, + data: TeamsAddOrUpdateMembershipForUserLegacyPayload, params: RequestParams = {}, ) => this.request< - UsersCreatePublicSshKeyForAuthenticatedData, - BasicError | ValidationError + TeamsAddOrUpdateMembershipForUserLegacyData, + TeamsAddOrUpdateMembershipForUserLegacyError >({ - path: \`/user/keys\`, - method: "POST", + path: \`/teams/\${teamId}/memberships/\${username}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -64589,378 +65032,398 @@ export class Api< }), /** - * @description This endpoint is accessible with 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 [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 users - * @name UsersDeleteEmailForAuthenticated - * @summary Delete an email address for the authenticated user - * @request DELETE:/user/emails + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsLegacy + * @summary Add or update team project permissions (Legacy) + * @request PUT:/teams/{team_id}/projects/{project_id} + * @deprecated */ - usersDeleteEmailForAuthenticated: ( - data: UsersDeleteEmailForAuthenticatedPayload, + teamsAddOrUpdateProjectPermissionsLegacy: ( + { teamId, projectId }: TeamsAddOrUpdateProjectPermissionsLegacyParams, + data: TeamsAddOrUpdateProjectPermissionsLegacyPayload, params: RequestParams = {}, ) => this.request< - UsersDeleteEmailForAuthenticatedData, - BasicError | ValidationError + TeamsAddOrUpdateProjectPermissionsLegacyData, + TeamsAddOrUpdateProjectPermissionsLegacyError >({ - path: \`/user/emails\`, - method: "DELETE", + path: \`/teams/\${teamId}/projects/\${projectId}\`, + method: "PUT", body: data, type: ContentType.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 **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 users - * @name UsersDeleteGpgKeyForAuthenticated - * @summary Delete a GPG key for the authenticated user - * @request DELETE:/user/gpg_keys/{gpg_key_id} + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsLegacy + * @summary Add or update team repository permissions (Legacy) + * @request PUT:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated */ - usersDeleteGpgKeyForAuthenticated: ( - { gpgKeyId }: UsersDeleteGpgKeyForAuthenticatedParams, + teamsAddOrUpdateRepoPermissionsLegacy: ( + { teamId, owner, repo }: TeamsAddOrUpdateRepoPermissionsLegacyParams, + data: TeamsAddOrUpdateRepoPermissionsLegacyPayload, params: RequestParams = {}, ) => this.request< - UsersDeleteGpgKeyForAuthenticatedData, + TeamsAddOrUpdateRepoPermissionsLegacyData, BasicError | ValidationError >({ - path: \`/user/gpg_keys/\${gpgKeyId}\`, - method: "DELETE", + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + method: "PUT", + body: data, + type: ContentType.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 **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 users - * @name UsersDeletePublicSshKeyForAuthenticated - * @summary Delete a public SSH key for the authenticated user - * @request DELETE:/user/keys/{key_id} + * @tags teams + * @name TeamsCheckPermissionsForProjectLegacy + * @summary Check team permissions for a project (Legacy) + * @request GET:/teams/{team_id}/projects/{project_id} + * @deprecated */ - usersDeletePublicSshKeyForAuthenticated: ( - { keyId }: UsersDeletePublicSshKeyForAuthenticatedParams, + teamsCheckPermissionsForProjectLegacy: ( + { teamId, projectId }: TeamsCheckPermissionsForProjectLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys/\${keyId}\`, - method: "DELETE", + this.request< + TeamsCheckPermissionsForProjectLegacyData, + void | { + documentation_url: string; + message: string; + } + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, + 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 **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 users - * @name UsersFollow - * @summary Follow a user - * @request PUT:/user/following/{username} + * @tags teams + * @name TeamsCheckPermissionsForRepoLegacy + * @summary Check team permissions for a repository (Legacy) + * @request GET:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated */ - usersFollow: ( - { username }: UsersFollowParams, + teamsCheckPermissionsForRepoLegacy: ( + { teamId, owner, repo }: TeamsCheckPermissionsForRepoLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following/\${username}\`, - method: "PUT", - ...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 - */ - usersGetAuthenticated: (params: RequestParams = {}) => - this.request({ - path: \`/user\`, + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "GET", 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 **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 users - * @name UsersGetGpgKeyForAuthenticated - * @summary Get a GPG key for the authenticated user - * @request GET:/user/gpg_keys/{gpg_key_id} + * @tags teams + * @name TeamsCreateDiscussionCommentLegacy + * @summary Create a discussion comment (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated */ - usersGetGpgKeyForAuthenticated: ( - { gpgKeyId }: UsersGetGpgKeyForAuthenticatedParams, + teamsCreateDiscussionCommentLegacy: ( + { teamId, discussionNumber }: TeamsCreateDiscussionCommentLegacyParams, + data: TeamsCreateDiscussionCommentLegacyPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys/\${gpgKeyId}\`, - method: "GET", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + 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/). + * @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 users - * @name UsersGetPublicSshKeyForAuthenticated - * @summary Get a public SSH key for the authenticated user - * @request GET:/user/keys/{key_id} + * @tags teams + * @name TeamsCreateDiscussionLegacy + * @summary Create a discussion (Legacy) + * @request POST:/teams/{team_id}/discussions + * @deprecated */ - usersGetPublicSshKeyForAuthenticated: ( - { keyId }: UsersGetPublicSshKeyForAuthenticatedParams, + teamsCreateDiscussionLegacy: ( + { teamId }: TeamsCreateDiscussionLegacyParams, + data: TeamsCreateDiscussionLegacyPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys/\${keyId}\`, - method: "GET", + this.request({ + path: \`/teams/\${teamId}/discussions\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List the users you've blocked on your personal account. + * @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 users - * @name UsersListBlockedByAuthenticated - * @summary List users blocked by the authenticated user - * @request GET:/user/blocks + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy + * @summary Create or update IdP group connections (Legacy) + * @request PATCH:/teams/{team_id}/team-sync/group-mappings + * @deprecated */ - usersListBlockedByAuthenticated: (params: RequestParams = {}) => + teamsCreateOrUpdateIdpGroupConnectionsLegacy: ( + { teamId }: TeamsCreateOrUpdateIdpGroupConnectionsLegacyParams, + data: TeamsCreateOrUpdateIdpGroupConnectionsLegacyPayload, + params: RequestParams = {}, + ) => this.request< - UsersListBlockedByAuthenticatedData, - | BasicError - | { - documentation_url: string; - message: string; - } + TeamsCreateOrUpdateIdpGroupConnectionsLegacyData, + BasicError | ValidationError >({ - path: \`/user/blocks\`, - method: "GET", + path: \`/teams/\${teamId}/team-sync/group-mappings\`, + 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. + * @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 users - * @name UsersListEmailsForAuthenticated - * @summary List email addresses for the authenticated user - * @request GET:/user/emails + * @tags teams + * @name TeamsDeleteDiscussionCommentLegacy + * @summary Delete a discussion comment (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated */ - usersListEmailsForAuthenticated: ( - query: UsersListEmailsForAuthenticatedParams, + teamsDeleteDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + }: TeamsDeleteDiscussionCommentLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/emails\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "DELETE", ...params, }), /** - * @description Lists the people who the authenticated user follows. + * @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 users - * @name UsersListFollowedByAuthenticated - * @summary List the people the authenticated user follows - * @request GET:/user/following + * @tags teams + * @name TeamsDeleteDiscussionLegacy + * @summary Delete a discussion (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - usersListFollowedByAuthenticated: ( - query: UsersListFollowedByAuthenticatedParams, + teamsDeleteDiscussionLegacy: ( + { teamId, discussionNumber }: TeamsDeleteDiscussionLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + method: "DELETE", ...params, }), /** - * @description Lists the people following the authenticated 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 [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 users - * @name UsersListFollowersForAuthenticatedUser - * @summary List followers of the authenticated user - * @request GET:/user/followers + * @tags teams + * @name TeamsDeleteLegacy + * @summary Delete a team (Legacy) + * @request DELETE:/teams/{team_id} + * @deprecated */ - usersListFollowersForAuthenticatedUser: ( - query: UsersListFollowersForAuthenticatedUserParams, + teamsDeleteLegacy: ( + { teamId }: TeamsDeleteLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/followers\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/teams/\${teamId}\`, + 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/). + * @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 users - * @name UsersListGpgKeysForAuthenticated - * @summary List GPG keys for the authenticated user - * @request GET:/user/gpg_keys + * @tags teams + * @name TeamsGetDiscussionCommentLegacy + * @summary Get a discussion comment (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated */ - usersListGpgKeysForAuthenticated: ( - query: UsersListGpgKeysForAuthenticatedParams, + teamsGetDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + }: TeamsGetDiscussionCommentLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, method: "GET", - query: query, format: "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. + * @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 users - * @name UsersListPublicEmailsForAuthenticated - * @summary List public email addresses for the authenticated user - * @request GET:/user/public_emails + * @tags teams + * @name TeamsGetDiscussionLegacy + * @summary Get a discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - usersListPublicEmailsForAuthenticated: ( - query: UsersListPublicEmailsForAuthenticatedParams, + teamsGetDiscussionLegacy: ( + { teamId, discussionNumber }: TeamsGetDiscussionLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/public_emails\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, method: "GET", - query: query, 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 **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 users - * @name UsersListPublicSshKeysForAuthenticated - * @summary List public SSH keys for the authenticated user - * @request GET:/user/keys + * @tags teams + * @name TeamsGetLegacy + * @summary Get a team (Legacy) + * @request GET:/teams/{team_id} + * @deprecated */ - usersListPublicSshKeysForAuthenticated: ( - query: UsersListPublicSshKeysForAuthenticatedParams, + teamsGetLegacy: ( + { teamId }: TeamsGetLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys\`, + this.request({ + path: \`/teams/\${teamId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Sets the visibility for your primary email addresses. + * @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 users - * @name UsersSetPrimaryEmailVisibilityForAuthenticated - * @summary Set primary email visibility for the authenticated user - * @request PATCH:/user/email/visibility + * @tags teams + * @name TeamsGetMemberLegacy + * @summary Get team member (Legacy) + * @request GET:/teams/{team_id}/members/{username} + * @deprecated */ - usersSetPrimaryEmailVisibilityForAuthenticated: ( - data: UsersSetPrimaryEmailVisibilityForAuthenticatedPayload, + teamsGetMemberLegacy: ( + { teamId, username }: TeamsGetMemberLegacyParams, params: RequestParams = {}, ) => - this.request< - UsersSetPrimaryEmailVisibilityForAuthenticatedData, - BasicError | ValidationError - >({ - path: \`/user/email/visibility\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "GET", ...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 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 users - * @name UsersUnblock - * @summary Unblock a user - * @request DELETE:/user/blocks/{username} + * @tags teams + * @name TeamsGetMembershipForUserLegacy + * @summary Get team membership for a user (Legacy) + * @request GET:/teams/{team_id}/memberships/{username} + * @deprecated */ - usersUnblock: ( - { username }: UsersUnblockParams, + teamsGetMembershipForUserLegacy: ( + { teamId, username }: TeamsGetMembershipForUserLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "DELETE", + this.request({ + path: \`/teams/\${teamId}/memberships/\${username}\`, + 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. + * @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 users - * @name UsersUnfollow - * @summary Unfollow a user - * @request DELETE:/user/following/{username} + * @tags teams + * @name TeamsListChildLegacy + * @summary List child teams (Legacy) + * @request GET:/teams/{team_id}/teams + * @deprecated */ - usersUnfollow: ( - { username }: UsersUnfollowParams, + teamsListChildLegacy: ( + { teamId, ...query }: TeamsListChildLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following/\${username}\`, - method: "DELETE", + this.request({ + path: \`/teams/\${teamId}/teams\`, + 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 **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 users - * @name UsersUpdateAuthenticated - * @summary Update the authenticated user - * @request PATCH:/user + * @tags teams + * @name TeamsListDiscussionCommentsLegacy + * @summary List discussion comments (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated */ - usersUpdateAuthenticated: ( - data: UsersUpdateAuthenticatedPayload, + teamsListDiscussionCommentsLegacy: ( + { + teamId, + discussionNumber, + ...query + }: TeamsListDiscussionCommentsLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/user\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + 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. + * @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 activity - * @name ActivityListEventsForAuthenticatedUser - * @summary List events for the authenticated user - * @request GET:/users/{username}/events + * @tags teams + * @name TeamsListDiscussionsLegacy + * @summary List discussions (Legacy) + * @request GET:/teams/{team_id}/discussions + * @deprecated */ - activityListEventsForAuthenticatedUser: ( - { username, ...query }: ActivityListEventsForAuthenticatedUserParams, + teamsListDiscussionsLegacy: ( + { teamId, ...query }: TeamsListDiscussionsLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events\`, + this.request({ + path: \`/teams/\${teamId}/discussions\`, method: "GET", query: query, format: "json", @@ -64968,43 +65431,40 @@ export class Api< }), /** - * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * @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 activity - * @name ActivityListOrgEventsForAuthenticatedUser - * @summary List organization events for the authenticated user - * @request GET:/users/{username}/events/orgs/{org} + * @tags teams + * @name TeamsListIdpGroupsForLegacy + * @summary List IdP groups for a team (Legacy) + * @request GET:/teams/{team_id}/team-sync/group-mappings + * @deprecated */ - activityListOrgEventsForAuthenticatedUser: ( - { - username, - org, - ...query - }: ActivityListOrgEventsForAuthenticatedUserParams, + teamsListIdpGroupsForLegacy: ( + { teamId }: TeamsListIdpGroupsForLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events/orgs/\${org}\`, + this.request({ + path: \`/teams/\${teamId}/team-sync/group-mappings\`, method: "GET", - query: query, 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 [\`List team members\`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. Team members will include the members of child teams. * - * @tags activity - * @name ActivityListPublicEventsForUser - * @summary List public events for a user - * @request GET:/users/{username}/events/public + * @tags teams + * @name TeamsListMembersLegacy + * @summary List team members (Legacy) + * @request GET:/teams/{team_id}/members + * @deprecated */ - activityListPublicEventsForUser: ( - { username, ...query }: ActivityListPublicEventsForUserParams, + teamsListMembersLegacy: ( + { teamId, ...query }: TeamsListMembersLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events/public\`, + this.request({ + path: \`/teams/\${teamId}/members\`, method: "GET", query: query, format: "json", @@ -65012,19 +65472,20 @@ 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. + * @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 activity - * @name ActivityListReceivedEventsForUser - * @summary List events received by the authenticated user - * @request GET:/users/{username}/received_events + * @tags teams + * @name TeamsListPendingInvitationsLegacy + * @summary List pending team invitations (Legacy) + * @request GET:/teams/{team_id}/invitations + * @deprecated */ - activityListReceivedEventsForUser: ( - { username, ...query }: ActivityListReceivedEventsForUserParams, + teamsListPendingInvitationsLegacy: ( + { teamId, ...query }: TeamsListPendingInvitationsLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/received_events\`, + this.request({ + path: \`/teams/\${teamId}/invitations\`, method: "GET", query: query, format: "json", @@ -65032,19 +65493,27 @@ export class Api< }), /** - * 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 [\`List team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for a team. * - * @tags activity - * @name ActivityListReceivedPublicEventsForUser - * @summary List public events received by a user - * @request GET:/users/{username}/received_events/public + * @tags teams + * @name TeamsListProjectsLegacy + * @summary List team projects (Legacy) + * @request GET:/teams/{team_id}/projects + * @deprecated */ - activityListReceivedPublicEventsForUser: ( - { username, ...query }: ActivityListReceivedPublicEventsForUserParams, + teamsListProjectsLegacy: ( + { teamId, ...query }: TeamsListProjectsLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/received_events/public\`, + this.request< + TeamsListProjectsLegacyData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/teams/\${teamId}/projects\`, method: "GET", query: query, format: "json", @@ -65052,19 +65521,20 @@ 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: + * @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 activity - * @name ActivityListReposStarredByUser - * @summary List repositories starred by a user - * @request GET:/users/{username}/starred + * @tags teams + * @name TeamsListReposLegacy + * @summary List team repositories (Legacy) + * @request GET:/teams/{team_id}/repos + * @deprecated */ - activityListReposStarredByUser: ( - { username, ...query }: ActivityListReposStarredByUserParams, + teamsListReposLegacy: ( + { teamId, ...query }: TeamsListReposLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/starred\`, + this.request({ + path: \`/teams/\${teamId}/repos\`, method: "GET", query: query, format: "json", @@ -65072,239 +65542,330 @@ export class Api< }), /** - * @description Lists repositories a user is watching. + * @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 activity - * @name ActivityListReposWatchedByUser - * @summary List repositories watched by a user - * @request GET:/users/{username}/subscriptions + * @tags teams + * @name TeamsRemoveMemberLegacy + * @summary Remove team member (Legacy) + * @request DELETE:/teams/{team_id}/members/{username} + * @deprecated */ - activityListReposWatchedByUser: ( - { username, ...query }: ActivityListReposWatchedByUserParams, + teamsRemoveMemberLegacy: ( + { teamId, username }: TeamsRemoveMemberLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/subscriptions\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "DELETE", ...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 [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 apps - * @name AppsGetUserInstallation - * @summary Get a user installation for the authenticated app - * @request GET:/users/{username}/installation + * @tags teams + * @name TeamsRemoveMembershipForUserLegacy + * @summary Remove team membership for a user (Legacy) + * @request DELETE:/teams/{team_id}/memberships/{username} + * @deprecated */ - appsGetUserInstallation: ( - { username }: AppsGetUserInstallationParams, + teamsRemoveMembershipForUserLegacy: ( + { teamId, username }: TeamsRemoveMembershipForUserLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/installation\`, - method: "GET", - format: "json", + this.request({ + path: \`/teams/\${teamId}/memberships/\${username}\`, + 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 \`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 [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 billing - * @name BillingGetGithubActionsBillingUser - * @summary Get GitHub Actions billing for a user - * @request GET:/users/{username}/settings/billing/actions + * @tags teams + * @name TeamsRemoveProjectLegacy + * @summary Remove a project from a team (Legacy) + * @request DELETE:/teams/{team_id}/projects/{project_id} + * @deprecated */ - billingGetGithubActionsBillingUser: ( - { username }: BillingGetGithubActionsBillingUserParams, + teamsRemoveProjectLegacy: ( + { teamId, projectId }: TeamsRemoveProjectLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/actions\`, - method: "GET", - format: "json", + this.request< + TeamsRemoveProjectLegacyData, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, + 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 **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 billing - * @name BillingGetGithubPackagesBillingUser - * @summary Get GitHub Packages billing for a user - * @request GET:/users/{username}/settings/billing/packages + * @tags teams + * @name TeamsRemoveRepoLegacy + * @summary Remove a repository from a team (Legacy) + * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated */ - billingGetGithubPackagesBillingUser: ( - { username }: BillingGetGithubPackagesBillingUserParams, + teamsRemoveRepoLegacy: ( + { teamId, owner, repo }: TeamsRemoveRepoLegacyParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/packages\`, - method: "GET", - format: "json", + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + method: "DELETE", ...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 }: BillingGetSharedStorageBillingUserParams, + teamsUpdateDiscussionCommentLegacy: ( + { + teamId, + discussionNumber, + commentNumber, + }: TeamsUpdateDiscussionCommentLegacyParams, + data: TeamsUpdateDiscussionCommentLegacyPayload, 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 public gists 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 [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 gists - * @name GistsListForUser - * @summary List gists for a user - * @request GET:/users/{username}/gists + * @tags teams + * @name TeamsUpdateDiscussionLegacy + * @summary Update a discussion (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - gistsListForUser: ( - { username, ...query }: GistsListForUserParams, + teamsUpdateDiscussionLegacy: ( + { teamId, discussionNumber }: TeamsUpdateDiscussionLegacyParams, + data: TeamsUpdateDiscussionLegacyPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/gists\`, - method: "GET", - query: query, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + method: "PATCH", + 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 **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 orgs - * @name OrgsListForUser - * @summary List organizations for a user - * @request GET:/users/{username}/orgs + * @tags teams + * @name TeamsUpdateLegacy + * @summary Update a team (Legacy) + * @request PATCH:/teams/{team_id} + * @deprecated */ - orgsListForUser: ( - { username, ...query }: OrgsListForUserParams, + teamsUpdateLegacy: ( + { teamId }: TeamsUpdateLegacyParams, + data: TeamsUpdateLegacyPayload, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/orgs\`, - method: "GET", - query: query, + this.request({ + path: \`/teams/\${teamId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), - + }; + user = { /** * No description * - * @tags projects - * @name ProjectsListForUser - * @summary List user projects - * @request GET:/users/{username}/projects + * @tags activity + * @name ActivityCheckRepoIsStarredByAuthenticatedUser + * @summary Check if a repository is starred by the authenticated user + * @request GET:/user/starred/{owner}/{repo} */ - projectsListForUser: ( - { username, ...query }: ProjectsListForUserParams, + activityCheckRepoIsStarredByAuthenticatedUser: ( + { owner, repo }: ActivityCheckRepoIsStarredByAuthenticatedUserParams, params: RequestParams = {}, ) => this.request< - ProjectsListForUserData, - | { - documentation_url: string; - message: string; - } - | ValidationError + ActivityCheckRepoIsStarredByAuthenticatedUserData, + ActivityCheckRepoIsStarredByAuthenticatedUserError >({ - path: \`/users/\${username}/projects\`, + path: \`/user/starred/\${owner}/\${repo}\`, method: "GET", - query: query, - format: "json", ...params, }), /** - * @description Lists public repositories for the specified user. + * @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 repos - * @name ReposListForUser - * @summary List repositories for a user - * @request GET:/users/{username}/repos + * @tags activity + * @name ActivityListReposStarredByAuthenticatedUser + * @summary List repositories starred by the authenticated user + * @request GET:/user/starred */ - reposListForUser: ( - { username, ...query }: ReposListForUserParams, + activityListReposStarredByAuthenticatedUser: ( + query: ActivityListReposStarredByAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/repos\`, + this.request( + { + path: \`/user/starred\`, + method: "GET", + query: query, + 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 + */ + activityListWatchedReposForAuthenticatedUser: ( + query: ActivityListWatchedReposForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + ActivityListWatchedReposForAuthenticatedUserData, + BasicError + >({ + path: \`/user/subscriptions\`, 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)." + * + * @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, + }), + /** * No description * - * @tags users - * @name UsersCheckFollowingForUser - * @summary Check if a user follows another user - * @request GET:/users/{username}/following/{target_user} + * @tags activity + * @name ActivityUnstarRepoForAuthenticatedUser + * @summary Unstar a repository for the authenticated user + * @request DELETE:/user/starred/{owner}/{repo} */ - usersCheckFollowingForUser: ( - { username, targetUser }: UsersCheckFollowingForUserParams, + activityUnstarRepoForAuthenticatedUser: ( + { owner, repo }: ActivityUnstarRepoForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/following/\${targetUser}\`, - method: "GET", + this.request({ + path: \`/user/starred/\${owner}/\${repo}\`, + 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)". + * @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 users - * @name UsersGetByUsername - * @summary Get a user - * @request GET:/users/{username} + * @tags apps + * @name AppsAddRepoToInstallation + * @summary Add a repository to an app installation + * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} */ - usersGetByUsername: ( - { username }: UsersGetByUsernameParams, + appsAddRepoToInstallation: ( + { installationId, repositoryId }: AppsAddRepoToInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}\`, + this.request({ + path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + method: "PUT", + ...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, + ...query + }: AppsListInstallationReposForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request< + AppsListInstallationReposForAuthenticatedUserData, + BasicError + >({ + path: \`/user/installations/\${installationId}/repositories\`, method: "GET", + query: query, 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 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 users - * @name UsersGetContextForUser - * @summary Get contextual information for a user - * @request GET:/users/{username}/hovercard + * @tags apps + * @name AppsListInstallationsForAuthenticatedUser + * @summary List app installations accessible to the user access token + * @request GET:/user/installations */ - usersGetContextForUser: ( - { username, ...query }: UsersGetContextForUserParams, + appsListInstallationsForAuthenticatedUser: ( + query: AppsListInstallationsForAuthenticatedUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/hovercard\`, + this.request< + AppsListInstallationsForAuthenticatedUserData, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/user/installations\`, method: "GET", query: query, format: "json", @@ -65312,16 +65873,19 @@ export class Api< }), /** - * @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 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 users - * @name UsersList - * @summary List users - * @request GET:/users + * @tags apps + * @name AppsListSubscriptionsForAuthenticatedUser + * @summary List subscriptions for the authenticated user + * @request GET:/user/marketplace_purchases */ - usersList: (query: UsersListParams, params: RequestParams = {}) => - this.request({ - path: \`/users\`, + appsListSubscriptionsForAuthenticatedUser: ( + query: AppsListSubscriptionsForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/marketplace_purchases\`, method: "GET", query: query, format: "json", @@ -65329,19 +65893,22 @@ export class Api< }), /** - * @description Lists the people following the specified user. + * @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 users - * @name UsersListFollowersForUser - * @summary List followers of a user - * @request GET:/users/{username}/followers + * @tags apps + * @name AppsListSubscriptionsForAuthenticatedUserStubbed + * @summary List subscriptions for the authenticated user (stubbed) + * @request GET:/user/marketplace_purchases/stubbed */ - usersListFollowersForUser: ( - { username, ...query }: UsersListFollowersForUserParams, + appsListSubscriptionsForAuthenticatedUserStubbed: ( + query: AppsListSubscriptionsForAuthenticatedUserStubbedParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/followers\`, + this.request< + AppsListSubscriptionsForAuthenticatedUserStubbedData, + BasicError + >({ + path: \`/user/marketplace_purchases/stubbed\`, method: "GET", query: query, format: "json", @@ -65349,2018 +65916,1450 @@ export class Api< }), /** - * @description Lists the people who the specified user follows. + * @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 users - * @name UsersListFollowingForUser - * @summary List the people a user follows - * @request GET:/users/{username}/following + * @tags apps + * @name AppsRemoveRepoFromInstallation + * @summary Remove a repository from an app installation + * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} */ - usersListFollowingForUser: ( - { username, ...query }: UsersListFollowingForUserParams, + appsRemoveRepoFromInstallation: ( + { installationId, repositoryId }: AppsRemoveRepoFromInstallationParams, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/following\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + method: "DELETE", ...params, }), /** - * @description Lists the GPG keys for a user. This information is accessible by anyone. + * @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 users - * @name UsersListGpgKeysForUser - * @summary List GPG keys for a user - * @request GET:/users/{username}/gpg_keys + * @tags interactions + * @name InteractionsGetRestrictionsForAuthenticatedUser + * @summary Get interaction restrictions for your public repositories + * @request GET:/user/interaction-limits */ - usersListGpgKeysForUser: ( - { username, ...query }: UsersListGpgKeysForUserParams, + interactionsGetRestrictionsForAuthenticatedUser: ( params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/gpg_keys\`, + this.request({ + path: \`/user/interaction-limits\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. + * @description Removes any interaction restrictions from your public repositories. * - * @tags users - * @name UsersListPublicKeysForUser - * @summary List public keys for a user - * @request GET:/users/{username}/keys + * @tags interactions + * @name InteractionsRemoveRestrictionsForAuthenticatedUser + * @summary Remove interaction restrictions from your public repositories + * @request DELETE:/user/interaction-limits */ - usersListPublicKeysForUser: ( - { username, ...query }: UsersListPublicKeysForUserParams, + interactionsRemoveRestrictionsForAuthenticatedUser: ( params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/keys\`, - method: "GET", - query: query, + this.request( + { + path: \`/user/interaction-limits\`, + method: "DELETE", + ...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 + */ + interactionsSetRestrictionsForAuthenticatedUser: ( + data: InteractionLimit, + params: RequestParams = {}, + ) => + this.request< + InteractionsSetRestrictionsForAuthenticatedUserData, + ValidationError + >({ + path: \`/user/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), - }; - zen = { + /** - * @description Get a random sentence from the Zen of GitHub + * @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 meta - * @name MetaGetZen - * @summary Get the Zen of GitHub - * @request GET:/zen + * @tags issues + * @name IssuesListForAuthenticatedUser + * @summary List user account issues assigned to the authenticated user + * @request GET:/user/issues */ - metaGetZen: (params: RequestParams = {}) => - this.request({ - path: \`/zen\`, + issuesListForAuthenticatedUser: ( + query: IssuesListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/issues\`, method: "GET", + query: query, + 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 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 */ - 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); - } + migrationsDeleteArchiveForAuthenticatedUser: ( + { migrationId }: MigrationsDeleteArchiveForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request( + { + path: \`/user/migrations/\${migrationId}/archive\`, + method: "DELETE", + ...params, + }, + ), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @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, + }), -/** - * @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} + * @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). * - * @name StopList - * @request GET:/trip/{trip_id}/stop - * @secure + * @tags migrations + * @name MigrationsGetStatusForAuthenticatedUser + * @summary Get a user migration status + * @request GET:/user/migrations/{migration_id} */ - stopList: ({ tripId }: StopListParams, params: RequestParams = {}) => - this.request({ - path: \`/trip/\${tripId}/stop\`, + migrationsGetStatusForAuthenticatedUser: ( + { migrationId, ...query }: MigrationsGetStatusForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations/\${migrationId}\`, method: "GET", - secure: true, + query: query, format: "json", ...params, }), /** - * @description list user's trips + * @description Lists all migrations a user has started. * - * @name TripList - * @request GET:/trip - * @secure + * @tags migrations + * @name MigrationsListForAuthenticatedUser + * @summary List user migrations + * @request GET:/user/migrations */ - tripList: (params: RequestParams = {}) => - this.request({ - path: \`/trip\`, + migrationsListForAuthenticatedUser: ( + query: MigrationsListForAuthenticatedUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/migrations\`, method: "GET", - secure: true, + query: query, 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; -} - -/** 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 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 interface TranslateGifParams { - /** Search term. */ - s: string; -} - -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 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 interface TranslateStickerParams { - /** Search term. */ - s: string; -} + /** + * @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 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 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 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; -} + /** + * 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 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 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 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; -} + /** + * 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, + }), -/** 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; -} + /** + * 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 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; - } + /** + * 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, + }), - /** - * @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; - } + /** + * 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, + }), - /** - * @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 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, + }), - /** - * @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; - } + /** + * 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, + }), - /** - * @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 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, + }), - /** - * @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 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 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 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, + }), + + /** + * @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, + }), - /** - * @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 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, + }), - /** - * @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 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, + }), - /** - * @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; - } -} + /** + * 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, + }), -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; + /** + * @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, + }), -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 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, + }), -export type RequestParams = Omit< - FullRequestParams, - "body" | "method" | "query" | "path" ->; + /** + * @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, + }), -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: ( - securityData: SecurityDataType | null, - ) => Promise | RequestParams | void; - customFetch?: typeof fetch; -} + /** + * @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 interface HttpResponse - extends Response { - data: D; - error: E; -} + /** + * @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, + }), -type CancelToken = Symbol | string | 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)." 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 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 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 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 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, + }), - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; + /** + * @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, + }), - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } + /** + * @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, + }), - public setSecurityData = (data: SecurityDataType | null) => { - this.securityData = data; - }; + /** + * @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, + }), - protected encodeQueryParam(key: string, value: any) { - const encodedKey = encodeURIComponent(key); - return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; - } + /** + * @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, + }), - protected addQueryParam(query: QueryParamsType, key: string) { - return this.encodeQueryParam(key, query[key]); - } + /** + * @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, + }), - protected addArrayQueryParam(query: QueryParamsType, key: string) { - const value = query[key]; - return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); - } + /** + * @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, + }), + + /** + * @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, + }), + + /** + * @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 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 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 addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? \`?\${queryString}\` : ""; - } + /** + * 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, + }), - 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 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, + }), - 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:** 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, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), - }, - }; - } + /** + * @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, + }), - 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 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, + }), - 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, ...query }: ActivityListReceivedEventsForUserParams, + 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, ...query }: ActivityListReceivedPublicEventsForUserParams, + 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 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 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 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, + }), - 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 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, + }), - 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 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, + }), - if (cancelToken) { - this.abortControllers.delete(cancelToken); - } + /** + * @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, + }), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @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, + }), -/** - * @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 Lists public gists for the specified user: * - * @tags gifs - * @name GetGifById - * @summary Get GIF by Id - * @request GET:/gifs/{gifId} - * @secure + * @tags gists + * @name GistsListForUser + * @summary List gists for a user + * @request GET:/users/{username}/gists */ - getGifById: ({ gifId }: GetGifByIdParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/\${gifId}\`, + gistsListForUser: ( + { username, ...query }: GistsListForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/gists\`, + method: "GET", + query: query, + 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. + * + * @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, + }), + + /** + * No description + * + * @tags projects + * @name ProjectsListForUser + * @summary List user projects + * @request GET:/users/{username}/projects + */ + projectsListForUser: ( + { username, ...query }: ProjectsListForUserParams, + params: RequestParams = {}, + ) => + this.request< + ProjectsListForUserData, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/users/\${username}/projects\`, method: "GET", - secure: true, + query: query, format: "json", ...params, }), /** - * @description A multiget version of the get GIF by ID endpoint. + * @description Lists public repositories for the specified user. * - * @tags gifs - * @name GetGifsById - * @summary Get GIFs by ID - * @request GET:/gifs - * @secure + * @tags repos + * @name ReposListForUser + * @summary List repositories for a user + * @request GET:/users/{username}/repos */ - getGifsById: (query: GetGifsByIdParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs\`, + reposListForUser: ( + { username, ...query }: ReposListForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/repos\`, 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. + * No description * - * @tags gifs - * @name RandomGif - * @summary Random GIF - * @request GET:/gifs/random - * @secure + * @tags users + * @name UsersCheckFollowingForUser + * @summary Check if a user follows another user + * @request GET:/users/{username}/following/{target_user} */ - randomGif: (query: RandomGifParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/random\`, + usersCheckFollowingForUser: ( + { username, targetUser }: UsersCheckFollowingForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/following/\${targetUser}\`, 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 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 gifs - * @name SearchGifs - * @summary Search GIFs - * @request GET:/gifs/search - * @secure + * @tags users + * @name UsersGetByUsername + * @summary Get a user + * @request GET:/users/{username} */ - searchGifs: (query: SearchGifsParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/search\`, + usersGetByUsername: ( + { username }: UsersGetByUsernameParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}\`, 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 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 gifs - * @name TranslateGif - * @summary Translate phrase to GIF - * @request GET:/gifs/translate - * @secure + * @tags users + * @name UsersGetContextForUser + * @summary Get contextual information for a user + * @request GET:/users/{username}/hovercard */ - translateGif: (query: TranslateGifParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/translate\`, + usersGetContextForUser: ( + { username, ...query }: UsersGetContextForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/hovercard\`, 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 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 gifs - * @name TrendingGifs - * @summary Trending GIFs - * @request GET:/gifs/trending - * @secure + * @tags users + * @name UsersList + * @summary List users + * @request GET:/users */ - trendingGifs: (query: TrendingGifsParams, params: RequestParams = {}) => - this.request({ - path: \`/gifs/trending\`, + usersList: (query: UsersListParams, params: RequestParams = {}) => + this.request({ + path: \`/users\`, 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 Lists the people following the specified user. * - * @tags stickers - * @name RandomSticker - * @summary Random Sticker - * @request GET:/stickers/random - * @secure + * @tags users + * @name UsersListFollowersForUser + * @summary List followers of a user + * @request GET:/users/{username}/followers */ - randomSticker: (query: RandomStickerParams, params: RequestParams = {}) => - this.request({ - path: \`/stickers/random\`, + usersListFollowersForUser: ( + { username, ...query }: UsersListFollowersForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/followers\`, 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. + * @description Lists the people who the specified user follows. * - * @tags stickers - * @name SearchStickers - * @summary Search Stickers - * @request GET:/stickers/search - * @secure + * @tags users + * @name UsersListFollowingForUser + * @summary List the people a user follows + * @request GET:/users/{username}/following */ - searchStickers: (query: SearchStickersParams, params: RequestParams = {}) => - this.request({ - path: \`/stickers/search\`, + usersListFollowingForUser: ( + { username, ...query }: UsersListFollowingForUserParams, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/following\`, 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 the GPG keys for a user. This information is accessible by anyone. * - * @tags stickers - * @name TranslateSticker - * @summary Translate phrase to Sticker - * @request GET:/stickers/translate - * @secure + * @tags users + * @name UsersListGpgKeysForUser + * @summary List GPG keys for a user + * @request GET:/users/{username}/gpg_keys */ - translateSticker: ( - query: TranslateStickerParams, + usersListGpgKeysForUser: ( + { username, ...query }: UsersListGpgKeysForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/stickers/translate\`, + this.request({ + path: \`/users/\${username}/gpg_keys\`, 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. + * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. * - * @tags stickers - * @name TrendingStickers - * @summary Trending Stickers - * @request GET:/stickers/trending - * @secure + * @tags users + * @name UsersListPublicKeysForUser + * @summary List public keys for a user + * @request GET:/users/{username}/keys */ - trendingStickers: ( - query: TrendingStickersParams, + usersListPublicKeysForUser: ( + { username, ...query }: UsersListPublicKeysForUserParams, params: RequestParams = {}, ) => - this.request({ - path: \`/stickers/trending\`, + this.request({ + path: \`/users/\${username}/keys\`, 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; - }); + 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[`extended > 'link-example' 1`] = ` +exports[`extended > 'link-example' 2`] = ` "/* eslint-disable */ /* tslint:disable */ // @ts-nocheck diff --git a/tests/__snapshots__/simple.test.ts.snap b/tests/__snapshots__/simple.test.ts.snap index 587ba27e0..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,6928 +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, - }), + 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; +} + +/** + * 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; +} + +/** + * 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. + */ +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; +} + +/** + * 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; +} + +/** + * 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; +} + +/** + * 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; +} + +/** + * Runner Application + * Runner Application + */ +export interface RunnerApplication { + architecture: string; + download_url: string; + filename: string; + os: string; +} + +export interface RunnerGroupsEnterprise { + allows_public_repositories: boolean; + default: boolean; + id: number; + 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\` */ + 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; +} + +/** + * 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: "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; +} + +/** 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 + */ +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; + +/** + * 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; +} + +/** + * 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 **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, - }), +/** + * 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; +} - /** - * @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, - }), +/** + * 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 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, - }), +/** + * 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; +} - /** - * @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, - }), +/** + * 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; +} - /** - * @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, - }), +/** + * 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 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, - }), +/** + * 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 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, - }), +/** + * 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; +} - /** - * @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, - }), +/** + * 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; +} - /** - * @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, - }), +/** + * 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; +} - /** - * @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, - }), +/** + * 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; - /** - * @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, - }), - }; - 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, - }), +/** + * 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; }; - 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, - }), + /** @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[]; +} - /** - * @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, - }), +/** + * 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; +} - /** - * @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, - }), +/** Traffic */ +export interface Traffic { + count: number; + /** @format date-time */ + timestamp: string; + uniques: 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/). **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, - }), +/** + * 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; +} - /** - * @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, - }), +/** + * 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 **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, - }), +/** + * Validation Error Simple + * Validation Error Simple + */ +export interface ValidationErrorSimple { + documentation_url: string; + errors?: string[]; + message: 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 - */ - 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, - }), +/** Verification */ +export interface Verification { + payload: string | null; + reason: string; + signature: string | null; + verified: boolean; +} - /** - * 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, - }), +/** + * View Traffic + * View Traffic + */ +export interface ViewTraffic { + /** @example 14850 */ + count: number; + /** @example 3782 */ + uniques: number; + views: Traffic[]; +} - /** - * @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, - }), +/** + * 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 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, - }), +/** + * 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; +} + +/** + * 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 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, - }), +/** + * Workflow Usage + * Workflow Usage + */ +export interface WorkflowUsage { + billable: { + MACOS?: { + total_ms?: number; + }; + UBUNTU?: { + total_ms?: number; + }; + WINDOWS?: { + total_ms?: number; + }; + }; +} - /** - * @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, - }), +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; - /** - * @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, - }), +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 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, - }), +export type RequestParams = Omit< + FullRequestParams, + "body" | "method" | "query" | "path" +>; - /** - * @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, - }), +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: ( + securityData: SecurityDataType | null, + ) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} - /** - * @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, - }), +export interface HttpResponse + extends Response { + data: D; + error: E; +} - /** - * @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, - }), +type CancelToken = Symbol | string | number; - /** - * @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, - }), +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); - /** - * @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, - }), + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; - /** - * @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, - }), + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } - /** - * @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, - }), + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; - /** - * @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, - }), + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return \`\${encodedKey}=\${encodeURIComponent(typeof value === "number" ? value : \`\${value}\`)}\`; + } - /** - * @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, - }), + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } - /** - * @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, - }), + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } - /** - * @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, - }), + 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), + }; - /** - * @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[]; + 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: \`/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, - }), + 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 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, - }), + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; - /** - * @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, - }), + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); - /** - * @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, - }), + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; - /** - * @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, - }), + 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 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, - }), + 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 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, - }), + 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 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, - }), + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } - /** - * @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; + 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; }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/audit-log\`, - method: "GET", - query: query, - format: "json", - ...params, - }), + any + >({ + path: \`/\`, + method: "GET", + format: "json", + ...params, + }); + app = { /** - * @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. + * @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 billing - * @name BillingGetGithubActionsBillingGhe - * @summary Get GitHub Actions billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/actions + * @tags apps + * @name AppsGetAuthenticated + * @summary Get the authenticated app + * @request GET:/app */ - billingGetGithubActionsBillingGhe: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/settings/billing/actions\`, + appsGetAuthenticated: (params: RequestParams = {}) => + this.request({ + path: \`/app\`, method: "GET", 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)." The authenticated user must be an enterprise admin. + * @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 billing - * @name BillingGetGithubPackagesBillingGhe - * @summary Get GitHub Packages billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/packages + * @tags apps + * @name AppsGetWebhookConfigForApp + * @summary Get a webhook configuration for an app + * @request GET:/app/hook/config */ - billingGetGithubPackagesBillingGhe: ( - enterprise: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/enterprises/\${enterprise}/settings/billing/packages\`, + appsGetWebhookConfigForApp: (params: RequestParams = {}) => + this.request({ + path: \`/app/hook/config\`, 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)." The authenticated user must be an enterprise admin. + * @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 billing - * @name BillingGetSharedStorageBillingGhe - * @summary Get shared storage billing for an enterprise - * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage + * @tags apps + * @name AppsUpdateWebhookConfigForApp + * @summary Update a webhook configuration for an app + * @request PATCH:/app/hook/config */ - billingGetSharedStorageBillingGhe: ( - enterprise: string, + 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: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, - method: "GET", + this.request({ + path: \`/app/hook/config\`, + 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. + * @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 activity - * @name ActivityListPublicEvents - * @summary List public events - * @request GET:/events + * @tags apps + * @name AppsListInstallations + * @summary List installations for the authenticated app + * @request GET:/app/installations */ - activityListPublicEvents: ( + appsListInstallations: ( query?: { + outdated?: string; /** * Page number of the results to fetch. * @default 1 @@ -19267,109 +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< - Event[], - | BasicError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/events\`, + this.request({ + path: \`/app/installations\`, 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. + * @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 activity - * @name ActivityGetFeeds - * @summary Get feeds - * @request GET:/feeds + * @tags apps + * @name AppsGetInstallation + * @summary Get an installation for the authenticated app + * @request GET:/app/installations/{installation_id} */ - activityGetFeeds: (params: RequestParams = {}) => - this.request({ - path: \`/feeds\`, + appsGetInstallation: (installationId: number, params: RequestParams = {}) => + this.request< + Installation, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/app/installations/\${installationId}\`, method: "GET", format: "json", ...params, }), - }; - gists = { + /** - * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: + * @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 gists - * @name GistsList - * @summary List gists for the authenticated user - * @request GET:/gists + * @tags apps + * @name AppsDeleteInstallation + * @summary Delete an installation for the authenticated app + * @request DELETE:/app/installations/{installation_id} */ - 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; - }, + appsDeleteInstallation: ( + installationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/gists\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/app/installations/\${installationId}\`, + method: "DELETE", ...params, }), /** - * @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. + * @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 gists - * @name GistsCreate - * @summary Create a gist - * @request POST:/gists + * @tags apps + * @name AppsCreateInstallationAccessToken + * @summary Create an installation access token for an app + * @request POST:/app/installations/{installation_id}/access_tokens */ - gistsCreate: ( + 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[]; /** - * 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!\\""}} + * List of repository IDs that the token should have access to + * @example [1] */ - files: Record< - string, - { - /** Content of the file */ - content: string; - } - >; - /** Flag indicating whether the gist is public */ - public?: boolean | "true" | "false"; + repository_ids?: number[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/gists\`, + this.request< + InstallationToken, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/app/installations/\${installationId}/access_tokens\`, method: "POST", body: data, type: ContentType.Json, @@ -19378,14 +19055,78 @@ export class Api< }), /** - * @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. + * @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 gists - * @name GistsListPublic - * @summary List public gists - * @request GET:/gists/public + * @tags apps + * @name AppsSuspendInstallation + * @summary Suspend an app installation + * @request PUT:/app/installations/{installation_id}/suspended */ - gistsListPublic: ( + appsSuspendInstallation: ( + installationId: number, + params: RequestParams = {}, + ) => + 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 **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. @@ -19397,13 +19138,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; }, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/public\`, + this.request({ + path: \`/applications/grants\`, method: "GET", query: query, format: "json", @@ -19411,179 +19150,132 @@ export class Api< }), /** - * @description List the authenticated user's starred gists: + * @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 gists - * @name GistsListStarred - * @summary List starred gists - * @request GET:/gists/starred + * @tags oauth-authorizations + * @name OauthAuthorizationsGetGrant + * @summary Get a single grant + * @request GET:/applications/grants/{grant_id} + * @deprecated */ - 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; - }, + oauthAuthorizationsGetGrant: ( + grantId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/starred\`, + this.request({ + path: \`/applications/grants/\${grantId}\`, method: "GET", - query: query, 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/). 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 gists - * @name GistsGet - * @summary Get a gist - * @request GET:/gists/{gist_id} + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteGrant + * @summary Delete a grant + * @request DELETE:/applications/grants/{grant_id} + * @deprecated */ - 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", + oauthAuthorizationsDeleteGrant: ( + grantId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/applications/grants/\${grantId}\`, + method: "DELETE", ...params, }), /** - * @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. + * @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 gists - * @name GistsUpdate - * @summary Update a gist - * @request PATCH:/gists/{gist_id} + * @tags apps + * @name AppsDeleteAuthorization + * @summary Delete an app authorization + * @request DELETE:/applications/{client_id}/grant */ - 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), + appsDeleteAuthorization: ( + clientId: string, + data: { + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}\`, - method: "PATCH", + this.request({ + path: \`/applications/\${clientId}/grant\`, + method: "DELETE", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * 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 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 gists - * @name GistsDelete - * @summary Delete a gist - * @request DELETE:/gists/{gist_id} + * @tags apps + * @name AppsRevokeGrantForApplication + * @summary Revoke a grant for an application + * @request DELETE:/applications/{client_id}/grants/{access_token} + * @deprecated */ - gistsDelete: (gistId: string, params: RequestParams = {}) => - this.request({ - path: \`/gists/\${gistId}\`, + appsRevokeGrantForApplication: ( + clientId: string, + accessToken: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/applications/\${clientId}/grants/\${accessToken}\`, method: "DELETE", ...params, }), /** - * No description + * @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 gists - * @name GistsListComments - * @summary List gist comments - * @request GET:/gists/{gist_id}/comments + * @tags apps + * @name AppsCheckToken + * @summary Check a token + * @request POST:/applications/{client_id}/token */ - 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; + appsCheckToken: ( + clientId: string, + data: { + /** The access_token of the OAuth application. */ + access_token: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/comments\`, - method: "GET", - query: query, + this.request({ + path: \`/applications/\${clientId}/token\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @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 gists - * @name GistsCreateComment - * @summary Create a gist comment - * @request POST:/gists/{gist_id}/comments + * @tags apps + * @name AppsResetToken + * @summary Reset a token + * @request PATCH:/applications/{client_id}/token */ - gistsCreateComment: ( - gistId: string, + appsResetToken: ( + clientId: string, data: { - /** - * The comment text. - * @maxLength 65535 - * @example "Body of the attachment" - */ - body: string; + /** The access_token of the OAuth application. */ + access_token: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/comments\`, - method: "POST", + this.request({ + path: \`/applications/\${clientId}/token\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -19591,128 +19283,173 @@ export class Api< }), /** - * 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 gists - * @name GistsGetComment - * @summary Get a gist comment - * @request GET:/gists/{gist_id}/comments/{comment_id} + * @tags apps + * @name AppsDeleteToken + * @summary Delete an app token + * @request DELETE:/applications/{client_id}/token */ - gistsGetComment: ( - gistId: string, - commentId: number, + appsDeleteToken: ( + clientId: string, + data: { + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token?: string; + }, 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", + this.request({ + path: \`/applications/\${clientId}/token\`, + method: "DELETE", + body: data, + type: ContentType.Json, ...params, }), /** - * No description + * @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 gists - * @name GistsUpdateComment - * @summary Update a gist comment - * @request PATCH:/gists/{gist_id}/comments/{comment_id} + * @tags apps + * @name AppsScopeToken + * @summary Create a scoped access token + * @request POST:/applications/{client_id}/token/scoped */ - gistsUpdateComment: ( - gistId: string, - commentId: number, + appsScopeToken: ( + clientId: string, data: { /** - * The comment text. - * @maxLength 65535 - * @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 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: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/applications/\${clientId}/token/scoped\`, + method: "POST", + body: data, + type: ContentType.Json, + 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 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, }), /** - * 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 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 gists - * @name GistsDeleteComment - * @summary Delete a gist comment - * @request DELETE:/gists/{gist_id}/comments/{comment_id} + * @tags apps + * @name AppsResetAuthorization + * @summary Reset an authorization + * @request POST:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - gistsDeleteComment: ( - gistId: string, - commentId: number, + appsResetAuthorization: ( + clientId: string, + accessToken: string, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/applications/\${clientId}/tokens/\${accessToken}\`, + method: "POST", + format: "json", ...params, }), /** - * 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 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 gists - * @name GistsListCommits - * @summary List gist commits - * @request GET:/gists/{gist_id}/commits + * @tags apps + * @name AppsRevokeAuthorizationForApplication + * @summary Revoke an authorization for an application + * @request DELETE:/applications/{client_id}/tokens/{access_token} + * @deprecated */ - 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; - }, + appsRevokeAuthorizationForApplication: ( + clientId: string, + accessToken: string, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/commits\`, + 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", - query: query, format: "json", ...params, }), - + }; + authorizations = { /** - * 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/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 gists - * @name GistsListForks - * @summary List gist forks - * @request GET:/gists/{gist_id}/forks + * @tags oauth-authorizations + * @name OauthAuthorizationsListAuthorizations + * @summary List your authorizations + * @request GET:/authorizations + * @deprecated */ - gistsListForks: ( - gistId: string, + oauthAuthorizationsListAuthorizations: ( query?: { /** * Page number of the results to fetch. @@ -19727,8 +19464,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/gists/\${gistId}/forks\`, + this.request({ + path: \`/authorizations\`, method: "GET", query: query, format: "json", @@ -19736,263 +19473,237 @@ export class Api< }), /** - * @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, - }), - - /** - * 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, - }), - - /** - * @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, - }), - - /** - * 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, - }), - - /** - * 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). 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 gists - * @name GistsGetRevision - * @summary Get a gist revision - * @request GET:/gists/{gist_id}/{sha} + * @tags oauth-authorizations + * @name OauthAuthorizationsCreateAuthorization + * @summary Create a new authorization + * @request POST:/authorizations + * @deprecated */ - gistsGetRevision: ( - gistId: string, - sha: string, + 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: \`/gists/\${gistId}/\${sha}\`, - method: "GET", + this.request({ + path: \`/authorizations\`, + method: "POST", + 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). + * @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 gitignore - * @name GitignoreGetAllTemplates - * @summary Get all gitignore templates - * @request GET:/gitignore/templates + * @tags oauth-authorizations + * @name OauthAuthorizationsGetOrCreateAuthorizationForApp + * @summary Get-or-create an authorization for a specific app + * @request PUT:/authorizations/clients/{client_id} + * @deprecated */ - gitignoreGetAllTemplates: (params: RequestParams = {}) => - this.request({ - path: \`/gitignore/templates\`, - method: "GET", + 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 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. + * @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 apps - * @name AppsListReposAccessibleToInstallation - * @summary List repositories accessible to the app installation - * @request GET:/installation/repositories + * @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 */ - appsListReposAccessibleToInstallation: ( - query?: { + oauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint: ( + clientId: string, + fingerprint: 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; /** - * 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< - { - repositories: Repository[]; - /** @example "selected" */ - repository_selection?: string; - total_count: number; - }, - BasicError - >({ - path: \`/installation/repositories\`, - method: "GET", - query: query, + this.request({ + path: \`/authorizations/clients/\${clientId}/\${fingerprint}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @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. + * @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 apps - * @name AppsRevokeInstallationAccessToken - * @summary Revoke an installation access token - * @request DELETE:/installation/token + * @tags oauth-authorizations + * @name OauthAuthorizationsGetAuthorization + * @summary Get a single authorization + * @request GET:/authorizations/{authorization_id} + * @deprecated */ - appsRevokeInstallationAccessToken: (params: RequestParams = {}) => - this.request({ - path: \`/installation/token\`, - method: "DELETE", + oauthAuthorizationsGetAuthorization: ( + authorizationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/authorizations/\${authorizationId}\`, + method: "GET", + format: "json", ...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. + * @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 issues - * @name IssuesList - * @summary List issues assigned to the authenticated user - * @request GET:/issues + * @tags oauth-authorizations + * @name OauthAuthorizationsUpdateAuthorization + * @summary Update an existing authorization + * @request PATCH:/authorizations/{authorization_id} + * @deprecated */ - 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; + 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; /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" + * A note to remind you what the OAuth token is for. + * @example "Update all gems" */ - sort?: "created" | "updated" | "comments"; + 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[]; /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * A list of scopes that this authorization is in. + * @example ["public_repo","user"] */ - state?: "open" | "closed" | "all"; + scopes?: string[] | null; }, params: RequestParams = {}, ) => - this.request({ - path: \`/issues\`, - method: "GET", - query: query, + this.request({ + path: \`/authorizations/\${authorizationId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), - }; - licenses = { + /** - * 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/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 licenses - * @name LicensesGetAllCommonlyUsed - * @summary Get all commonly used licenses - * @request GET:/licenses + * @tags oauth-authorizations + * @name OauthAuthorizationsDeleteAuthorization + * @summary Delete an authorization + * @request DELETE:/authorizations/{authorization_id} + * @deprecated */ - licensesGetAllCommonlyUsed: ( - query?: { - featured?: boolean; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + oauthAuthorizationsDeleteAuthorization: ( + authorizationId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/licenses\`, + 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", - query: query, format: "json", ...params, }), @@ -20000,132 +19711,144 @@ export class Api< /** * No description * - * @tags licenses - * @name LicensesGet - * @summary Get a license - * @request GET:/licenses/{license} + * @tags codes-of-conduct + * @name CodesOfConductGetConductCode + * @summary Get a code of conduct + * @request GET:/codes_of_conduct/{key} */ - licensesGet: (license: string, params: RequestParams = {}) => - this.request({ - path: \`/licenses/\${license}\`, + codesOfConductGetConductCode: (key: string, params: RequestParams = {}) => + this.request< + CodeOfConduct, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/codes_of_conduct/\${key}\`, method: "GET", format: "json", ...params, }), }; - markdown = { + 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 markdown - * @name MarkdownRender - * @summary Render a Markdown document - * @request POST:/markdown + * @tags apps + * @name AppsCreateContentAttachment + * @summary Create a content attachment + * @request POST:/content_references/{content_reference_id}/attachments */ - markdownRender: ( + appsCreateContentAttachment: ( + contentReferenceId: number, data: { - /** The repository context to use when creating references in \`gfm\` mode. */ - context?: string; /** - * The rendering mode. - * @default "markdown" - * @example "markdown" + * The body of the attachment + * @maxLength 262144 + * @example "Body of the attachment" */ - mode?: "markdown" | "gfm"; - /** The Markdown text to render in HTML. */ - text: string; + body: string; + /** + * The title of the attachment + * @maxLength 1024 + * @example "Title of the attachment" + */ + title: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/markdown\`, + 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 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. + * @description Lists all the emojis available to use on GitHub. * - * @tags markdown - * @name MarkdownRenderRaw - * @summary Render a Markdown document in raw mode - * @request POST:/markdown/raw + * @tags emojis + * @name EmojisGet + * @summary Get emojis + * @request GET:/emojis */ - markdownRenderRaw: (data: WebhookConfigUrl, params: RequestParams = {}) => - this.request({ - path: \`/markdown/raw\`, - method: "POST", - body: data, - type: ContentType.Text, + emojisGet: (params: RequestParams = {}) => + this.request, any>({ + path: \`/emojis\`, + method: "GET", + format: "json", ...params, }), }; - marketplaceListing = { + enterprises = { /** - * @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. + * @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 apps - * @name AppsGetSubscriptionPlanForAccount - * @summary Get a subscription plan for an account - * @request GET:/marketplace_listing/accounts/{account_id} + * @tags enterprise-admin + * @name EnterpriseAdminGetGithubActionsPermissionsEnterprise + * @summary Get GitHub Actions permissions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions */ - appsGetSubscriptionPlanForAccount: ( - accountId: number, + enterpriseAdminGetGithubActionsPermissionsEnterprise: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/marketplace_listing/accounts/\${accountId}\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions\`, method: "GET", format: "json", ...params, }), /** - * @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. + * @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 apps - * @name AppsListPlans - * @summary List plans - * @request GET:/marketplace_listing/plans + * @tags enterprise-admin + * @name EnterpriseAdminSetGithubActionsPermissionsEnterprise + * @summary Set GitHub Actions permissions for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions */ - appsListPlans: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: 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: \`/marketplace_listing/plans\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @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. + * @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 apps - * @name AppsListAccountsForPlan - * @summary List accounts for a plan - * @request GET:/marketplace_listing/plans/{plan_id}/accounts + * @tags enterprise-admin + * @name EnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary List selected organizations enabled for GitHub Actions in an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/organizations */ - appsListAccountsForPlan: ( - planId: number, + enterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterprise: ( + enterprise: string, 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 @@ -20136,16 +19859,17 @@ export class Api< * @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\`, + this.request< + { + organizations: OrganizationSimple[]; + total_count: number; + }, + any + >({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, method: "GET", query: query, format: "json", @@ -20153,185 +19877,139 @@ export class Api< }), /** - * @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. + * @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 apps - * @name AppsGetSubscriptionPlanForAccountStubbed - * @summary Get a subscription plan for an account (stubbed) - * @request GET:/marketplace_listing/stubbed/accounts/{account_id} + * @tags enterprise-admin + * @name EnterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise + * @summary Set selected organizations enabled for GitHub Actions in an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/organizations */ - appsGetSubscriptionPlanForAccountStubbed: ( - accountId: number, + enterpriseAdminSetSelectedOrganizationsEnabledGithubActionsEnterprise: ( + enterprise: string, + data: { + /** List of organization IDs to enable for GitHub Actions. */ + selected_organization_ids: number[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @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. + * @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 apps - * @name AppsListPlansStubbed - * @summary List plans (stubbed) - * @request GET:/marketplace_listing/stubbed/plans + * @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} */ - appsListPlansStubbed: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + enterpriseAdminEnableSelectedOrganizationGithubActionsEnterprise: ( + enterprise: string, + orgId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/marketplace_listing/stubbed/plans\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, + method: "PUT", ...params, }), /** - * @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. + * @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 apps - * @name AppsListAccountsForPlanStubbed - * @summary List accounts for a plan (stubbed) - * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts + * @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} */ - 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"; - }, + enterpriseAdminDisableSelectedOrganizationGithubActionsEnterprise: ( + enterprise: string, + orgId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/marketplace_listing/stubbed/plans/\${planId}/accounts\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/organizations/\${orgId}\`, + method: "DELETE", ...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. + * @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 meta - * @name MetaGet - * @summary Get GitHub meta information - * @request GET:/meta + * @tags enterprise-admin + * @name EnterpriseAdminGetAllowedActionsEnterprise + * @summary Get allowed actions for an enterprise + * @request GET:/enterprises/{enterprise}/actions/permissions/selected-actions */ - metaGet: (params: RequestParams = {}) => - this.request({ - path: \`/meta\`, + enterpriseAdminGetAllowedActionsEnterprise: ( + enterprise: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, method: "GET", format: "json", ...params, }), - }; - networks = { + /** - * No description + * @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 activity - * @name ActivityListPublicEventsForRepoNetwork - * @summary List public events for a network of repositories - * @request GET:/networks/{owner}/{repo}/events + * @tags enterprise-admin + * @name EnterpriseAdminSetAllowedActionsEnterprise + * @summary Set allowed actions for an enterprise + * @request PUT:/enterprises/{enterprise}/actions/permissions/selected-actions */ - 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; - }, + enterpriseAdminSetAllowedActionsEnterprise: ( + enterprise: string, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/networks/\${owner}/\${repo}/events\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/permissions/selected-actions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), - }; - notifications = { + /** - * @description List all notifications for the current user, sorted by most recently updated. + * @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 activity - * @name ActivityListNotificationsForAuthenticatedUser - * @summary List notifications for the authenticated user - * @request GET:/notifications + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnerGroupsForEnterprise + * @summary List self-hosted runner groups for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runner-groups */ - activityListNotificationsForAuthenticatedUser: ( + enterpriseAdminListSelfHostedRunnerGroupsForEnterprise: ( + enterprise: 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: \`/notifications\`, + this.request< + { + runner_groups: RunnerGroupsEnterprise[]; + total_count: number; + }, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups\`, method: "GET", query: query, format: "json", @@ -20339,33 +20017,30 @@ export class Api< }), /** - * @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\`. + * @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 activity - * @name ActivityMarkNotificationsAsRead - * @summary Mark notifications as read - * @request PUT:/notifications + * @tags enterprise-admin + * @name EnterpriseAdminCreateSelfHostedRunnerGroupForEnterprise + * @summary Create a self-hosted runner group for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runner-groups */ - activityMarkNotificationsAsRead: ( + enterpriseAdminCreateSelfHostedRunnerGroupForEnterprise: ( + enterprise: string, data: { - /** - * Describes the last point that notifications were checked. - * @format date-time - */ - last_read_at?: string; - /** Whether the notification has been read. */ - read?: boolean; + /** 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< - { - message?: string; - }, - BasicError - >({ - path: \`/notifications\`, - method: "PUT", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -20373,77 +20048,50 @@ export class Api< }), /** - * 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, - }), - - /** - * 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. + * @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 activity - * @name ActivityGetThreadSubscriptionForAuthenticatedUser - * @summary Get a thread subscription for the authenticated user - * @request GET:/notifications/threads/{thread_id}/subscription + * @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} */ - activityGetThreadSubscriptionForAuthenticatedUser: ( - threadId: number, + enterpriseAdminGetSelfHostedRunnerGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", format: "json", ...params, }), /** - * @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. + * @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 activity - * @name ActivitySetThreadSubscription - * @summary Set a thread subscription - * @request PUT:/notifications/threads/{thread_id}/subscription + * @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} */ - activitySetThreadSubscription: ( - threadId: number, + enterpriseAdminUpdateSelfHostedRunnerGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, data: { + /** Name of the runner group. */ + name?: string; /** - * Whether to block all notifications from a thread. - * @default false + * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: \`all\` or \`selected\` + * @default "all" */ - ignored?: boolean; + visibility?: "selected" | "all"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/notifications/threads/\${threadId}/subscription\`, - method: "PUT", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -20451,266 +20099,139 @@ export class Api< }), /** - * @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, - }), - }; - octocat = { - /** - * @description Get the octocat as ASCII art - * - * @tags meta - * @name MetaGetOctocat - * @summary Get Octocat - * @request GET:/octocat + * @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} */ - metaGetOctocat: ( - query?: { - /** The words to show in Octocat's speech bubble */ - s?: string; - }, + enterpriseAdminDeleteSelfHostedRunnerGroupFromEnterprise: ( + enterprise: string, + runnerGroupId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/octocat\`, - method: "GET", - query: query, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}\`, + method: "DELETE", ...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. + * @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 OrgsList - * @summary List organizations - * @request GET:/organizations + * @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 */ - orgsList: ( + 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; - /** An organization ID. Only return organizations with an ID greater than this ID. */ - since?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/organizations\`, + this.request< + { + organizations: OrganizationSimple[]; + total_count: number; + }, + any + >({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, method: "GET", query: query, format: "json", ...params, }), - }; - 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. + * @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 OrgsUpdate - * @summary Update an organization - * @request PATCH:/orgs/{org} + * @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 */ - orgsUpdate: ( - org: string, + enterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + enterprise: string, + runnerGroupId: number, 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; + /** List of organization IDs that can access the runner group. */ + selected_organization_ids: number[]; }, params: RequestParams = {}, ) => - this.request< - OrganizationFull, - | BasicError - | { - documentation_url: string; - message: string; - } - | (ValidationError | ValidationErrorSimple) - >({ - path: \`/orgs/\${org}\`, - method: "PATCH", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations\`, + method: "PUT", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * @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. + * @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 actions - * @name ActionsGetGithubActionsPermissionsOrganization - * @summary Get GitHub Actions permissions for an organization - * @request GET:/orgs/{org}/actions/permissions + * @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} */ - actionsGetGithubActionsPermissionsOrganization: ( - org: string, + enterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + enterprise: string, + runnerGroupId: number, + orgId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions\`, - method: "GET", - format: "json", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, + method: "PUT", ...params, }), /** - * @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. + * @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 actions - * @name ActionsSetGithubActionsPermissionsOrganization - * @summary Set GitHub Actions permissions for an organization - * @request PUT:/orgs/{org}/actions/permissions + * @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} */ - 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; - }, + enterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterprise: ( + enterprise: string, + runnerGroupId: number, + orgId: number, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/actions/permissions\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/organizations/\${orgId}\`, + method: "DELETE", ...params, }), /** - * @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. + * @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 actions - * @name ActionsListSelectedRepositoriesEnabledGithubActionsOrganization - * @summary List selected repositories enabled for GitHub Actions in an organization - * @request GET:/orgs/{org}/actions/permissions/repositories + * @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 */ - actionsListSelectedRepositoriesEnabledGithubActionsOrganization: ( - org: string, + enterpriseAdminListSelfHostedRunnersInGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, query?: { /** * Page number of the results to fetch. @@ -20727,12 +20248,12 @@ export class Api< ) => this.request< { - repositories: Repository[]; + runners: Runner[]; total_count: number; }, any >({ - path: \`/orgs/\${org}/actions/permissions/repositories\`, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, method: "GET", query: query, format: "json", @@ -20740,23 +20261,24 @@ export class Api< }), /** - * @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. + * @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 actions - * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization - * @summary Set selected repositories enabled for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories + * @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 */ - actionsSetSelectedRepositoriesEnabledGithubActionsOrganization: ( - org: string, + enterpriseAdminSetSelfHostedRunnersInGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, data: { - /** List of repository IDs to enable for GitHub Actions. */ - selected_repository_ids: number[]; + /** List of runner IDs to add to the runner group. */ + runners: number[]; }, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/actions/permissions/repositories\`, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners\`, method: "PUT", body: data, type: ContentType.Json, @@ -20764,93 +20286,55 @@ export class Api< }), /** - * @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. + * @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 actions - * @name ActionsEnableSelectedRepositoryGithubActionsOrganization - * @summary Enable a selected repository for GitHub Actions in an organization - * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} + * @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} */ - actionsEnableSelectedRepositoryGithubActionsOrganization: ( - org: string, - repositoryId: number, + enterpriseAdminAddSelfHostedRunnerToGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, + runnerId: number, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "PUT", ...params, }), /** - * @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 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 actions - * @name ActionsDisableSelectedRepositoryGithubActionsOrganization - * @summary Disable a selected repository for GitHub Actions in an organization - * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} + * @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} */ - actionsDisableSelectedRepositoryGithubActionsOrganization: ( - org: string, - repositoryId: number, + enterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterprise: ( + enterprise: string, + runnerGroupId: number, + runnerId: number, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, + path: \`/enterprises/\${enterprise}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "DELETE", ...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. - * - * @tags actions - * @name ActionsGetAllowedActionsOrganization - * @summary Get allowed actions for an organization - * @request GET:/orgs/{org}/actions/permissions/selected-actions - */ - actionsGetAllowedActionsOrganization: ( - org: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/selected-actions\`, - 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. - * - * @tags actions - * @name ActionsSetAllowedActionsOrganization - * @summary Set allowed actions for an organization - * @request PUT:/orgs/{org}/actions/permissions/selected-actions - */ - actionsSetAllowedActionsOrganization: ( - org: string, - data: SelectedActions, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/permissions/selected-actions\`, - method: "PUT", - 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)." 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 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 actions - * @name ActionsListSelfHostedRunnerGroupsForOrg - * @summary List self-hosted runner groups for an organization - * @request GET:/orgs/{org}/actions/runner-groups + * @tags enterprise-admin + * @name EnterpriseAdminListSelfHostedRunnersForEnterprise + * @summary List self-hosted runners for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners */ - actionsListSelfHostedRunnerGroupsForOrg: ( - org: string, + enterpriseAdminListSelfHostedRunnersForEnterprise: ( + enterprise: string, query?: { /** * Page number of the results to fetch. @@ -20867,12 +20351,12 @@ export class Api< ) => this.request< { - runner_groups: RunnerGroupsOrg[]; - total_count: number; + runners?: Runner[]; + total_count?: number; }, any >({ - path: \`/orgs/\${org}/actions/runner-groups\`, + path: \`/enterprises/\${enterprise}/actions/runners\`, method: "GET", query: query, format: "json", @@ -20880,208 +20364,217 @@ export class Api< }), /** - * @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 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 actions - * @name ActionsCreateSelfHostedRunnerGroupForOrg - * @summary Create a self-hosted runner group for an organization - * @request POST:/orgs/{org}/actions/runner-groups + * @tags enterprise-admin + * @name EnterpriseAdminListRunnerApplicationsForEnterprise + * @summary List runner applications for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/downloads */ - 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[]; - /** - * 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?: "selected" | "all" | "private"; - }, + enterpriseAdminListRunnerApplicationsForEnterprise: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups\`, + this.request({ + path: \`/enterprises/\${enterprise}/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 \`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", - 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)." 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 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 actions - * @name ActionsGetSelfHostedRunnerGroupForOrg - * @summary Get a self-hosted runner group for an organization - * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} + * @tags enterprise-admin + * @name EnterpriseAdminCreateRemoveTokenForEnterprise + * @summary Create a remove token for an enterprise + * @request POST:/enterprises/{enterprise}/actions/runners/remove-token */ - actionsGetSelfHostedRunnerGroupForOrg: ( - org: string, - runnerGroupId: number, + enterpriseAdminCreateRemoveTokenForEnterprise: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "GET", + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/remove-token\`, + method: "POST", 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)." 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 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 actions - * @name ActionsUpdateSelfHostedRunnerGroupForOrg - * @summary Update a self-hosted runner group for an organization - * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} + * @tags enterprise-admin + * @name EnterpriseAdminGetSelfHostedRunnerForEnterprise + * @summary Get a self-hosted runner for an enterprise + * @request GET:/enterprises/{enterprise}/actions/runners/{runner_id} */ - 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"; - }, + enterpriseAdminGetSelfHostedRunnerForEnterprise: ( + enterprise: string, + runnerId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, + method: "GET", 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 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 actions - * @name ActionsDeleteSelfHostedRunnerGroupFromOrg - * @summary Delete a self-hosted runner group from an organization - * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} + * @tags enterprise-admin + * @name EnterpriseAdminDeleteSelfHostedRunnerFromEnterprise + * @summary Delete a self-hosted runner from an enterprise + * @request DELETE:/enterprises/{enterprise}/actions/runners/{runner_id} */ - actionsDeleteSelfHostedRunnerGroupFromOrg: ( - org: string, - runnerGroupId: number, + enterpriseAdminDeleteSelfHostedRunnerFromEnterprise: ( + enterprise: string, + runnerId: number, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, + path: \`/enterprises/\${enterprise}/actions/runners/\${runnerId}\`, method: "DELETE", ...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 **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 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 audit-log + * @name AuditLogGetAuditLog + * @summary Get the audit log for an enterprise + * @request GET:/enterprises/{enterprise}/audit-log */ - actionsListRepoAccessToSelfHostedRunnerGroupInOrg: ( - org: string, - runnerGroupId: number, + 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< - { - repositories: Repository[]; - total_count: number; - }, - any - >({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, + this.request({ + path: \`/enterprises/\${enterprise}/audit-log\`, 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 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 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 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 billing + * @name BillingGetGithubActionsBillingGhe + * @summary Get GitHub Actions billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/actions */ - actionsSetRepoAccessToSelfHostedRunnerGroupInOrg: ( - org: string, - runnerGroupId: number, - data: { - /** List of repository IDs that can access the runner group. */ - selected_repository_ids: number[]; - }, + billingGetGithubActionsBillingGhe: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/actions\`, + method: "GET", + 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 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. + * @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 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} + * @tags billing + * @name BillingGetGithubPackagesBillingGhe + * @summary Get GitHub Packages billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/packages */ - actionsAddRepoAccessToSelfHostedRunnerGroupInOrg: ( - org: string, - runnerGroupId: number, - repositoryId: number, + billingGetGithubPackagesBillingGhe: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, - method: "PUT", + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/packages\`, + method: "GET", + 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)." 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 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 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 billing + * @name BillingGetSharedStorageBillingGhe + * @summary Get shared storage billing for an enterprise + * @request GET:/enterprises/{enterprise}/settings/billing/shared-storage */ - actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg: ( - org: string, - runnerGroupId: number, - repositoryId: number, + billingGetSharedStorageBillingGhe: ( + enterprise: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, - method: "DELETE", + this.request({ + path: \`/enterprises/\${enterprise}/settings/billing/shared-storage\`, + method: "GET", + format: "json", ...params, }), - + }; + events = { /** - * @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 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 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 activity + * @name ActivityListPublicEvents + * @summary List public events + * @request GET:/events */ - actionsListSelfHostedRunnersInGroupForOrg: ( - org: string, - runnerGroupId: number, + activityListPublicEvents: ( query?: { /** * Page number of the results to fetch. @@ -21097,94 +20590,121 @@ export class Api< params: RequestParams = {}, ) => this.request< - { - runners: Runner[]; - total_count: number; - }, - any + Event[], + | BasicError + | { + code?: string; + documentation_url?: string; + message?: string; + } >({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, + path: \`/events\`, method: "GET", query: query, format: "json", ...params, }), - + }; + feeds = { /** - * @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 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 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 activity + * @name ActivityGetFeeds + * @summary Get feeds + * @request GET:/feeds */ - actionsSetSelfHostedRunnersInGroupForOrg: ( - org: string, - runnerGroupId: number, - data: { - /** List of runner IDs to add to the runner group. */ - runners: number[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, - method: "PUT", - body: data, - type: ContentType.Json, + activityGetFeeds: (params: RequestParams = {}) => + this.request({ + path: \`/feeds\`, + method: "GET", + format: "json", ...params, }), - + }; + gists = { /** - * @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. + * @description Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: * - * @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} + * @tags gists + * @name GistsList + * @summary List gists for the authenticated user + * @request GET:/gists */ - actionsAddSelfHostedRunnerToGroupForOrg: ( - org: string, - runnerGroupId: number, - runnerId: number, + 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: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "PUT", + this.request({ + path: \`/gists\`, + 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)." 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 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 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 gists + * @name GistsCreate + * @summary Create a gist + * @request POST:/gists */ - actionsRemoveSelfHostedRunnerFromGroupForOrg: ( - org: string, - runnerGroupId: number, - runnerId: number, + 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: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, - method: "DELETE", + this.request({ + path: \`/gists\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "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 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 actions - * @name ActionsListSelfHostedRunnersForOrg - * @summary List self-hosted runners for an organization - * @request GET:/orgs/{org}/actions/runners + * @tags gists + * @name GistsListPublic + * @summary List public gists + * @request GET:/gists/public */ - actionsListSelfHostedRunnersForOrg: ( - org: string, + gistsListPublic: ( query?: { /** * Page number of the results to fetch. @@ -21196,17 +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< - { - runners: Runner[]; - total_count: number; - }, - any - >({ - path: \`/orgs/\${org}/actions/runners\`, + this.request({ + path: \`/gists/public\`, method: "GET", query: query, format: "json", @@ -21214,108 +20730,133 @@ 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 \`admin:org\` scope to use this endpoint. + * @description List the authenticated user's starred gists: * - * @tags actions - * @name ActionsListRunnerApplicationsForOrg - * @summary List runner applications for an organization - * @request GET:/orgs/{org}/actions/runners/downloads + * @tags gists + * @name GistsListStarred + * @summary List starred gists + * @request GET:/gists/starred */ - actionsListRunnerApplicationsForOrg: ( - org: string, + 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: \`/orgs/\${org}/actions/runners/downloads\`, + this.request({ + path: \`/gists/starred\`, 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 \`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: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/registration-token\`, - 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 \`\`\` + * No description * - * @tags actions - * @name ActionsCreateRemoveTokenForOrg - * @summary Create a remove token for an organization - * @request POST:/orgs/{org}/actions/runners/remove-token + * @tags gists + * @name GistsGet + * @summary Get a gist + * @request GET:/gists/{gist_id} */ - actionsCreateRemoveTokenForOrg: (org: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/actions/runners/remove-token\`, - method: "POST", + 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, }), /** - * @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 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 actions - * @name ActionsGetSelfHostedRunnerForOrg - * @summary Get a self-hosted runner for an organization - * @request GET:/orgs/{org}/actions/runners/{runner_id} + * @tags gists + * @name GistsUpdate + * @summary Update a gist + * @request PATCH:/gists/{gist_id} */ - actionsGetSelfHostedRunnerForOrg: ( - org: string, - runnerId: number, + 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: \`/orgs/\${org}/actions/runners/\${runnerId}\`, - method: "GET", + this.request({ + path: \`/gists/\${gistId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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. + * No description * - * @tags actions - * @name ActionsDeleteSelfHostedRunnerFromOrg - * @summary Delete a self-hosted runner from an organization - * @request DELETE:/orgs/{org}/actions/runners/{runner_id} + * @tags gists + * @name GistsDelete + * @summary Delete a gist + * @request DELETE:/gists/{gist_id} */ - actionsDeleteSelfHostedRunnerFromOrg: ( - org: string, - runnerId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + gistsDelete: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}\`, 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. + * No description * - * @tags actions - * @name ActionsListOrgSecrets - * @summary List organization secrets - * @request GET:/orgs/{org}/actions/secrets + * @tags gists + * @name GistsListComments + * @summary List gist comments + * @request GET:/gists/{gist_id}/comments */ - actionsListOrgSecrets: ( - org: string, + gistsListComments: ( + gistId: string, query?: { /** * Page number of the results to fetch. @@ -21330,14 +20871,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - { - secrets: OrganizationActionsSecret[]; - total_count: number; - }, - any - >({ - path: \`/orgs/\${org}/actions/secrets\`, + this.request({ + path: \`/gists/\${gistId}/comments\`, method: "GET", query: query, format: "json", @@ -21345,230 +20880,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. 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: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/public-key\`, - method: "GET", - 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. - * - * @tags actions - * @name ActionsGetOrgSecret - * @summary Get an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name} - */ - actionsGetOrgSecret: ( - org: string, - secretName: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, - 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) \`\`\` + * No description * - * @tags actions - * @name ActionsCreateOrUpdateOrgSecret - * @summary Create or update an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name} + * @tags gists + * @name GistsCreateComment + * @summary Create a gist comment + * @request POST:/gists/{gist_id}/comments */ - actionsCreateOrUpdateOrgSecret: ( - org: string, - secretName: string, + gistsCreateComment: ( + gistId: 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[]; /** - * 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. + * The comment text. + * @maxLength 65535 + * @example "Body of the attachment" */ - visibility?: "all" | "private" | "selected"; + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, - method: "PUT", + this.request({ + path: \`/gists/\${gistId}/comments\`, + method: "POST", 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. - * - * @tags actions - * @name ActionsDeleteOrgSecret - * @summary Delete an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} - */ - 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. + * No description * - * @tags actions - * @name ActionsListSelectedReposForOrgSecret - * @summary List selected repositories for an organization secret - * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories + * @tags gists + * @name GistsGetComment + * @summary Get a gist comment + * @request GET:/gists/{gist_id}/comments/{comment_id} */ - actionsListSelectedReposForOrgSecret: ( - org: string, - secretName: string, + gistsGetComment: ( + gistId: string, + commentId: number, params: RequestParams = {}, ) => this.request< - { - repositories: MinimalRepository[]; - total_count: number; - }, - any + GistComment, + | { + block?: { + created_at?: string; + html_url?: string | null; + reason?: string; + }; + documentation_url?: string; + message?: string; + } + | BasicError >({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, + path: \`/gists/\${gistId}/comments/\${commentId}\`, method: "GET", format: "json", ...params, }), /** - * @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. + * No description * - * @tags actions - * @name ActionsSetSelectedReposForOrgSecret - * @summary Set selected repositories for an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories + * @tags gists + * @name GistsUpdateComment + * @summary Update a gist comment + * @request PATCH:/gists/{gist_id}/comments/{comment_id} */ - actionsSetSelectedReposForOrgSecret: ( - org: string, - secretName: string, + gistsUpdateComment: ( + gistId: string, + commentId: number, 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[]; + /** + * The comment text. + * @maxLength 65535 + * @example "Body of the attachment" + */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, - method: "PUT", + this.request({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "PATCH", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @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. + * No description * - * @tags actions - * @name ActionsAddSelectedRepoToOrgSecret - * @summary Add selected repository to an organization secret - * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + * @tags gists + * @name GistsDeleteComment + * @summary Delete a gist comment + * @request DELETE:/gists/{gist_id}/comments/{comment_id} */ - actionsAddSelectedRepoToOrgSecret: ( - org: string, - secretName: string, - repositoryId: number, + gistsDeleteComment: ( + gistId: string, + commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, - method: "PUT", + this.request({ + path: \`/gists/\${gistId}/comments/\${commentId}\`, + method: "DELETE", ...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. + * No description * - * @tags actions - * @name ActionsRemoveSelectedRepoFromOrgSecret - * @summary Remove selected repository from an organization secret - * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} + * @tags gists + * @name GistsListCommits + * @summary List gist commits + * @request GET:/gists/{gist_id}/commits */ - actionsRemoveSelectedRepoFromOrgSecret: ( - org: string, - secretName: string, - repositoryId: number, + 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: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, - method: "DELETE", + this.request({ + path: \`/gists/\${gistId}/commits\`, + method: "GET", + query: query, + 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. + * No description * - * @tags orgs - * @name OrgsGetAuditLog - * @summary Get the audit log for an organization - * @request GET:/orgs/{org}/audit-log + * @tags gists + * @name GistsListForks + * @summary List gist forks + * @request GET:/gists/{gist_id}/forks */ - orgsGetAuditLog: ( - org: string, + gistsListForks: ( + gistId: 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\`, + this.request({ + path: \`/gists/\${gistId}/forks\`, method: "GET", query: query, format: "json", @@ -21576,23 +21054,17 @@ export class Api< }), /** - * @description List the users blocked by an organization. + * @description **Note**: This was previously \`/gists/:gist_id/fork\`. * - * @tags orgs - * @name OrgsListBlockedUsers - * @summary List users blocked by an organization - * @request GET:/orgs/{org}/blocks + * @tags gists + * @name GistsFork + * @summary Fork a gist + * @request POST:/gists/{gist_id}/forks */ - orgsListBlockedUsers: (org: string, params: RequestParams = {}) => - this.request< - SimpleUser[], - { - documentation_url: string; - message: string; - } - >({ - path: \`/orgs/\${org}/blocks\`, - method: "GET", + gistsFork: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/forks\`, + method: "POST", format: "json", ...params, }), @@ -21600,37 +21072,29 @@ export class Api< /** * No description * - * @tags orgs - * @name OrgsCheckBlockedUser - * @summary Check if a user is blocked by an organization - * @request GET:/orgs/{org}/blocks/{username} + * @tags gists + * @name GistsCheckIsStarred + * @summary Check if a gist is starred + * @request GET:/gists/{gist_id}/star */ - orgsCheckBlockedUser: ( - org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, + gistsCheckIsStarred: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, method: "GET", ...params, }), /** - * No description + * @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 orgs - * @name OrgsBlockUser - * @summary Block a user from an organization - * @request PUT:/orgs/{org}/blocks/{username} + * @tags gists + * @name GistsStar + * @summary Star a gist + * @request PUT:/gists/{gist_id}/star */ - orgsBlockUser: ( - org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, + gistsStar: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, method: "PUT", ...params, }), @@ -21638,67 +21102,81 @@ export class Api< /** * No description * - * @tags orgs - * @name OrgsUnblockUser - * @summary Unblock a user from an organization - * @request DELETE:/orgs/{org}/blocks/{username} + * @tags gists + * @name GistsUnstar + * @summary Unstar a gist + * @request DELETE:/gists/{gist_id}/star */ - orgsUnblockUser: ( - org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/blocks/\${username}\`, + gistsUnstar: (gistId: string, params: RequestParams = {}) => + this.request({ + path: \`/gists/\${gistId}/star\`, 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). + * No description * - * @tags orgs - * @name OrgsListSamlSsoAuthorizations - * @summary List SAML SSO authorizations for an organization - * @request GET:/orgs/{org}/credential-authorizations + * @tags gists + * @name GistsGetRevision + * @summary Get a gist revision + * @request GET:/gists/{gist_id}/{sha} */ - orgsListSamlSsoAuthorizations: (org: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/credential-authorizations\`, + gistsGetRevision: ( + gistId: string, + sha: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/gists/\${gistId}/\${sha}\`, method: "GET", format: "json", ...params, }), - + }; + gitignore = { /** - * @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 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 orgs - * @name OrgsRemoveSamlSsoAuthorization - * @summary Remove a SAML SSO authorization for an organization - * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} + * @tags gitignore + * @name GitignoreGetAllTemplates + * @summary Get all gitignore templates + * @request GET:/gitignore/templates */ - orgsRemoveSamlSsoAuthorization: ( - org: string, - credentialId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, - method: "DELETE", + gitignoreGetAllTemplates: (params: RequestParams = {}) => + this.request({ + path: \`/gitignore/templates\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 activity - * @name ActivityListPublicOrgEvents - * @summary List public organization events - * @request GET:/orgs/{org}/events + * @tags gitignore + * @name GitignoreGetTemplate + * @summary Get a gitignore template + * @request GET:/gitignore/templates/{name} */ - activityListPublicOrgEvents: ( - org: string, + 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. @@ -21713,8 +21191,16 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/events\`, + this.request< + { + repositories: Repository[]; + /** @example "selected" */ + repository_selection?: string; + total_count: number; + }, + BasicError + >({ + path: \`/installation/repositories\`, method: "GET", query: query, format: "json", @@ -21722,16 +21208,51 @@ export class Api< }), /** - * @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 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 orgs - * @name OrgsListFailedInvitations - * @summary List failed organization invitations - * @request GET:/orgs/{org}/failed_invitations + * @tags apps + * @name AppsRevokeInstallationAccessToken + * @summary Revoke an installation access token + * @request DELETE:/installation/token */ - orgsListFailedInvitations: ( - 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 @@ -21742,33 +21263,42 @@ 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}/failed_invitations\`, + this.request({ + path: \`/issues\`, method: "GET", query: query, format: "json", ...params, }), - + }; + licenses = { /** * No description * - * @tags orgs - * @name OrgsListWebhooks - * @summary List organization webhooks - * @request GET:/orgs/{org}/hooks + * @tags licenses + * @name LicensesGetAllCommonlyUsed + * @summary Get all commonly used licenses + * @request GET:/licenses */ - orgsListWebhooks: ( - org: string, + licensesGetAllCommonlyUsed: ( query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + featured?: boolean; /** * Results per page (max 100) * @default 30 @@ -21777,8 +21307,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks\`, + this.request({ + path: \`/licenses\`, method: "GET", query: query, format: "json", @@ -21786,234 +21316,278 @@ export class Api< }), /** - * @description Here's how you can create a hook that posts payloads in JSON format: + * No description * - * @tags orgs - * @name OrgsCreateWebhook - * @summary Create an organization webhook - * @request POST:/orgs/{org}/hooks + * @tags licenses + * @name LicensesGet + * @summary Get a license + * @request GET:/licenses/{license} */ - orgsCreateWebhook: ( - org: string, + licensesGet: (license: string, params: RequestParams = {}) => + this.request({ + path: \`/licenses/\${license}\`, + method: "GET", + format: "json", + ...params, + }), + }; + 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; /** - * 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; + * The rendering mode. + * @default "markdown" + * @example "markdown" + */ + mode?: "markdown" | "gfm"; + /** The Markdown text to render in HTML. */ + text: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks\`, + this.request({ + path: \`/markdown\`, method: "POST", 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 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 orgs - * @name OrgsGetWebhook - * @summary Get an organization webhook - * @request GET:/orgs/{org}/hooks/{hook_id} + * @tags markdown + * @name MarkdownRenderRaw + * @summary Render a Markdown document in raw mode + * @request POST:/markdown/raw */ - orgsGetWebhook: (org: string, hookId: number, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, + 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, }), /** - * @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 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 orgs - * @name OrgsUpdateWebhook - * @summary Update an organization webhook - * @request PATCH:/orgs/{org}/hooks/{hook_id} + * @tags apps + * @name AppsListPlans + * @summary List plans + * @request GET:/marketplace_listing/plans */ - orgsUpdateWebhook: ( - org: string, - hookId: number, - data: { + appsListPlans: ( + 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; - /** 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; - }; + page?: number; /** - * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - * @default ["push"] + * Results per page (max 100) + * @default 30 */ - events?: string[]; - /** @example ""web"" */ - name?: string; + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/marketplace_listing/plans\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @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 orgs - * @name OrgsDeleteWebhook - * @summary Delete an organization webhook - * @request DELETE:/orgs/{org}/hooks/{hook_id} + * @tags apps + * @name AppsListAccountsForPlan + * @summary List accounts for a plan + * @request GET:/marketplace_listing/plans/{plan_id}/accounts */ - orgsDeleteWebhook: ( - org: string, - hookId: number, + 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: \`/orgs/\${org}/hooks/\${hookId}\`, - method: "DELETE", + this.request({ + path: \`/marketplace_listing/plans/\${planId}/accounts\`, + method: "GET", + query: query, + format: "json", ...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 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 orgs - * @name OrgsGetWebhookConfigForOrg - * @summary Get a webhook configuration for an organization - * @request GET:/orgs/{org}/hooks/{hook_id}/config + * @tags apps + * @name AppsGetSubscriptionPlanForAccountStubbed + * @summary Get a subscription plan for an account (stubbed) + * @request GET:/marketplace_listing/stubbed/accounts/{account_id} */ - orgsGetWebhookConfigForOrg: ( - org: string, - hookId: number, + appsGetSubscriptionPlanForAccountStubbed: ( + accountId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/hooks/\${hookId}/config\`, + this.request({ + path: \`/marketplace_listing/stubbed/accounts/\${accountId}\`, method: "GET", 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 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 orgs - * @name OrgsUpdateWebhookConfigForOrg - * @summary Update a webhook configuration for an organization - * @request PATCH:/orgs/{org}/hooks/{hook_id}/config + * @tags apps + * @name AppsListPlansStubbed + * @summary List plans (stubbed) + * @request GET:/marketplace_listing/stubbed/plans */ - 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; + 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: \`/orgs/\${org}/hooks/\${hookId}/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/marketplace_listing/stubbed/plans\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @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 orgs - * @name OrgsPingWebhook - * @summary Ping an organization webhook - * @request POST:/orgs/{org}/hooks/{hook_id}/pings + * @tags apps + * @name AppsListAccountsForPlanStubbed + * @summary List accounts for a plan (stubbed) + * @request GET:/marketplace_listing/stubbed/plans/{plan_id}/accounts */ - orgsPingWebhook: ( - org: string, - hookId: number, + 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}/hooks/\${hookId}/pings\`, - method: "POST", + this.request({ + path: \`/marketplace_listing/stubbed/plans/\${planId}/accounts\`, + method: "GET", + query: query, + format: "json", ...params, }), - + }; + meta = { /** - * @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 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 apps - * @name AppsGetOrgInstallation - * @summary Get an organization installation for the authenticated app - * @request GET:/orgs/{org}/installation + * @tags meta + * @name MetaGet + * @summary Get GitHub meta information + * @request GET:/meta */ - appsGetOrgInstallation: (org: string, params: RequestParams = {}) => - this.request({ - path: \`/orgs/\${org}/installation\`, + metaGet: (params: RequestParams = {}) => + this.request({ + path: \`/meta\`, method: "GET", format: "json", ...params, }), - + }; + networks = { /** - * @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. + * No description * - * @tags orgs - * @name OrgsListAppInstallations - * @summary List app installations for an organization - * @request GET:/orgs/{org}/installations + * @tags activity + * @name ActivityListPublicEventsForRepoNetwork + * @summary List public events for a network of repositories + * @request GET:/networks/{owner}/{repo}/events */ - orgsListAppInstallations: ( - org: string, + activityListPublicEventsForRepoNetwork: ( + owner: string, + repo: string, query?: { /** * Page number of the results to fetch. @@ -22028,54 +21602,87 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - { - installations: Installation[]; - total_count: number; - }, - any - >({ - path: \`/orgs/\${org}/installations\`, + this.request({ + path: \`/networks/\${owner}/\${repo}/events\`, method: "GET", query: query, format: "json", ...params, }), - + }; + notifications = { /** - * @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 List all notifications for the current user, sorted by most recently updated. * - * @tags interactions - * @name InteractionsGetRestrictionsForOrg - * @summary Get interaction restrictions for an organization - * @request GET:/orgs/{org}/interaction-limits + * @tags activity + * @name ActivityListNotificationsForAuthenticatedUser + * @summary List notifications for the authenticated user + * @request GET:/notifications */ - interactionsGetRestrictionsForOrg: ( - org: string, + 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: \`/orgs/\${org}/interaction-limits\`, + this.request({ + path: \`/notifications\`, method: "GET", + query: query, format: "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 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 interactions - * @name InteractionsSetRestrictionsForOrg - * @summary Set interaction restrictions for an organization - * @request PUT:/orgs/{org}/interaction-limits + * @tags activity + * @name ActivityMarkNotificationsAsRead + * @summary Mark notifications as read + * @request PUT:/notifications */ - interactionsSetRestrictionsForOrg: ( - org: string, - data: InteractionLimit, + 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({ - path: \`/orgs/\${org}/interaction-limits\`, + this.request< + { + message?: string; + }, + BasicError + >({ + path: \`/notifications\`, method: "PUT", body: data, type: ContentType.Json, @@ -22084,86 +21691,77 @@ export class Api< }), /** - * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. + * No description * - * @tags interactions - * @name InteractionsRemoveRestrictionsForOrg - * @summary Remove interaction restrictions for an organization - * @request DELETE:/orgs/{org}/interaction-limits + * @tags activity + * @name ActivityGetThread + * @summary Get a thread + * @request GET:/notifications/threads/{thread_id} */ - interactionsRemoveRestrictionsForOrg: ( - org: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/interaction-limits\`, - method: "DELETE", + activityGetThread: (threadId: number, params: RequestParams = {}) => + this.request({ + path: \`/notifications/threads/\${threadId}\`, + method: "GET", + 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\`. + * No description * - * @tags orgs - * @name OrgsListPendingInvitations - * @summary List pending organization invitations - * @request GET:/orgs/{org}/invitations + * @tags activity + * @name ActivityMarkThreadAsRead + * @summary Mark a thread as read + * @request PATCH:/notifications/threads/{thread_id} */ - 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; - }, + 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}/invitations\`, + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, 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 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 orgs - * @name OrgsCreateInvitation - * @summary Create an organization invitation - * @request POST:/orgs/{org}/invitations + * @tags activity + * @name ActivitySetThreadSubscription + * @summary Set a thread subscription + * @request PUT:/notifications/threads/{thread_id}/subscription */ - orgsCreateInvitation: ( - org: string, + activitySetThreadSubscription: ( + threadId: number, 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" + * Whether to block all notifications from a thread. + * @default false */ - role?: "admin" | "direct_member" | "billing_manager"; - /** Specify IDs for the teams you want to invite new members to. */ - team_ids?: number[]; + ignored?: boolean; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations\`, - method: "POST", + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -22171,136 +21769,267 @@ export class Api< }), /** - * @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 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 orgs - * @name OrgsCancelInvitation - * @summary Cancel an organization invitation - * @request DELETE:/orgs/{org}/invitations/{invitation_id} + * @tags activity + * @name ActivityDeleteThreadSubscription + * @summary Delete a thread subscription + * @request DELETE:/notifications/threads/{thread_id}/subscription */ - orgsCancelInvitation: ( - org: string, - invitationId: number, + activityDeleteThreadSubscription: ( + threadId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations/\${invitationId}\`, + this.request({ + path: \`/notifications/threads/\${threadId}/subscription\`, method: "DELETE", ...params, }), - + }; + 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, + }), + }; + organizations = { /** - * @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 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 OrgsListInvitationTeams - * @summary List organization invitation teams - * @request GET:/orgs/{org}/invitations/{invitation_id}/teams + * @name OrgsList + * @summary List organizations + * @request GET:/organizations */ - orgsListInvitationTeams: ( - org: string, - invitationId: number, + orgsList: ( query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; /** * 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; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/invitations/\${invitationId}/teams\`, + this.request({ + path: \`/organizations\`, method: "GET", query: query, format: "json", ...params, }), + }; + 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 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 **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 IssuesListForOrg - * @summary List organization issues assigned to the authenticated user - * @request GET:/orgs/{org}/issues + * @tags orgs + * @name OrgsUpdate + * @summary Update an organization + * @request PATCH:/orgs/{org} */ - issuesListForOrg: ( + orgsUpdate: ( org: string, - query?: { + data: { + /** Billing email address. This address is not publicized. */ + billing_email?: string; + /** @example ""http://github.blog"" */ + blog?: string; + /** The company name. */ + company?: string; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * 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" */ - direction?: "asc" | "desc"; + 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; /** - * 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" + * 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. */ - filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; - /** A list of comma separated label names. Example: \`bug,ui,@high\` */ - labels?: string; + members_allowed_repository_creation_type?: "all" | "private" | "none"; /** - * Page number of the results to fetch. - * @default 1 + * 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. */ - page?: number; + members_can_create_internal_repositories?: boolean; /** - * Results per page (max 100) - * @default 30 + * 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 */ - 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; + members_can_create_pages?: boolean; /** - * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. - * @default "created" + * 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 */ - sort?: "created" | "updated" | "comments"; + members_can_create_private_pages?: boolean; /** - * Indicates the state of the issues to return. Can be either \`open\`, \`closed\`, or \`all\`. - * @default "open" + * 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. */ - state?: "open" | "closed" | "all"; + 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({ - path: \`/orgs/\${org}/issues\`, + 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 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", - query: query, format: "json", ...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 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 orgs - * @name OrgsListMembers - * @summary List organization members - * @request GET:/orgs/{org}/members + * @tags actions + * @name ActionsSetGithubActionsPermissionsOrganization + * @summary Set GitHub Actions permissions for an organization + * @request PUT:/orgs/{org}/actions/permissions */ - orgsListMembers: ( + 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, + }), + + /** + * @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?: { - /** - * 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 @@ -22311,19 +22040,17 @@ 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({ - path: \`/orgs/\${org}/members\`, + this.request< + { + repositories: Repository[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/permissions/repositories\`, method: "GET", query: query, format: "json", @@ -22331,122 +22058,116 @@ export class Api< }), /** - * @description Check if a user is, publicly or privately, a member of the organization. + * @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 orgs - * @name OrgsCheckMembershipForUser - * @summary Check organization membership for a user - * @request GET:/orgs/{org}/members/{username} + * @tags actions + * @name ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization + * @summary Set selected repositories enabled for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories */ - orgsCheckMembershipForUser: ( + actionsSetSelectedRepositoriesEnabledGithubActionsOrganization: ( org: string, - username: string, + data: { + /** List of repository IDs to enable for GitHub Actions. */ + selected_repository_ids: number[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members/\${username}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/permissions/repositories\`, + method: "PUT", + body: data, + type: ContentType.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 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 orgs - * @name OrgsRemoveMember - * @summary Remove an organization member - * @request DELETE:/orgs/{org}/members/{username} + * @tags actions + * @name ActionsEnableSelectedRepositoryGithubActionsOrganization + * @summary Enable a selected repository for GitHub Actions in an organization + * @request PUT:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - orgsRemoveMember: ( + actionsEnableSelectedRepositoryGithubActionsOrganization: ( org: string, - username: string, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/members/\${username}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, + method: "PUT", ...params, }), /** - * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. + * @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 orgs - * @name OrgsGetMembershipForUser - * @summary Get organization membership for a user - * @request GET:/orgs/{org}/memberships/{username} + * @tags actions + * @name ActionsDisableSelectedRepositoryGithubActionsOrganization + * @summary Disable a selected repository for GitHub Actions in an organization + * @request DELETE:/orgs/{org}/actions/permissions/repositories/{repository_id} */ - orgsGetMembershipForUser: ( + actionsDisableSelectedRepositoryGithubActionsOrganization: ( org: string, - username: string, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/permissions/repositories/\${repositoryId}\`, + method: "DELETE", ...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. + * @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 orgs - * @name OrgsSetMembershipForUser - * @summary Set organization membership for a user - * @request PUT:/orgs/{org}/memberships/{username} + * @tags actions + * @name ActionsGetAllowedActionsOrganization + * @summary Get allowed actions for an organization + * @request GET:/orgs/{org}/actions/permissions/selected-actions */ - orgsSetMembershipForUser: ( + actionsGetAllowedActionsOrganization: ( org: string, - username: string, - data: { - /** - * 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: \`/orgs/\${org}/memberships/\${username}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/actions/permissions/selected-actions\`, + method: "GET", format: "json", ...params, }), /** - * @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 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 orgs - * @name OrgsRemoveMembershipForUser - * @summary Remove organization membership for a user - * @request DELETE:/orgs/{org}/memberships/{username} + * @tags actions + * @name ActionsSetAllowedActionsOrganization + * @summary Set allowed actions for an organization + * @request PUT:/orgs/{org}/actions/permissions/selected-actions */ - orgsRemoveMembershipForUser: ( + actionsSetAllowedActionsOrganization: ( org: string, - username: string, + data: SelectedActions, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/memberships/\${username}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/permissions/selected-actions\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Lists the most recent migrations. + * @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 migrations - * @name MigrationsListForOrg - * @summary List organization migrations - * @request GET:/orgs/{org}/migrations + * @tags actions + * @name ActionsListSelfHostedRunnerGroupsForOrg + * @summary List self-hosted runner groups for an organization + * @request GET:/orgs/{org}/actions/runner-groups */ - migrationsListForOrg: ( + actionsListSelfHostedRunnerGroupsForOrg: ( org: string, query?: { /** @@ -22462,8 +22183,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations\`, + this.request< + { + runner_groups: RunnerGroupsOrg[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/runner-groups\`, method: "GET", query: query, format: "json", @@ -22471,34 +22198,32 @@ export class Api< }), /** - * @description Initiates the generation of a migration archive. + * @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 migrations - * @name MigrationsStartForOrg - * @summary Start an organization migration - * @request POST:/orgs/{org}/migrations + * @tags actions + * @name ActionsCreateSelfHostedRunnerGroupForOrg + * @summary Create a self-hosted runner group for an organization + * @request POST:/orgs/{org}/actions/runner-groups */ - migrationsStartForOrg: ( + actionsCreateSelfHostedRunnerGroupForOrg: ( 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; + /** 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[]; /** - * Indicates whether repositories should be locked (to prevent manipulation) while migrating data. - * @default false + * 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" */ - lock_repositories?: boolean; - /** A list of arrays indicating which repositories should be migrated. */ - repositories: string[]; + visibility?: "selected" | "all" | "private"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups\`, method: "POST", body: data, type: ContentType.Json, @@ -22507,280 +22232,174 @@ 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. + * @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 migrations - * @name MigrationsDownloadArchiveForOrg - * @summary Download an organization migration archive - * @request GET:/orgs/{org}/migrations/{migration_id}/archive + * @tags actions + * @name ActionsGetSelfHostedRunnerGroupForOrg + * @summary Get a self-hosted runner group for an organization + * @request GET:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - migrationsDownloadArchiveForOrg: ( + actionsGetSelfHostedRunnerGroupForOrg: ( org: string, - migrationId: number, + runnerGroupId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, method: "GET", + format: "json", ...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 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 migrations - * @name MigrationsListReposForOrg - * @summary List repositories in an organization migration - * @request GET:/orgs/{org}/migrations/{migration_id}/repositories + * @tags actions + * @name ActionsUpdateSelfHostedRunnerGroupForOrg + * @summary Update a self-hosted runner group for an organization + * @request PATCH:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - migrationsListReposForOrg: ( + actionsUpdateSelfHostedRunnerGroupForOrg: ( org: string, - migrationId: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + 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"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/migrations/\${migrationId}/repositories\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List all users who are outside collaborators of an organization. + * @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 orgs - * @name OrgsListOutsideCollaborators - * @summary List outside collaborators for an organization - * @request GET:/orgs/{org}/outside_collaborators + * @tags actions + * @name ActionsDeleteSelfHostedRunnerGroupFromOrg + * @summary Delete a self-hosted runner group from an organization + * @request DELETE:/orgs/{org}/actions/runner-groups/{runner_group_id} */ - orgsListOutsideCollaborators: ( + actionsDeleteSelfHostedRunnerGroupFromOrg: ( 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; - }, + runnerGroupId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/outside_collaborators\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}\`, + method: "DELETE", ...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/)". + * @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 orgs - * @name OrgsConvertMemberToOutsideCollaborator - * @summary Convert an organization member to outside collaborator - * @request PUT:/orgs/{org}/outside_collaborators/{username} + * @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 */ - orgsConvertMemberToOutsideCollaborator: ( + actionsListRepoAccessToSelfHostedRunnerGroupInOrg: ( org: string, - username: string, + runnerGroupId: number, params: RequestParams = {}, ) => this.request< - void, - | { - documentation_url?: string; - message?: string; - } - | BasicError + { + repositories: Repository[]; + total_count: number; + }, + any >({ - path: \`/orgs/\${org}/outside_collaborators/\${username}\`, - method: "PUT", + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, + method: "GET", + format: "json", ...params, }), /** - * @description Removing a user from this list will remove them from all the organization's repositories. + * @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 orgs - * @name OrgsRemoveOutsideCollaborator - * @summary Remove outside collaborator from an organization - * @request DELETE:/orgs/{org}/outside_collaborators/{username} + * @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 */ - orgsRemoveOutsideCollaborator: ( + actionsSetRepoAccessToSelfHostedRunnerGroupInOrg: ( org: string, - username: string, + runnerGroupId: number, + data: { + /** List of repository IDs that can access the runner group. */ + selected_repository_ids: number[]; + }, params: RequestParams = {}, ) => - this.request< - void, - { - documentation_url?: string; - message?: string; - } - >({ - path: \`/orgs/\${org}/outside_collaborators/\${username}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories\`, + method: "PUT", + body: data, + type: ContentType.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 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 ProjectsListForOrg - * @summary List organization projects - * @request GET:/orgs/{org}/projects + * @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} */ - projectsListForOrg: ( + actionsAddRepoAccessToSelfHostedRunnerGroupInOrg: ( 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"; - }, + runnerGroupId: number, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/projects\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, + 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 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 ProjectsCreateForOrg - * @summary Create an organization project - * @request POST:/orgs/{org}/projects + * @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} */ - projectsCreateForOrg: ( + actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg: ( org: string, - data: { - /** The description of the project. */ - body?: string; - /** The name of the project. */ - name: string; - }, + runnerGroupId: number, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/projects\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/repositories/\${repositoryId}\`, + method: "DELETE", ...params, }), /** - * @description Members of an organization can choose to have their membership publicized or not. + * @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 orgs - * @name OrgsListPublicMembers - * @summary List public organization members - * @request GET:/orgs/{org}/public_members + * @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 */ - orgsListPublicMembers: ( + actionsListSelfHostedRunnersInGroupForOrg: ( org: string, + runnerGroupId: number, query?: { /** * Page number of the results to fetch. @@ -22795,8 +22414,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members\`, + this.request< + { + runners: Runner[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, method: "GET", query: query, format: "json", @@ -22804,75 +22429,81 @@ 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)." 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 orgs - * @name OrgsCheckPublicMembershipForUser - * @summary Check public organization membership for a user - * @request GET:/orgs/{org}/public_members/{username} + * @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 */ - orgsCheckPublicMembershipForUser: ( + actionsSetSelfHostedRunnersInGroupForOrg: ( org: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, - method: "GET", + runnerGroupId: number, + data: { + /** List of runner IDs to add to the runner group. */ + runners: number[]; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners\`, + method: "PUT", + body: data, + type: ContentType.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 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 orgs - * @name OrgsSetPublicMembershipForAuthenticatedUser - * @summary Set public organization membership for the authenticated user - * @request PUT:/orgs/{org}/public_members/{username} + * @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} */ - orgsSetPublicMembershipForAuthenticatedUser: ( + actionsAddSelfHostedRunnerToGroupForOrg: ( org: string, - username: string, + runnerGroupId: number, + runnerId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, + this.request({ + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "PUT", ...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)." 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 orgs - * @name OrgsRemovePublicMembershipForAuthenticatedUser - * @summary Remove public organization membership for the authenticated user - * @request DELETE:/orgs/{org}/public_members/{username} + * @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} */ - orgsRemovePublicMembershipForAuthenticatedUser: ( + actionsRemoveSelfHostedRunnerFromGroupForOrg: ( org: string, - username: string, + runnerGroupId: number, + runnerId: number, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/public_members/\${username}\`, + path: \`/orgs/\${org}/actions/runner-groups/\${runnerGroupId}/runners/\${runnerId}\`, method: "DELETE", ...params, }), /** - * @description Lists repositories for the specified organization. + * @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 repos - * @name ReposListForOrg - * @summary List organization repositories - * @request GET:/orgs/{org}/repos + * @tags actions + * @name ActionsListSelfHostedRunnersForOrg + * @summary List self-hosted runners for an organization + * @request GET:/orgs/{org}/actions/runners */ - reposListForOrg: ( + actionsListSelfHostedRunnersForOrg: ( 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 @@ -22883,25 +22514,17 @@ export class Api< * @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\`, + this.request< + { + runners: Runner[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/runners\`, method: "GET", query: query, format: "json", @@ -22909,193 +22532,107 @@ export class Api< }), /** - * @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 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 repos - * @name ReposCreateInOrg - * @summary Create an organization repository - * @request POST:/orgs/{org}/repos + * @tags actions + * @name ActionsListRunnerApplicationsForOrg + * @summary List runner applications for an organization + * @request GET:/orgs/{org}/actions/runners/downloads */ - reposCreateInOrg: ( + actionsListRunnerApplicationsForOrg: ( 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, + this.request({ + path: \`/orgs/\${org}/actions/runners/downloads\`, + method: "GET", 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 \`repo\` or \`admin:org\` scope. + * @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 billing - * @name BillingGetGithubActionsBillingOrg - * @summary Get GitHub Actions billing for an organization - * @request GET:/orgs/{org}/settings/billing/actions + * @tags actions + * @name ActionsCreateRegistrationTokenForOrg + * @summary Create a registration token for an organization + * @request POST:/orgs/{org}/actions/runners/registration-token */ - billingGetGithubActionsBillingOrg: ( + actionsCreateRegistrationTokenForOrg: ( org: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/actions\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/actions/runners/registration-token\`, + method: "POST", format: "json", ...params, }), /** - * @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 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 billing - * @name BillingGetGithubPackagesBillingOrg - * @summary Get GitHub Packages billing for an organization - * @request GET:/orgs/{org}/settings/billing/packages + * @tags actions + * @name ActionsCreateRemoveTokenForOrg + * @summary Create a remove token for an organization + * @request POST:/orgs/{org}/actions/runners/remove-token */ - billingGetGithubPackagesBillingOrg: ( - org: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/packages\`, - method: "GET", + actionsCreateRemoveTokenForOrg: (org: string, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/actions/runners/remove-token\`, + method: "POST", 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 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 billing - * @name BillingGetSharedStorageBillingOrg - * @summary Get shared storage billing for an organization - * @request GET:/orgs/{org}/settings/billing/shared-storage + * @tags actions + * @name ActionsGetSelfHostedRunnerForOrg + * @summary Get a self-hosted runner for an organization + * @request GET:/orgs/{org}/actions/runners/{runner_id} */ - billingGetSharedStorageBillingOrg: ( + actionsGetSelfHostedRunnerForOrg: ( org: string, + runnerId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/settings/billing/shared-storage\`, + this.request({ + path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, 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. 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 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 teams - * @name TeamsListIdpGroupsForOrg - * @summary List IdP groups for an organization - * @request GET:/orgs/{org}/team-sync/groups + * @tags actions + * @name ActionsDeleteSelfHostedRunnerFromOrg + * @summary Delete a self-hosted runner from an organization + * @request DELETE:/orgs/{org}/actions/runners/{runner_id} */ - teamsListIdpGroupsForOrg: ( + actionsDeleteSelfHostedRunnerFromOrg: ( org: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + runnerId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/team-sync/groups\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/runners/\${runnerId}\`, + method: "DELETE", ...params, }), /** - * @description Lists all teams in an organization that are visible to the authenticated user. + * @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 teams - * @name TeamsList - * @summary List teams - * @request GET:/orgs/{org}/teams + * @tags actions + * @name ActionsListOrgSecrets + * @summary List organization secrets + * @request GET:/orgs/{org}/actions/secrets */ - teamsList: ( + actionsListOrgSecrets: ( org: string, query?: { /** @@ -23111,8 +22648,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams\`, + this.request< + { + secrets: OrganizationActionsSecret[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/secrets\`, method: "GET", query: query, format: "json", @@ -23120,317 +22663,230 @@ export class Api< }), /** - * @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 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 teams - * @name TeamsCreate - * @summary Create a team - * @request POST:/orgs/{org}/teams + * @tags actions + * @name ActionsGetOrgPublicKey + * @summary Get an organization public key + * @request GET:/orgs/{org}/actions/secrets/public-key */ - 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"; - /** - * 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: \`/orgs/\${org}/teams\`, - method: "POST", - body: data, - type: ContentType.Json, + actionsGetOrgPublicKey: (org: string, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/actions/secrets/public-key\`, + method: "GET", 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}\`. + * @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 teams - * @name TeamsGetByName - * @summary Get a team by name - * @request GET:/orgs/{org}/teams/{team_slug} + * @tags actions + * @name ActionsGetOrgSecret + * @summary Get an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name} */ - teamsGetByName: ( + actionsGetOrgSecret: ( org: string, - teamSlug: string, + secretName: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, method: "GET", 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 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 teams - * @name TeamsUpdateInOrg - * @summary Update a team - * @request PATCH:/orgs/{org}/teams/{team_slug} + * @tags actions + * @name ActionsCreateOrUpdateOrgSecret + * @summary Create or update an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name} */ - teamsUpdateInOrg: ( + actionsCreateOrUpdateOrgSecret: ( org: string, - teamSlug: string, + secretName: 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"; + /** 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[]; /** - * 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. + * 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. */ - privacy?: "secret" | "closed"; + visibility?: "all" | "private" | "selected"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, + method: "PUT", 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 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 teams - * @name TeamsDeleteInOrg - * @summary Delete a team - * @request DELETE:/orgs/{org}/teams/{team_slug} + * @tags actions + * @name ActionsDeleteOrgSecret + * @summary Delete an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name} */ - teamsDeleteInOrg: ( + actionsDeleteOrgSecret: ( org: string, - teamSlug: string, + secretName: string, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}\`, + path: \`/orgs/\${org}/actions/secrets/\${secretName}\`, method: "DELETE", ...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 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 teams - * @name TeamsListDiscussionsInOrg - * @summary List discussions - * @request GET:/orgs/{org}/teams/{team_slug}/discussions + * @tags actions + * @name ActionsListSelectedReposForOrgSecret + * @summary List selected repositories for an organization secret + * @request GET:/orgs/{org}/actions/secrets/{secret_name}/repositories */ - teamsListDiscussionsInOrg: ( + actionsListSelectedReposForOrgSecret: ( 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; - }, + secretName: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, + this.request< + { + repositories: MinimalRepository[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, method: "GET", - query: query, - format: "json", - ...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\`. - * - * @tags teams - * @name TeamsCreateDiscussionInOrg - * @summary Create a discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions - */ - teamsCreateDiscussionInOrg: ( - org: string, - teamSlug: string, - 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; - }, - 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}\`. + * @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 teams - * @name TeamsGetDiscussionInOrg - * @summary Get a discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags actions + * @name ActionsSetSelectedReposForOrgSecret + * @summary Set selected repositories for an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories */ - teamsGetDiscussionInOrg: ( - org: string, - teamSlug: string, - discussionNumber: 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: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories\`, + method: "PUT", + body: data, + type: ContentType.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 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 teams - * @name TeamsUpdateDiscussionInOrg - * @summary Update a discussion - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags actions + * @name ActionsAddSelectedRepoToOrgSecret + * @summary Add selected repository to an organization secret + * @request PUT:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - teamsUpdateDiscussionInOrg: ( + actionsAddSelectedRepoToOrgSecret: ( org: string, - teamSlug: string, - discussionNumber: number, - data: { - /** The discussion post's body text. */ - body?: string; - /** The discussion post's title. */ - title?: string; - }, + secretName: string, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, + method: "PUT", ...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 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 teams - * @name TeamsDeleteDiscussionInOrg - * @summary Delete a discussion - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} + * @tags actions + * @name ActionsRemoveSelectedRepoFromOrgSecret + * @summary Remove selected repository from an organization secret + * @request DELETE:/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} */ - teamsDeleteDiscussionInOrg: ( + actionsRemoveSelectedRepoFromOrgSecret: ( org: string, - teamSlug: string, - discussionNumber: number, + secretName: string, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + this.request({ + path: \`/orgs/\${org}/actions/secrets/\${secretName}/repositories/\${repositoryId}\`, 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 **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 teams - * @name TeamsListDiscussionCommentsInOrg - * @summary List discussion comments - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments + * @tags orgs + * @name OrgsGetAuditLog + * @summary Get the audit log for an organization + * @request GET:/orgs/{org}/audit-log */ - teamsListDiscussionCommentsInOrg: ( + orgsGetAuditLog: ( org: string, - teamSlug: string, - discussionNumber: number, 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; /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" + * 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\`. */ - direction?: "asc" | "desc"; + 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; + /** 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}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, + this.request({ + path: \`/orgs/\${org}/audit-log\`, method: "GET", query: query, format: "json", @@ -23438,229 +22894,130 @@ 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\`. - * - * @tags teams - * @name TeamsCreateDiscussionCommentInOrg - * @summary Create a discussion comment - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments - */ - teamsCreateDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - data: { - /** The discussion comment's body text. */ - body: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "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 List the users blocked by an organization. * - * @tags teams - * @name TeamsGetDiscussionCommentInOrg - * @summary Get a discussion comment - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags orgs + * @name OrgsListBlockedUsers + * @summary List users blocked by an organization + * @request GET:/orgs/{org}/blocks */ - teamsGetDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + orgsListBlockedUsers: (org: string, params: RequestParams = {}) => + this.request< + SimpleUser[], + { + documentation_url: string; + message: string; + } + >({ + path: \`/orgs/\${org}/blocks\`, method: "GET", 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}\`. - * - * @tags teams - * @name TeamsUpdateDiscussionCommentInOrg - * @summary Update a discussion comment - * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} - */ - teamsUpdateDiscussionCommentInOrg: ( - org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, - data: { - /** The discussion comment's body text. */ - body: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "PATCH", - 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}\`. + * No description * - * @tags teams - * @name TeamsDeleteDiscussionCommentInOrg - * @summary Delete a discussion comment - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} + * @tags orgs + * @name OrgsCheckBlockedUser + * @summary Check if a user is blocked by an organization + * @request GET:/orgs/{org}/blocks/{username} */ - teamsDeleteDiscussionCommentInOrg: ( + orgsCheckBlockedUser: ( org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, + method: "GET", ...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\`. + * No description * - * @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 orgs + * @name OrgsBlockUser + * @summary Block a user from an organization + * @request PUT:/orgs/{org}/blocks/{username} */ - reactionsListForTeamDiscussionCommentInOrg: ( + orgsBlockUser: ( 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; - }, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/orgs/\${org}/blocks/\${username}\`, + method: "PUT", ...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\`. + * No description * - * @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 orgs + * @name OrgsUnblockUser + * @summary Unblock a user from an organization + * @request DELETE:/orgs/{org}/blocks/{username} */ - reactionsCreateForTeamDiscussionCommentInOrg: ( + orgsUnblockUser: ( org: string, - teamSlug: string, - 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"; - }, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + 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 **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 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 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 orgs + * @name OrgsRemoveSamlSsoAuthorization + * @summary Remove a SAML SSO authorization for an organization + * @request DELETE:/orgs/{org}/credential-authorizations/{credential_id} */ - reactionsDeleteForTeamDiscussionComment: ( + orgsRemoveSamlSsoAuthorization: ( org: string, - teamSlug: string, - discussionNumber: number, - commentNumber: number, - reactionId: number, + credentialId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions/\${reactionId}\`, + this.request({ + path: \`/orgs/\${org}/credential-authorizations/\${credentialId}\`, method: "DELETE", ...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\`. + * No description * - * @tags reactions - * @name ReactionsListForTeamDiscussionInOrg - * @summary List reactions for a team discussion - * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * @tags activity + * @name ActivityListPublicOrgEvents + * @summary List public organization events + * @request GET:/orgs/{org}/events */ - reactionsListForTeamDiscussionInOrg: ( + activityListPublicOrgEvents: ( 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 @@ -23674,8 +23031,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, + this.request({ + path: \`/orgs/\${org}/events\`, method: "GET", query: query, format: "json", @@ -23683,72 +23040,47 @@ 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 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 reactions - * @name ReactionsCreateForTeamDiscussionInOrg - * @summary Create reaction for a team discussion - * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions + * @tags orgs + * @name OrgsListFailedInvitations + * @summary List failed organization invitations + * @request GET:/orgs/{org}/failed_invitations */ - reactionsCreateForTeamDiscussionInOrg: ( + orgsListFailedInvitations: ( 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"; + 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}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/failed_invitations\`, + method: "GET", + query: query, format: "json", ...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/). - * - * @tags reactions - * @name ReactionsDeleteForTeamDiscussion - * @summary Delete team discussion reaction - * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} - */ - reactionsDeleteForTeamDiscussion: ( - org: string, - teamSlug: string, - discussionNumber: number, - reactionId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions/\${reactionId}\`, - 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\`. **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 orgs + * @name OrgsListWebhooks + * @summary List organization webhooks + * @request GET:/orgs/{org}/hooks */ - teamsListPendingInvitationsInOrg: ( + orgsListWebhooks: ( org: string, - teamSlug: string, query?: { /** * Page number of the results to fetch. @@ -23763,8 +23095,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/invitations\`, + this.request({ + path: \`/orgs/\${org}/hooks\`, method: "GET", query: query, format: "json", @@ -23772,103 +23104,112 @@ export class Api< }), /** - * @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 Here's how you can create a hook that posts payloads in JSON format: * - * @tags teams - * @name TeamsListMembersInOrg - * @summary List team members - * @request GET:/orgs/{org}/teams/{team_slug}/members + * @tags orgs + * @name OrgsCreateWebhook + * @summary Create an organization webhook + * @request POST:/orgs/{org}/hooks */ - teamsListMembersInOrg: ( + orgsCreateWebhook: ( org: string, - teamSlug: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + data: { /** - * Results per page (max 100) - * @default 30 + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true */ - per_page?: number; + 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; + }; /** - * 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" + * Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + * @default ["push"] */ - role?: "member" | "maintainer" | "all"; + events?: string[]; + /** Must be passed as "web". */ + name: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, - method: "GET", - query: query, + this.request({ + path: \`/orgs/\${org}/hooks\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @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 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 teams - * @name TeamsGetMembershipForUserInOrg - * @summary Get team membership for a user - * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags orgs + * @name OrgsGetWebhook + * @summary Get an organization webhook + * @request GET:/orgs/{org}/hooks/{hook_id} */ - teamsGetMembershipForUserInOrg: ( - org: string, - teamSlug: string, - username: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + orgsGetWebhook: (org: string, hookId: number, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, 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 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 teams - * @name TeamsAddOrUpdateMembershipForUserInOrg - * @summary Add or update team membership for a user - * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} + * @tags orgs + * @name OrgsUpdateWebhook + * @summary Update an organization webhook + * @request PATCH:/orgs/{org}/hooks/{hook_id} */ - teamsAddOrUpdateMembershipForUserInOrg: ( + orgsUpdateWebhook: ( org: string, - teamSlug: string, - username: string, + hookId: 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" + * Determines if notifications are sent when the webhook is triggered. Set to \`true\` to send notifications. + * @default true */ - role?: "member" | "maintainer"; + 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"] + */ + events?: string[]; + /** @example ""web"" */ + name?: string; }, params: RequestParams = {}, ) => - this.request< - TeamMembership, - void | { - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: string; - } - >({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -23876,148 +23217,121 @@ 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 orgs + * @name OrgsDeleteWebhook + * @summary Delete an organization webhook + * @request DELETE:/orgs/{org}/hooks/{hook_id} */ - teamsRemoveMembershipForUserInOrg: ( + orgsDeleteWebhook: ( org: string, - teamSlug: string, - username: string, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${username}\`, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}\`, 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\`. + * @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 teams - * @name TeamsListProjectsInOrg - * @summary List team projects - * @request GET:/orgs/{org}/teams/{team_slug}/projects + * @tags orgs + * @name OrgsGetWebhookConfigForOrg + * @summary Get a webhook configuration for an organization + * @request GET:/orgs/{org}/hooks/{hook_id}/config */ - teamsListProjectsInOrg: ( + orgsGetWebhookConfigForOrg: ( 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; - }, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects\`, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/config\`, 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 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 teams - * @name TeamsCheckPermissionsForProjectInOrg - * @summary Check team permissions for a project - * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags orgs + * @name OrgsUpdateWebhookConfigForOrg + * @summary Update a webhook configuration for an organization + * @request PATCH:/orgs/{org}/hooks/{hook_id}/config */ - teamsCheckPermissionsForProjectInOrg: ( + orgsUpdateWebhookConfigForOrg: ( org: string, - teamSlug: string, - projectId: number, + 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: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/config\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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 This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. * - * @tags teams - * @name TeamsAddOrUpdateProjectPermissionsInOrg - * @summary Add or update team project permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags orgs + * @name OrgsPingWebhook + * @summary Ping an organization webhook + * @request POST:/orgs/{org}/hooks/{hook_id}/pings */ - teamsAddOrUpdateProjectPermissionsInOrg: ( + orgsPingWebhook: ( 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"; - }, + hookId: number, params: RequestParams = {}, ) => - this.request< - void, - { - documentation_url?: string; - message?: string; - } - >({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/hooks/\${hookId}/pings\`, + method: "POST", ...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}\`. + * @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 teams - * @name TeamsRemoveProjectInOrg - * @summary Remove a project from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/projects/{project_id} + * @tags apps + * @name AppsGetOrgInstallation + * @summary Get an organization installation for the authenticated app + * @request GET:/orgs/{org}/installation */ - teamsRemoveProjectInOrg: ( - org: string, - teamSlug: string, - projectId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, - method: "DELETE", + appsGetOrgInstallation: (org: string, params: RequestParams = {}) => + this.request({ + path: \`/orgs/\${org}/installation\`, + method: "GET", + 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 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 teams - * @name TeamsListReposInOrg - * @summary List team repositories - * @request GET:/orgs/{org}/teams/{team_slug}/repos + * @tags orgs + * @name OrgsListAppInstallations + * @summary List app installations for an organization + * @request GET:/orgs/{org}/installations */ - teamsListReposInOrg: ( + orgsListAppInstallations: ( org: string, - teamSlug: string, query?: { /** * Page number of the results to fetch. @@ -24032,8 +23346,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, + this.request< + { + installations: Installation[]; + total_count: number; + }, + any + >({ + path: \`/orgs/\${org}/installations\`, method: "GET", query: query, format: "json", @@ -24041,131 +23361,127 @@ 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 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 teams - * @name TeamsCheckPermissionsForRepoInOrg - * @summary Check team permissions for a repository - * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags interactions + * @name InteractionsGetRestrictionsForOrg + * @summary Get interaction restrictions for an organization + * @request GET:/orgs/{org}/interaction-limits */ - teamsCheckPermissionsForRepoInOrg: ( + interactionsGetRestrictionsForOrg: ( org: string, - teamSlug: string, - owner: string, - repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, method: "GET", 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 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 teams - * @name TeamsAddOrUpdateRepoPermissionsInOrg - * @summary Add or update team repository permissions - * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags interactions + * @name InteractionsSetRestrictionsForOrg + * @summary Set interaction restrictions for an organization + * @request PUT:/orgs/{org}/interaction-limits */ - teamsAddOrUpdateRepoPermissionsInOrg: ( + interactionsSetRestrictionsForOrg: ( 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"; - }, + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + this.request({ + path: \`/orgs/\${org}/interaction-limits\`, method: "PUT", body: data, type: ContentType.Json, + 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}\`. + * @description Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. * - * @tags teams - * @name TeamsRemoveRepoInOrg - * @summary Remove a repository from a team - * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} + * @tags interactions + * @name InteractionsRemoveRestrictionsForOrg + * @summary Remove interaction restrictions for an organization + * @request DELETE:/orgs/{org}/interaction-limits */ - teamsRemoveRepoInOrg: ( + interactionsRemoveRestrictionsForOrg: ( org: string, - teamSlug: string, - owner: string, - repo: string, params: RequestParams = {}, ) => this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, + path: \`/orgs/\${org}/interaction-limits\`, 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 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 TeamsListIdpGroupsInOrg - * @summary List IdP groups for a team - * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * @tags orgs + * @name OrgsListPendingInvitations + * @summary List pending organization invitations + * @request GET:/orgs/{org}/invitations */ - teamsListIdpGroupsInOrg: ( + orgsListPendingInvitations: ( 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}/team-sync/group-mappings\`, + this.request({ + path: \`/orgs/\${org}/invitations\`, 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. 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 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 teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg - * @summary Create or update IdP group connections - * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings + * @tags orgs + * @name OrgsCreateInvitation + * @summary Create an organization invitation + * @request POST:/orgs/{org}/invitations */ - teamsCreateOrUpdateIdpGroupConnectionsInOrg: ( + orgsCreateInvitation: ( 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; - }[]; + /** **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: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/invitations\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -24173,16 +23489,35 @@ export class Api< }), /** - * @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 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 teams - * @name TeamsListChildInOrg - * @summary List child teams - * @request GET:/orgs/{org}/teams/{team_slug}/teams + * @tags orgs + * @name OrgsCancelInvitation + * @summary Cancel an organization invitation + * @request DELETE:/orgs/{org}/invitations/{invitation_id} */ - teamsListChildInOrg: ( + orgsCancelInvitation: ( org: string, - teamSlug: string, + invitationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/invitations/\${invitationId}\`, + method: "DELETE", + ...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. + * + * @tags orgs + * @name OrgsListInvitationTeams + * @summary List organization invitation teams + * @request GET:/orgs/{org}/invitations/{invitation_id}/teams + */ + orgsListInvitationTeams: ( + org: string, + invitationId: number, query?: { /** * Page number of the results to fetch. @@ -24197,182 +23532,205 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, + this.request({ + path: \`/orgs/\${org}/invitations/\${invitationId}/teams\`, method: "GET", query: query, format: "json", ...params, }), - }; - projects = { + /** - * No description + * @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 projects - * @name ProjectsGetCard - * @summary Get a project card - * @request GET:/projects/columns/cards/{card_id} + * @tags issues + * @name IssuesListForOrg + * @summary List organization issues assigned to the authenticated user + * @request GET:/orgs/{org}/issues */ - projectsGetCard: (cardId: number, params: RequestParams = {}) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, + 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: \`/orgs/\${org}/issues\`, method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @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 projects - * @name ProjectsUpdateCard - * @summary Update an existing project card - * @request PATCH:/projects/columns/cards/{card_id} + * @tags orgs + * @name OrgsListMembers + * @summary List organization members + * @request GET:/orgs/{org}/members */ - projectsUpdateCard: ( - cardId: number, - data: { + orgsListMembers: ( + org: string, + query?: { /** - * Whether or not the card is archived - * @example false + * 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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 */ - archived?: boolean; + per_page?: number; /** - * The project card's note - * @example "Update all gems" + * 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" */ - note?: string | null; + role?: "all" | "admin" | "member"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/orgs/\${org}/members\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Check if a user is, publicly or privately, a member of the organization. * - * @tags projects - * @name ProjectsDeleteCard - * @summary Delete a project card - * @request DELETE:/projects/columns/cards/{card_id} + * @tags orgs + * @name OrgsCheckMembershipForUser + * @summary Check organization membership for a user + * @request GET:/orgs/{org}/members/{username} */ - projectsDeleteCard: (cardId: number, params: RequestParams = {}) => - this.request< - void, - | BasicError - | { - documentation_url?: string; - errors?: string[]; - message?: string; - } - >({ - path: \`/projects/columns/cards/\${cardId}\`, - method: "DELETE", + orgsCheckMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/members/\${username}\`, + method: "GET", ...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 projects - * @name ProjectsMoveCard - * @summary Move a project card - * @request POST:/projects/columns/cards/{card_id}/moves + * @tags orgs + * @name OrgsRemoveMember + * @summary Remove an organization member + * @request DELETE:/orgs/{org}/members/{username} */ - 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; - }, + orgsRemoveMember: ( + org: string, + username: string, 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", + this.request({ + path: \`/orgs/\${org}/members/\${username}\`, + method: "DELETE", ...params, }), /** - * No description + * @description In order to get a user's membership with an organization, the authenticated user must be an organization member. * - * @tags projects - * @name ProjectsGetColumn - * @summary Get a project column - * @request GET:/projects/columns/{column_id} + * @tags orgs + * @name OrgsGetMembershipForUser + * @summary Get organization membership for a user + * @request GET:/orgs/{org}/memberships/{username} */ - projectsGetColumn: (columnId: number, params: RequestParams = {}) => - this.request({ - path: \`/projects/columns/\${columnId}\`, + orgsGetMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, method: "GET", format: "json", ...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 projects - * @name ProjectsUpdateColumn - * @summary Update an existing project column - * @request PATCH:/projects/columns/{column_id} + * @tags orgs + * @name OrgsSetMembershipForUser + * @summary Set organization membership for a user + * @request PUT:/orgs/{org}/memberships/{username} */ - projectsUpdateColumn: ( - columnId: number, + orgsSetMembershipForUser: ( + org: string, + username: string, data: { /** - * Name of the project column - * @example "Remaining tasks" + * 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" */ - name: string; + role?: "admin" | "member"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/columns/\${columnId}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/memberships/\${username}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -24380,36 +23738,35 @@ export class Api< }), /** - * 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 projects - * @name ProjectsDeleteColumn - * @summary Delete a project column - * @request DELETE:/projects/columns/{column_id} + * @tags orgs + * @name OrgsRemoveMembershipForUser + * @summary Remove organization membership for a user + * @request DELETE:/orgs/{org}/memberships/{username} */ - projectsDeleteColumn: (columnId: number, params: RequestParams = {}) => + orgsRemoveMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => this.request({ - path: \`/projects/columns/\${columnId}\`, + path: \`/orgs/\${org}/memberships/\${username}\`, method: "DELETE", ...params, }), /** - * No description + * @description Lists the most recent migrations. * - * @tags projects - * @name ProjectsListCards - * @summary List project cards - * @request GET:/projects/columns/{column_id}/cards + * @tags migrations + * @name MigrationsListForOrg + * @summary List organization migrations + * @request GET:/orgs/{org}/migrations */ - projectsListCards: ( - columnId: number, + migrationsListForOrg: ( + org: string, 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 @@ -24422,91 +23779,44 @@ export class Api< per_page?: number; }, params: RequestParams = {}, - ) => - this.request({ - path: \`/projects/columns/\${columnId}/cards\`, - 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. - * - * @tags projects - * @name ProjectsCreateCard - * @summary Create a project card - * @request POST:/projects/columns/{column_id}/cards - */ - 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< - ProjectCard, - | BasicError - | (ValidationError | ValidationErrorSimple) - | { - code?: string; - documentation_url?: string; - errors?: { - code?: string; - message?: string; - }[]; - message?: string; - } - >({ - path: \`/projects/columns/\${columnId}/cards\`, - method: "POST", - body: data, - type: ContentType.Json, + ) => + this.request({ + path: \`/orgs/\${org}/migrations\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description Initiates the generation of a migration archive. * - * @tags projects - * @name ProjectsMoveColumn - * @summary Move a project column - * @request POST:/projects/columns/{column_id}/moves + * @tags migrations + * @name MigrationsStartForOrg + * @summary Start an organization migration + * @request POST:/orgs/{org}/migrations */ - projectsMoveColumn: ( - columnId: number, + migrationsStartForOrg: ( + org: string, data: { + exclude?: string[]; /** - * The position of the column in a project - * @pattern ^(?:first|last|after:\\d+)$ - * @example "last" + * Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). + * @default false */ - position: string; + 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: \`/projects/columns/\${columnId}/moves\`, + this.request({ + path: \`/orgs/\${org}/migrations\`, method: "POST", body: data, type: ContentType.Json, @@ -24515,115 +23825,95 @@ export class Api< }), /** - * @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 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 projects - * @name ProjectsGet - * @summary Get a project - * @request GET:/projects/{project_id} + * @tags migrations + * @name MigrationsGetStatusForOrg + * @summary Get an organization migration status + * @request GET:/orgs/{org}/migrations/{migration_id} */ - projectsGet: (projectId: number, params: RequestParams = {}) => - this.request({ - path: \`/projects/\${projectId}\`, + migrationsGetStatusForOrg: ( + org: string, + migrationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}\`, 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 Fetches the URL to a migration archive. * - * @tags projects - * @name ProjectsUpdate - * @summary Update a project - * @request PATCH:/projects/{project_id} + * @tags migrations + * @name MigrationsDownloadArchiveForOrg + * @summary Download an organization migration archive + * @request GET:/orgs/{org}/migrations/{migration_id}/archive */ - projectsUpdate: ( - projectId: number, - 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 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; - }, + migrationsDownloadArchiveForOrg: ( + org: string, + migrationId: number, params: RequestParams = {}, ) => - 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", + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, + method: "GET", ...params, }), /** - * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. + * @description Deletes a previous migration archive. Migration archives are automatically deleted after seven days. * - * @tags projects - * @name ProjectsDelete - * @summary Delete a project - * @request DELETE:/projects/{project_id} + * @tags migrations + * @name MigrationsDeleteArchiveForOrg + * @summary Delete an organization migration archive + * @request DELETE:/orgs/{org}/migrations/{migration_id}/archive */ - projectsDelete: (projectId: number, params: RequestParams = {}) => - this.request< - void, - | BasicError - | { - documentation_url?: string; - errors?: string[]; - message?: string; - } - >({ - path: \`/projects/\${projectId}\`, + migrationsDeleteArchiveForOrg: ( + org: string, + migrationId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/archive\`, 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 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 projects - * @name ProjectsListCollaborators - * @summary List project collaborators - * @request GET:/projects/{project_id}/collaborators + * @tags migrations + * @name MigrationsUnlockRepoForOrg + * @summary Unlock an organization repository + * @request DELETE:/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock */ - projectsListCollaborators: ( - projectId: number, + 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. + * + * @tags migrations + * @name MigrationsListReposForOrg + * @summary List repositories in an organization migration + * @request GET:/orgs/{org}/migrations/{migration_id}/repositories + */ + migrationsListReposForOrg: ( + org: string, + migrationId: 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 @@ -24637,16 +23927,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - SimpleUser[], - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/projects/\${projectId}/collaborators\`, + this.request({ + path: \`/orgs/\${org}/migrations/\${migrationId}/repositories\`, method: "GET", query: query, format: "json", @@ -24654,107 +23936,105 @@ 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 List all users who are outside collaborators of an organization. * - * @tags projects - * @name ProjectsAddCollaborator - * @summary Add project collaborator - * @request PUT:/projects/{project_id}/collaborators/{username} + * @tags orgs + * @name OrgsListOutsideCollaborators + * @summary List outside collaborators for an organization + * @request GET:/orgs/{org}/outside_collaborators */ - projectsAddCollaborator: ( - projectId: number, - username: string, - data: { + orgsListOutsideCollaborators: ( + org: string, + query?: { /** - * The permission to grant the collaborator. - * @default "write" - * @example "write" + * 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" */ - permission?: "read" | "write" | "admin"; + 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< - 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}/outside_collaborators\`, + method: "GET", + query: query, + 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. - * - * @tags projects - * @name ProjectsRemoveCollaborator - * @summary Remove user as a collaborator - * @request DELETE:/projects/{project_id}/collaborators/{username} + * @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} */ - projectsRemoveCollaborator: ( - projectId: number, + orgsConvertMemberToOutsideCollaborator: ( + org: string, username: string, params: RequestParams = {}, ) => this.request< void, - | BasicError | { - documentation_url: string; - message: string; + documentation_url?: string; + message?: string; } - | ValidationError + | BasicError >({ - path: \`/projects/\${projectId}/collaborators/\${username}\`, - method: "DELETE", + path: \`/orgs/\${org}/outside_collaborators/\${username}\`, + method: "PUT", ...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 Removing a user from this list will remove them from all the organization's repositories. * - * @tags projects - * @name ProjectsGetPermissionForUser - * @summary Get project permission for a user - * @request GET:/projects/{project_id}/collaborators/{username}/permission + * @tags orgs + * @name OrgsRemoveOutsideCollaborator + * @summary Remove outside collaborator from an organization + * @request DELETE:/orgs/{org}/outside_collaborators/{username} */ - projectsGetPermissionForUser: ( - projectId: number, + orgsRemoveOutsideCollaborator: ( + org: string, username: string, params: RequestParams = {}, ) => this.request< - RepositoryCollaboratorPermission, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError + void, + { + documentation_url?: string; + message?: string; + } >({ - path: \`/projects/\${projectId}/collaborators/\${username}/permission\`, - method: "GET", - format: "json", + path: \`/orgs/\${org}/outside_collaborators/\${username}\`, + method: "DELETE", ...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 projects - * @name ProjectsListColumns - * @summary List project columns - * @request GET:/projects/{project_id}/columns + * @name ProjectsListForOrg + * @summary List organization projects + * @request GET:/orgs/{org}/projects */ - projectsListColumns: ( - projectId: number, + projectsListForOrg: ( + org: string, query?: { /** * Page number of the results to fetch. @@ -24766,11 +24046,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: \`/projects/\${projectId}/columns\`, + this.request({ + path: \`/orgs/\${org}/projects\`, method: "GET", query: query, format: "json", @@ -24778,102 +24063,179 @@ export class Api< }), /** - * 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 projects - * @name ProjectsCreateColumn - * @summary Create a project column - * @request POST:/projects/{project_id}/columns + * @name ProjectsCreateForOrg + * @summary Create an organization project + * @request POST:/orgs/{org}/projects */ - projectsCreateColumn: ( - projectId: number, + projectsCreateForOrg: ( + org: string, data: { - /** - * Name of the project column - * @example "Remaining tasks" - */ + /** The description of the project. */ + body?: string; + /** The name of the project. */ name: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/projects/\${projectId}/columns\`, + this.request({ + path: \`/orgs/\${org}/projects\`, 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 Members of an organization can choose to have their membership publicized or not. * - * @tags rate-limit - * @name RateLimitGet - * @summary Get rate limit status for the authenticated user - * @request GET:/rate_limit + * @tags orgs + * @name OrgsListPublicMembers + * @summary List public organization members + * @request GET:/orgs/{org}/public_members */ - rateLimitGet: (params: RequestParams = {}) => - this.request({ - path: \`/rate_limit\`, + 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: \`/orgs/\${org}/public_members\`, method: "GET", + query: query, 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). + * No description * - * @tags reactions - * @name ReactionsDeleteLegacy - * @summary Delete a reaction (Legacy) - * @request DELETE:/reactions/{reaction_id} - * @deprecated + * @tags orgs + * @name OrgsCheckPublicMembershipForUser + * @summary Check public organization membership for a user + * @request GET:/orgs/{org}/public_members/{username} */ - reactionsDeleteLegacy: (reactionId: number, params: RequestParams = {}) => - this.request< - void, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/reactions/\${reactionId}\`, + orgsCheckPublicMembershipForUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, + method: "GET", + ...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)." + * + * @tags orgs + * @name OrgsSetPublicMembershipForAuthenticatedUser + * @summary Set public organization membership for the authenticated user + * @request PUT:/orgs/{org}/public_members/{username} + */ + orgsSetPublicMembershipForAuthenticatedUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, + method: "PUT", + ...params, + }), + + /** + * No description + * + * @tags orgs + * @name OrgsRemovePublicMembershipForAuthenticatedUser + * @summary Remove public organization membership for the authenticated user + * @request DELETE:/orgs/{org}/public_members/{username} + */ + orgsRemovePublicMembershipForAuthenticatedUser: ( + org: string, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/public_members/\${username}\`, 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 Lists repositories for the specified organization. * * @tags repos - * @name ReposGet - * @summary Get a repository - * @request GET:/repos/{owner}/{repo} + * @name ReposListForOrg + * @summary List organization repositories + * @request GET:/orgs/{org}/repos */ - reposGet: (owner: string, repo: string, params: RequestParams = {}) => - this.request({ - path: \`/repos/\${owner}/\${repo}\`, + 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", ...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} + * @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 */ - reposUpdate: ( - owner: string, - repo: 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. @@ -24891,12 +24253,10 @@ export class Api< */ 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 @@ -24904,6 +24264,8 @@ export class Api< 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 @@ -24926,22 +24288,28 @@ export class Api< * @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. */ + /** 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}\`, - method: "PATCH", + this.request({ + path: \`/orgs/\${org}/repos\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -24949,270 +24317,281 @@ export class Api< }), /** - * @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 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 actions - * @name ActionsListArtifactsForRepo - * @summary List artifacts for a repository - * @request GET:/repos/{owner}/{repo}/actions/artifacts + * @tags billing + * @name BillingGetGithubActionsBillingOrg + * @summary Get GitHub Actions billing for an organization + * @request GET:/orgs/{org}/settings/billing/actions */ - 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; - }, + billingGetGithubActionsBillingOrg: ( + org: string, params: RequestParams = {}, ) => - this.request< - { - artifacts: Artifact[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts\`, + this.request({ + path: \`/orgs/\${org}/settings/billing/actions\`, 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 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 actions - * @name ActionsGetArtifact - * @summary Get an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @tags billing + * @name BillingGetGithubPackagesBillingOrg + * @summary Get GitHub Packages billing for an organization + * @request GET:/orgs/{org}/settings/billing/packages */ - actionsGetArtifact: ( - owner: string, - repo: string, - artifactId: number, + billingGetGithubPackagesBillingOrg: ( + org: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, + this.request({ + path: \`/orgs/\${org}/settings/billing/packages\`, method: "GET", 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 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 actions - * @name ActionsDeleteArtifact - * @summary Delete an artifact - * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} + * @tags billing + * @name BillingGetSharedStorageBillingOrg + * @summary Get shared storage billing for an organization + * @request GET:/orgs/{org}/settings/billing/shared-storage */ - actionsDeleteArtifact: ( - owner: string, - repo: string, - artifactId: number, + billingGetSharedStorageBillingOrg: ( + org: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/settings/billing/shared-storage\`, + method: "GET", + format: "json", ...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 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 actions - * @name ActionsDownloadArtifact - * @summary Download an artifact - * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} + * @tags teams + * @name TeamsListIdpGroupsForOrg + * @summary List IdP groups for an organization + * @request GET:/orgs/{org}/team-sync/groups */ - actionsDownloadArtifact: ( - owner: string, - repo: string, - artifactId: number, - archiveFormat: 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}/actions/artifacts/\${artifactId}/\${archiveFormat}\`, + this.request({ + path: \`/orgs/\${org}/team-sync/groups\`, method: "GET", + query: query, + format: "json", ...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 Lists all teams in an organization that are visible to the authenticated user. * - * @tags actions - * @name ActionsGetJobForWorkflowRun - * @summary Get a job for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} + * @tags teams + * @name TeamsList + * @summary List teams + * @request GET:/orgs/{org}/teams */ - actionsGetJobForWorkflowRun: ( - owner: string, - repo: string, - jobId: number, + 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}/actions/jobs/\${jobId}\`, + this.request({ + path: \`/orgs/\${org}/teams\`, 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 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 actions - * @name ActionsDownloadJobLogsForWorkflowRun - * @summary Download job logs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs + * @tags teams + * @name TeamsCreate + * @summary Create a team + * @request POST:/orgs/{org}/teams */ - actionsDownloadJobLogsForWorkflowRun: ( - owner: string, - repo: string, - jobId: number, + 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"; + /** + * 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}/actions/jobs/\${jobId}/logs\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams\`, + 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 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 actions - * @name ActionsGetGithubActionsPermissionsRepository - * @summary Get GitHub Actions permissions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions + * @tags teams + * @name TeamsGetByName + * @summary Get a team by name + * @request GET:/orgs/{org}/teams/{team_slug} */ - actionsGetGithubActionsPermissionsRepository: ( - owner: string, - repo: string, + teamsGetByName: ( + org: string, + teamSlug: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, 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. + * @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 actions - * @name ActionsSetGithubActionsPermissionsRepository - * @summary Set GitHub Actions permissions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions + * @tags teams + * @name TeamsUpdateInOrg + * @summary Update a team + * @request PATCH:/orgs/{org}/teams/{team_slug} */ - actionsSetGithubActionsPermissionsRepository: ( - owner: string, - repo: string, + teamsUpdateInOrg: ( + org: string, + teamSlug: 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; + /** 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}/actions/permissions\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}\`, + method: "PATCH", 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. - * - * @tags actions - * @name ActionsGetAllowedActionsRepository - * @summary Get allowed actions for a repository - * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions - */ - actionsGetAllowedActionsRepository: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, - 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 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 actions - * @name ActionsSetAllowedActionsRepository - * @summary Set allowed actions for a repository - * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions + * @tags teams + * @name TeamsDeleteInOrg + * @summary Delete a team + * @request DELETE:/orgs/{org}/teams/{team_slug} */ - actionsSetAllowedActionsRepository: ( - owner: string, - repo: string, - data: SelectedActions, + teamsDeleteInOrg: ( + org: string, + teamSlug: string, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/orgs/\${org}/teams/\${teamSlug}\`, + 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. + * @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 actions - * @name ActionsListSelfHostedRunnersForRepo - * @summary List self-hosted runners for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners + * @tags teams + * @name TeamsListDiscussionsInOrg + * @summary List discussions + * @request GET:/orgs/{org}/teams/{team_slug}/discussions */ - actionsListSelfHostedRunnersForRepo: ( - owner: string, - repo: 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 @@ -25226,14 +24605,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}/teams/\${teamSlug}/discussions\`, method: "GET", query: query, format: "json", @@ -25241,124 +24614,126 @@ 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. - * - * @tags actions - * @name ActionsListRunnerApplicationsForRepo - * @summary List runner applications for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/downloads - */ - actionsListRunnerApplicationsForRepo: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - 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 \`\`\` + * @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 actions - * @name ActionsCreateRegistrationTokenForRepo - * @summary Create a registration token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token + * @tags teams + * @name TeamsCreateDiscussionInOrg + * @summary Create a discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions */ - actionsCreateRegistrationTokenForRepo: ( - owner: string, - repo: string, + teamsCreateDiscussionInOrg: ( + org: string, + teamSlug: string, + 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; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions\`, method: "POST", + body: data, + type: ContentType.Json, 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 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 actions - * @name ActionsCreateRemoveTokenForRepo - * @summary Create a remove token for a repository - * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token + * @tags teams + * @name TeamsGetDiscussionInOrg + * @summary Get a discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - actionsCreateRemoveTokenForRepo: ( - owner: string, - repo: string, + teamsGetDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, - method: "POST", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "GET", 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 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 actions - * @name ActionsGetSelfHostedRunnerForRepo - * @summary Get a self-hosted runner for a repository - * @request GET:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @tags teams + * @name TeamsUpdateDiscussionInOrg + * @summary Update a discussion + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - actionsGetSelfHostedRunnerForRepo: ( - owner: string, - repo: string, - runnerId: number, + teamsUpdateDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + data: { + /** The discussion post's body text. */ + body?: string; + /** The discussion post's title. */ + title?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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. + * @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 actions - * @name ActionsDeleteSelfHostedRunnerFromRepo - * @summary Delete a self-hosted runner from a repository - * @request DELETE:/repos/{owner}/{repo}/actions/runners/{runner_id} + * @tags teams + * @name TeamsDeleteDiscussionInOrg + * @summary Delete a discussion + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number} */ - actionsDeleteSelfHostedRunnerFromRepo: ( - owner: string, - repo: string, - runnerId: number, + teamsDeleteDiscussionInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runners/\${runnerId}\`, + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}\`, 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 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 actions - * @name ActionsListWorkflowRunsForRepo - * @summary List workflow runs for a repository - * @request GET:/repos/{owner}/{repo}/actions/runs + * @tags teams + * @name TeamsListDiscussionCommentsInOrg + * @summary List discussion comments + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - actionsListWorkflowRunsForRepo: ( - owner: string, - repo: string, + teamsListDiscussionCommentsInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, 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; + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -25369,19 +24744,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/runs\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, method: "GET", query: query, format: "json", @@ -25389,126 +24756,127 @@ export class Api< }), /** - * @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 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 actions - * @name ActionsGetWorkflowRun - * @summary Get a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} + * @tags teams + * @name TeamsCreateDiscussionCommentInOrg + * @summary Create a discussion comment + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments */ - actionsGetWorkflowRun: ( - owner: string, - repo: string, - runId: number, + teamsCreateDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + data: { + /** The discussion comment's body text. */ + body: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, 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. + * @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 actions - * @name ActionsDeleteWorkflowRun - * @summary Delete a workflow run - * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} + * @tags teams + * @name TeamsGetDiscussionCommentInOrg + * @summary Get a discussion comment + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - actionsDeleteWorkflowRun: ( - owner: string, - repo: string, - runId: number, + teamsGetDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + 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 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 actions - * @name ActionsListWorkflowRunArtifacts - * @summary List workflow run artifacts - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts + * @tags teams + * @name TeamsUpdateDiscussionCommentInOrg + * @summary Update a discussion comment + * @request PATCH:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - 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; + teamsUpdateDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, + data: { + /** The discussion comment's body text. */ + body: string; }, 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}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + 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 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 actions - * @name ActionsCancelWorkflowRun - * @summary Cancel a workflow run - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel + * @tags teams + * @name TeamsDeleteDiscussionCommentInOrg + * @summary Delete a discussion comment + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number} */ - actionsCancelWorkflowRun: ( - owner: string, - repo: string, - runId: number, + teamsDeleteDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, - method: "POST", + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + method: "DELETE", ...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 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 actions - * @name ActionsListJobsForWorkflowRun - * @summary List jobs for a workflow run - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs + * @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 */ - actionsListJobsForWorkflowRun: ( - owner: string, - repo: string, - runId: number, + reactionsListForTeamDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, 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"; + /** 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 @@ -25518,117 +24886,99 @@ export class Api< * Results per page (max 100) * @default 30 */ - per_page?: number; - }, - params: RequestParams = {}, - ) => - this.request< - { - jobs: Job[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/jobs\`, - method: "GET", - query: query, - format: "json", - ...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. - * - * @tags actions - * @name ActionsDownloadWorkflowRunLogs - * @summary Download workflow run logs - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs - */ - actionsDownloadWorkflowRunLogs: ( - owner: string, - repo: string, - runId: number, + per_page?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, method: "GET", + query: query, + 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 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 actions - * @name ActionsReRunWorkflow - * @summary Re-run a workflow - * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun + * @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 */ - actionsReRunWorkflow: ( - owner: string, - repo: string, - runId: number, + reactionsCreateForTeamDiscussionCommentInOrg: ( + org: string, + teamSlug: string, + 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: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, method: "POST", + 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. + * @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 actions - * @name ActionsGetWorkflowRunUsage - * @summary Get workflow run usage - * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing + * @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} */ - actionsGetWorkflowRunUsage: ( - owner: string, - repo: string, - runId: number, + reactionsDeleteForTeamDiscussionComment: ( + org: string, + teamSlug: string, + discussionNumber: number, + commentNumber: number, + reactionId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions/\${reactionId}\`, + 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 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 actions - * @name ActionsListRepoSecrets - * @summary List repository secrets - * @request GET:/repos/{owner}/{repo}/actions/secrets + * @tags reactions + * @name ReactionsListForTeamDiscussionInOrg + * @summary List reactions for a team discussion + * @request GET:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - actionsListRepoSecrets: ( - owner: string, - repo: 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 @@ -25642,14 +24992,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}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, method: "GET", query: query, format: "json", @@ -25657,105 +25001,105 @@ 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. - * - * @tags actions - * @name ActionsGetRepoPublicKey - * @summary Get a repository public key - * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key - */ - actionsGetRepoPublicKey: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, - method: "GET", - 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 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 actions - * @name ActionsGetRepoSecret - * @summary Get a repository secret - * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags reactions + * @name ReactionsCreateForTeamDiscussionInOrg + * @summary Create reaction for a team discussion + * @request POST:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions */ - actionsGetRepoSecret: ( - owner: string, - repo: string, - secretName: string, + 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}/actions/secrets/\${secretName}\`, - method: "GET", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...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 **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 actions - * @name ActionsCreateOrUpdateRepoSecret - * @summary Create or update a repository secret - * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags reactions + * @name ReactionsDeleteForTeamDiscussion + * @summary Delete team discussion reaction + * @request DELETE:/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id} */ - 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; - }, + reactionsDeleteForTeamDiscussion: ( + org: string, + teamSlug: string, + discussionNumber: number, + reactionId: number, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "PUT", - body: data, - type: ContentType.Json, + path: \`/orgs/\${org}/teams/\${teamSlug}/discussions/\${discussionNumber}/reactions/\${reactionId}\`, + method: "DELETE", ...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 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 actions - * @name ActionsDeleteRepoSecret - * @summary Delete a repository secret - * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} + * @tags teams + * @name TeamsListPendingInvitationsInOrg + * @summary List pending team invitations + * @request GET:/orgs/{org}/teams/{team_slug}/invitations */ - actionsDeleteRepoSecret: ( - owner: string, - repo: string, - secretName: string, + teamsListPendingInvitationsInOrg: ( + 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: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/invitations\`, + 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 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 actions - * @name ActionsListRepoWorkflows - * @summary List repository workflows - * @request GET:/repos/{owner}/{repo}/actions/workflows + * @tags teams + * @name TeamsListMembersInOrg + * @summary List team members + * @request GET:/orgs/{org}/teams/{team_slug}/members */ - actionsListRepoWorkflows: ( - owner: string, - repo: string, + teamsListMembersInOrg: ( + org: string, + teamSlug: string, query?: { /** * Page number of the results to fetch. @@ -25767,17 +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< - { - total_count: number; - workflows: Workflow[]; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/actions/workflows\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/members\`, method: "GET", query: query, format: "json", @@ -25785,113 +25131,100 @@ 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 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 actions - * @name ActionsGetWorkflow - * @summary Get a workflow - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} + * @tags teams + * @name TeamsGetMembershipForUserInOrg + * @summary Get team membership for a user + * @request GET:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - actionsGetWorkflow: ( - owner: string, - repo: string, - workflowId: number | string, + teamsGetMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/memberships/\${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. - * - * @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)." + * @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 actions - * @name ActionsCreateWorkflowDispatch - * @summary Create a workflow dispatch event - * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserInOrg + * @summary Add or update team membership for a user + * @request PUT:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - actionsCreateWorkflowDispatch: ( - owner: string, - repo: string, - workflowId: number | string, + teamsAddOrUpdateMembershipForUserInOrg: ( + org: string, + teamSlug: 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 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}/actions/workflows/\${workflowId}/dispatches\`, - method: "POST", + 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 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 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 actions - * @name ActionsEnableWorkflow - * @summary Enable a workflow - * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable + * @tags teams + * @name TeamsRemoveMembershipForUserInOrg + * @summary Remove team membership for a user + * @request DELETE:/orgs/{org}/teams/{team_slug}/memberships/{username} */ - actionsEnableWorkflow: ( - owner: string, - repo: string, - workflowId: number | string, + teamsRemoveMembershipForUserInOrg: ( + org: string, + teamSlug: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, - method: "PUT", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/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 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 actions - * @name ActionsListWorkflowRuns - * @summary List workflow runs - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs + * @tags teams + * @name TeamsListProjectsInOrg + * @summary List team projects + * @request GET:/orgs/{org}/teams/{team_slug}/projects */ - actionsListWorkflowRuns: ( - owner: string, - repo: string, - workflowId: number | string, + teamsListProjectsInOrg: ( + org: string, + teamSlug: 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 @@ -25902,19 +25235,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}/teams/\${teamSlug}/projects\`, method: "GET", query: query, format: "json", @@ -25922,37 +25247,95 @@ 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 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 actions - * @name ActionsGetWorkflowUsage - * @summary Get workflow usage - * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing + * @tags teams + * @name TeamsCheckPermissionsForProjectInOrg + * @summary Check team permissions for a project + * @request GET:/orgs/{org}/teams/{team_slug}/projects/{project_id} */ - actionsGetWorkflowUsage: ( - owner: string, - repo: string, - workflowId: number | string, + teamsCheckPermissionsForProjectInOrg: ( + org: string, + teamSlug: string, + projectId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + 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}\`. + * + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsInOrg + * @summary Add or update team project permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/projects/{project_id} + */ + 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< + void, + { + documentation_url?: string; + message?: string; + } + >({ + 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: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, - method: "GET", - format: "json", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/projects/\${projectId}\`, + method: "DELETE", ...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 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 issues - * @name IssuesListAssignees - * @summary List assignees - * @request GET:/repos/{owner}/{repo}/assignees + * @tags teams + * @name TeamsListReposInOrg + * @summary List team repositories + * @request GET:/orgs/{org}/teams/{team_slug}/repos */ - issuesListAssignees: ( - owner: string, - repo: string, + teamsListReposInOrg: ( + org: string, + teamSlug: string, query?: { /** * Page number of the results to fetch. @@ -25967,8 +25350,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/assignees\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos\`, method: "GET", query: query, format: "json", @@ -25976,214 +25359,131 @@ export class Api< }), /** - * @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 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 IssuesCheckUserCanBeAssigned - * @summary Check if a user can be assigned - * @request GET:/repos/{owner}/{repo}/assignees/{assignee} + * @tags teams + * @name TeamsCheckPermissionsForRepoInOrg + * @summary Check team permissions for a repository + * @request GET:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - issuesCheckUserCanBeAssigned: ( + teamsCheckPermissionsForRepoInOrg: ( + org: string, + teamSlug: string, owner: string, repo: string, - assignee: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, method: "GET", + 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 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 repos - * @name ReposEnableAutomatedSecurityFixes - * @summary Enable automated security fixes - * @request PUT:/repos/{owner}/{repo}/automated-security-fixes + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsInOrg + * @summary Add or update team repository permissions + * @request PUT:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - reposEnableAutomatedSecurityFixes: ( + 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"; + }, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, method: "PUT", + body: data, + type: ContentType.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)". + * @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 repos - * @name ReposDisableAutomatedSecurityFixes - * @summary Disable automated security fixes - * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes + * @tags teams + * @name TeamsRemoveRepoInOrg + * @summary Remove a repository from a team + * @request DELETE:/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} */ - reposDisableAutomatedSecurityFixes: ( + teamsRemoveRepoInOrg: ( + org: string, + teamSlug: string, owner: string, repo: string, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + path: \`/orgs/\${org}/teams/\${teamSlug}/repos/\${owner}/\${repo}\`, method: "DELETE", ...params, }), /** - * No description - * - * @tags repos - * @name ReposListBranches - * @summary List branches - * @request GET:/repos/{owner}/{repo}/branches - */ - reposListBranches: ( - 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; - /** 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\`, - method: "GET", - query: query, - format: "json", - ...params, - }), - - /** - * 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 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 repos - * @name ReposGetBranchProtection - * @summary Get branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags teams + * @name TeamsListIdpGroupsInOrg + * @summary List IdP groups for a team + * @request GET:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - reposGetBranchProtection: ( - owner: string, - repo: string, - branch: string, + teamsListIdpGroupsInOrg: ( + org: string, + teamSlug: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, 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. 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 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 repos - * @name ReposUpdateBranchProtection - * @summary Update branch protection - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsInOrg + * @summary Create or update IdP group connections + * @request PATCH:/orgs/{org}/teams/{team_slug}/team-sync/group-mappings */ - reposUpdateBranchProtection: ( - owner: string, - repo: string, - branch: string, + teamsCreateOrUpdateIdpGroupConnectionsInOrg: ( + org: string, + teamSlug: 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; - }, - params: RequestParams = {}, - ) => - this.request< - ProtectedBranch, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationErrorSimple - >({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, - method: "PUT", + /** 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: \`/orgs/\${org}/teams/\${teamSlug}/team-sync/group-mappings\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -26191,139 +25491,205 @@ 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 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 ReposDeleteBranchProtection - * @summary Delete branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection + * @tags teams + * @name TeamsListChildInOrg + * @summary List child teams + * @request GET:/orgs/{org}/teams/{team_slug}/teams */ - reposDeleteBranchProtection: ( - owner: string, - repo: string, - branch: string, + teamsListChildInOrg: ( + 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: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, - method: "DELETE", + this.request({ + path: \`/orgs/\${org}/teams/\${teamSlug}/teams\`, + method: "GET", + query: query, + format: "json", ...params, }), - + }; + projects = { /** - * @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 ReposGetAdminBranchProtection - * @summary Get admin branch protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags projects + * @name ProjectsGetCard + * @summary Get a project card + * @request GET:/projects/columns/cards/{card_id} */ - reposGetAdminBranchProtection: ( - owner: string, - repo: string, - branch: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + projectsGetCard: (cardId: number, params: RequestParams = {}) => + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, 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. + * No description * - * @tags repos - * @name ReposSetAdminBranchProtection - * @summary Set admin branch protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags projects + * @name ProjectsUpdateCard + * @summary Update an existing project card + * @request PATCH:/projects/columns/cards/{card_id} */ - reposSetAdminBranchProtection: ( - owner: string, - repo: string, - branch: string, + projectsUpdateCard: ( + cardId: number, + data: { + /** + * Whether or not the card is archived + * @example false + */ + archived?: boolean; + /** + * The project card's note + * @example "Update all gems" + */ + note?: string | null; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, - method: "POST", + this.request({ + path: \`/projects/columns/cards/\${cardId}\`, + 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. Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * No description * - * @tags repos - * @name ReposDeleteAdminBranchProtection - * @summary Delete admin branch protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins + * @tags projects + * @name ProjectsDeleteCard + * @summary Delete a project card + * @request DELETE:/projects/columns/cards/{card_id} */ - reposDeleteAdminBranchProtection: ( - owner: string, - repo: string, - branch: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + 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 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 projects + * @name ProjectsMoveCard + * @summary Move a project card + * @request POST:/projects/columns/cards/{card_id}/moves */ - reposGetPullRequestReviewProtection: ( - owner: string, - repo: string, - branch: string, + 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; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + 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}\`, 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. + * No description * - * @tags repos - * @name ReposUpdatePullRequestReviewProtection - * @summary Update pull request review protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @tags projects + * @name ProjectsUpdateColumn + * @summary Update an existing project column + * @request PATCH:/projects/columns/{column_id} */ - reposUpdatePullRequestReviewProtection: ( - owner: string, - repo: string, - branch: string, + projectsUpdateColumn: ( + columnId: number, 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; + /** + * Name of the project column + * @example "Remaining tasks" + */ + name: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + this.request({ + path: \`/projects/columns/\${columnId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -26332,130 +25698,201 @@ 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 ReposDeletePullRequestReviewProtection - * @summary Delete pull request review protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + * @tags projects + * @name ProjectsDeleteColumn + * @summary Delete a project column + * @request DELETE:/projects/columns/{column_id} */ - reposDeletePullRequestReviewProtection: ( - owner: string, - repo: string, - branch: string, - params: RequestParams = {}, - ) => + projectsDeleteColumn: (columnId: number, params: RequestParams = {}) => this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + path: \`/projects/columns/\${columnId}\`, 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. + * No description * - * @tags repos - * @name ReposGetCommitSignatureProtection - * @summary Get commit signature protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags projects + * @name ProjectsListCards + * @summary List project cards + * @request GET:/projects/columns/{column_id}/cards */ - reposGetCommitSignatureProtection: ( - owner: string, - repo: string, - branch: string, + 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; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + this.request({ + path: \`/projects/columns/\${columnId}/cards\`, 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 **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 ReposCreateCommitSignatureProtection - * @summary Create commit signature protection - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags projects + * @name ProjectsCreateCard + * @summary Create a project card + * @request POST:/projects/columns/{column_id}/cards */ - reposCreateCommitSignatureProtection: ( - owner: string, - repo: string, - branch: string, + 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({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + 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", + 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. + * No description * - * @tags repos - * @name ReposDeleteCommitSignatureProtection - * @summary Delete commit signature protection - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures + * @tags projects + * @name ProjectsMoveColumn + * @summary Move a project column + * @request POST:/projects/columns/{column_id}/moves */ - reposDeleteCommitSignatureProtection: ( - owner: string, - repo: string, - branch: string, + 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}/branches/\${branch}/protection/required_signatures\`, - method: "DELETE", + this.request({ + path: \`/projects/columns/\${columnId}/moves\`, + 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 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 ReposGetStatusChecksProtection - * @summary Get status checks protection - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @tags projects + * @name ProjectsGet + * @summary Get a project + * @request GET:/projects/{project_id} */ - reposGetStatusChecksProtection: ( - owner: string, - repo: string, - branch: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + projectsGet: (projectId: number, params: RequestParams = {}) => + this.request({ + path: \`/projects/\${projectId}\`, 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 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 repos - * @name ReposUpdateStatusCheckProtection - * @summary Update status check protection - * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks + * @tags projects + * @name ProjectsUpdate + * @summary Update a project + * @request PATCH:/projects/{project_id} */ - reposUpdateStatusCheckProtection: ( - owner: string, - repo: string, - branch: string, + projectsUpdate: ( + projectId: number, 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; + /** + * 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 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}/branches/\${branch}/protection/required_status_checks\`, + this.request< + Project, + | BasicError + | { + documentation_url?: string; + errors?: string[]; + message?: string; + } + | void + | ValidationErrorSimple + >({ + path: \`/projects/\${projectId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -26464,237 +25901,365 @@ 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. - * - * @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. + * @description Deletes a project board. Returns a \`404 Not Found\` status if projects are disabled. * - * @tags repos - * @name ReposGetAllStatusCheckContexts - * @summary Get all status check contexts - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags projects + * @name ProjectsDelete + * @summary Delete a project + * @request DELETE:/projects/{project_id} */ - 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", + projectsDelete: (projectId: number, params: RequestParams = {}) => + this.request< + void, + | BasicError + | { + documentation_url?: string; + errors?: string[]; + message?: string; + } + >({ + path: \`/projects/\${projectId}\`, + 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 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 ReposAddStatusCheckContexts - * @summary Add status check contexts - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags projects + * @name ProjectsListCollaborators + * @summary List project collaborators + * @request GET:/projects/{project_id}/collaborators */ - reposAddStatusCheckContexts: ( - owner: string, - repo: string, - branch: string, - data: { - /** contexts parameter */ - contexts: 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 + */ + 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< + SimpleUser[], + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/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. + * @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 ReposSetStatusCheckContexts - * @summary Set status check contexts - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags projects + * @name ProjectsAddCollaborator + * @summary Add project collaborator + * @request PUT:/projects/{project_id}/collaborators/{username} */ - reposSetStatusCheckContexts: ( - owner: string, - repo: string, - branch: string, + projectsAddCollaborator: ( + projectId: number, + username: string, data: { - /** contexts parameter */ - contexts: string[]; + /** + * The permission to grant the collaborator. + * @default "write" + * @example "write" + */ + permission?: "read" | "write" | "admin"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + this.request< + void, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/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 Removes a collaborator from an organization project. You must be an organization owner or a project \`admin\` to remove a collaborator. * - * @tags repos - * @name ReposRemoveStatusCheckContexts - * @summary Remove status check contexts - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts + * @tags projects + * @name ProjectsRemoveCollaborator + * @summary Remove user as a collaborator + * @request DELETE:/projects/{project_id}/collaborators/{username} */ - reposRemoveStatusCheckContexts: ( - owner: string, - repo: string, - branch: string, - data: { - /** contexts parameter */ - contexts: string[]; - }, + projectsRemoveCollaborator: ( + projectId: number, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + this.request< + void, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators/\${username}\`, method: "DELETE", - 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 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 repos - * @name ReposGetAccessRestrictions - * @summary Get access restrictions - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @tags projects + * @name ProjectsGetPermissionForUser + * @summary Get project permission for a user + * @request GET:/projects/{project_id}/collaborators/{username}/permission */ - reposGetAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + projectsGetPermissionForUser: ( + projectId: number, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + this.request< + RepositoryCollaboratorPermission, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/projects/\${projectId}/collaborators/\${username}/permission\`, 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. + * No description * - * @tags repos - * @name ReposDeleteAccessRestrictions - * @summary Delete access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions + * @tags projects + * @name ProjectsListColumns + * @summary List project columns + * @request GET:/projects/{project_id}/columns */ - reposDeleteAccessRestrictions: ( - owner: string, - repo: string, - branch: string, + projectsListColumns: ( + projectId: 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}/branches/\${branch}/protection/restrictions\`, - method: "DELETE", + this.request({ + path: \`/projects/\${projectId}/columns\`, + 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. 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. + * No description * - * @tags repos - * @name ReposGetAppsWithAccessToProtectedBranch - * @summary Get apps with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @tags projects + * @name ProjectsCreateColumn + * @summary Create a project column + * @request POST:/projects/{project_id}/columns */ - reposGetAppsWithAccessToProtectedBranch: ( - owner: string, - repo: string, - branch: string, + projectsCreateColumn: ( + projectId: number, + data: { + /** + * Name of the project column + * @example "Remaining tasks" + */ + name: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + 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 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 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 ReposAddAppAccessRestrictions - * @summary Add app access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @name ReposGet + * @summary Get a repository + * @request GET:/repos/{owner}/{repo} */ - reposAddAppAccessRestrictions: ( - owner: string, - repo: string, - branch: string, - data: { - /** apps parameter */ - apps: string[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, - method: "POST", - body: data, - type: ContentType.Json, + reposGet: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: \`/repos/\${owner}/\${repo}\`, + 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 **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 ReposSetAppAccessRestrictions - * @summary Set app access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @name ReposUpdate + * @summary Update a repository + * @request PATCH:/repos/{owner}/{repo} */ - reposSetAppAccessRestrictions: ( + reposUpdate: ( owner: string, repo: string, - branch: string, data: { - /** apps parameter */ - apps: 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 + */ + 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}/branches/\${branch}/protection/restrictions/apps\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -26702,555 +26267,416 @@ 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 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 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 ReposRemoveAppAccessRestrictions - * @summary Remove app access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps + * @name ReposDelete + * @summary Delete a repository + * @request DELETE:/repos/{owner}/{repo} */ - reposRemoveAppAccessRestrictions: ( - owner: string, - repo: string, - branch: string, - data: { - /** apps parameter */ - apps: string[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + reposDelete: (owner: string, repo: string, params: RequestParams = {}) => + this.request< + void, + | { + documentation_url?: string; + message?: string; + } + | BasicError + >({ + path: \`/repos/\${owner}/\${repo}\`, method: "DELETE", - 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 teams who have push access to this branch. The list includes child teams. + * @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 ReposGetTeamsWithAccessToProtectedBranch - * @summary Get teams with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags actions + * @name ActionsListArtifactsForRepo + * @summary List artifacts for a repository + * @request GET:/repos/{owner}/{repo}/actions/artifacts */ - reposGetTeamsWithAccessToProtectedBranch: ( + actionsListArtifactsForRepo: ( owner: string, repo: string, - branch: 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/restrictions/teams\`, + this.request< + { + artifacts: Artifact[]; + total_count: number; + }, + any + >({ + 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. 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 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 ReposAddTeamAccessRestrictions - * @summary Add team access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags actions + * @name ActionsGetArtifact + * @summary Get an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - reposAddTeamAccessRestrictions: ( + actionsGetArtifact: ( owner: string, repo: string, - branch: string, - data: { - /** teams parameter */ - teams: string[]; - }, + artifactId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}\`, + 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 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 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 ReposSetTeamAccessRestrictions - * @summary Set team access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags actions + * @name ActionsDeleteArtifact + * @summary Delete an artifact + * @request DELETE:/repos/{owner}/{repo}/actions/artifacts/{artifact_id} */ - reposSetTeamAccessRestrictions: ( + actionsDeleteArtifact: ( owner: string, repo: string, - branch: string, - data: { - /** teams parameter */ - teams: string[]; - }, + artifactId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - 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. 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 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 ReposRemoveTeamAccessRestrictions - * @summary Remove team access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams + * @tags actions + * @name ActionsDownloadArtifact + * @summary Download an artifact + * @request GET:/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} */ - reposRemoveTeamAccessRestrictions: ( + actionsDownloadArtifact: ( owner: string, repo: string, - branch: string, - data: { - /** teams parameter */ - teams: string[]; - }, + artifactId: number, + archiveFormat: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, - method: "DELETE", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/artifacts/\${artifactId}/\${archiveFormat}\`, + 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. Lists the people who have push access to this branch. + * @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 ReposGetUsersWithAccessToProtectedBranch - * @summary Get users with access to the protected branch - * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags actions + * @name ActionsGetJobForWorkflowRun + * @summary Get a job for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id} */ - reposGetUsersWithAccessToProtectedBranch: ( + actionsGetJobForWorkflowRun: ( owner: string, repo: string, - branch: string, + jobId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/jobs/\${jobId}\`, 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. 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 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 ReposAddUserAccessRestrictions - * @summary Add user access restrictions - * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags actions + * @name ActionsDownloadJobLogsForWorkflowRun + * @summary Download job logs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/jobs/{job_id}/logs */ - reposAddUserAccessRestrictions: ( + actionsDownloadJobLogsForWorkflowRun: ( owner: string, repo: string, - branch: string, - data: { - /** users parameter */ - users: string[]; - }, + jobId: number, 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/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. 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 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 ReposSetUserAccessRestrictions - * @summary Set user access restrictions - * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags actions + * @name ActionsGetGithubActionsPermissionsRepository + * @summary Get GitHub Actions permissions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions */ - reposSetUserAccessRestrictions: ( + actionsGetGithubActionsPermissionsRepository: ( owner: string, repo: string, - branch: string, - data: { - /** users parameter */ - users: string[]; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + 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 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 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 ReposRemoveUserAccessRestrictions - * @summary Remove user access restrictions - * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users + * @tags actions + * @name ActionsSetGithubActionsPermissionsRepository + * @summary Set GitHub Actions permissions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions */ - reposRemoveUserAccessRestrictions: ( + actionsSetGithubActionsPermissionsRepository: ( owner: string, repo: string, - branch: string, data: { - /** users parameter */ - users: string[]; + /** 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({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions\`, + method: "PUT", 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 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 ReposRenameBranch - * @summary Rename a branch - * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename + * @tags actions + * @name ActionsGetAllowedActionsRepository + * @summary Get allowed actions for a repository + * @request GET:/repos/{owner}/{repo}/actions/permissions/selected-actions */ - reposRenameBranch: ( + actionsGetAllowedActionsRepository: ( owner: string, repo: string, - branch: string, - data: { - /** The new name of the branch. */ - new_name: string; - }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/branches/\${branch}/rename\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-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. 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 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 checks - * @name ChecksCreate - * @summary Create a check run - * @request POST:/repos/{owner}/{repo}/check-runs - */ - 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; + * @tags actions + * @name ActionsSetAllowedActionsRepository + * @summary Set allowed actions for a repository + * @request PUT:/repos/{owner}/{repo}/actions/permissions/selected-actions + */ + actionsSetAllowedActionsRepository: ( + owner: string, + repo: string, + data: SelectedActions, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/permissions/selected-actions\`, + method: "PUT", + body: data, + type: ContentType.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. + * + * @tags actions + * @name ActionsListSelfHostedRunnersForRepo + * @summary List self-hosted runners for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners + */ + actionsListSelfHostedRunnersForRepo: ( + owner: string, + repo: string, + query?: { /** - * The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. - * @default "queued" + * Page number of the results to fetch. + * @default 1 */ - status?: "queued" | "in_progress" | "completed"; + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + { + runners: Runner[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/runners\`, + 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. 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 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 checks - * @name ChecksGet - * @summary Get a check run - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} + * @tags actions + * @name ActionsListRunnerApplicationsForRepo + * @summary List runner applications for a repository + * @request GET:/repos/{owner}/{repo}/actions/runners/downloads */ - checksGet: ( + actionsListRunnerApplicationsForRepo: ( owner: string, repo: string, - checkRunId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/downloads\`, 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. 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 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 checks - * @name ChecksUpdate - * @summary Update a check run - * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} + * @tags actions + * @name ActionsCreateRegistrationTokenForRepo + * @summary Create a registration token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/registration-token */ - checksUpdate: ( + actionsCreateRegistrationTokenForRepo: ( owner: string, repo: string, - checkRunId: number, - data: ( - | { - status?: "completed"; - [key: string]: any; - } - | { - status?: "queued" | "in_progress"; - [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?: - | "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}/check-runs/\${checkRunId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/registration-token\`, + method: "POST", + 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 \`\`\` + * + * @tags actions + * @name ActionsCreateRemoveTokenForRepo + * @summary Create a remove token for a repository + * @request POST:/repos/{owner}/{repo}/actions/runners/remove-token + */ + actionsCreateRemoveTokenForRepo: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runners/remove-token\`, + method: "POST", + 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. + * + * @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 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 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. * - * @tags checks - * @name ChecksListAnnotations - * @summary List check run annotations - * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations + * @tags actions + * @name ActionsListWorkflowRunsForRepo + * @summary List workflow runs for a repository + * @request GET:/repos/{owner}/{repo}/actions/runs */ - checksListAnnotations: ( + actionsListWorkflowRunsForRepo: ( owner: string, repo: string, - checkRunId: number, 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 @@ -27261,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}/check-runs/\${checkRunId}/annotations\`, + this.request< + { + total_count: number; + workflow_runs: WorkflowRun[]; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/runs\`, method: "GET", query: query, format: "json", @@ -27273,106 +26707,59 @@ 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. - * - * @tags checks - * @name ChecksCreateSuite - * @summary Create a check suite - * @request POST:/repos/{owner}/{repo}/check-suites - */ - checksCreateSuite: ( - owner: string, - repo: string, - data: { - /** The sha of the head commit. */ - head_sha: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites\`, - method: "POST", - body: data, - type: ContentType.Json, - 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 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 checks - * @name ChecksSetSuitesPreferences - * @summary Update repository preferences for check suites - * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences + * @tags actions + * @name ActionsGetWorkflowRun + * @summary Get a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id} */ - checksSetSuitesPreferences: ( + actionsGetWorkflowRun: ( owner: string, repo: 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; - }[]; - }, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/preferences\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + 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 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 checks - * @name ChecksGetSuite - * @summary Get a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} + * @tags actions + * @name ActionsDeleteWorkflowRun + * @summary Delete a workflow run + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id} */ - checksGetSuite: ( + actionsDeleteWorkflowRun: ( owner: string, repo: string, - checkSuiteId: number, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}\`, + 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 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 checks - * @name ChecksListForSuite - * @summary List check runs in a check suite - * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs + * @tags actions + * @name ActionsListWorkflowRunArtifacts + * @summary List workflow run artifacts + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts */ - checksListForSuite: ( + actionsListWorkflowRunArtifacts: ( owner: string, repo: string, - checkSuiteId: number, + runId: 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 @@ -27383,19 +26770,17 @@ 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[]; + artifacts: Artifact[]; total_count: number; }, any >({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/check-runs\`, + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/artifacts\`, method: "GET", query: query, format: "json", @@ -27403,53 +26788,66 @@ 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 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 checks - * @name ChecksRerequestSuite - * @summary Rerequest a check suite - * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest + * @tags actions + * @name ActionsCancelWorkflowRun + * @summary Cancel a workflow run + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/cancel */ - checksRerequestSuite: ( + actionsCancelWorkflowRun: ( owner: string, repo: string, - checkSuiteId: number, + runId: number, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/cancel\`, 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. + * @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 code-scanning - * @name CodeScanningListAlertsForRepo - * @summary List code scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts + * @tags actions + * @name ActionsListJobsForWorkflowRun + * @summary List jobs for a workflow run + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/jobs */ - codeScanningListAlertsForRepo: ( + actionsListJobsForWorkflowRun: ( owner: string, repo: string, + runId: number, 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; + /** + * 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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => this.request< - CodeScanningAlertCodeScanningAlertItems[], - void | { - code?: string; - documentation_url?: string; - message?: string; - } + { + jobs: Job[]; + total_count: number; + }, + any >({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts\`, + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/jobs\`, method: "GET", query: query, format: "json", @@ -27457,154 +26855,98 @@ 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 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 code-scanning - * @name CodeScanningGetAlert - * @summary Get a code scanning alert - * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @tags actions + * @name ActionsDownloadWorkflowRunLogs + * @summary Download workflow run logs + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - codeScanningGetAlert: ( + actionsDownloadWorkflowRunLogs: ( owner: string, repo: string, - alertNumber: number, + runId: 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: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, 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 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 code-scanning - * @name CodeScanningUpdateAlert - * @summary Update a code scanning alert - * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} + * @tags actions + * @name ActionsDeleteWorkflowRunLogs + * @summary Delete workflow run logs + * @request DELETE:/repos/{owner}/{repo}/actions/runs/{run_id}/logs */ - codeScanningUpdateAlert: ( + actionsDeleteWorkflowRunLogs: ( 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; - }, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/logs\`, + method: "DELETE", ...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 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 code-scanning - * @name CodeScanningListRecentAnalyses - * @summary List recent code scanning analyses for a repository - * @request GET:/repos/{owner}/{repo}/code-scanning/analyses + * @tags actions + * @name ActionsReRunWorkflow + * @summary Re-run a workflow + * @request POST:/repos/{owner}/{repo}/actions/runs/{run_id}/rerun */ - codeScanningListRecentAnalyses: ( + actionsReRunWorkflow: ( 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; - }, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/analyses\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/rerun\`, + method: "POST", ...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 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 code-scanning - * @name CodeScanningUploadSarif - * @summary Upload a SARIF file - * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs + * @tags actions + * @name ActionsGetWorkflowRunUsage + * @summary Get workflow run usage + * @request GET:/repos/{owner}/{repo}/actions/runs/{run_id}/timing */ - codeScanningUploadSarif: ( + actionsGetWorkflowRunUsage: ( owner: string, repo: 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; - }, + runId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/code-scanning/sarifs\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/runs/\${runId}/timing\`, + method: "GET", + 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 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 ReposListCollaborators - * @summary List repository collaborators - * @request GET:/repos/{owner}/{repo}/collaborators + * @tags actions + * @name ActionsListRepoSecrets + * @summary List repository secrets + * @request GET:/repos/{owner}/{repo}/actions/secrets */ - reposListCollaborators: ( + actionsListRepoSecrets: ( 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 @@ -27618,8 +26960,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators\`, + this.request< + { + secrets: ActionsSecret[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/secrets\`, method: "GET", query: query, format: "json", @@ -27627,112 +26975,103 @@ export class Api< }), /** - * @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 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 ReposCheckCollaborator - * @summary Check if a user is a repository collaborator - * @request GET:/repos/{owner}/{repo}/collaborators/{username} + * @tags actions + * @name ActionsGetRepoPublicKey + * @summary Get a repository public key + * @request GET:/repos/{owner}/{repo}/actions/secrets/public-key */ - reposCheckCollaborator: ( + actionsGetRepoPublicKey: ( owner: string, repo: string, - username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/public-key\`, 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. + * @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 ReposAddCollaborator - * @summary Add a repository collaborator - * @request PUT:/repos/{owner}/{repo}/collaborators/{username} + * @tags actions + * @name ActionsGetRepoSecret + * @summary Get a repository secret + * @request GET:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - reposAddCollaborator: ( + actionsGetRepoSecret: ( owner: string, repo: 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; - }, + secretName: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, - method: "PUT", - 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 repos - * @name ReposRemoveCollaborator - * @summary Remove a repository collaborator - * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} + * @tags actions + * @name ActionsCreateOrUpdateRepoSecret + * @summary Create or update a repository secret + * @request PUT:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - reposRemoveCollaborator: ( + actionsCreateOrUpdateRepoSecret: ( owner: string, repo: string, - username: 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; + }, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, - method: "DELETE", + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + method: "PUT", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. + * @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 ReposGetCollaboratorPermissionLevel - * @summary Get repository permissions for a user - * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission + * @tags actions + * @name ActionsDeleteRepoSecret + * @summary Delete a repository secret + * @request DELETE:/repos/{owner}/{repo}/actions/secrets/{secret_name} */ - reposGetCollaboratorPermissionLevel: ( + actionsDeleteRepoSecret: ( owner: string, repo: string, - username: string, + secretName: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/secrets/\${secretName}\`, + 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 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 ReposListCommitCommentsForRepo - * @summary List commit comments for a repository - * @request GET:/repos/{owner}/{repo}/comments + * @tags actions + * @name ActionsListRepoWorkflows + * @summary List repository workflows + * @request GET:/repos/{owner}/{repo}/actions/workflows */ - reposListCommitCommentsForRepo: ( + actionsListRepoWorkflows: ( owner: string, repo: string, query?: { @@ -27749,8 +27088,14 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments\`, + this.request< + { + total_count: number; + workflows: Workflow[]; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/actions/workflows\`, method: "GET", query: query, format: "json", @@ -27758,96 +27103,113 @@ export class Api< }), /** - * No description + * @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 ReposGetCommitComment - * @summary Get a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id} + * @tags actions + * @name ActionsGetWorkflow + * @summary Get a workflow + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id} + */ + actionsGetWorkflow: ( + owner: string, + repo: string, + workflowId: number | string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}\`, + 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. + * + * @tags actions + * @name ActionsDisableWorkflow + * @summary Disable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable */ - reposGetCommitComment: ( + actionsDisableWorkflow: ( owner: string, repo: string, - commentId: number, + workflowId: number | string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/disable\`, + method: "PUT", ...params, }), /** - * No description + * @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 ReposUpdateCommitComment - * @summary Update a commit comment - * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} + * @tags actions + * @name ActionsCreateWorkflowDispatch + * @summary Create a workflow dispatch event + * @request POST:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches */ - reposUpdateCommitComment: ( + actionsCreateWorkflowDispatch: ( owner: string, repo: string, - commentId: number, + workflowId: number | string, data: { - /** The contents of the comment */ - body: string; + /** 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}/comments/\${commentId}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/dispatches\`, + method: "POST", body: data, type: ContentType.Json, - format: "json", ...params, }), /** - * No description + * @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 ReposDeleteCommitComment - * @summary Delete a commit comment - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} + * @tags actions + * @name ActionsEnableWorkflow + * @summary Enable a workflow + * @request PUT:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable */ - reposDeleteCommitComment: ( + actionsEnableWorkflow: ( owner: string, repo: string, - commentId: number, + workflowId: number | string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/enable\`, + method: "PUT", ...params, }), /** - * @description List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#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 reactions - * @name ReactionsListForCommitComment - * @summary List reactions for a commit comment - * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @tags actions + * @name ActionsListWorkflowRuns + * @summary List workflow runs + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs */ - reactionsListForCommitComment: ( + actionsListWorkflowRuns: ( owner: string, repo: string, - commentId: number, + workflowId: number | 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 commit comment. */ - content?: - | "+1" - | "-1" - | "laugh" - | "confused" - | "heart" - | "hooray" - | "rocket" - | "eyes"; + /** 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 @@ -27858,18 +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< - Reaction[], - | BasicError - | { - documentation_url: string; - message: string; - } + { + total_count: number; + workflow_runs: WorkflowRun[]; + }, + any >({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/runs\`, method: "GET", query: query, format: "json", @@ -27877,105 +27240,53 @@ 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 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 reactions - * @name ReactionsCreateForCommitComment - * @summary Create reaction for a commit comment - * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions + * @tags actions + * @name ActionsGetWorkflowUsage + * @summary Get workflow usage + * @request GET:/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing */ - reactionsCreateForCommitComment: ( + actionsGetWorkflowUsage: ( 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"; - }, + workflowId: number | string, params: RequestParams = {}, ) => - this.request< - Reaction, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/actions/workflows/\${workflowId}/timing\`, + method: "GET", format: "json", ...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). - * - * @tags reactions - * @name ReactionsDeleteForCommitComment - * @summary Delete a commit comment reaction - * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} - */ - reactionsDeleteForCommitComment: ( - owner: string, - repo: string, - commentId: number, - reactionId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", - ...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 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 ReposListCommits - * @summary List commits - * @request GET:/repos/{owner}/{repo}/commits + * @tags issues + * @name IssuesListAssignees + * @summary List assignees + * @request GET:/repos/{owner}/{repo}/assignees */ - reposListCommits: ( + issuesListAssignees: ( owner: string, repo: string, 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}/commits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/assignees\`, method: "GET", query: query, format: "json", @@ -27983,45 +27294,74 @@ 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. Returns all branches where the given commit SHA is the HEAD, or latest commit for the 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 ReposListBranchesForHeadCommit - * @summary List branches for HEAD commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head + * @tags issues + * @name IssuesCheckUserCanBeAssigned + * @summary Check if a user can be assigned + * @request GET:/repos/{owner}/{repo}/assignees/{assignee} */ - reposListBranchesForHeadCommit: ( + issuesCheckUserCanBeAssigned: ( owner: string, repo: string, - commitSha: string, + assignee: string, params: RequestParams = {}, ) => - this.request< - BranchShort[], - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/branches-where-head\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/assignees/\${assignee}\`, method: "GET", - format: "json", ...params, }), /** - * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. + * @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 + */ + reposEnableAutomatedSecurityFixes: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + method: "PUT", + ...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)". + * + * @tags repos + * @name ReposDisableAutomatedSecurityFixes + * @summary Disable automated security fixes + * @request DELETE:/repos/{owner}/{repo}/automated-security-fixes + */ + reposDisableAutomatedSecurityFixes: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/automated-security-fixes\`, + method: "DELETE", + ...params, + }), + + /** + * No description * * @tags repos - * @name ReposListCommentsForCommit - * @summary List commit comments - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @name ReposListBranches + * @summary List branches + * @request GET:/repos/{owner}/{repo}/branches */ - reposListCommentsForCommit: ( + reposListBranches: ( owner: string, repo: string, - commitSha: string, query?: { /** * Page number of the results to fetch. @@ -28033,11 +27373,13 @@ 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}/commits/\${commitSha}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches\`, method: "GET", query: query, format: "json", @@ -28045,437 +27387,394 @@ 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. + * No description * * @tags repos - * @name ReposCreateCommitComment - * @summary Create a commit comment - * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments + * @name ReposGetBranch + * @summary Get a branch + * @request GET:/repos/{owner}/{repo}/branches/{branch} */ - reposCreateCommitComment: ( + reposGetBranch: ( owner: string, repo: string, - commitSha: 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; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + BranchWithProtection, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}\`, + method: "GET", 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. + * @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 ReposListPullRequestsAssociatedWithCommit - * @summary List pull requests associated with a commit - * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls + * @name ReposGetBranchProtection + * @summary Get branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection */ - reposListPullRequestsAssociatedWithCommit: ( + reposGetBranchProtection: ( 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 - */ - per_page?: number; + branch: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + 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. 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: 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; }, params: RequestParams = {}, ) => this.request< - PullRequestSimple[], - { - documentation_url: string; - message: string; - } + ProtectedBranch, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationErrorSimple >({ - path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/pulls\`, - method: "GET", - query: query, + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + method: "PUT", + 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 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 ReposGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/commits/{ref} + * @name ReposDeleteBranchProtection + * @summary Delete branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection */ - reposGetCommit: ( + reposDeleteBranchProtection: ( owner: string, repo: string, - ref: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection\`, + 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 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 checks - * @name ChecksListForRef - * @summary List check runs for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs + * @tags repos + * @name ReposGetAdminBranchProtection + * @summary Get admin branch protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - checksListForRef: ( + reposGetAdminBranchProtection: ( 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"; - }, + branch: string, params: RequestParams = {}, ) => - this.request< - { - check_runs: CheckRun[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, 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. + * @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 checks - * @name ChecksListSuitesForRef - * @summary List check suites for a Git reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites + * @tags repos + * @name ReposSetAdminBranchProtection + * @summary Set admin branch protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - checksListSuitesForRef: ( + reposSetAdminBranchProtection: ( 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 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + branch: string, params: RequestParams = {}, ) => - this.request< - { - check_suites: CheckSuite[]; - total_count: number; - }, - any - >({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-suites\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + method: "POST", format: "json", ...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 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 ReposGetCombinedStatusForRef - * @summary Get the combined status for a specific reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/status + * @name ReposDeleteAdminBranchProtection + * @summary Delete admin branch protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ - reposGetCombinedStatusForRef: ( + reposDeleteAdminBranchProtection: ( owner: string, repo: string, - ref: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/status\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/enforce_admins\`, + 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 ReposGetPullRequestReviewProtection + * @summary Get pull request review protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews + */ + reposGetPullRequestReviewProtection: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, 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 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 ReposListCommitStatusesForRef - * @summary List commit statuses for a reference - * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses + * @name ReposUpdatePullRequestReviewProtection + * @summary Update pull request review protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - reposListCommitStatusesForRef: ( + reposUpdatePullRequestReviewProtection: ( 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; + 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; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/commits/\${ref}/statuses\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + 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 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 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 ReposDeletePullRequestReviewProtection + * @summary Delete pull request review protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews */ - codesOfConductGetForRepo: ( + reposDeletePullRequestReviewProtection: ( owner: string, repo: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_pull_request_reviews\`, + 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 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 ReposGetCommunityProfileMetrics - * @summary Get community profile metrics - * @request GET:/repos/{owner}/{repo}/community/profile + * @name ReposGetCommitSignatureProtection + * @summary Get commit signature protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - reposGetCommunityProfileMetrics: ( + reposGetCommitSignatureProtection: ( owner: string, repo: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/community/profile\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, method: "GET", 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 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 ReposCompareCommits - * @summary Compare two commits - * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} + * @name ReposCreateCommitSignatureProtection + * @summary Create commit signature protection + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - reposCompareCommits: ( + reposCreateCommitSignatureProtection: ( owner: string, repo: string, - base: string, - head: string, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "POST", 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 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 ReposGetContent - * @summary Get repository content - * @request GET:/repos/{owner}/{repo}/contents/{path} + * @name ReposDeleteCommitSignatureProtection + * @summary Delete commit signature protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures */ - reposGetContent: ( + reposDeleteCommitSignatureProtection: ( owner: string, repo: string, - path: string, - query?: { - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: string; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_signatures\`, + method: "DELETE", ...params, }), /** - * @description Creates a new file or replaces an existing file in 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 repos - * @name ReposCreateOrUpdateFileContents - * @summary Create or update file contents - * @request PUT:/repos/{owner}/{repo}/contents/{path} + * @name ReposGetStatusChecksProtection + * @summary Get status checks protection + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - reposCreateOrUpdateFileContents: ( + reposGetStatusChecksProtection: ( 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; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + method: "GET", 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 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 ReposDeleteFile - * @summary Delete a file - * @request DELETE:/repos/{owner}/{repo}/contents/{path} + * @name ReposUpdateStatusCheckProtection + * @summary Update status check protection + * @request PATCH:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - reposDeleteFile: ( + reposUpdateStatusCheckProtection: ( owner: string, repo: string, - path: string, + branch: 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; + /** 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< - FileCommit, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -28483,157 +27782,66 @@ export class Api< }), /** - * @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 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 ReposListContributors - * @summary List repository contributors - * @request GET:/repos/{owner}/{repo}/contributors + * @name ReposRemoveStatusCheckProtection + * @summary Remove status check protection + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ - reposListContributors: ( + reposRemoveStatusCheckProtection: ( 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; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/contributors\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks\`, + method: "DELETE", ...params, }), /** - * @description Simple filtering of deployments is available via query parameters: + * @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 ReposListDeployments - * @summary List deployments - * @request GET:/repos/{owner}/{repo}/deployments + * @name ReposGetAllStatusCheckContexts + * @summary Get all status check contexts + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - reposListDeployments: ( + reposGetAllStatusCheckContexts: ( 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; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, 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 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 ReposCreateDeployment - * @summary Create a deployment - * @request POST:/repos/{owner}/{repo}/deployments + * @name ReposAddStatusCheckContexts + * @summary Add status check contexts + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - reposCreateDeployment: ( + reposAddStatusCheckContexts: ( owner: string, repo: string, + branch: 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; + /** contexts parameter */ + contexts: string[]; }, 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\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, method: "POST", body: data, type: ContentType.Json, @@ -28642,290 +27850,243 @@ 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 ReposGetDeployment - * @summary Get a deployment - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} + * @name ReposSetStatusCheckContexts + * @summary Set status check contexts + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - reposGetDeployment: ( + reposSetStatusCheckContexts: ( owner: string, repo: string, - deploymentId: number, + branch: string, + data: { + /** contexts parameter */ + contexts: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, + method: "PUT", + body: data, + type: ContentType.Json, 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 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 ReposDeleteDeployment - * @summary Delete a deployment - * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} + * @name ReposRemoveStatusCheckContexts + * @summary Remove status check contexts + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts */ - reposDeleteDeployment: ( + reposRemoveStatusCheckContexts: ( owner: string, repo: string, - deploymentId: number, + branch: string, + data: { + /** contexts parameter */ + contexts: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/required_status_checks/contexts\`, method: "DELETE", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Users with pull access can view deployment statuses for a deployment: + * @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 ReposListDeploymentStatuses - * @summary List deployment statuses - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @name ReposGetAccessRestrictions + * @summary Get access restrictions + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions */ - reposListDeploymentStatuses: ( + reposGetAccessRestrictions: ( owner: string, repo: string, - deploymentId: number, - 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}/deployments/\${deploymentId}/statuses\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, method: "GET", - query: query, 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 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 + */ + reposDeleteAccessRestrictions: ( + owner: string, + repo: string, + branch: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions\`, + 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. * * @tags repos - * @name ReposCreateDeploymentStatus - * @summary Create a deployment status - * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses + * @name ReposGetAppsWithAccessToProtectedBranch + * @summary Get apps with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - reposCreateDeploymentStatus: ( + reposGetAppsWithAccessToProtectedBranch: ( 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; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "GET", format: "json", ...params, }), /** - * @description Users with pull access can view a deployment status for a deployment: + * @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 ReposGetDeploymentStatus - * @summary Get a deployment status - * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} + * @name ReposAddAppAccessRestrictions + * @summary Add app access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - reposGetDeploymentStatus: ( + reposAddAppAccessRestrictions: ( owner: string, repo: string, - deploymentId: number, - statusId: number, + branch: string, + data: { + /** apps parameter */ + apps: string[]; + }, 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}/branches/\${branch}/protection/restrictions/apps\`, + method: "POST", + body: data, + type: ContentType.Json, 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 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 ReposCreateDispatchEvent - * @summary Create a repository dispatch event - * @request POST:/repos/{owner}/{repo}/dispatches + * @name ReposSetAppAccessRestrictions + * @summary Set app access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - reposCreateDispatchEvent: ( + reposSetAppAccessRestrictions: ( owner: string, repo: string, + branch: 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; + /** apps parameter */ + apps: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/dispatches\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "PUT", 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. 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 activity - * @name ActivityListRepoEvents - * @summary List repository events - * @request GET:/repos/{owner}/{repo}/events + * @tags repos + * @name ReposRemoveAppAccessRestrictions + * @summary Remove app access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps */ - activityListRepoEvents: ( + reposRemoveAppAccessRestrictions: ( 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: { + /** apps parameter */ + apps: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/events\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/apps\`, + method: "DELETE", + 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. Lists the teams who have push access to this branch. The list includes child teams. * * @tags repos - * @name ReposListForks - * @summary List forks - * @request GET:/repos/{owner}/{repo}/forks + * @name ReposGetTeamsWithAccessToProtectedBranch + * @summary Get teams with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - reposListForks: ( + reposGetTeamsWithAccessToProtectedBranch: ( 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; - /** - * The sort order. Can be either \`newest\`, \`oldest\`, or \`stargazers\`. - * @default "newest" - */ - sort?: "newest" | "oldest" | "stargazers"; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/forks\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, method: "GET", - query: query, 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 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 ReposCreateFork - * @summary Create a fork - * @request POST:/repos/{owner}/{repo}/forks + * @name ReposAddTeamAccessRestrictions + * @summary Add team access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - reposCreateFork: ( + reposAddTeamAccessRestrictions: ( owner: string, repo: string, + branch: string, data: { - /** Optional parameter to specify the organization name if forking into an organization. */ - organization?: string; + /** teams parameter */ + teams: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/forks\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, method: "POST", body: data, type: ContentType.Json, @@ -28934,30 +28095,26 @@ 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. 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 git - * @name GitCreateBlob - * @summary Create a blob - * @request POST:/repos/{owner}/{repo}/git/blobs + * @tags repos + * @name ReposSetTeamAccessRestrictions + * @summary Set team access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - gitCreateBlob: ( + reposSetTeamAccessRestrictions: ( owner: string, repo: string, + branch: string, data: { - /** The new blob's content. */ - content: string; - /** - * The encoding used for \`content\`. Currently, \`"utf-8"\` and \`"base64"\` are supported. - * @default "utf-8" - */ - encoding?: string; + /** teams parameter */ + teams: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/blobs\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -28965,175 +28122,154 @@ export class Api< }), /** - * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. + * @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 git - * @name GitGetBlob - * @summary Get a blob - * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} + * @tags repos + * @name ReposRemoveTeamAccessRestrictions + * @summary Remove team access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams */ - gitGetBlob: ( + reposRemoveTeamAccessRestrictions: ( owner: string, repo: string, - fileSha: string, + branch: string, + data: { + /** teams parameter */ + teams: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/teams\`, + method: "DELETE", + body: data, + type: ContentType.Json, 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 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 git - * @name GitCreateCommit - * @summary Create a commit - * @request POST:/repos/{owner}/{repo}/git/commits + * @tags repos + * @name ReposGetUsersWithAccessToProtectedBranch + * @summary Get users with access to the protected branch + * @request GET:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - gitCreateCommit: ( + reposGetUsersWithAccessToProtectedBranch: ( 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; - }, + branch: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/commits\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + 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 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 git - * @name GitGetCommit - * @summary Get a commit - * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} + * @tags repos + * @name ReposAddUserAccessRestrictions + * @summary Add user access restrictions + * @request POST:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - gitGetCommit: ( + reposAddUserAccessRestrictions: ( owner: string, repo: string, - commitSha: string, + branch: string, + data: { + /** users parameter */ + users: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "POST", + body: data, + type: ContentType.Json, 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 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 git - * @name GitListMatchingRefs - * @summary List matching references - * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} + * @tags repos + * @name ReposSetUserAccessRestrictions + * @summary Set user access restrictions + * @request PUT:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - gitListMatchingRefs: ( + reposSetUserAccessRestrictions: ( 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; + branch: string, + data: { + /** users parameter */ + users: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, - 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 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 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 git - * @name GitGetRef - * @summary Get a reference - * @request GET:/repos/{owner}/{repo}/git/ref/{ref} + * @tags repos + * @name ReposRemoveUserAccessRestrictions + * @summary Remove user access restrictions + * @request DELETE:/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users */ - gitGetRef: ( + reposRemoveUserAccessRestrictions: ( owner: string, repo: string, - ref: string, + branch: string, + data: { + /** users parameter */ + users: string[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/protection/restrictions/users\`, + method: "DELETE", + body: data, + type: ContentType.Json, 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 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 git - * @name GitCreateRef - * @summary Create a reference - * @request POST:/repos/{owner}/{repo}/git/refs + * @tags repos + * @name ReposRenameBranch + * @summary Rename a branch + * @request POST:/repos/{owner}/{repo}/branches/{branch}/rename */ - gitCreateRef: ( + reposRenameBranch: ( owner: string, repo: string, + branch: 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; + /** The new name of the branch. */ + new_name: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/branches/\${branch}/rename\`, method: "POST", body: data, type: ContentType.Json, @@ -29142,91 +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 git - * @name GitUpdateRef - * @summary Update a reference - * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + * @tags checks + * @name ChecksCreate + * @summary Create a check run + * @request POST:/repos/{owner}/{repo}/check-runs */ - gitUpdateRef: ( + checksCreate: ( owner: string, repo: string, - ref: string, - data: { + 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; /** - * 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 + * The current status. Can be one of \`queued\`, \`in_progress\`, or \`completed\`. + * @default "queued" */ - force?: boolean; - /** The SHA1 value to set this reference to */ - sha: string; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * No description - * - * @tags git - * @name GitDeleteRef - * @summary Delete a reference - * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} - */ - gitDeleteRef: ( - owner: string, - repo: string, - ref: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, - 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. | - * - * @tags git - * @name GitCreateTag - * @summary Create a tag object - * @request POST:/repos/{owner}/{repo}/git/tags - */ - gitCreateTag: ( - 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"; + status?: "queued" | "in_progress" | "completed"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/tags\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs\`, method: "POST", body: data, type: ContentType.Json, @@ -29235,113 +28409,165 @@ export class Api< }), /** - * @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 **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 git - * @name GitGetTag - * @summary Get a tag - * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} + * @tags checks + * @name ChecksGet + * @summary Get a check run + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - gitGetTag: ( + checksGet: ( owner: string, repo: string, - tagSha: string, + checkRunId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, 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 **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 git - * @name GitCreateTree - * @summary Create a tree - * @request POST:/repos/{owner}/{repo}/git/trees + * @tags checks + * @name ChecksUpdate + * @summary Update a check run + * @request PATCH:/repos/{owner}/{repo}/check-runs/{check_run_id} */ - gitCreateTree: ( + checksUpdate: ( owner: string, repo: string, - data: { + checkRunId: number, + data: ( + | { + status?: "completed"; + [key: string]: any; + } + | { + status?: "queued" | "in_progress"; + [key: string]: any; + } + ) & { /** - * 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. + * 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 */ - base_tree?: string; - /** Objects (of \`path\`, \`mode\`, \`type\`, and \`sha\`) specifying a tree structure. */ - tree: { + actions?: { /** - * 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. + * A short explanation of what this action would do. The maximum size is 40 characters. + * @maxLength 40 */ - 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; + description: 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. + * A reference for the action on the integrator's system. The maximum size is 20 characters. + * @maxLength 20 */ - sha?: string | null; - /** Either \`blob\`, \`tree\`, or \`commit\`. */ - type?: "blob" | "tree" | "commit"; + 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}/git/trees\`, - 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. - * - * @tags git - * @name GitGetTree - * @summary Get a tree - * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} - */ - gitGetTree: ( - 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; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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 ReposListWebhooks - * @summary List repository webhooks - * @request GET:/repos/{owner}/{repo}/hooks + * @tags checks + * @name ChecksListAnnotations + * @summary List check run annotations + * @request GET:/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations */ - reposListWebhooks: ( + checksListAnnotations: ( owner: string, repo: string, + checkRunId: number, query?: { /** * Page number of the results to fetch. @@ -29356,8 +28582,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-runs/\${checkRunId}/annotations\`, method: "GET", query: query, format: "json", @@ -29365,49 +28591,24 @@ 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. + * @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 ReposCreateWebhook - * @summary Create a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks + * @tags checks + * @name ChecksCreateSuite + * @summary Create a check suite + * @request POST:/repos/{owner}/{repo}/check-suites */ - reposCreateWebhook: ( + checksCreateSuite: ( 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; + /** The sha of the head commit. */ + head_sha: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites\`, method: "POST", body: data, type: ContentType.Json, @@ -29416,73 +28617,32 @@ export class Api< }), /** - * @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} - */ - reposGetWebhook: ( - owner: string, - repo: string, - hookId: number, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, - 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 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 ReposUpdateWebhook - * @summary Update a repository webhook - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} + * @tags checks + * @name ChecksSetSuitesPreferences + * @summary Update repository preferences for check suites + * @request PATCH:/repos/{owner}/{repo}/check-suites/preferences */ - reposUpdateWebhook: ( + checksSetSuitesPreferences: ( owner: string, repo: string, - hookId: number, data: { - /** - * 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[]; + /** 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}/hooks/\${hookId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/preferences\`, method: "PATCH", body: data, type: ContentType.Json, @@ -29491,167 +28651,182 @@ export class Api< }), /** - * No description - * - * @tags repos - * @name ReposDeleteWebhook - * @summary Delete a repository webhook - * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} - */ - 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. + * @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 ReposGetWebhookConfigForRepo - * @summary Get a webhook configuration for a repository - * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @tags checks + * @name ChecksGetSuite + * @summary Get a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id} */ - reposGetWebhookConfigForRepo: ( + checksGetSuite: ( owner: string, repo: string, - hookId: number, + checkSuiteId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}\`, 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. + * @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 ReposUpdateWebhookConfigForRepo - * @summary Update a webhook configuration for a repository - * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config + * @tags checks + * @name ChecksListForSuite + * @summary List check runs in a check suite + * @request GET:/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs */ - reposUpdateWebhookConfigForRepo: ( + checksListForSuite: ( 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; + 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 + */ + 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({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, - method: "PATCH", - body: data, - type: ContentType.Json, + params: RequestParams = {}, + ) => + this.request< + { + check_runs: CheckRun[]; + total_count: number; + }, + any + >({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/check-runs\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. + * @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 ReposPingWebhook - * @summary Ping a repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings + * @tags checks + * @name ChecksRerequestSuite + * @summary Rerequest a check suite + * @request POST:/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest */ - reposPingWebhook: ( + checksRerequestSuite: ( owner: string, repo: string, - hookId: number, + checkSuiteId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/check-suites/\${checkSuiteId}/rerequest\`, method: "POST", ...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\` + * @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 ReposTestPushWebhook - * @summary Test the push repository webhook - * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests + * @tags code-scanning + * @name CodeScanningListAlertsForRepo + * @summary List code scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts */ - reposTestPushWebhook: ( + codeScanningListAlertsForRepo: ( owner: string, repo: string, - hookId: number, + 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; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, - method: "POST", + this.request< + CodeScanningAlertCodeScanningAlertItems[], + void | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts\`, + method: "GET", + query: query, + 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 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 migrations - * @name MigrationsGetImportStatus - * @summary Get an import status - * @request GET:/repos/{owner}/{repo}/import + * @tags code-scanning + * @name CodeScanningGetAlert + * @summary Get a code scanning alert + * @request GET:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - migrationsGetImportStatus: ( + codeScanningGetAlert: ( owner: string, repo: string, + alertNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, + 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 Start a source import to a GitHub repository using GitHub Importer. + * @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 migrations - * @name MigrationsStartImport - * @summary Start an import - * @request PUT:/repos/{owner}/{repo}/import + * @tags code-scanning + * @name CodeScanningUpdateAlert + * @summary Update a code scanning alert + * @request PATCH:/repos/{owner}/{repo}/code-scanning/alerts/{alert_number} */ - migrationsStartImport: ( + codeScanningUpdateAlert: ( owner: string, repo: string, + alertNumber: AlertNumber, 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; + /** **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}/import\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/alerts/\${alertNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -29659,106 +28834,167 @@ 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 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 migrations - * @name MigrationsUpdateImport - * @summary Update an import - * @request PATCH:/repos/{owner}/{repo}/import + * @tags code-scanning + * @name CodeScanningListRecentAnalyses + * @summary List recent code scanning analyses for a repository + * @request GET:/repos/{owner}/{repo}/code-scanning/analyses */ - migrationsUpdateImport: ( + codeScanningListRecentAnalyses: ( 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; + 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}/import\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/analyses\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Stop an import for a repository. + * @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 migrations - * @name MigrationsCancelImport - * @summary Cancel an import - * @request DELETE:/repos/{owner}/{repo}/import + * @tags code-scanning + * @name CodeScanningUploadSarif + * @summary Upload a SARIF file + * @request POST:/repos/{owner}/{repo}/code-scanning/sarifs */ - migrationsCancelImport: ( + codeScanningUploadSarif: ( owner: string, repo: 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; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/code-scanning/sarifs\`, + method: "POST", + body: data, + type: ContentType.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 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 migrations - * @name MigrationsGetCommitAuthors - * @summary Get commit authors - * @request GET:/repos/{owner}/{repo}/import/authors + * @tags repos + * @name ReposListCollaborators + * @summary List repository collaborators + * @request GET:/repos/{owner}/{repo}/collaborators */ - migrationsGetCommitAuthors: ( + reposListCollaborators: ( owner: string, repo: string, query?: { - /** A user ID. Only return users with an ID greater than this ID. */ - since?: 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" + */ + affiliation?: "outside" | "direct" | "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}/import/authors\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators\`, + method: "GET", + query: query, + 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. + * + * @tags repos + * @name ReposCheckCollaborator + * @summary Check if a user is a repository collaborator + * @request GET:/repos/{owner}/{repo}/collaborators/{username} + */ + reposCheckCollaborator: ( + owner: string, + repo: string, + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, method: "GET", - query: query, - 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 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 migrations - * @name MigrationsMapCommitAuthor - * @summary Map a commit author - * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} + * @tags repos + * @name ReposAddCollaborator + * @summary Add a repository collaborator + * @request PUT:/repos/{owner}/{repo}/collaborators/{username} */ - migrationsMapCommitAuthor: ( + reposAddCollaborator: ( owner: string, repo: string, - authorId: number, + username: string, data: { - /** The new Git author email. */ - email?: string; - /** The new Git author name. */ - name?: string; - /** @example ""can't touch this"" */ - remote_id?: 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" + */ + permission?: "pull" | "push" | "admin" | "maintain" | "triage"; + /** @example ""push"" */ + permissions?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -29766,108 +29002,121 @@ export class Api< }), /** - * @description List files larger than 100MB found during the import + * No description * - * @tags migrations - * @name MigrationsGetLargeFiles - * @summary Get large files - * @request GET:/repos/{owner}/{repo}/import/large_files + * @tags repos + * @name ReposRemoveCollaborator + * @summary Remove a repository collaborator + * @request DELETE:/repos/{owner}/{repo}/collaborators/{username} */ - migrationsGetLargeFiles: ( + reposRemoveCollaborator: ( owner: string, repo: string, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/large_files\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}\`, + method: "DELETE", ...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 Checks the repository permission of a collaborator. The possible repository permissions are \`admin\`, \`write\`, \`read\`, and \`none\`. * - * @tags migrations - * @name MigrationsSetLfsPreference - * @summary Update Git LFS preference - * @request PATCH:/repos/{owner}/{repo}/import/lfs + * @tags repos + * @name ReposGetCollaboratorPermissionLevel + * @summary Get repository permissions for a user + * @request GET:/repos/{owner}/{repo}/collaborators/{username}/permission */ - migrationsSetLfsPreference: ( + reposGetCollaboratorPermissionLevel: ( owner: string, repo: 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"; - }, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/import/lfs\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/collaborators/\${username}/permission\`, + method: "GET", format: "json", ...params, }), /** - * @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 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 apps - * @name AppsGetRepoInstallation - * @summary Get a repository installation for the authenticated app - * @request GET:/repos/{owner}/{repo}/installation + * @tags repos + * @name ReposListCommitCommentsForRepo + * @summary List commit comments for a repository + * @request GET:/repos/{owner}/{repo}/comments */ - appsGetRepoInstallation: ( + 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}/installation\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments\`, method: "GET", + query: query, 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. + * No description * - * @tags interactions - * @name InteractionsGetRestrictionsForRepo - * @summary Get interaction restrictions for a repository - * @request GET:/repos/{owner}/{repo}/interaction-limits + * @tags repos + * @name ReposGetCommitComment + * @summary Get a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id} */ - interactionsGetRestrictionsForRepo: ( + reposGetCommitComment: ( owner: string, repo: string, + commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, 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. + * No description * - * @tags interactions - * @name InteractionsSetRestrictionsForRepo - * @summary Set interaction restrictions for a repository - * @request PUT:/repos/{owner}/{repo}/interaction-limits + * @tags repos + * @name ReposUpdateCommitComment + * @summary Update a commit comment + * @request PATCH:/repos/{owner}/{repo}/comments/{comment_id} */ - interactionsSetRestrictionsForRepo: ( + reposUpdateCommitComment: ( owner: string, repo: string, - data: InteractionLimit, + commentId: number, + data: { + /** The contents of the comment */ + body: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -29875,36 +29124,48 @@ export class Api< }), /** - * @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. + * No description * - * @tags interactions - * @name InteractionsRemoveRestrictionsForRepo - * @summary Remove interaction restrictions for a repository - * @request DELETE:/repos/{owner}/{repo}/interaction-limits + * @tags repos + * @name ReposDeleteCommitComment + * @summary Delete a commit comment + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id} */ - interactionsRemoveRestrictionsForRepo: ( + reposDeleteCommitComment: ( owner: string, repo: string, + commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}\`, 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 List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). * - * @tags repos - * @name ReposListInvitations - * @summary List repository invitations - * @request GET:/repos/{owner}/{repo}/invitations + * @tags reactions + * @name ReactionsListForCommitComment + * @summary List reactions for a commit comment + * @request GET:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - reposListInvitations: ( + reactionsListForCommitComment: ( 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 commit comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; /** * Page number of the results to fetch. * @default 1 @@ -29918,8 +29179,15 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/invitations\`, + this.request< + Reaction[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, method: "GET", query: query, format: "json", @@ -29927,26 +29195,41 @@ 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 repos - * @name ReposUpdateInvitation - * @summary Update a repository invitation - * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} + * @tags reactions + * @name ReactionsCreateForCommitComment + * @summary Create reaction for a commit comment + * @request POST:/repos/{owner}/{repo}/comments/{comment_id}/reactions */ - reposUpdateInvitation: ( + reactionsCreateForCommitComment: ( owner: string, repo: string, - invitationId: number, + commentId: 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"; + /** 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}/invitations/\${invitationId}\`, - method: "PATCH", + this.request< + Reaction, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -29954,79 +29237,63 @@ export class Api< }), /** - * 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 repos - * @name ReposDeleteInvitation - * @summary Delete a repository invitation - * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} + * @tags reactions + * @name ReactionsDeleteForCommitComment + * @summary Delete a commit comment reaction + * @request DELETE:/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id} */ - reposDeleteInvitation: ( + reactionsDeleteForCommitComment: ( owner: string, repo: string, - invitationId: number, + commentId: number, + reactionId: number, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + path: \`/repos/\${owner}/\${repo}/comments/\${commentId}/reactions/\${reactionId}\`, 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. + * @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 IssuesListForRepo - * @summary List repository issues - * @request GET:/repos/{owner}/{repo}/issues + * @tags repos + * @name ReposListCommits + * @summary List commits + * @request GET:/repos/{owner}/{repo}/commits */ - issuesListForRepo: ( + reposListCommits: ( 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; + /** 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; - /** - * 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"; + /** 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}/issues\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits\`, method: "GET", query: query, format: "json", @@ -30034,72 +29301,46 @@ export class Api< }), /** - * @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. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. * - * @tags issues - * @name IssuesCreate - * @summary Create an issue - * @request POST:/repos/{owner}/{repo}/issues + * @tags repos + * @name ReposListBranchesForHeadCommit + * @summary List branches for HEAD commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head */ - issuesCreate: ( + reposListBranchesForHeadCommit: ( 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; - }, + commitSha: string, params: RequestParams = {}, ) => this.request< - Issue, - | BasicError - | ValidationError + BranchShort[], | { - code?: string; - documentation_url?: string; - message?: string; + documentation_url: string; + message: string; } + | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/issues\`, - method: "POST", - body: data, - type: ContentType.Json, + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/branches-where-head\`, + method: "GET", format: "json", ...params, }), /** - * @description By default, Issue Comments are ordered by ascending ID. + * @description Use the \`:commit_sha\` to specify the commit that will have its comments listed. * - * @tags issues - * @name IssuesListCommentsForRepo - * @summary List issue comments for a repository - * @request GET:/repos/{owner}/{repo}/issues/comments + * @tags repos + * @name ReposListCommentsForCommit + * @summary List commit comments + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - issuesListCommentsForRepo: ( + reposListCommentsForCommit: ( owner: string, repo: string, + commitSha: string, query?: { - /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -30110,18 +29351,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}/issues/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, method: "GET", query: query, format: "json", @@ -30129,96 +29363,119 @@ export class Api< }), /** - * No description + * @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 issues - * @name IssuesGetComment - * @summary Get an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags repos + * @name ReposCreateCommitComment + * @summary Create a commit comment + * @request POST:/repos/{owner}/{repo}/commits/{commit_sha}/comments */ - issuesGetComment: ( + reposCreateCommitComment: ( owner: string, repo: string, - commentId: number, + commitSha: 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}/issues/comments/\${commentId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/comments\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesUpdateComment - * @summary Update an issue comment - * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags repos + * @name ReposListPullRequestsAssociatedWithCommit + * @summary List pull requests associated with a commit + * @request GET:/repos/{owner}/{repo}/commits/{commit_sha}/pulls */ - issuesUpdateComment: ( + reposListPullRequestsAssociatedWithCommit: ( owner: string, repo: string, - commentId: number, - data: { - /** The contents of the comment. */ - body: string; + 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({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request< + PullRequestSimple[], + { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/commits/\${commitSha}/pulls\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesDeleteComment - * @summary Delete an issue comment - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} + * @tags repos + * @name ReposGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/commits/{ref} */ - issuesDeleteComment: ( + reposGetCommit: ( owner: string, repo: string, - commentId: number, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}\`, + method: "GET", + format: "json", ...params, }), /** - * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + * @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 reactions - * @name ReactionsListForIssueComment - * @summary List reactions for an issue comment - * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * @tags checks + * @name ChecksListForRef + * @summary List check runs for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-runs */ - reactionsListForIssueComment: ( + checksListForRef: ( owner: string, repo: string, - commentId: number, + ref: string, 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"; + /** 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 @@ -30229,18 +29486,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< - Reaction[], - | BasicError - | { - documentation_url: string; - message: string; - } + { + check_runs: CheckRun[]; + total_count: number; + }, + any >({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-runs\`, method: "GET", query: query, format: "json", @@ -30248,79 +29506,85 @@ 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. + * @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 reactions - * @name ReactionsCreateForIssueComment - * @summary Create reaction for an issue comment - * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + * @tags checks + * @name ChecksListSuitesForRef + * @summary List check suites for a Git reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/check-suites */ - reactionsCreateForIssueComment: ( + checksListSuitesForRef: ( owner: string, repo: 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"; + 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 + */ + page?: number; + /** + * Results per page (max 100) + * @default 30 + */ + per_page?: number; }, params: RequestParams = {}, ) => this.request< - Reaction, - | { - documentation_url: string; - message: string; - } - | ValidationError + { + check_suites: CheckSuite[]; + total_count: number; + }, + any >({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/check-suites\`, + method: "GET", + query: query, 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). + * @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 reactions - * @name ReactionsDeleteForIssueComment - * @summary Delete an issue comment reaction - * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id} + * @tags repos + * @name ReposGetCombinedStatusForRef + * @summary Get the combined status for a specific reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/status */ - reactionsDeleteForIssueComment: ( + reposGetCombinedStatusForRef: ( owner: string, repo: string, - commentId: number, - reactionId: number, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions/\${reactionId}\`, - method: "DELETE", + 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 issues - * @name IssuesListEventsForRepo - * @summary List issue events for a repository - * @request GET:/repos/{owner}/{repo}/issues/events + * @tags repos + * @name ReposListCommitStatusesForRef + * @summary List commit statuses for a reference + * @request GET:/repos/{owner}/{repo}/commits/{ref}/statuses */ - issuesListEventsForRepo: ( + reposListCommitStatusesForRef: ( owner: string, repo: string, + ref: string, query?: { /** * Page number of the results to fetch. @@ -30335,8 +29599,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/events\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/commits/\${ref}/statuses\`, method: "GET", query: query, format: "json", @@ -30344,97 +29608,138 @@ export class Api< }), /** - * No description + * @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 issues - * @name IssuesGetEvent - * @summary Get an issue event - * @request GET:/repos/{owner}/{repo}/issues/events/{event_id} + * @tags codes-of-conduct + * @name CodesOfConductGetForRepo + * @summary Get the code of conduct for a repository + * @request GET:/repos/{owner}/{repo}/community/code_of_conduct */ - issuesGetEvent: ( + codesOfConductGetForRepo: ( owner: string, repo: string, - eventId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/events/\${eventId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/community/code_of_conduct\`, method: "GET", 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 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 issues - * @name IssuesGet - * @summary Get an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number} + * @tags repos + * @name ReposGetCommunityProfileMetrics + * @summary Get community profile metrics + * @request GET:/repos/{owner}/{repo}/community/profile */ - issuesGet: ( + reposGetCommunityProfileMetrics: ( owner: string, repo: string, - issueNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/community/profile\`, method: "GET", format: "json", ...params, }), /** - * @description Issue owners and users with push access can edit an issue. + * @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 issues - * @name IssuesUpdate - * @summary Update an issue - * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} + * @tags repos + * @name ReposCompareCommits + * @summary Compare two commits + * @request GET:/repos/{owner}/{repo}/compare/{base}...{head} */ - issuesUpdate: ( + reposCompareCommits: ( owner: string, repo: string, - issueNumber: number, + base: string, + head: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/compare/\${base}...\${head}\`, + 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. + * + * @tags repos + * @name ReposGetContent + * @summary Get repository content + * @request GET:/repos/{owner}/{repo}/contents/{path} + */ + reposGetContent: ( + owner: string, + repo: string, + path: string, + query?: { + /** 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}/contents/\${path}\`, + method: "GET", + query: query, + format: "json", + ...params, + }), + + /** + * @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} + */ + reposCreateOrUpdateFileContents: ( + owner: string, + repo: string, + path: string, 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; + /** 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< - Issue, - | BasicError - | ValidationError - | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/contents/\${path}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -30442,26 +29747,53 @@ export class Api< }), /** - * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. + * @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 issues - * @name IssuesAddAssignees - * @summary Add assignees to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @tags repos + * @name ReposDeleteFile + * @summary Delete a file + * @request DELETE:/repos/{owner}/{repo}/contents/{path} */ - issuesAddAssignees: ( + reposDeleteFile: ( owner: string, repo: string, - issueNumber: number, + path: 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[]; + /** 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}/issues/\${issueNumber}/assignees\`, - method: "POST", + 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", @@ -30469,45 +29801,57 @@ export class Api< }), /** - * @description Removes one or more assignees from an issue. + * @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 issues - * @name IssuesRemoveAssignees - * @summary Remove assignees from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees + * @tags repos + * @name ReposListContributors + * @summary List repository contributors + * @request GET:/repos/{owner}/{repo}/contributors */ - issuesRemoveAssignees: ( + reposListContributors: ( 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[]; + 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}/issues/\${issueNumber}/assignees\`, - method: "DELETE", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/contributors\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * @description Issue Comments are ordered by ascending ID. + * @description Simple filtering of deployments is available via query parameters: * - * @tags issues - * @name IssuesListComments - * @summary List issue comments - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @tags repos + * @name ReposListDeployments + * @summary List deployments + * @request GET:/repos/{owner}/{repo}/deployments */ - issuesListComments: ( + reposListDeployments: ( owner: string, repo: string, - issueNumber: number, 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 @@ -30518,13 +29862,26 @@ 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; + /** + * 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}/issues/\${issueNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments\`, method: "GET", query: query, format: "json", @@ -30532,44 +29889,129 @@ export class Api< }), /** - * @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 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 issues - * @name IssuesCreateComment - * @summary Create an issue comment - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments + * @tags repos + * @name ReposCreateDeployment + * @summary Create a deployment + * @request POST:/repos/{owner}/{repo}/deployments */ - issuesCreateComment: ( + reposCreateDeployment: ( owner: string, repo: string, - issueNumber: number, data: { - /** The contents of the comment. */ - body: string; + /** + * 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({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + 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", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags repos + * @name ReposGetDeployment + * @summary Get a deployment + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id} + */ + reposGetDeployment: ( + owner: string, + repo: string, + deploymentId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + 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)." + * + * @tags repos + * @name ReposDeleteDeployment + * @summary Delete a deployment + * @request DELETE:/repos/{owner}/{repo}/deployments/{deployment_id} + */ + reposDeleteDeployment: ( + owner: string, + repo: string, + deploymentId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}\`, + method: "DELETE", ...params, }), /** - * No description + * @description Users with pull access can view deployment statuses for a deployment: * - * @tags issues - * @name IssuesListEvents - * @summary List issue events - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events + * @tags repos + * @name ReposListDeploymentStatuses + * @summary List deployment statuses + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - issuesListEvents: ( + reposListDeploymentStatuses: ( owner: string, repo: string, - issueNumber: number, + deploymentId: number, query?: { /** * Page number of the results to fetch. @@ -30584,8 +30026,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, method: "GET", query: query, format: "json", @@ -30593,273 +30035,317 @@ export class Api< }), /** - * No description + * @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 issues - * @name IssuesListLabelsOnIssue - * @summary List labels for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags repos + * @name ReposCreateDeploymentStatus + * @summary Create a deployment status + * @request POST:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses */ - issuesListLabelsOnIssue: ( + reposCreateDeploymentStatus: ( owner: string, repo: string, - issueNumber: number, - query?: { + deploymentId: number, + data: { /** - * Page number of the results to fetch. - * @default 1 + * 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. */ - page?: number; + auto_inactive?: boolean; /** - * Results per page (max 100) - * @default 30 + * A short description of the status. The maximum description length is 140 characters. + * @default "" */ - per_page?: number; + 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}/issues/\${issueNumber}/labels\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description Users with pull access can view a deployment status for a deployment: * - * @tags issues - * @name IssuesAddLabels - * @summary Add labels to an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags repos + * @name ReposGetDeploymentStatus + * @summary Get a deployment status + * @request GET:/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id} */ - issuesAddLabels: ( + reposGetDeploymentStatus: ( 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[]; - }, + deploymentId: number, + statusId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + DeploymentStatus, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/deployments/\${deploymentId}/statuses/\${statusId}\`, + method: "GET", format: "json", ...params, }), /** - * @description Removes any previous labels and sets the new labels for an issue. + * @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 issues - * @name IssuesSetLabels - * @summary Set labels for an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels + * @tags repos + * @name ReposCreateDispatchEvent + * @summary Create a repository dispatch event + * @request POST:/repos/{owner}/{repo}/dispatches */ - issuesSetLabels: ( + reposCreateDispatchEvent: ( 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[]; + /** 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}/issues/\${issueNumber}/labels\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/dispatches\`, + method: "POST", 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 + * @tags activity + * @name ActivityListRepoEvents + * @summary List repository events + * @request GET:/repos/{owner}/{repo}/events */ - issuesRemoveAllLabels: ( + activityListRepoEvents: ( 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}/issues/\${issueNumber}/labels\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/events\`, + method: "GET", + query: query, + format: "json", ...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. + * No description * - * @tags issues - * @name IssuesRemoveLabel - * @summary Remove a label from an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} + * @tags repos + * @name ReposListForks + * @summary List forks + * @request GET:/repos/{owner}/{repo}/forks */ - issuesRemoveLabel: ( + reposListForks: ( owner: string, repo: string, - issueNumber: number, - name: string, + query?: { + /** + * 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?: "newest" | "oldest" | "stargazers"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels/\${name}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/forks\`, + method: "GET", + query: query, 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 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 issues - * @name IssuesLock - * @summary Lock an issue - * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @tags repos + * @name ReposCreateFork + * @summary Create a fork + * @request POST:/repos/{owner}/{repo}/forks */ - issuesLock: ( + reposCreateFork: ( owner: string, repo: string, - issueNumber: number, data: { - /** - * 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, + /** Optional parameter to specify the organization name if forking into an organization. */ + organization?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, - method: "PUT", + this.request({ + path: \`/repos/\${owner}/\${repo}/forks\`, + method: "POST", body: data, type: ContentType.Json, + format: "json", ...params, }), /** - * @description Users with push access can unlock an issue's conversation. + * No description * - * @tags issues - * @name IssuesUnlock - * @summary Unlock an issue - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/lock + * @tags git + * @name GitCreateBlob + * @summary Create a blob + * @request POST:/repos/{owner}/{repo}/git/blobs */ - issuesUnlock: ( + gitCreateBlob: ( owner: string, repo: string, - issueNumber: number, + data: { + /** The new blob's content. */ + content: string; + /** + * The encoding used for \`content\`. Currently, \`"utf-8"\` and \`"base64"\` are supported. + * @default "utf-8" + */ + encoding?: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/blobs\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). + * @description The \`content\` in the response will always be Base64 encoded. _Note_: This API supports blobs up to 100 megabytes in size. * - * @tags reactions - * @name ReactionsListForIssue - * @summary List reactions for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @tags git + * @name GitGetBlob + * @summary Get a blob + * @request GET:/repos/{owner}/{repo}/git/blobs/{file_sha} */ - reactionsListForIssue: ( + gitGetBlob: ( 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; - }, + fileSha: string, params: RequestParams = {}, ) => - this.request< - Reaction[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/blobs/\${fileSha}\`, 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. + * @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 reactions - * @name ReactionsCreateForIssue - * @summary Create reaction for an issue - * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions + * @tags git + * @name GitCreateCommit + * @summary Create a commit + * @request POST:/repos/{owner}/{repo}/git/commits */ - reactionsCreateForIssue: ( + gitCreateCommit: ( 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"; + /** 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< - Reaction, - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/commits\`, method: "POST", body: data, type: ContentType.Json, @@ -30868,38 +30354,38 @@ 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 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 reactions - * @name ReactionsDeleteForIssue - * @summary Delete an issue reaction - * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} + * @tags git + * @name GitGetCommit + * @summary Get a commit + * @request GET:/repos/{owner}/{repo}/git/commits/{commit_sha} */ - reactionsDeleteForIssue: ( + gitGetCommit: ( owner: string, repo: string, - issueNumber: number, - reactionId: number, + commitSha: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions/\${reactionId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/commits/\${commitSha}\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesListEventsForTimeline - * @summary List timeline events for an issue - * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline + * @tags git + * @name GitListMatchingRefs + * @summary List matching references + * @request GET:/repos/{owner}/{repo}/git/matching-refs/{ref} */ - issuesListEventsForTimeline: ( + gitListMatchingRefs: ( owner: string, repo: string, - issueNumber: number, + ref: string, query?: { /** * Page number of the results to fetch. @@ -30914,15 +30400,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - IssueEventForIssue[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/timeline\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/matching-refs/\${ref}\`, method: "GET", query: query, format: "json", @@ -30930,66 +30409,82 @@ export class Api< }), /** - * 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 repos - * @name ReposListDeployKeys - * @summary List deploy keys - * @request GET:/repos/{owner}/{repo}/keys + * @tags git + * @name GitGetRef + * @summary Get a reference + * @request GET:/repos/{owner}/{repo}/git/ref/{ref} */ - reposListDeployKeys: ( + gitGetRef: ( 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; - }, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/ref/\${ref}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description You can create a read-only deploy key. + * @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 ReposCreateDeployKey - * @summary Create a deploy key - * @request POST:/repos/{owner}/{repo}/keys + * @tags git + * @name GitCreateRef + * @summary Create a reference + * @request POST:/repos/{owner}/{repo}/git/refs */ - reposCreateDeployKey: ( + gitCreateRef: ( + 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; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags git + * @name GitUpdateRef + * @summary Update a reference + * @request PATCH:/repos/{owner}/{repo}/git/refs/{ref} + */ + gitUpdateRef: ( owner: string, repo: string, + ref: 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/)." + * 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 */ - read_only?: boolean; - /** A name for the key. */ - title?: string; + force?: boolean; + /** The SHA1 value to set this reference to */ + sha: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -30999,100 +30494,128 @@ 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 GitDeleteRef + * @summary Delete a reference + * @request DELETE:/repos/{owner}/{repo}/git/refs/{ref} */ - reposGetDeployKey: ( + gitDeleteRef: ( owner: string, repo: string, - keyId: number, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/refs/\${ref}\`, + method: "DELETE", ...params, }), /** - * @description Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. + * @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 ReposDeleteDeployKey - * @summary Delete a deploy key - * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} + * @tags git + * @name GitCreateTag + * @summary Create a tag object + * @request POST:/repos/{owner}/{repo}/git/tags */ - reposDeleteDeployKey: ( + gitCreateTag: ( owner: string, repo: string, - keyId: number, + 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"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/git/tags\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...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 IssuesListLabelsForRepo - * @summary List labels for a repository - * @request GET:/repos/{owner}/{repo}/labels + * @tags git + * @name GitGetTag + * @summary Get a tag + * @request GET:/repos/{owner}/{repo}/git/tags/{tag_sha} */ - issuesListLabelsForRepo: ( + gitGetTag: ( 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; - }, + tagSha: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/tags/\${tagSha}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesCreateLabel - * @summary Create a label - * @request POST:/repos/{owner}/{repo}/labels + * @tags git + * @name GitCreateTree + * @summary Create a tree + * @request POST:/repos/{owner}/{repo}/git/trees */ - issuesCreateLabel: ( + gitCreateTree: ( 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; + /** + * 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}/labels\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/trees\`, method: "POST", body: data, type: ContentType.Json, @@ -31101,22 +30624,27 @@ export class Api< }), /** - * No description + * @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 issues - * @name IssuesGetLabel - * @summary Get a label - * @request GET:/repos/{owner}/{repo}/labels/{name} + * @tags git + * @name GitGetTree + * @summary Get a tree + * @request GET:/repos/{owner}/{repo}/git/trees/{tree_sha} */ - issuesGetLabel: ( + gitGetTree: ( owner: string, repo: string, - name: 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; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/git/trees/\${treeSha}\`, method: "GET", + query: query, format: "json", ...params, }), @@ -31124,90 +30652,158 @@ export class Api< /** * No description * - * @tags issues - * @name IssuesUpdateLabel - * @summary Update a label - * @request PATCH:/repos/{owner}/{repo}/labels/{name} + * @tags repos + * @name ReposListWebhooks + * @summary List repository webhooks + * @request GET:/repos/{owner}/{repo}/hooks */ - issuesUpdateLabel: ( + reposListWebhooks: ( 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; + 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}/labels/\${name}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesDeleteLabel - * @summary Delete a label - * @request DELETE:/repos/{owner}/{repo}/labels/{name} + * @tags repos + * @name ReposCreateWebhook + * @summary Create a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks */ - issuesDeleteLabel: ( + reposCreateWebhook: ( owner: string, repo: string, - name: 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}/labels/\${name}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks\`, + method: "POST", + body: data, + type: ContentType.Json, + 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 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 ReposListLanguages - * @summary List repository languages - * @request GET:/repos/{owner}/{repo}/languages + * @name ReposGetWebhook + * @summary Get a repository webhook + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id} */ - reposListLanguages: ( + reposGetWebhook: ( owner: string, repo: string, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/languages\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, method: "GET", 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. + * @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 licenses - * @name LicensesGetForRepo - * @summary Get the license for a repository - * @request GET:/repos/{owner}/{repo}/license + * @tags repos + * @name ReposUpdateWebhook + * @summary Update a repository webhook + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id} */ - licensesGetForRepo: ( + reposUpdateWebhook: ( owner: string, repo: string, + hookId: number, + data: { + /** + * 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}/license\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -31216,118 +30812,70 @@ export class Api< * No description * * @tags repos - * @name ReposMerge - * @summary Merge a branch - * @request POST:/repos/{owner}/{repo}/merges + * @name ReposDeleteWebhook + * @summary Delete a repository webhook + * @request DELETE:/repos/{owner}/{repo}/hooks/{hook_id} */ - reposMerge: ( + reposDeleteWebhook: ( 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; - }, + hookId: number, 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", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}\`, + method: "DELETE", ...params, }), /** - * No description + * @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 issues - * @name IssuesListMilestones - * @summary List milestones - * @request GET:/repos/{owner}/{repo}/milestones + * @tags repos + * @name ReposGetWebhookConfigForRepo + * @summary Get a webhook configuration for a repository + * @request GET:/repos/{owner}/{repo}/hooks/{hook_id}/config */ - issuesListMilestones: ( + reposGetWebhookConfigForRepo: ( owner: string, repo: string, - query?: { - /** - * The direction of the sort. Either \`asc\` or \`desc\`. - * @default "asc" - */ - direction?: "asc" | "desc"; - /** - * 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. 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"; - }, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, method: "GET", - query: query, format: "json", ...params, }), /** - * No description + * @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 issues - * @name IssuesCreateMilestone - * @summary Create a milestone - * @request POST:/repos/{owner}/{repo}/milestones + * @tags repos + * @name ReposUpdateWebhookConfigForRepo + * @summary Update a webhook configuration for a repository + * @request PATCH:/repos/{owner}/{repo}/hooks/{hook_id}/config */ - issuesCreateMilestone: ( + reposUpdateWebhookConfigForRepo: ( owner: string, repo: string, + hookId: 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 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}/milestones\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/config\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -31335,240 +30883,200 @@ export class Api< }), /** - * 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 IssuesGetMilestone - * @summary Get a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags repos + * @name ReposPingWebhook + * @summary Ping a repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/pings */ - issuesGetMilestone: ( + reposPingWebhook: ( owner: string, repo: string, - milestoneNumber: number, + hookId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/pings\`, + method: "POST", ...params, }), /** - * No description + * @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 issues - * @name IssuesUpdateMilestone - * @summary Update a milestone - * @request PATCH:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags repos + * @name ReposTestPushWebhook + * @summary Test the push repository webhook + * @request POST:/repos/{owner}/{repo}/hooks/{hook_id}/tests */ - issuesUpdateMilestone: ( + reposTestPushWebhook: ( 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", + repo: string, + hookId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/hooks/\${hookId}/tests\`, + method: "POST", ...params, }), /** - * No description + * @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 issues - * @name IssuesDeleteMilestone - * @summary Delete a milestone - * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} + * @tags migrations + * @name MigrationsGetImportStatus + * @summary Get an import status + * @request GET:/repos/{owner}/{repo}/import */ - issuesDeleteMilestone: ( + migrationsGetImportStatus: ( owner: string, repo: string, - milestoneNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @description Start a source import to a GitHub repository using GitHub Importer. * - * @tags issues - * @name IssuesListLabelsForMilestone - * @summary List labels for issues in a milestone - * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels + * @tags migrations + * @name MigrationsStartImport + * @summary Start an import + * @request PUT:/repos/{owner}/{repo}/import */ - issuesListLabelsForMilestone: ( + migrationsStartImport: ( owner: string, repo: string, - milestoneNumber: number, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: 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}/milestones/\${milestoneNumber}/labels\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description List all notifications for the current user. + * @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 activity - * @name ActivityListRepoNotificationsForAuthenticatedUser - * @summary List repository notifications for the authenticated user - * @request GET:/repos/{owner}/{repo}/notifications + * @tags migrations + * @name MigrationsUpdateImport + * @summary Update an import + * @request PATCH:/repos/{owner}/{repo}/import */ - activityListRepoNotificationsForAuthenticatedUser: ( + migrationsUpdateImport: ( owner: string, repo: 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; + 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; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/notifications\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/import\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "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 Stop an import for a repository. * - * @tags activity - * @name ActivityMarkRepoNotificationsAsRead - * @summary Mark repository notifications as read - * @request PUT:/repos/{owner}/{repo}/notifications + * @tags migrations + * @name MigrationsCancelImport + * @summary Cancel an import + * @request DELETE:/repos/{owner}/{repo}/import */ - activityMarkRepoNotificationsAsRead: ( + migrationsCancelImport: ( 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, + 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 ReposGetPages - * @summary Get a GitHub Pages site - * @request GET:/repos/{owner}/{repo}/pages + * @tags migrations + * @name MigrationsGetCommitAuthors + * @summary Get commit authors + * @request GET:/repos/{owner}/{repo}/import/authors */ - reposGetPages: (owner: string, repo: string, params: RequestParams = {}) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages\`, + migrationsGetCommitAuthors: ( + owner: string, + repo: string, + query?: { + /** A user ID. Only return users with an ID greater than this ID. */ + since?: number; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/import/authors\`, method: "GET", + query: query, 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 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 ReposCreatePagesSite - * @summary Create a GitHub Pages site - * @request POST:/repos/{owner}/{repo}/pages + * @tags migrations + * @name MigrationsMapCommitAuthor + * @summary Map a commit author + * @request PATCH:/repos/{owner}/{repo}/import/authors/{author_id} */ - reposCreatePagesSite: ( + migrationsMapCommitAuthor: ( owner: string, repo: string, + authorId: number, 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"; - }; + /** 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< - Page, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/import/authors/\${authorId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -31576,173 +31084,142 @@ 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). + * @description List files larger than 100MB found during the import * - * @tags repos - * @name ReposUpdateInformationAboutPagesSite - * @summary Update information about a GitHub Pages site - * @request PUT:/repos/{owner}/{repo}/pages + * @tags migrations + * @name MigrationsGetLargeFiles + * @summary Get large files + * @request GET:/repos/{owner}/{repo}/import/large_files */ - reposUpdateInformationAboutPagesSite: ( + migrationsGetLargeFiles: ( 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: \`/repos/\${owner}/\${repo}/pages\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/import/large_files\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 repos - * @name ReposDeletePagesSite - * @summary Delete a GitHub Pages site - * @request DELETE:/repos/{owner}/{repo}/pages + * @tags migrations + * @name MigrationsSetLfsPreference + * @summary Update Git LFS preference + * @request PATCH:/repos/{owner}/{repo}/import/lfs */ - reposDeletePagesSite: ( + migrationsSetLfsPreference: ( owner: string, repo: 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"; + }, params: RequestParams = {}, ) => - this.request< - void, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pages\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/import/lfs\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * No description + * @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 ReposListPagesBuilds - * @summary List GitHub Pages builds - * @request GET:/repos/{owner}/{repo}/pages/builds + * @tags apps + * @name AppsGetRepoInstallation + * @summary Get a repository installation for the authenticated app + * @request GET:/repos/{owner}/{repo}/installation */ - reposListPagesBuilds: ( + 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}/pages/builds\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/installation\`, 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 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 ReposRequestPagesBuild - * @summary Request a GitHub Pages build - * @request POST:/repos/{owner}/{repo}/pages/builds + * @tags interactions + * @name InteractionsGetRestrictionsForRepo + * @summary Get interaction restrictions for a repository + * @request GET:/repos/{owner}/{repo}/interaction-limits */ - reposRequestPagesBuild: ( + interactionsGetRestrictionsForRepo: ( owner: string, repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + method: "GET", format: "json", ...params, }), /** - * No description + * @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 ReposGetLatestPagesBuild - * @summary Get latest Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/latest + * @tags interactions + * @name InteractionsSetRestrictionsForRepo + * @summary Set interaction restrictions for a repository + * @request PUT:/repos/{owner}/{repo}/interaction-limits */ - reposGetLatestPagesBuild: ( + interactionsSetRestrictionsForRepo: ( owner: string, repo: string, + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @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 ReposGetPagesBuild - * @summary Get GitHub Pages build - * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} + * @tags interactions + * @name InteractionsRemoveRestrictionsForRepo + * @summary Remove interaction restrictions for a repository + * @request DELETE:/repos/{owner}/{repo}/interaction-limits */ - reposGetPagesBuild: ( + interactionsRemoveRestrictionsForRepo: ( owner: string, repo: string, - buildId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/interaction-limits\`, + method: "DELETE", ...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. + * @description When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. * - * @tags projects - * @name ProjectsListForRepo - * @summary List repository projects - * @request GET:/repos/{owner}/{repo}/projects + * @tags repos + * @name ReposListInvitations + * @summary List repository invitations + * @request GET:/repos/{owner}/{repo}/invitations */ - projectsListForRepo: ( + reposListInvitations: ( owner: string, repo: string, query?: { @@ -31756,16 +31233,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}/invitations\`, method: "GET", query: query, format: "json", @@ -31773,27 +31245,26 @@ 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. + * No description * - * @tags projects - * @name ProjectsCreateForRepo - * @summary Create a repository project - * @request POST:/repos/{owner}/{repo}/projects + * @tags repos + * @name ReposUpdateInvitation + * @summary Update a repository invitation + * @request PATCH:/repos/{owner}/{repo}/invitations/{invitation_id} */ - projectsCreateForRepo: ( + reposUpdateInvitation: ( owner: string, repo: string, + invitationId: number, data: { - /** The description of the project. */ - body?: string; - /** The name of the project. */ - name: string; + /** 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}/projects\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/invitations/\${invitationId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -31801,23 +31272,52 @@ export class Api< }), /** - * @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. + * No description * - * @tags pulls - * @name PullsList - * @summary List pull requests - * @request GET:/repos/{owner}/{repo}/pulls + * @tags repos + * @name ReposDeleteInvitation + * @summary Delete a repository invitation + * @request DELETE:/repos/{owner}/{repo}/invitations/{invitation_id} */ - pullsList: ( + reposDeleteInvitation: ( + owner: string, + repo: string, + 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?: { - /** 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\`. */ + /** 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"; - /** 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; + /** 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 @@ -31828,21 +31328,23 @@ 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; /** - * 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). + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. * @default "created" */ - sort?: "created" | "updated" | "popularity" | "long-running"; + sort?: "created" | "updated" | "comments"; /** - * Either \`open\`, \`closed\`, or \`all\` to filter by state. + * 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}/pulls\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues\`, method: "GET", query: query, format: "json", @@ -31850,36 +31352,51 @@ export class Api< }), /** - * @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 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 pulls - * @name PullsCreate - * @summary Create a pull request - * @request POST:/repos/{owner}/{repo}/pulls + * @tags issues + * @name IssuesCreate + * @summary Create an issue + * @request POST:/repos/{owner}/{repo}/issues */ - pullsCreate: ( + issuesCreate: ( 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; + 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}/pulls\`, + this.request< + Issue, + | BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues\`, method: "POST", body: data, type: ContentType.Json, @@ -31888,18 +31405,18 @@ export class Api< }), /** - * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. + * @description By default, Issue Comments are ordered by ascending ID. * - * @tags pulls - * @name PullsListReviewCommentsForRepo - * @summary List review comments in a repository - * @request GET:/repos/{owner}/{repo}/pulls/comments + * @tags issues + * @name IssuesListCommentsForRepo + * @summary List issue comments for a repository + * @request GET:/repos/{owner}/{repo}/issues/comments */ - pullsListReviewCommentsForRepo: ( + issuesListCommentsForRepo: ( owner: string, repo: string, query?: { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ + /** Either \`asc\` or \`desc\`. Ignored without the \`sort\` parameter. */ direction?: "asc" | "desc"; /** * Page number of the results to fetch. @@ -31921,8 +31438,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments\`, method: "GET", query: query, format: "json", @@ -31930,46 +31447,46 @@ export class Api< }), /** - * @description Provides details for a review comment. + * No description * - * @tags pulls - * @name PullsGetReviewComment - * @summary Get a review comment for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags issues + * @name IssuesGetComment + * @summary Get an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - pullsGetReviewComment: ( + issuesGetComment: ( owner: string, repo: string, commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "GET", format: "json", ...params, }), /** - * @description Enables you to edit a review comment. + * No description * - * @tags pulls - * @name PullsUpdateReviewComment - * @summary Update a review comment for a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags issues + * @name IssuesUpdateComment + * @summary Update an issue comment + * @request PATCH:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - pullsUpdateReviewComment: ( + issuesUpdateComment: ( owner: string, repo: string, commentId: number, data: { - /** The text of the reply to the review comment. */ + /** The contents of the comment. */ body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -31978,39 +31495,39 @@ export class Api< }), /** - * @description Deletes a review comment. + * No description * - * @tags pulls - * @name PullsDeleteReviewComment - * @summary Delete a review comment for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} + * @tags issues + * @name IssuesDeleteComment + * @summary Delete an issue comment + * @request DELETE:/repos/{owner}/{repo}/issues/comments/{comment_id} */ - pullsDeleteReviewComment: ( + issuesDeleteComment: ( owner: string, repo: string, commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}\`, method: "DELETE", ...params, }), /** - * @description List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + * @description List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). * * @tags reactions - * @name ReactionsListForPullRequestReviewComment - * @summary List reactions for a pull request review comment - * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @name ReactionsListForIssueComment + * @summary List reactions for an issue comment + * @request GET:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions */ - reactionsListForPullRequestReviewComment: ( + 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 a pull request review comment. */ + /** 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" @@ -32033,57 +31550,209 @@ export class Api< }, params: RequestParams = {}, ) => - this.request< - Reaction[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, + this.request< + Reaction[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/comments/\${commentId}/reactions\`, + method: "GET", + query: query, + 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. + * + * @tags reactions + * @name ReactionsCreateForIssueComment + * @summary Create reaction for an issue comment + * @request POST:/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions + */ + reactionsCreateForIssueComment: ( + owner: string, + repo: 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< + 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 issues + * @name IssuesListEventsForRepo + * @summary List issue events for a repository + * @request GET:/repos/{owner}/{repo}/issues/events + */ + issuesListEventsForRepo: ( + 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}/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", + 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. + * + * @tags issues + * @name IssuesGet + * @summary Get an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number} + */ + issuesGet: ( + owner: string, + repo: string, + issueNumber: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @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 Issue owners and users with push access can edit an issue. * - * @tags reactions - * @name ReactionsCreateForPullRequestReviewComment - * @summary Create reaction for a pull request review comment - * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions + * @tags issues + * @name IssuesUpdate + * @summary Update an issue + * @request PATCH:/repos/{owner}/{repo}/issues/{issue_number} */ - reactionsCreateForPullRequestReviewComment: ( + issuesUpdate: ( owner: string, repo: string, - commentId: number, + issueNumber: 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"; + /** 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< - Reaction, + Issue, + | BasicError + | ValidationError | { - documentation_url: string; - message: string; + code?: string; + documentation_url?: string; + message?: string; } - | ValidationError >({ - path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, - method: "POST", + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -32091,76 +31760,53 @@ 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. + * @description Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. * - * @tags pulls - * @name PullsGet - * @summary Get a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} + * @tags issues + * @name IssuesAddAssignees + * @summary Add assignees to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - pullsGet: ( + issuesAddAssignees: ( owner: string, repo: string, - pullNumber: number, + 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}/pulls/\${pullNumber}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + method: "POST", + body: data, + type: ContentType.Json, 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 Removes one or more assignees from an issue. * - * @tags pulls - * @name PullsUpdate - * @summary Update a pull request - * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} + * @tags issues + * @name IssuesRemoveAssignees + * @summary Remove assignees from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/assignees */ - pullsUpdate: ( + issuesRemoveAssignees: ( owner: string, repo: string, - pullNumber: number, + issueNumber: 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; + /** 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}/pulls/\${pullNumber}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/assignees\`, + method: "DELETE", body: data, type: ContentType.Json, format: "json", @@ -32168,20 +31814,18 @@ export class Api< }), /** - * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. + * @description Issue Comments are ordered by ascending ID. * - * @tags pulls - * @name PullsListReviewComments - * @summary List review comments on a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments + * @tags issues + * @name IssuesListComments + * @summary List issue comments + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - pullsListReviewComments: ( + issuesListComments: ( owner: string, repo: string, - pullNumber: number, + issueNumber: number, query?: { - /** Can be either \`asc\` or \`desc\`. Ignored without \`sort\` parameter. */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -32194,16 +31838,11 @@ export class Api< 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}/issues/\${issueNumber}/comments\`, method: "GET", query: query, format: "json", @@ -32211,69 +31850,25 @@ 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. - * - * @tags pulls - * @name PullsCreateReviewComment - * @summary Create a review comment for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments - */ - 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: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, - 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 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 pulls - * @name PullsCreateReplyForReviewComment - * @summary Create a reply for a review comment - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies + * @tags issues + * @name IssuesCreateComment + * @summary Create an issue comment + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/comments */ - pullsCreateReplyForReviewComment: ( + issuesCreateComment: ( owner: string, repo: string, - pullNumber: number, - commentId: number, + issueNumber: number, data: { - /** The text of the review comment. */ + /** The contents of the comment. */ body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments/\${commentId}/replies\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/comments\`, method: "POST", body: data, type: ContentType.Json, @@ -32282,17 +31877,17 @@ export class Api< }), /** - * @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 issues + * @name IssuesListEvents + * @summary List issue events + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/events */ - pullsListCommits: ( + issuesListEvents: ( owner: string, repo: string, - pullNumber: number, + issueNumber: number, query?: { /** * Page number of the results to fetch. @@ -32307,8 +31902,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/events\`, method: "GET", query: query, format: "json", @@ -32316,17 +31911,17 @@ 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 issues + * @name IssuesListLabelsOnIssue + * @summary List labels for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - pullsListFiles: ( + issuesListLabelsOnIssue: ( owner: string, repo: string, - pullNumber: number, + issueNumber: number, query?: { /** * Page number of the results to fetch. @@ -32341,8 +31936,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, method: "GET", query: query, format: "json", @@ -32352,57 +31947,50 @@ 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 + * @tags issues + * @name IssuesAddLabels + * @summary Add labels to an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - pullsCheckIfMerged: ( + issuesAddLabels: ( owner: string, repo: string, - pullNumber: number, + 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}/pulls/\${pullNumber}/merge\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + 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 Removes any previous labels and sets the new labels for an issue. * - * @tags pulls - * @name PullsMerge - * @summary Merge a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge + * @tags issues + * @name IssuesSetLabels + * @summary Set labels for an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - pullsMerge: ( + issuesSetLabels: ( owner: string, repo: string, - pullNumber: number, + issueNumber: 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, + /** 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< - PullRequestMergeResult, - | BasicError - | { - documentation_url?: string; - message?: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, method: "PUT", body: data, type: ContentType.Json, @@ -32413,220 +32001,184 @@ 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 issues + * @name IssuesRemoveAllLabels + * @summary Remove all labels from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels */ - pullsListRequestedReviewers: ( + issuesRemoveAllLabels: ( 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; - }, + issueNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/labels\`, + 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. + * @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 pulls - * @name PullsRequestReviewers - * @summary Request reviewers for a pull request - * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags issues + * @name IssuesRemoveLabel + * @summary Remove a label from an issue + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/labels/{name} */ - pullsRequestReviewers: ( + issuesRemoveLabel: ( 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[]; - }, + issueNumber: number, + name: 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}/issues/\${issueNumber}/labels/\${name}\`, + method: "DELETE", format: "json", ...params, }), /** - * 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 pulls - * @name PullsRemoveRequestedReviewers - * @summary Remove requested reviewers from a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers + * @tags issues + * @name IssuesLock + * @summary Lock an issue + * @request PUT:/repos/{owner}/{repo}/issues/{issue_number}/lock */ - pullsRemoveRequestedReviewers: ( + issuesLock: ( owner: string, repo: string, - pullNumber: number, + issueNumber: 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[]; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, - method: "DELETE", - body: data, - type: ContentType.Json, - ...params, - }), - - /** - * @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 - */ - 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 + * 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\` */ - per_page?: number; - }, + lock_reason?: "off-topic" | "too heated" | "resolved" | "spam"; + } | null, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, + method: "PUT", + body: data, + type: ContentType.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 Users with push access can unlock an issue's conversation. * - * @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 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}/pulls/\${pullNumber}/reviews\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/lock\`, + method: "DELETE", ...params, }), /** - * No description + * @description List the reactions to an [issue](https://docs.github.com/rest/reference/issues). * - * @tags pulls - * @name PullsGetReview - * @summary Get a review for a pull request - * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags reactions + * @name ReactionsListForIssue + * @summary List reactions for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - pullsGetReview: ( + reactionsListForIssue: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, + 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: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + this.request< + Reaction[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions\`, method: "GET", + query: query, format: "json", ...params, }), /** - * @description Update the review summary comment with new text. + * @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 pulls - * @name PullsUpdateReview - * @summary Update a review for a pull request - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags reactions + * @name ReactionsCreateForIssue + * @summary Create reaction for an issue + * @request POST:/repos/{owner}/{repo}/issues/{issue_number}/reactions */ - pullsUpdateReview: ( + reactionsCreateForIssue: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, + issueNumber: number, data: { - /** The body text of the pull request review. */ - body: 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: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, - method: "PUT", + 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", @@ -32634,40 +32186,38 @@ export class Api< }), /** - * No description + * @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 pulls - * @name PullsDeletePendingReview - * @summary Delete a pending review for a pull request - * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} + * @tags reactions + * @name ReactionsDeleteForIssue + * @summary Delete an issue reaction + * @request DELETE:/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id} */ - pullsDeletePendingReview: ( + reactionsDeleteForIssue: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, + issueNumber: number, + reactionId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/reactions/\${reactionId}\`, method: "DELETE", - 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 issues + * @name IssuesListEventsForTimeline + * @summary List timeline events for an issue + * @request GET:/repos/{owner}/{repo}/issues/{issue_number}/timeline */ - pullsListCommentsForReview: ( + issuesListEventsForTimeline: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, + issueNumber: number, query?: { /** * Page number of the results to fetch. @@ -32682,8 +32232,15 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/comments\`, + this.request< + IssueEventForIssue[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/issues/\${issueNumber}/timeline\`, method: "GET", query: query, format: "json", @@ -32691,58 +32248,65 @@ export class Api< }), /** - * @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. + * No description * - * @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 repos + * @name ReposListDeployKeys + * @summary List deploy keys + * @request GET:/repos/{owner}/{repo}/keys */ - pullsDismissReview: ( + reposListDeployKeys: ( owner: string, repo: string, - pullNumber: number, - reviewId: number, - data: { - /** @example ""APPROVE"" */ - event?: string; - /** The message for the pull request review dismissal */ - message: 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/\${reviewId}/dismissals\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/keys\`, + method: "GET", + query: query, format: "json", ...params, }), /** - * No description + * @description You can create a read-only deploy key. * - * @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 repos + * @name ReposCreateDeployKey + * @summary Create a deploy key + * @request POST:/repos/{owner}/{repo}/keys */ - pullsSubmitReview: ( + reposCreateDeployKey: ( 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"; + /** 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: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/events\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/keys\`, method: "POST", body: data, type: ContentType.Json, @@ -32751,77 +32315,55 @@ export class Api< }), /** - * @description Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. + * No description * - * @tags pulls - * @name PullsUpdateBranch - * @summary Update a pull request branch - * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch - */ - 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< - { - message?: string; - url?: string; - }, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/update-branch\`, - method: "PUT", - body: data, - type: ContentType.Json, + * @tags repos + * @name ReposGetDeployKey + * @summary Get a deploy key + * @request GET:/repos/{owner}/{repo}/keys/{key_id} + */ + reposGetDeployKey: ( + owner: string, + repo: string, + keyId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, + 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 Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. * * @tags repos - * @name ReposGetReadme - * @summary Get a repository README - * @request GET:/repos/{owner}/{repo}/readme + * @name ReposDeleteDeployKey + * @summary Delete a deploy key + * @request DELETE:/repos/{owner}/{repo}/keys/{key_id} */ - reposGetReadme: ( + reposDeleteDeployKey: ( owner: string, repo: string, - query?: { - /** The name of the commit/branch/tag. Default: the repository’s default branch (usually \`master\`) */ - ref?: string; - }, + keyId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/readme\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/keys/\${keyId}\`, + method: "DELETE", ...params, }), /** - * @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 IssuesListLabelsForRepo + * @summary List labels for a repository + * @request GET:/repos/{owner}/{repo}/labels */ - reposListReleases: ( + issuesListLabelsForRepo: ( owner: string, repo: string, query?: { @@ -32838,8 +32380,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels\`, method: "GET", query: query, format: "json", @@ -32847,40 +32389,28 @@ 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. + * No description * - * @tags repos - * @name ReposCreateRelease - * @summary Create a release - * @request POST:/repos/{owner}/{repo}/releases + * @tags issues + * @name IssuesCreateLabel + * @summary Create a label + * @request POST:/repos/{owner}/{repo}/labels */ - reposCreateRelease: ( + issuesCreateLabel: ( 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; + /** 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: \`/repos/\${owner}/\${repo}/releases\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels\`, method: "POST", body: data, type: ContentType.Json, @@ -32889,57 +32419,50 @@ 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. + * No description * - * @tags repos - * @name ReposGetReleaseAsset - * @summary Get a release asset - * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @tags issues + * @name IssuesGetLabel + * @summary Get a label + * @request GET:/repos/{owner}/{repo}/labels/{name} */ - reposGetReleaseAsset: ( + issuesGetLabel: ( owner: string, repo: string, - assetId: number, + name: string, params: RequestParams = {}, ) => - this.request< - ReleaseAsset, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, 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 issues + * @name IssuesUpdateLabel + * @summary Update a label + * @request PATCH:/repos/{owner}/{repo}/labels/{name} */ - reposUpdateReleaseAsset: ( + issuesUpdateLabel: ( owner: string, repo: string, - assetId: number, + name: string, 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; + /** 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: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -32950,155 +32473,119 @@ export class Api< /** * No description * - * @tags repos - * @name ReposDeleteReleaseAsset - * @summary Delete a release asset - * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} + * @tags issues + * @name IssuesDeleteLabel + * @summary Delete a label + * @request DELETE:/repos/{owner}/{repo}/labels/{name} */ - reposDeleteReleaseAsset: ( + issuesDeleteLabel: ( owner: string, repo: string, - assetId: number, + name: string, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + path: \`/repos/\${owner}/\${repo}/labels/\${name}\`, method: "DELETE", ...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. - * - * @tags repos - * @name ReposGetLatestRelease - * @summary Get the latest release - * @request GET:/repos/{owner}/{repo}/releases/latest - */ - 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. + * @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 ReposGetReleaseByTag - * @summary Get a release by tag name - * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} + * @name ReposListLanguages + * @summary List repository languages + * @request GET:/repos/{owner}/{repo}/languages */ - reposGetReleaseByTag: ( + reposListLanguages: ( owner: string, repo: string, - tag: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/tags/\${tag}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/languages\`, 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 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 ReposGetRelease - * @summary Get a release - * @request GET:/repos/{owner}/{repo}/releases/{release_id} + * @tags licenses + * @name LicensesGetForRepo + * @summary Get the license for a repository + * @request GET:/repos/{owner}/{repo}/license */ - reposGetRelease: ( + licensesGetForRepo: ( owner: string, repo: string, - releaseId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/license\`, method: "GET", format: "json", ...params, }), /** - * @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} - */ - 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 Users with push access to the repository can delete a release. + * No description * - * @tags repos - * @name ReposDeleteRelease - * @summary Delete a release - * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} + * @tags repos + * @name ReposMerge + * @summary Merge a branch + * @request POST:/repos/{owner}/{repo}/merges */ - reposDeleteRelease: ( + reposMerge: ( owner: string, repo: string, - releaseId: 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; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, - method: "DELETE", + 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", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** * No description * - * @tags repos - * @name ReposListReleaseAssets - * @summary List release assets - * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets + * @tags issues + * @name IssuesListMilestones + * @summary List milestones + * @request GET:/repos/{owner}/{repo}/milestones */ - reposListReleaseAssets: ( + issuesListMilestones: ( owner: string, repo: string, - releaseId: number, query?: { + /** + * The direction of the sort. Either \`asc\` or \`desc\`. + * @default "asc" + */ + direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -33109,11 +32596,21 @@ 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}/releases/\${releaseId}/assets\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones\`, method: "GET", query: query, format: "json", @@ -33121,166 +32618,192 @@ 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. + * No description * - * @tags repos - * @name ReposUploadReleaseAsset - * @summary Upload a release asset - * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets + * @tags issues + * @name IssuesCreateMilestone + * @summary Create a milestone + * @request POST:/repos/{owner}/{repo}/milestones */ - reposUploadReleaseAsset: ( + issuesCreateMilestone: ( owner: string, repo: string, - releaseId: number, - data: WebhookConfigUrl, - query?: { - label?: string; - name?: 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; + /** + * 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}/releases/\${releaseId}/assets\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones\`, method: "POST", - query: query, 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. + * No description * - * @tags secret-scanning - * @name SecretScanningListAlertsForRepo - * @summary List secret scanning alerts for a repository - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts + * @tags issues + * @name IssuesGetMilestone + * @summary Get a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number} */ - secretScanningListAlertsForRepo: ( + issuesGetMilestone: ( owner: string, repo: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + 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; /** - * Results per page (max 100) - * @default 30 + * The state of the milestone. Either \`open\` or \`closed\`. + * @default "open" */ - per_page?: number; - /** Set to \`open\` or \`resolved\` to only list secret scanning alerts in a specific state. */ - state?: "open" | "resolved"; + state?: "open" | "closed"; + /** The title of the milestone. */ + title?: string; }, params: RequestParams = {}, ) => - this.request< - SecretScanningAlert[], - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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. + * No description * - * @tags secret-scanning - * @name SecretScanningGetAlert - * @summary Get a secret scanning alert - * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * @tags issues + * @name IssuesDeleteMilestone + * @summary Delete a milestone + * @request DELETE:/repos/{owner}/{repo}/milestones/{milestone_number} */ - secretScanningGetAlert: ( + issuesDeleteMilestone: ( owner: string, repo: string, - alertNumber: AlertNumber, + milestoneNumber: number, params: RequestParams = {}, ) => - this.request< - SecretScanningAlert, - void | { - code?: string; - documentation_url?: string; - message?: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/secret-scanning/alerts/\${alertNumber}\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/milestones/\${milestoneNumber}\`, + method: "DELETE", ...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. + * No description * - * @tags secret-scanning - * @name SecretScanningUpdateAlert - * @summary Update a secret scanning alert - * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} + * @tags issues + * @name IssuesListLabelsForMilestone + * @summary List labels for issues in a milestone + * @request GET:/repos/{owner}/{repo}/milestones/{milestone_number}/labels */ - secretScanningUpdateAlert: ( + issuesListLabelsForMilestone: ( 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; + milestoneNumber: 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< - SecretScanningAlert, - 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}/milestones/\${milestoneNumber}/labels\`, + method: "GET", + query: query, format: "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 List all notifications for the current user. * * @tags activity - * @name ActivityListStargazersForRepo - * @summary List stargazers - * @request GET:/repos/{owner}/{repo}/stargazers + * @name ActivityListRepoNotificationsForAuthenticatedUser + * @summary List repository notifications for the authenticated user + * @request GET:/repos/{owner}/{repo}/notifications */ - activityListStargazersForRepo: ( + activityListRepoNotificationsForAuthenticatedUser: ( owner: string, repo: 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}/stargazers\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/notifications\`, method: "GET", query: query, format: "json", @@ -33288,154 +32811,162 @@ export class Api< }), /** - * @description Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + * @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 ReposGetCodeFrequencyStats - * @summary Get the weekly commit activity - * @request GET:/repos/{owner}/{repo}/stats/code_frequency + * @tags activity + * @name ActivityMarkRepoNotificationsAsRead + * @summary Mark repository notifications as read + * @request PUT:/repos/{owner}/{repo}/notifications */ - reposGetCodeFrequencyStats: ( + 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}/stats/code_frequency\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/notifications\`, + method: "PUT", + body: data, + type: ContentType.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\`. + * No description * * @tags repos - * @name ReposGetCommitActivityStats - * @summary Get the last year of commit activity - * @request GET:/repos/{owner}/{repo}/stats/commit_activity + * @name ReposGetPages + * @summary Get a GitHub Pages site + * @request GET:/repos/{owner}/{repo}/pages */ - reposGetCommitActivityStats: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, + reposGetPages: (owner: string, repo: string, params: RequestParams = {}) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pages\`, method: "GET", 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 Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." * * @tags repos - * @name ReposGetContributorsStats - * @summary Get all contributor commit activity - * @request GET:/repos/{owner}/{repo}/stats/contributors + * @name ReposCreatePagesSite + * @summary Create a GitHub Pages site + * @request POST:/repos/{owner}/{repo}/pages */ - reposGetContributorsStats: ( + reposCreatePagesSite: ( 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"; + }; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/contributors\`, - method: "GET", + this.request< + Page, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "POST", + body: data, + type: ContentType.Json, 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 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 ReposGetParticipationStats - * @summary Get the weekly commit count - * @request GET:/repos/{owner}/{repo}/stats/participation + * @name ReposUpdateInformationAboutPagesSite + * @summary Update information about a GitHub Pages site + * @request PUT:/repos/{owner}/{repo}/pages */ - reposGetParticipationStats: ( + 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: \`/repos/\${owner}/\${repo}/stats/participation\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "PUT", + body: data, + type: ContentType.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 ReposDeletePagesSite + * @summary Delete a GitHub Pages site + * @request DELETE:/repos/{owner}/{repo}/pages */ - reposGetPunchCardStats: ( + reposDeletePagesSite: ( owner: string, repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, - method: "GET", - format: "json", + this.request< + void, + | BasicError + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pages\`, + method: "DELETE", ...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} - */ - reposCreateCommitStatus: ( - owner: string, - repo: string, - sha: string, - data: { - /** - * 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: "error" | "failure" | "pending" | "success"; - /** - * 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; - }, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/statuses/\${sha}\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", - ...params, - }), - - /** - * @description Lists the people watching the specified repository. - * - * @tags activity - * @name ActivityListWatchersForRepo - * @summary List watchers - * @request GET:/repos/{owner}/{repo}/subscribers + * @name ReposListPagesBuilds + * @summary List GitHub Pages builds + * @request GET:/repos/{owner}/{repo}/pages/builds */ - activityListWatchersForRepo: ( + reposListPagesBuilds: ( owner: string, repo: string, query?: { @@ -33452,8 +32983,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscribers\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds\`, method: "GET", query: query, format: "json", @@ -33461,81 +32992,75 @@ export class Api< }), /** - * No description + * @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 activity - * @name ActivityGetRepoSubscription - * @summary Get a repository subscription - * @request GET:/repos/{owner}/{repo}/subscription + * @tags repos + * @name ReposRequestPagesBuild + * @summary Request a GitHub Pages build + * @request POST:/repos/{owner}/{repo}/pages/builds */ - activityGetRepoSubscription: ( + reposRequestPagesBuild: ( owner: string, repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds\`, + method: "POST", 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 repos + * @name ReposGetLatestPagesBuild + * @summary Get latest Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/latest */ - activitySetRepoSubscription: ( + reposGetLatestPagesBuild: ( owner: string, repo: string, - data: { - /** 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: \`/repos/\${owner}/\${repo}/subscription\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds/latest\`, + method: "GET", format: "json", ...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). + * No description * - * @tags activity - * @name ActivityDeleteRepoSubscription - * @summary Delete a repository subscription - * @request DELETE:/repos/{owner}/{repo}/subscription + * @tags repos + * @name ReposGetPagesBuild + * @summary Get GitHub Pages build + * @request GET:/repos/{owner}/{repo}/pages/builds/{build_id} */ - activityDeleteRepoSubscription: ( + reposGetPagesBuild: ( owner: string, repo: string, + buildId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/subscription\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/pages/builds/\${buildId}\`, + method: "GET", + format: "json", ...params, }), /** - * No description + * @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 ReposListTags - * @summary List repository tags - * @request GET:/repos/{owner}/{repo}/tags + * @tags projects + * @name ProjectsListForRepo + * @summary List repository projects + * @request GET:/repos/{owner}/{repo}/projects */ - reposListTags: ( + projectsListForRepo: ( owner: string, repo: string, query?: { @@ -33549,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: \`/repos/\${owner}/\${repo}/tags\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/projects\`, method: "GET", query: query, format: "json", @@ -33561,37 +33091,51 @@ 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 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 ReposDownloadTarballArchive - * @summary Download a repository archive (tar) - * @request GET:/repos/{owner}/{repo}/tarball/{ref} + * @tags projects + * @name ProjectsCreateForRepo + * @summary Create a repository project + * @request POST:/repos/{owner}/{repo}/projects */ - reposDownloadTarballArchive: ( + projectsCreateForRepo: ( owner: string, repo: string, - ref: string, + data: { + /** The description of the project. */ + body?: string; + /** The name of the project. */ + name: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/tarball/\${ref}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/projects\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * No description + * @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 ReposListTeams - * @summary List repository teams - * @request GET:/repos/{owner}/{repo}/teams + * @tags pulls + * @name PullsList + * @summary List pull requests + * @request GET:/repos/{owner}/{repo}/pulls */ - reposListTeams: ( + 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 @@ -33602,11 +33146,21 @@ export class Api< * @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}/teams\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls\`, method: "GET", query: query, format: "json", @@ -33614,156 +33168,198 @@ export class Api< }), /** - * No description + * @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 ReposGetAllTopics - * @summary Get all repository topics - * @request GET:/repos/{owner}/{repo}/topics + * @tags pulls + * @name PullsCreate + * @summary Create a pull request + * @request POST:/repos/{owner}/{repo}/pulls */ - reposGetAllTopics: ( + pullsCreate: ( 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; + }, params: RequestParams = {}, ) => - this.request< - Topic, - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/repos/\${owner}/\${repo}/topics\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. * - * @tags repos - * @name ReposReplaceAllTopics - * @summary Replace all repository topics - * @request PUT:/repos/{owner}/{repo}/topics + * @tags pulls + * @name PullsListReviewCommentsForRepo + * @summary List review comments in a repository + * @request GET:/repos/{owner}/{repo}/pulls/comments */ - reposReplaceAllTopics: ( + pullsListReviewCommentsForRepo: ( 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[]; + 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< - Topic, - | 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}/pulls/comments\`, + 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 Provides details for a review comment. * - * @tags repos - * @name ReposGetClones - * @summary Get repository clones - * @request GET:/repos/{owner}/{repo}/traffic/clones + * @tags pulls + * @name PullsGetReviewComment + * @summary Get a review comment for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reposGetClones: ( + pullsGetReviewComment: ( owner: string, repo: string, - query?: { - /** - * Must be one of: \`day\`, \`week\`. - * @default "day" - */ - per?: "day" | "week"; - }, + commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/clones\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Get the top 10 popular contents over the last 14 days. + * @description Enables you to edit a review comment. * - * @tags repos - * @name ReposGetTopPaths - * @summary Get top referral paths - * @request GET:/repos/{owner}/{repo}/traffic/popular/paths + * @tags pulls + * @name PullsUpdateReviewComment + * @summary Update a review comment for a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reposGetTopPaths: ( + pullsUpdateReviewComment: ( owner: string, repo: string, + commentId: number, + data: { + /** The text of the reply to the review comment. */ + body: string; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Get the top 10 referrers over the last 14 days. + * @description Deletes a review comment. * - * @tags repos - * @name ReposGetTopReferrers - * @summary Get top referral sources - * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers + * @tags pulls + * @name PullsDeleteReviewComment + * @summary Delete a review comment for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id} */ - reposGetTopReferrers: ( + pullsDeleteReviewComment: ( owner: string, repo: string, + commentId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, - method: "GET", - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}\`, + method: "DELETE", ...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 List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). * - * @tags repos - * @name ReposGetViews - * @summary Get page views - * @request GET:/repos/{owner}/{repo}/traffic/views + * @tags reactions + * @name ReactionsListForPullRequestReviewComment + * @summary List reactions for a pull request review comment + * @request GET:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions */ - reposGetViews: ( + 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 pull request review comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; /** - * 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; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/traffic/views\`, + this.request< + Reaction[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, method: "GET", query: query, format: "json", @@ -33771,26 +33367,40 @@ 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 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 repos - * @name ReposTransfer - * @summary Transfer a repository - * @request POST:/repos/{owner}/{repo}/transfer + * @tags reactions + * @name ReactionsCreateForPullRequestReviewComment + * @summary Create reaction for a pull request review comment + * @request POST:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions */ - reposTransfer: ( + reactionsCreateForPullRequestReviewComment: ( owner: string, repo: string, + commentId: 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 [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"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/transfer\`, + this.request< + Reaction, + | { + documentation_url: string; + message: string; + } + | ValidationError + >({ + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions\`, method: "POST", body: data, type: ContentType.Json, @@ -33799,197 +33409,189 @@ 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)". - * - * @tags repos - * @name ReposEnableVulnerabilityAlerts - * @summary Enable vulnerability alerts - * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts - */ - reposEnableVulnerabilityAlerts: ( - owner: string, - repo: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, - method: "PUT", - ...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 **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 repos - * @name ReposDisableVulnerabilityAlerts - * @summary Disable vulnerability alerts - * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts + * @tags reactions + * @name ReactionsDeleteForPullRequestComment + * @summary Delete a pull request comment reaction + * @request DELETE:/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id} */ - reposDisableVulnerabilityAlerts: ( + reactionsDeleteForPullRequestComment: ( owner: string, repo: string, + commentId: number, + reactionId: number, params: RequestParams = {}, ) => this.request({ - path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + path: \`/repos/\${owner}/\${repo}/pulls/comments/\${commentId}/reactions/\${reactionId}\`, method: "DELETE", ...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 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 ReposDownloadZipballArchive - * @summary Download a repository archive (zip) - * @request GET:/repos/{owner}/{repo}/zipball/{ref} + * @tags pulls + * @name PullsGet + * @summary Get a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number} */ - reposDownloadZipballArchive: ( + pullsGet: ( owner: string, repo: string, - ref: string, + pullNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, 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 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 repos - * @name ReposCreateUsingTemplate - * @summary Create a repository using a template - * @request POST:/repos/{template_owner}/{template_repo}/generate + * @tags pulls + * @name PullsUpdate + * @summary Update a pull request + * @request PATCH:/repos/{owner}/{repo}/pulls/{pull_number} */ - reposCreateUsingTemplate: ( - templateOwner: string, - templateRepo: string, + pullsUpdate: ( + owner: string, + repo: string, + pullNumber: 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 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({ - path: \`/repos/\${templateOwner}/\${templateRepo}/generate\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}\`, + 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. + * @description Lists all review comments for a pull request. By default, review comments are in ascending order by ID. * - * @tags repos - * @name ReposListPublic - * @summary List public repositories - * @request GET:/repositories + * @tags pulls + * @name PullsListReviewComments + * @summary List review comments on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - reposListPublic: ( + pullsListReviewComments: ( + owner: string, + repo: string, + pullNumber: number, query?: { - /** A repository ID. Only return repositories with an ID greater than this ID. */ - since?: number; + /** 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: \`/repositories\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/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 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 enterprise-admin - * @name EnterpriseAdminListProvisionedGroupsEnterprise - * @summary List provisioned SCIM groups for an enterprise - * @request GET:/scim/v2/enterprises/{enterprise}/Groups + * @tags pulls + * @name PullsCreateReviewComment + * @summary Create a review comment for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments */ - 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; + 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: \`/scim/v2/enterprises/\${enterprise}/Groups\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments\`, + 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. 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 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 enterprise-admin - * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup - * @summary Provision a SCIM enterprise group and invite users - * @request POST:/scim/v2/enterprises/{enterprise}/Groups + * @tags pulls + * @name PullsCreateReplyForReviewComment + * @summary Create a reply for a review comment + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies */ - enterpriseAdminProvisionAndInviteEnterpriseGroup: ( - enterprise: string, + pullsCreateReplyForReviewComment: ( + owner: string, + repo: string, + pullNumber: number, + commentId: 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 text of the review comment. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/comments/\${commentId}/replies\`, method: "POST", body: data, type: ContentType.Json, @@ -33998,124 +33600,162 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * @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 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 PullsListCommits + * @summary List commits on a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/commits */ - enterpriseAdminGetProvisioningInformationForEnterpriseGroup: ( - enterprise: string, - scimGroupId: 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: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/commits\`, 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 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 **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. * - * @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 PullsListFiles + * @summary List pull requests files + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/files */ - 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[]; + pullsListFiles: ( + 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: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/files\`, + 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). + * No description * - * @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 pulls + * @name PullsCheckIfMerged + * @summary Check if a pull request has been merged + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - 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[]; - }, + pullsCheckIfMerged: ( + owner: string, + repo: string, + pullNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "PATCH", - body: data, - type: ContentType.Json, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/merge\`, + method: "GET", ...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 EnterpriseAdminDeleteScimGroupFromEnterprise - * @summary Delete a SCIM group from an enterprise - * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} + * @tags pulls + * @name PullsMerge + * @summary Merge a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/merge */ - enterpriseAdminDeleteScimGroupFromEnterprise: ( - enterprise: string, - scimGroupId: string, + pullsMerge: ( + 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, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, - method: "DELETE", + this.request< + PullRequestMergeResult, + | BasicError + | { + documentation_url?: string; + message?: string; + } + | ValidationError + >({ + 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. 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 pulls + * @name PullsListRequestedReviewers + * @summary List requested reviewers for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - enterpriseAdminListProvisionedIdentitiesEnterprise: ( - enterprise: string, + pullsListRequestedReviewers: ( + owner: string, + repo: string, + pullNumber: 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({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, method: "GET", query: query, format: "json", @@ -34123,44 +33763,27 @@ 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 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 EnterpriseAdminProvisionAndInviteEnterpriseUser - * @summary Provision and invite a SCIM enterprise user - * @request POST:/scim/v2/enterprises/{enterprise}/Users + * @tags pulls + * @name PullsRequestReviewers + * @summary Request reviewers for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - enterpriseAdminProvisionAndInviteEnterpriseUser: ( - enterprise: string, + pullsRequestReviewers: ( + owner: string, + repo: string, + pullNumber: number, 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; + /** 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: \`/scim/v2/enterprises/\${enterprise}/Users\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/requested_reviewers\`, method: "POST", body: data, type: ContentType.Json, @@ -34169,94 +33792,109 @@ export class Api< }), /** - * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * No description * - * @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 PullsRemoveRequestedReviewers + * @summary Remove requested reviewers from a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers */ - enterpriseAdminGetProvisioningInformationForEnterpriseUser: ( - enterprise: string, - scimUserId: string, + pullsRemoveRequestedReviewers: ( + 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[]; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - 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. 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 The list of reviews returns in chronological order. * - * @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 pulls + * @name PullsListReviews + * @summary List reviews for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews */ - 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; + 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: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + 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. 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 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 enterprise-admin - * @name EnterpriseAdminUpdateAttributeForEnterpriseUser - * @summary Update an attribute for a SCIM enterprise user - * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} + * @tags pulls + * @name PullsCreateReview + * @summary Create a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews */ - enterpriseAdminUpdateAttributeForEnterpriseUser: ( - enterprise: string, - scimUserId: string, + pullsCreateReview: ( + owner: string, + repo: string, + pullNumber: number, data: { - /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ - Operations: object[]; - /** The SCIM schema URIs. */ - schemas: string[]; + /** **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: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -34264,107 +33902,49 @@ export class Api< }), /** - * @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: string, - scimUserId: string, - params: RequestParams = {}, - ) => - this.request({ - path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, - 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 pulls + * @name PullsGetReview + * @summary Get a review for a pull request + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - scimListProvisionedIdentities: ( - org: 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\\"\`. - */ - filter?: string; - /** Used for pagination: the index of the first result to return. */ - startIndex?: number; - }, + pullsGetReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, method: "GET", - query: query, format: "json", ...params, }), /** - * @description Provision organization membership for a user, and send an activation email to the email address. + * @description Update the review summary comment with new text. * - * @tags scim - * @name ScimProvisionAndInviteUser - * @summary Provision and invite a SCIM user - * @request POST:/scim/v2/organizations/{org}/Users + * @tags pulls + * @name PullsUpdateReview + * @summary Update a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - scimProvisionAndInviteUser: ( - org: string, + pullsUpdateReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, 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 body text of the pull request review. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users\`, - method: "POST", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -34374,118 +33954,84 @@ 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 pulls + * @name PullsDeletePendingReview + * @summary Delete a pending review for a pull request + * @request DELETE:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id} */ - scimGetProvisioningInformationForUser: ( - org: string, - scimUserId: string, + pullsDeletePendingReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}\`, + method: "DELETE", 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}\`. + * @description List comments for a specific pull request review. * - * @tags scim - * @name ScimSetInformationForProvisionedUser - * @summary Update a provisioned organization membership - * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags pulls + * @name PullsListCommentsForReview + * @summary List comments for a pull request review + * @request GET:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments */ - scimSetInformationForProvisionedUser: ( - org: string, - scimUserId: string, - data: { - active?: boolean; - /** - * The name of the user, suitable for display to end-users - * @example "Jon Doe" - */ - displayName?: string; + pullsListCommentsForReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, + query?: { /** - * user emails - * @minItems 1 - * @example [{"value":"someone@example.com","primary":true},{"value":"another@example.com","primary":false}] + * Page number of the results to fetch. + * @default 1 */ - 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[]; + page?: number; /** - * Configured by the admin. Could be an email, login, or username - * @example "someone@example.com" + * Results per page (max 100) + * @default 30 */ - userName: string; + per_page?: number; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "PUT", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/comments\`, + method: "GET", + query: query, format: "json", ...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 **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 scim - * @name ScimUpdateAttributeForUser - * @summary Update an attribute for a SCIM user - * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} + * @tags pulls + * @name PullsDismissReview + * @summary Dismiss a review for a pull request + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals */ - scimUpdateAttributeForUser: ( - org: string, - scimUserId: string, + pullsDismissReview: ( + owner: string, + repo: string, + pullNumber: number, + reviewId: number, 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[]; + /** @example ""APPROVE"" */ + event?: string; + /** The message for the pull request review dismissal */ + message: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, - method: "PATCH", + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/dismissals\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -34495,120 +34041,90 @@ export class Api< /** * 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: 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 + * @tags pulls + * @name PullsSubmitReview + * @summary Submit a review for a pull request + * @request POST:/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events */ - 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"; + pullsSubmitReview: ( + 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"; }, params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/reviews/\${reviewId}/events\`, + method: "POST", + body: data, + type: ContentType.Json, + 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. + * + * @tags pulls + * @name PullsUpdateBranch + * @summary Update a pull request branch + * @request PUT:/repos/{owner}/{repo}/pulls/{pull_number}/update-branch + */ + 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< { - incomplete_results: boolean; - items: CodeSearchResultItem[]; - total_count: number; + message?: string; + url?: string; }, | BasicError - | ValidationError | { - code?: string; - documentation_url?: string; - message?: string; + documentation_url: string; + message: string; } + | ValidationError >({ - path: \`/search/code\`, - method: "GET", - query: query, + path: \`/repos/\${owner}/\${repo}/pulls/\${pullNumber}/update-branch\`, + method: "PUT", + 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\` + * @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 search - * @name SearchCommits - * @summary Search commits - * @request GET:/search/commits + * @tags repos + * @name ReposGetReadme + * @summary Get a repository README + * @request GET:/repos/{owner}/{repo}/readme */ - 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 - */ - 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?: "author-date" | "committer-date"; + 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< - { - incomplete_results: boolean; - items: CommitSearchResultItem[]; - total_count: number; - }, - { - documentation_url: string; - message: string; - } - >({ - path: \`/search/commits\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/readme\`, method: "GET", query: query, format: "json", @@ -34616,20 +34132,17 @@ 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 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 search - * @name SearchIssuesAndPullRequests - * @summary Search issues and pull requests - * @request GET:/search/issues + * @tags repos + * @name ReposListReleases + * @summary List releases + * @request GET:/repos/{owner}/{repo}/releases */ - 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"; + reposListReleases: ( + owner: string, + repo: string, + query?: { /** * Page number of the results to fetch. * @default 1 @@ -34640,39 +34153,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 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< - { - 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}/releases\`, method: "GET", query: query, format: "json", @@ -34680,239 +34165,218 @@ 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 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 search - * @name SearchLabels - * @summary Search labels - * @request GET:/search/labels + * @tags repos + * @name ReposCreateRelease + * @summary Create a release + * @request POST:/repos/{owner}/{repo}/releases */ - searchLabels: ( - query: { + reposCreateRelease: ( + owner: string, + repo: string, + data: { + /** Text describing the contents of the tag. */ + body?: 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" + * \`true\` to create a draft (unpublished) release, \`false\` to create a published one. + * @default false */ - 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"; + 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< - { - incomplete_results: boolean; - items: LabelSearchResultItem[]; - total_count: number; - }, - BasicError | ValidationError - >({ - path: \`/search/labels\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases\`, + 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 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 search - * @name SearchRepos - * @summary Search repositories - * @request GET:/search/repositories + * @tags repos + * @name ReposGetReleaseAsset + * @summary Get a release asset + * @request GET:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - 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 - */ - 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?: "stars" | "forks" | "help-wanted-issues" | "updated"; - }, + reposGetReleaseAsset: ( + owner: string, + repo: string, + assetId: number, params: RequestParams = {}, ) => this.request< - { - incomplete_results: boolean; - items: RepoSearchResultItem[]; - total_count: number; - }, - | ValidationError + ReleaseAsset, + | BasicError | { - code?: string; - documentation_url?: string; - message?: string; + documentation_url: string; + message: string; } >({ - path: \`/search/repositories\`, + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, 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. + * @description Users with push access to the repository can edit a release asset. * - * @tags search - * @name SearchTopics - * @summary Search topics - * @request GET:/search/topics + * @tags repos + * @name ReposUpdateReleaseAsset + * @summary Update a release asset + * @request PATCH:/repos/{owner}/{repo}/releases/assets/{asset_id} */ - 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; + 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< - { - incomplete_results: boolean; - items: TopicSearchResultItem[]; - total_count: number; - }, - { - documentation_url: string; - message: string; - } - >({ - path: \`/search/topics\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * No description + * + * @tags repos + * @name ReposDeleteReleaseAsset + * @summary Delete a release asset + * @request DELETE:/repos/{owner}/{repo}/releases/assets/{asset_id} + */ + reposDeleteReleaseAsset: ( + owner: string, + repo: string, + assetId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/assets/\${assetId}\`, + method: "DELETE", + ...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. + * + * @tags repos + * @name ReposGetLatestRelease + * @summary Get the latest release + * @request GET:/repos/{owner}/{repo}/releases/latest + */ + reposGetLatestRelease: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/latest\`, method: "GET", - query: query, 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 Get a published release with the specified tag. * - * @tags search - * @name SearchUsers - * @summary Search users - * @request GET:/search/users + * @tags repos + * @name ReposGetReleaseByTag + * @summary Get a release by tag name + * @request GET:/repos/{owner}/{repo}/releases/tags/{tag} */ - 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 - */ - 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?: "followers" | "repositories" | "joined"; - }, + reposGetReleaseByTag: ( + owner: string, + repo: string, + tag: 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}/releases/tags/\${tag}\`, 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. + * @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 teams - * @name TeamsGetLegacy - * @summary Get a team (Legacy) - * @request GET:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposGetRelease + * @summary Get a release + * @request GET:/repos/{owner}/{repo}/releases/{release_id} */ - teamsGetLegacy: (teamId: number, params: RequestParams = {}) => - this.request({ - path: \`/teams/\${teamId}\`, + reposGetRelease: ( + owner: string, + repo: string, + releaseId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, 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 Users with push access to the repository can edit a release. * - * @tags teams - * @name TeamsUpdateLegacy - * @summary Update a team (Legacy) - * @request PATCH:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposUpdateRelease + * @summary Update a release + * @request PATCH:/repos/{owner}/{repo}/releases/{release_id} */ - teamsUpdateLegacy: ( - teamId: number, + reposUpdateRelease: ( + owner: string, + repo: string, + releaseId: 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"; + /** 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: \`/teams/\${teamId}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -34921,38 +34385,38 @@ 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 Users with push access to the repository can delete a release. * - * @tags teams - * @name TeamsDeleteLegacy - * @summary Delete a team (Legacy) - * @request DELETE:/teams/{team_id} - * @deprecated + * @tags repos + * @name ReposDeleteRelease + * @summary Delete a release + * @request DELETE:/repos/{owner}/{repo}/releases/{release_id} */ - teamsDeleteLegacy: (teamId: number, params: RequestParams = {}) => - this.request({ - path: \`/teams/\${teamId}\`, + reposDeleteRelease: ( + owner: string, + repo: string, + releaseId: number, + params: RequestParams = {}, + ) => + 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 [\`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 - */ - teamsListDiscussionsLegacy: ( - teamId: number, + * @tags repos + * @name ReposListReleaseAssets + * @summary List release assets + * @request GET:/repos/{owner}/{repo}/releases/{release_id}/assets + */ + reposListReleaseAssets: ( + owner: string, + repo: string, + releaseId: number, query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -34966,8 +34430,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, method: "GET", query: query, format: "json", @@ -34975,126 +34439,151 @@ 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 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 teams - * @name TeamsCreateDiscussionLegacy - * @summary Create a discussion (Legacy) - * @request POST:/teams/{team_id}/discussions - * @deprecated + * @tags repos + * @name ReposUploadReleaseAsset + * @summary Upload a release asset + * @request POST:/repos/{owner}/{repo}/releases/{release_id}/assets */ - 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; + reposUploadReleaseAsset: ( + owner: string, + repo: string, + releaseId: number, + data: WebhookConfigUrl, + query?: { + label?: string; + name?: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/releases/\${releaseId}/assets\`, method: "POST", + query: query, 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 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 teams - * @name TeamsGetDiscussionLegacy - * @summary Get a discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags secret-scanning + * @name SecretScanningListAlertsForRepo + * @summary List secret scanning alerts for a repository + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts */ - teamsGetDiscussionLegacy: ( - teamId: number, - discussionNumber: 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: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + 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 **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 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 teams - * @name TeamsUpdateDiscussionLegacy - * @summary Update a discussion (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags secret-scanning + * @name SecretScanningGetAlert + * @summary Get a secret scanning alert + * @request GET:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} */ - teamsUpdateDiscussionLegacy: ( - teamId: number, - discussionNumber: number, - data: { - /** The discussion post's body text. */ - body?: string; - /** The discussion post's title. */ - title?: string; - }, + secretScanningGetAlert: ( + owner: string, + repo: string, + alertNumber: AlertNumber, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + 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 **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 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 teams - * @name TeamsDeleteDiscussionLegacy - * @summary Delete a discussion (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number} - * @deprecated + * @tags secret-scanning + * @name SecretScanningUpdateAlert + * @summary Update a secret scanning alert + * @request PATCH:/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number} */ - teamsDeleteDiscussionLegacy: ( - teamId: number, - discussionNumber: 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({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, - method: "DELETE", + this.request< + SecretScanningAlert, + 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, }), /** - * @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 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 teams - * @name TeamsListDiscussionCommentsLegacy - * @summary List discussion comments (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @tags activity + * @name ActivityListStargazersForRepo + * @summary List stargazers + * @request GET:/repos/{owner}/{repo}/stargazers */ - teamsListDiscussionCommentsLegacy: ( - teamId: number, - discussionNumber: number, + activityListStargazersForRepo: ( + 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 @@ -35108,8 +34597,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/stargazers\`, method: "GET", query: query, format: "json", @@ -35117,127 +34606,157 @@ 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 Returns a weekly aggregate of the number of additions and deletions pushed to a repository. * - * @tags teams - * @name TeamsCreateDiscussionCommentLegacy - * @summary Create a discussion comment (Legacy) - * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments - * @deprecated + * @tags repos + * @name ReposGetCodeFrequencyStats + * @summary Get the weekly commit activity + * @request GET:/repos/{owner}/{repo}/stats/code_frequency */ - teamsCreateDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - data: { - /** The discussion comment's body text. */ - body: string; - }, + reposGetCodeFrequencyStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/code_frequency\`, + 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\`. + * + * @tags repos + * @name ReposGetCommitActivityStats + * @summary Get the last year of commit activity + * @request GET:/repos/{owner}/{repo}/stats/commit_activity + */ + reposGetCommitActivityStats: ( + owner: string, + repo: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/commit_activity\`, + method: "GET", + 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 + * + * @tags repos + * @name ReposGetContributorsStats + * @summary Get all contributor commit activity + * @request GET:/repos/{owner}/{repo}/stats/contributors + */ + reposGetContributorsStats: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/contributors\`, + 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 [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 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 teams - * @name TeamsGetDiscussionCommentLegacy - * @summary Get a discussion comment (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags repos + * @name ReposGetParticipationStats + * @summary Get the weekly commit count + * @request GET:/repos/{owner}/{repo}/stats/participation */ - teamsGetDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, + reposGetParticipationStats: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/participation\`, 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/). + * @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 teams - * @name TeamsUpdateDiscussionCommentLegacy - * @summary Update a discussion comment (Legacy) - * @request PATCH:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags repos + * @name ReposGetPunchCardStats + * @summary Get the hourly commit count for each day + * @request GET:/repos/{owner}/{repo}/stats/punch_card */ - teamsUpdateDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, - data: { - /** The discussion comment's body text. */ - body: string; - }, + reposGetPunchCardStats: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/stats/punch_card\`, + 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/). + * @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 TeamsDeleteDiscussionCommentLegacy - * @summary Delete a discussion comment (Legacy) - * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} - * @deprecated + * @tags repos + * @name ReposCreateCommitStatus + * @summary Create a commit status + * @request POST:/repos/{owner}/{repo}/statuses/{sha} */ - teamsDeleteDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, + reposCreateCommitStatus: ( + owner: string, + repo: string, + sha: string, + data: { + /** + * 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: "error" | "failure" | "pending" | "success"; + /** + * 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; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, - method: "DELETE", + 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 [\`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 the people watching the specified repository. * - * @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 activity + * @name ActivityListWatchersForRepo + * @summary List watchers + * @request GET:/repos/{owner}/{repo}/subscribers */ - reactionsListForTeamDiscussionCommentLegacy: ( - teamId: number, - discussionNumber: number, - commentNumber: number, + activityListWatchersForRepo: ( + 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"; /** * Page number of the results to fetch. * @default 1 @@ -35251,8 +34770,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscribers\`, method: "GET", query: query, format: "json", @@ -35260,131 +34779,83 @@ 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 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. + * No description * - * @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 activity + * @name ActivityGetRepoSubscription + * @summary Get a repository subscription + * @request GET:/repos/{owner}/{repo}/subscription */ - 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"; - }, + activityGetRepoSubscription: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, + 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 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 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 reactions - * @name ReactionsListForTeamDiscussionLegacy - * @summary List reactions for a team discussion (Legacy) - * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions - * @deprecated + * @tags activity + * @name ActivitySetRepoSubscription + * @summary Set a repository subscription + * @request PUT:/repos/{owner}/{repo}/subscription */ - 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; + activitySetRepoSubscription: ( + owner: string, + repo: string, + data: { + /** 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: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, - method: "GET", - query: query, + this.request({ + path: \`/repos/\${owner}/\${repo}/subscription\`, + 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 [\`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 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 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"; - }, + * @tags activity + * @name ActivityDeleteRepoSubscription + * @summary Delete a repository subscription + * @request DELETE:/repos/{owner}/{repo}/subscription + */ + activityDeleteRepoSubscription: ( + owner: string, + repo: string, 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}/subscription\`, + 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\`. + * No description * - * @tags teams - * @name TeamsListPendingInvitationsLegacy - * @summary List pending team invitations (Legacy) - * @request GET:/teams/{team_id}/invitations - * @deprecated + * @tags repos + * @name ReposListTags + * @summary List repository tags + * @request GET:/repos/{owner}/{repo}/tags */ - teamsListPendingInvitationsLegacy: ( - teamId: number, + reposListTags: ( + owner: string, + repo: string, query?: { /** * Page number of the results to fetch. @@ -35399,8 +34870,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/invitations\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/tags\`, method: "GET", query: query, format: "json", @@ -35408,16 +34879,36 @@ 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 team members\`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. Team members will include the members of child teams. + * @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 TeamsListMembersLegacy - * @summary List team members (Legacy) - * @request GET:/teams/{team_id}/members - * @deprecated + * @tags repos + * @name ReposDownloadTarballArchive + * @summary Download a repository archive (tar) + * @request GET:/repos/{owner}/{repo}/tarball/{ref} */ - teamsListMembersLegacy: ( - teamId: number, + 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. @@ -35429,19 +34920,11 @@ 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: \`/teams/\${teamId}/members\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/teams\`, method: "GET", query: query, format: "json", @@ -35449,200 +34932,156 @@ export class Api< }), /** - * @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. + * No description * - * @tags teams - * @name TeamsGetMemberLegacy - * @summary Get team member (Legacy) - * @request GET:/teams/{team_id}/members/{username} - * @deprecated + * @tags repos + * @name ReposGetAllTopics + * @summary Get all repository topics + * @request GET:/repos/{owner}/{repo}/topics */ - teamsGetMemberLegacy: ( - teamId: number, - username: string, + reposGetAllTopics: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/members/\${username}\`, + this.request< + Topic, + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/repos/\${owner}/\${repo}/topics\`, method: "GET", + 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)." + * No description * - * @tags teams - * @name TeamsAddMemberLegacy - * @summary Add team member (Legacy) - * @request PUT:/teams/{team_id}/members/{username} - * @deprecated + * @tags repos + * @name ReposReplaceAllTopics + * @summary Replace all repository topics + * @request PUT:/repos/{owner}/{repo}/topics */ - teamsAddMemberLegacy: ( - teamId: number, - username: string, + 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< - void, + Topic, | BasicError - | void | { - /** @example ""https://docs.github.com/rest"" */ - documentation_url?: string; - errors?: { - code?: string; - field?: string; - resource?: string; - }[]; - message?: string; + documentation_url: string; + message: string; } + | ValidationErrorSimple >({ - path: \`/teams/\${teamId}/members/\${username}\`, + path: \`/repos/\${owner}/\${repo}/topics\`, 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 - */ - teamsRemoveMemberLegacy: ( - teamId: number, - username: string, - 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 [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 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 teams - * @name TeamsGetMembershipForUserLegacy - * @summary Get team membership for a user (Legacy) - * @request GET:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags repos + * @name ReposGetClones + * @summary Get repository clones + * @request GET:/repos/{owner}/{repo}/traffic/clones */ - teamsGetMembershipForUserLegacy: ( - teamId: number, - username: string, + reposGetClones: ( + owner: string, + repo: string, + query?: { + /** + * Must be one of: \`day\`, \`week\`. + * @default "day" + */ + per?: "day" | "week"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/memberships/\${username}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/clones\`, 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 [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 Get the top 10 popular contents over the last 14 days. * - * @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 ReposGetTopPaths + * @summary Get top referral paths + * @request GET:/repos/{owner}/{repo}/traffic/popular/paths */ - 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"; - }, + reposGetTopPaths: ( + owner: string, + repo: 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", - body: data, - type: ContentType.Json, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/popular/paths\`, + 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 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 Get the top 10 referrers over the last 14 days. * - * @tags teams - * @name TeamsRemoveMembershipForUserLegacy - * @summary Remove team membership for a user (Legacy) - * @request DELETE:/teams/{team_id}/memberships/{username} - * @deprecated + * @tags repos + * @name ReposGetTopReferrers + * @summary Get top referral sources + * @request GET:/repos/{owner}/{repo}/traffic/popular/referrers */ - teamsRemoveMembershipForUserLegacy: ( - teamId: number, - username: string, + reposGetTopReferrers: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/memberships/\${username}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/popular/referrers\`, + 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. + * @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 teams - * @name TeamsListProjectsLegacy - * @summary List team projects (Legacy) - * @request GET:/teams/{team_id}/projects - * @deprecated + * @tags repos + * @name ReposGetViews + * @summary Get page views + * @request GET:/repos/{owner}/{repo}/traffic/views */ - teamsListProjectsLegacy: ( - teamId: number, + 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< - TeamProject[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/teams/\${teamId}/projects\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/traffic/views\`, method: "GET", query: query, format: "json", @@ -35650,266 +35089,226 @@ 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. + * @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 teams - * @name TeamsCheckPermissionsForProjectLegacy - * @summary Check team permissions for a project (Legacy) - * @request GET:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags repos + * @name ReposTransfer + * @summary Transfer a repository + * @request POST:/repos/{owner}/{repo}/transfer */ - teamsCheckPermissionsForProjectLegacy: ( - teamId: number, - projectId: number, + reposTransfer: ( + owner: string, + repo: string, + 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[]; + }, params: RequestParams = {}, ) => - this.request< - TeamProject, - void | { - documentation_url: string; - message: string; - } - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, - method: "GET", + this.request({ + path: \`/repos/\${owner}/\${repo}/transfer\`, + 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 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 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 teams - * @name TeamsAddOrUpdateProjectPermissionsLegacy - * @summary Add or update team project permissions (Legacy) - * @request PUT:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags repos + * @name ReposCheckVulnerabilityAlerts + * @summary Check if vulnerability alerts are enabled for a repository + * @request GET:/repos/{owner}/{repo}/vulnerability-alerts */ - 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"; - }, + reposCheckVulnerabilityAlerts: ( + owner: string, + repo: string, 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, + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + 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 [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. + * @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 teams - * @name TeamsRemoveProjectLegacy - * @summary Remove a project from a team (Legacy) - * @request DELETE:/teams/{team_id}/projects/{project_id} - * @deprecated + * @tags repos + * @name ReposEnableVulnerabilityAlerts + * @summary Enable vulnerability alerts + * @request PUT:/repos/{owner}/{repo}/vulnerability-alerts */ - teamsRemoveProjectLegacy: ( - teamId: number, - projectId: number, + reposEnableVulnerabilityAlerts: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request< - void, - | BasicError - | { - documentation_url: string; - message: string; - } - | ValidationError - >({ - path: \`/teams/\${teamId}/projects/\${projectId}\`, - method: "DELETE", + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + 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 [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. + * @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 TeamsListReposLegacy - * @summary List team repositories (Legacy) - * @request GET:/teams/{team_id}/repos - * @deprecated + * @tags repos + * @name ReposDisableVulnerabilityAlerts + * @summary Disable vulnerability alerts + * @request DELETE:/repos/{owner}/{repo}/vulnerability-alerts */ - 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; - }, + reposDisableVulnerabilityAlerts: ( + owner: string, + repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/repos/\${owner}/\${repo}/vulnerability-alerts\`, + method: "DELETE", ...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 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 TeamsCheckPermissionsForRepoLegacy - * @summary Check team permissions for a repository (Legacy) - * @request GET:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags repos + * @name ReposDownloadZipballArchive + * @summary Download a repository archive (zip) + * @request GET:/repos/{owner}/{repo}/zipball/{ref} */ - teamsCheckPermissionsForRepoLegacy: ( - teamId: number, + reposDownloadZipballArchive: ( owner: string, repo: string, + ref: string, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, + this.request({ + path: \`/repos/\${owner}/\${repo}/zipball/\${ref}\`, 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 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)." + * @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 TeamsAddOrUpdateRepoPermissionsLegacy - * @summary Add or update team repository permissions (Legacy) - * @request PUT:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags repos + * @name ReposCreateUsingTemplate + * @summary Create a repository using a template + * @request POST:/repos/{template_owner}/{template_repo}/generate */ - teamsAddOrUpdateRepoPermissionsLegacy: ( - teamId: number, - owner: string, - repo: string, + reposCreateUsingTemplate: ( + templateOwner: string, + templateRepo: string, data: { + /** A short description of the new repository. */ + description?: string; /** - * 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. + * 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 */ - permission?: "pull" | "push" | "admin"; + private?: boolean; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "PUT", + this.request({ + path: \`/repos/\${templateOwner}/\${templateRepo}/generate\`, + method: "POST", body: data, type: ContentType.Json, + format: "json", ...params, }), - + }; + repositories = { /** - * @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 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 teams - * @name TeamsRemoveRepoLegacy - * @summary Remove a repository from a team (Legacy) - * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} - * @deprecated + * @tags repos + * @name ReposListPublic + * @summary List public repositories + * @request GET:/repositories */ - teamsRemoveRepoLegacy: ( - teamId: number, - owner: string, - repo: string, + reposListPublic: ( + query?: { + /** A repository ID. Only return repositories with an ID greater than this ID. */ + since?: number; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, - method: "DELETE", + this.request({ + path: \`/repositories\`, + method: "GET", + query: query, + format: "json", ...params, }), - + }; + scim = { /** - * @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 **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags teams - * @name TeamsListIdpGroupsForLegacy - * @summary List IdP groups for a team (Legacy) - * @request GET:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedGroupsEnterprise + * @summary List provisioned SCIM groups for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Groups */ - teamsListIdpGroupsForLegacy: (teamId: number, params: RequestParams = {}) => - this.request({ - path: \`/teams/\${teamId}/team-sync/group-mappings\`, + 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: \`/scim/v2/enterprises/\${enterprise}/Groups\`, 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 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 **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 teams - * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy - * @summary Create or update IdP group connections (Legacy) - * @request PATCH:/teams/{team_id}/team-sync/group-mappings - * @deprecated + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseGroup + * @summary Provision a SCIM enterprise group and invite users + * @request POST:/scim/v2/enterprises/{enterprise}/Groups */ - teamsCreateOrUpdateIdpGroupConnectionsLegacy: ( - teamId: number, + enterpriseAdminProvisionAndInviteEnterpriseGroup: ( + enterprise: 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: { - /** @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; + /** 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; }[]; - /** @example ""I am not a timestamp"" */ - synced_at?: string; + /** The SCIM schema URIs. */ + schemas: string[]; }, params: RequestParams = {}, ) => - this.request({ - path: \`/teams/\${teamId}/team-sync/group-mappings\`, - method: "PATCH", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups\`, + method: "POST", body: data, type: ContentType.Json, format: "json", @@ -35917,105 +35316,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 [\`List child teams\`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags teams - * @name TeamsListChildLegacy - * @summary List child teams (Legacy) - * @request GET:/teams/{team_id}/teams - * @deprecated + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseGroup + * @summary Get SCIM provisioning information for an enterprise group + * @request GET:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - 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; - }, + enterpriseAdminGetProvisioningInformationForEnterpriseGroup: ( + enterprise: string, + scimGroupId: string, 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\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, method: "GET", 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 **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 users - * @name UsersUpdateAuthenticated - * @summary Update the authenticated user - * @request PATCH:/user + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseGroup + * @summary Set SCIM information for a provisioned enterprise group + * @request PUT:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - usersUpdateAuthenticated: ( + enterpriseAdminSetInformationForProvisionedEnterpriseGroup: ( + enterprise: string, + scimGroupId: string, 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 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\`, - method: "PATCH", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + method: "PUT", body: data, type: ContentType.Json, format: "json", @@ -36023,157 +35368,213 @@ export class Api< }), /** - * @description List the users you've blocked on your personal account. + * @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 users - * @name UsersListBlockedByAuthenticated - * @summary List users blocked by the authenticated user - * @request GET:/user/blocks + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseGroup + * @summary Update an attribute for a SCIM enterprise group + * @request PATCH:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - usersListBlockedByAuthenticated: (params: RequestParams = {}) => - this.request< - SimpleUser[], - | BasicError - | { - documentation_url: string; - message: string; - } - >({ - path: \`/user/blocks\`, - method: "GET", + 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: \`/scim/v2/enterprises/\${enterprise}/Groups/\${scimGroupId}\`, + 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 users - * @name UsersCheckBlocked - * @summary Check if a user is blocked by the authenticated user - * @request GET:/user/blocks/{username} + * @tags enterprise-admin + * @name EnterpriseAdminDeleteScimGroupFromEnterprise + * @summary Delete a SCIM group from an enterprise + * @request DELETE:/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} */ - usersCheckBlocked: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "GET", + enterpriseAdminDeleteScimGroupFromEnterprise: ( + enterprise: string, + scimGroupId: string, + params: RequestParams = {}, + ) => + 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 users - * @name UsersBlock - * @summary Block a user - * @request PUT:/user/blocks/{username} + * @tags enterprise-admin + * @name EnterpriseAdminListProvisionedIdentitiesEnterprise + * @summary List SCIM provisioned identities for an enterprise + * @request GET:/scim/v2/enterprises/{enterprise}/Users */ - usersBlock: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "PUT", + 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 users - * @name UsersUnblock - * @summary Unblock a user - * @request DELETE:/user/blocks/{username} + * @tags enterprise-admin + * @name EnterpriseAdminProvisionAndInviteEnterpriseUser + * @summary Provision and invite a SCIM enterprise user + * @request POST:/scim/v2/enterprises/{enterprise}/Users */ - usersUnblock: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/blocks/\${username}\`, - method: "DELETE", + 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: \`/scim/v2/enterprises/\${enterprise}/Users\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Sets the visibility for your primary email addresses. + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @tags users - * @name UsersSetPrimaryEmailVisibilityForAuthenticated - * @summary Set primary email visibility for the authenticated user - * @request PATCH:/user/email/visibility + * @tags enterprise-admin + * @name EnterpriseAdminGetProvisioningInformationForEnterpriseUser + * @summary Get SCIM provisioning information for an enterprise user + * @request GET:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - 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"; - }, + enterpriseAdminGetProvisioningInformationForEnterpriseUser: ( + enterprise: string, + scimUserId: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/email/visibility\`, - method: "PATCH", - body: data, - type: ContentType.Json, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "GET", 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 **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 users - * @name UsersListEmailsForAuthenticated - * @summary List email addresses for the authenticated user - * @request GET:/user/emails + * @tags enterprise-admin + * @name EnterpriseAdminSetInformationForProvisionedEnterpriseUser + * @summary Set SCIM information for a provisioned enterprise user + * @request PUT:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - usersListEmailsForAuthenticated: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + 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/emails\`, - method: "GET", - query: query, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "PUT", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description This endpoint is accessible with the \`user\` scope. + * @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 users - * @name UsersAddEmailForAuthenticated - * @summary Add an email address for the authenticated user - * @request POST:/user/emails + * @tags enterprise-admin + * @name EnterpriseAdminUpdateAttributeForEnterpriseUser + * @summary Update an attribute for a SCIM enterprise user + * @request PATCH:/scim/v2/enterprises/{enterprise}/Users/{scim_user_id} */ - 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, + 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/emails\`, - method: "POST", + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -36181,56 +35582,54 @@ export class Api< }), /** - * @description This endpoint is accessible with the \`user\` scope. + * @description **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. * - * @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, + * @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: string, + scimUserId: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/emails\`, + this.request({ + path: \`/scim/v2/enterprises/\${enterprise}/Users/\${scimUserId}\`, method: "DELETE", - body: data, - type: ContentType.Json, ...params, }), /** - * @description Lists the people following the authenticated user. + * @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 users - * @name UsersListFollowersForAuthenticatedUser - * @summary List followers of the authenticated user - * @request GET:/user/followers + * @tags scim + * @name ScimListProvisionedIdentities + * @summary List SCIM provisioned identities + * @request GET:/scim/v2/organizations/{org}/Users */ - usersListFollowersForAuthenticatedUser: ( + 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/followers\`, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users\`, method: "GET", query: query, format: "json", @@ -36238,32 +35637,54 @@ export class Api< }), /** - * @description Lists the people who the authenticated user follows. + * @description Provision organization membership for a user, and send an activation email to the email address. * - * @tags users - * @name UsersListFollowedByAuthenticated - * @summary List the people the authenticated user follows - * @request GET:/user/following + * @tags scim + * @name ScimProvisionAndInviteUser + * @summary Provision and invite a SCIM user + * @request POST:/scim/v2/organizations/{org}/Users */ - usersListFollowedByAuthenticated: ( - 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/following\`, - method: "GET", - query: query, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), @@ -36271,61 +35692,159 @@ export class Api< /** * No description * - * @tags users - * @name UsersCheckPersonIsFollowedByAuthenticated - * @summary Check if a person is followed by the authenticated user - * @request GET:/user/following/{username} + * @tags scim + * @name ScimGetProvisioningInformationForUser + * @summary Get SCIM provisioning information for a user + * @request GET:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - usersCheckPersonIsFollowedByAuthenticated: ( - username: string, + scimGetProvisioningInformationForUser: ( + org: string, + scimUserId: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/following/\${username}\`, + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, 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 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 UsersFollow - * @summary Follow a user - * @request PUT:/user/following/{username} + * @tags scim + * @name ScimSetInformationForProvisionedUser + * @summary Update a provisioned organization membership + * @request PUT:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - usersFollow: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/following/\${username}\`, + scimSetInformationForProvisionedUser: ( + org: string, + scimUserId: 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; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/scim/v2/organizations/\${org}/Users/\${scimUserId}\`, method: "PUT", + 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 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 UsersUnfollow - * @summary Unfollow a user - * @request DELETE:/user/following/{username} + * @tags scim + * @name ScimUpdateAttributeForUser + * @summary Update an attribute for a SCIM user + * @request PATCH:/scim/v2/organizations/{org}/Users/{scim_user_id} */ - usersUnfollow: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/user/following/\${username}\`, - method: "DELETE", + 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 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 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 */ - usersListGpgKeysForAuthenticated: ( - 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 @@ -36336,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: \`/user/gpg_keys\`, + 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", @@ -36348,76 +35884,173 @@ 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 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 users - * @name UsersCreateGpgKeyForAuthenticated - * @summary Create a GPG key for the authenticated user - * @request POST:/user/gpg_keys + * @tags search + * @name SearchCommits + * @summary Search commits + * @request GET:/search/commits */ - usersCreateGpgKeyForAuthenticated: ( - data: { - /** A GPG key in ASCII-armored format. */ - armored_public_key: string; + 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 + */ + 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?: "author-date" | "committer-date"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys\`, - method: "POST", - body: data, - type: ContentType.Json, + this.request< + { + incomplete_results: boolean; + items: CommitSearchResultItem[]; + total_count: number; + }, + { + documentation_url: string; + message: string; + } + >({ + path: \`/search/commits\`, + 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 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 users - * @name UsersGetGpgKeyForAuthenticated - * @summary Get a GPG key for the authenticated user - * @request GET:/user/gpg_keys/{gpg_key_id} + * @tags search + * @name SearchIssuesAndPullRequests + * @summary Search issues and pull requests + * @request GET:/search/issues */ - usersGetGpgKeyForAuthenticated: ( - gpgKeyId: number, + 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; + /** + * 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?: + | "comments" + | "reactions" + | "reactions-+1" + | "reactions--1" + | "reactions-smile" + | "reactions-thinking_face" + | "reactions-heart" + | "reactions-tada" + | "interactions" + | "created" + | "updated"; + }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/gpg_keys/\${gpgKeyId}\`, + 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", ...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 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 UsersDeleteGpgKeyForAuthenticated - * @summary Delete a GPG key for the authenticated user - * @request DELETE:/user/gpg_keys/{gpg_key_id} + * @tags search + * @name SearchLabels + * @summary Search labels + * @request GET:/search/labels */ - usersDeleteGpgKeyForAuthenticated: ( - gpgKeyId: number, + searchLabels: ( + 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"; + /** 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: \`/user/gpg_keys/\${gpgKeyId}\`, - method: "DELETE", + this.request< + { + incomplete_results: boolean; + items: LabelSearchResultItem[]; + total_count: number; + }, + BasicError | ValidationError + >({ + path: \`/search/labels\`, + 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 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 apps - * @name AppsListInstallationsForAuthenticatedUser - * @summary List app installations accessible to the user access token - * @request GET:/user/installations + * @tags search + * @name SearchRepos + * @summary Search repositories + * @request GET:/search/repositories */ - appsListInstallationsForAuthenticatedUser: ( - 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 @@ -36428,21 +36061,60 @@ 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< { - installations: Installation[]; + incomplete_results: boolean; + items: RepoSearchResultItem[]; total_count: number; }, - | BasicError + | ValidationError | { - documentation_url: string; - message: string; + code?: string; + documentation_url?: string; + message?: string; } >({ - path: \`/user/installations\`, + 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\`, method: "GET", query: query, format: "json", @@ -36450,16 +36122,20 @@ export class Api< }), /** - * @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 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 apps - * @name AppsListInstallationReposForAuthenticatedUser - * @summary List repositories accessible to the user access token - * @request GET:/user/installations/{installation_id}/repositories + * @tags search + * @name SearchUsers + * @summary Search users + * @request GET:/search/users */ - appsListInstallationReposForAuthenticatedUser: ( - installationId: number, - 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 @@ -36470,95 +36146,92 @@ 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< { - repositories: Repository[]; - repository_selection?: string; + incomplete_results: boolean; + items: UserSearchResultItem[]; total_count: number; }, - BasicError + | ValidationError + | { + code?: string; + documentation_url?: string; + message?: string; + } >({ - path: \`/user/installations/\${installationId}/repositories\`, + path: \`/search/users\`, 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, - }), - - /** - * @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, - }), - + }; + teams = { /** - * @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 **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 interactions - * @name InteractionsGetRestrictionsForAuthenticatedUser - * @summary Get interaction restrictions for your public repositories - * @request GET:/user/interaction-limits + * @tags teams + * @name TeamsGetLegacy + * @summary Get a team (Legacy) + * @request GET:/teams/{team_id} + * @deprecated */ - interactionsGetRestrictionsForAuthenticatedUser: ( - params: RequestParams = {}, - ) => - this.request({ - path: \`/user/interaction-limits\`, + teamsGetLegacy: (teamId: number, params: RequestParams = {}) => + this.request({ + path: \`/teams/\${teamId}\`, 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 **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 interactions - * @name InteractionsSetRestrictionsForAuthenticatedUser - * @summary Set interaction restrictions for your public repositories - * @request PUT:/user/interaction-limits + * @tags teams + * @name TeamsUpdateLegacy + * @summary Update a team (Legacy) + * @request PATCH:/teams/{team_id} + * @deprecated */ - interactionsSetRestrictionsForAuthenticatedUser: ( - data: InteractionLimit, + 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: \`/user/interaction-limits\`, - method: "PUT", + this.request({ + path: \`/teams/\${teamId}\`, + method: "PATCH", body: data, type: ContentType.Json, format: "json", @@ -36566,92 +36239,38 @@ export class Api< }), /** - * @description Removes any interaction restrictions from your public repositories. + * @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 interactions - * @name InteractionsRemoveRestrictionsForAuthenticatedUser - * @summary Remove interaction restrictions from your public repositories - * @request DELETE:/user/interaction-limits + * @tags teams + * @name TeamsDeleteLegacy + * @summary Delete a team (Legacy) + * @request DELETE:/teams/{team_id} + * @deprecated */ - interactionsRemoveRestrictionsForAuthenticatedUser: ( - params: RequestParams = {}, - ) => - this.request({ - path: \`/user/interaction-limits\`, + teamsDeleteLegacy: (teamId: number, params: RequestParams = {}) => + this.request({ + path: \`/teams/\${teamId}\`, 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. + * @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 issues - * @name IssuesListForAuthenticatedUser - * @summary List user account issues assigned to the authenticated user - * @request GET:/user/issues + * @tags teams + * @name TeamsListDiscussionsLegacy + * @summary List discussions (Legacy) + * @request GET:/teams/{team_id}/discussions + * @deprecated */ - issuesListForAuthenticatedUser: ( + teamsListDiscussionsLegacy: ( + teamId: number, 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: \`/user/issues\`, - method: "GET", - query: query, - 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 - */ - usersListPublicSshKeysForAuthenticated: ( - query?: { /** * Page number of the results to fetch. * @default 1 @@ -36665,8 +36284,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys\`, + this.request({ + path: \`/teams/\${teamId}/discussions\`, method: "GET", query: query, format: "json", @@ -36674,30 +36293,31 @@ export class Api< }), /** - * @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 **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 users - * @name UsersCreatePublicSshKeyForAuthenticated - * @summary Create a public SSH key for the authenticated user - * @request POST:/user/keys + * @tags teams + * @name TeamsCreateDiscussionLegacy + * @summary Create a discussion (Legacy) + * @request POST:/teams/{team_id}/discussions + * @deprecated */ - 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; + teamsCreateDiscussionLegacy: ( + teamId: number, + data: { + /** The discussion post's body text. */ + body: string; /** - * A descriptive name for the new key. - * @example "Personal MacBook Air" + * 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 */ - title?: string; + private?: boolean; + /** The discussion post's title. */ + title: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys\`, + this.request({ + path: \`/teams/\${teamId}/discussions\`, method: "POST", body: data, type: ContentType.Json, @@ -36706,83 +36326,93 @@ 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/). + * @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 users - * @name UsersGetPublicSshKeyForAuthenticated - * @summary Get a public SSH key for the authenticated user - * @request GET:/user/keys/{key_id} + * @tags teams + * @name TeamsGetDiscussionLegacy + * @summary Get a discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - usersGetPublicSshKeyForAuthenticated: ( - keyId: number, + teamsGetDiscussionLegacy: ( + teamId: number, + discussionNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/user/keys/\${keyId}\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, 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 **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 users - * @name UsersDeletePublicSshKeyForAuthenticated - * @summary Delete a public SSH key for the authenticated user - * @request DELETE:/user/keys/{key_id} + * @tags teams + * @name TeamsUpdateDiscussionLegacy + * @summary Update a discussion (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - usersDeletePublicSshKeyForAuthenticated: ( - keyId: 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: \`/user/keys/\${keyId}\`, - method: "DELETE", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + 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 **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 apps - * @name AppsListSubscriptionsForAuthenticatedUser - * @summary List subscriptions for the authenticated user - * @request GET:/user/marketplace_purchases + * @tags teams + * @name TeamsDeleteDiscussionLegacy + * @summary Delete a discussion (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number} + * @deprecated */ - appsListSubscriptionsForAuthenticatedUser: ( - 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: \`/user/marketplace_purchases\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}\`, + 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/). + * @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 apps - * @name AppsListSubscriptionsForAuthenticatedUserStubbed - * @summary List subscriptions for the authenticated user (stubbed) - * @request GET:/user/marketplace_purchases/stubbed + * @tags teams + * @name TeamsListDiscussionCommentsLegacy + * @summary List discussion comments (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated */ - appsListSubscriptionsForAuthenticatedUserStubbed: ( + teamsListDiscussionCommentsLegacy: ( + teamId: number, + discussionNumber: number, query?: { + /** + * One of \`asc\` (ascending) or \`desc\` (descending). + * @default "desc" + */ + direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -36796,8 +36426,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/marketplace_purchases/stubbed\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, method: "GET", query: query, format: "json", @@ -36805,75 +36435,75 @@ export class Api< }), /** - * 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 [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 orgs - * @name OrgsListMembershipsForAuthenticatedUser - * @summary List organization memberships for the authenticated user - * @request GET:/user/memberships/orgs + * @tags teams + * @name TeamsCreateDiscussionCommentLegacy + * @summary Create a discussion comment (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/comments + * @deprecated */ - orgsListMembershipsForAuthenticatedUser: ( - 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 memberships to return. Can be either \`active\` or \`pending\`. If not specified, the API returns both active and pending memberships. */ - state?: "active" | "pending"; + teamsCreateDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + data: { + /** The discussion comment's body text. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/memberships/orgs\`, - method: "GET", - query: query, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments\`, + 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 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 orgs - * @name OrgsGetMembershipForAuthenticatedUser - * @summary Get an organization membership for the authenticated user - * @request GET:/user/memberships/orgs/{org} + * @tags teams + * @name TeamsGetDiscussionCommentLegacy + * @summary Get a discussion comment (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated */ - orgsGetMembershipForAuthenticatedUser: ( - org: string, + teamsGetDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + commentNumber: number, params: RequestParams = {}, ) => - this.request({ - path: \`/user/memberships/orgs/\${org}\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, method: "GET", 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 [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 orgs - * @name OrgsUpdateMembershipForAuthenticatedUser - * @summary Update an organization membership for the authenticated user - * @request PATCH:/user/memberships/orgs/{org} + * @tags teams + * @name TeamsUpdateDiscussionCommentLegacy + * @summary Update a discussion comment (Legacy) + * @request PATCH:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated */ - orgsUpdateMembershipForAuthenticatedUser: ( - org: string, + teamsUpdateDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + commentNumber: number, data: { - /** The state that the membership should be in. Only \`"active"\` will be accepted. */ - state: "active"; + /** The discussion comment's body text. */ + body: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/memberships/orgs/\${org}\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}\`, method: "PATCH", body: data, type: ContentType.Json, @@ -36882,15 +36512,50 @@ export class Api< }), /** - * @description Lists all migrations a user has started. + * @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 migrations - * @name MigrationsListForAuthenticatedUser - * @summary List user migrations - * @request GET:/user/migrations + * @tags teams + * @name TeamsDeleteDiscussionCommentLegacy + * @summary Delete a discussion comment (Legacy) + * @request DELETE:/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number} + * @deprecated */ - migrationsListForAuthenticatedUser: ( + 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/). + * + * @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: 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 @@ -36904,8 +36569,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, method: "GET", query: query, format: "json", @@ -36913,36 +36578,34 @@ export class Api< }), /** - * @description Initiates the generation of a user migration archive. + * @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 migrations - * @name MigrationsStartForAuthenticatedUser - * @summary Start a user migration - * @request POST:/user/migrations + * @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 */ - migrationsStartForAuthenticatedUser: ( + reactionsCreateForTeamDiscussionCommentLegacy: ( + teamId: number, + discussionNumber: number, + commentNumber: number, 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 [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: \`/user/migrations\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/comments/\${commentNumber}/reactions\`, method: "POST", body: data, type: ContentType.Json, @@ -36951,22 +36614,43 @@ 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 **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 migrations - * @name MigrationsGetStatusForAuthenticatedUser - * @summary Get a user migration status - * @request GET:/user/migrations/{migration_id} + * @tags reactions + * @name ReactionsListForTeamDiscussionLegacy + * @summary List reactions for a team discussion (Legacy) + * @request GET:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated */ - migrationsGetStatusForAuthenticatedUser: ( - migrationId: number, + reactionsListForTeamDiscussionLegacy: ( + teamId: number, + discussionNumber: number, query?: { - exclude?: 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. */ + 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: \`/user/migrations/\${migrationId}\`, + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, method: "GET", query: query, format: "json", @@ -36974,70 +36658,51 @@ export class Api< }), /** - * @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, - }), - - /** - * @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, - }), - - /** - * @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 **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 migrations - * @name MigrationsUnlockRepoForAuthenticatedUser - * @summary Unlock a user repository - * @request DELETE:/user/migrations/{migration_id}/repos/{repo_name}/lock + * @tags reactions + * @name ReactionsCreateForTeamDiscussionLegacy + * @summary Create reaction for a team discussion (Legacy) + * @request POST:/teams/{team_id}/discussions/{discussion_number}/reactions + * @deprecated */ - migrationsUnlockRepoForAuthenticatedUser: ( - migrationId: number, - repoName: string, + 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: \`/user/migrations/\${migrationId}/repos/\${repoName}/lock\`, - method: "DELETE", + this.request({ + path: \`/teams/\${teamId}/discussions/\${discussionNumber}/reactions\`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", ...params, }), /** - * @description Lists all the repositories for this user migration. + * @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 migrations - * @name MigrationsListReposForUser - * @summary List repositories for a user migration - * @request GET:/user/migrations/{migration_id}/repositories + * @tags teams + * @name TeamsListPendingInvitationsLegacy + * @summary List pending team invitations (Legacy) + * @request GET:/teams/{team_id}/invitations + * @deprecated */ - migrationsListReposForUser: ( - migrationId: number, + teamsListPendingInvitationsLegacy: ( + teamId: number, query?: { /** * Page number of the results to fetch. @@ -37052,8 +36717,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/migrations/\${migrationId}/repositories\`, + this.request({ + path: \`/teams/\${teamId}/invitations\`, method: "GET", query: query, format: "json", @@ -37061,14 +36726,16 @@ export class Api< }), /** - * @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 **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 orgs - * @name OrgsListForAuthenticatedUser - * @summary List organizations for the authenticated user - * @request GET:/user/orgs + * @tags teams + * @name TeamsListMembersLegacy + * @summary List team members (Legacy) + * @request GET:/teams/{team_id}/members + * @deprecated */ - orgsListForAuthenticatedUser: ( + teamsListMembersLegacy: ( + teamId: number, query?: { /** * Page number of the results to fetch. @@ -37080,11 +36747,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: \`/user/orgs\`, + this.request({ + path: \`/teams/\${teamId}/members\`, method: "GET", query: query, format: "json", @@ -37092,254 +36767,177 @@ export class Api< }), /** - * No description + * @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 projects - * @name ProjectsCreateForAuthenticatedUser - * @summary Create a user project - * @request POST:/user/projects + * @tags teams + * @name TeamsGetMemberLegacy + * @summary Get team member (Legacy) + * @request GET:/teams/{team_id}/members/{username} + * @deprecated */ - 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; - }, + 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)." + * + * @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< - Project, + void, | BasicError + | void | { - documentation_url: string; - message: string; + /** @example ""https://docs.github.com/rest"" */ + documentation_url?: string; + errors?: { + code?: string; + field?: string; + resource?: string; + }[]; + message?: string; } - | ValidationErrorSimple >({ - path: \`/user/projects\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + path: \`/teams/\${teamId}/members/\${username}\`, + method: "PUT", ...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. + * @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 users - * @name UsersListPublicEmailsForAuthenticated - * @summary List public email addresses for the authenticated user - * @request GET:/user/public_emails + * @tags teams + * @name TeamsRemoveMemberLegacy + * @summary Remove team member (Legacy) + * @request DELETE:/teams/{team_id}/members/{username} + * @deprecated */ - usersListPublicEmailsForAuthenticated: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; - }, + teamsRemoveMemberLegacy: ( + teamId: number, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/public_emails\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/teams/\${teamId}/members/\${username}\`, + method: "DELETE", ...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 **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 repos - * @name ReposListForAuthenticatedUser - * @summary List repositories for the authenticated user - * @request GET:/user/repos + * @tags teams + * @name TeamsGetMembershipForUserLegacy + * @summary Get team membership for a user (Legacy) + * @request GET:/teams/{team_id}/memberships/{username} + * @deprecated */ - 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"; - }, + teamsGetMembershipForUserLegacy: ( + teamId: number, + username: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repos\`, + this.request({ + path: \`/teams/\${teamId}/memberships/\${username}\`, method: "GET", - query: query, 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 **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 repos - * @name ReposCreateForAuthenticatedUser - * @summary Create a repository for the authenticated user - * @request POST:/user/repos + * @tags teams + * @name TeamsAddOrUpdateMembershipForUserLegacy + * @summary Add or update team membership for a user (Legacy) + * @request PUT:/teams/{team_id}/memberships/{username} + * @deprecated */ - reposCreateForAuthenticatedUser: ( + teamsAddOrUpdateMembershipForUserLegacy: ( + teamId: number, + username: string, 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 + * 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" */ - 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; + role?: "member" | "maintainer"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repos\`, - method: "POST", - body: data, - type: ContentType.Json, - format: "json", + 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, + }), + + /** + * @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, }), /** - * @description When authenticating as a user, this endpoint will list all currently open repository invitations for that 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 team projects\`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. Lists the organization projects for a team. * - * @tags repos - * @name ReposListInvitationsForAuthenticatedUser - * @summary List repository invitations for the authenticated user - * @request GET:/user/repository_invitations + * @tags teams + * @name TeamsListProjectsLegacy + * @summary List team projects (Legacy) + * @request GET:/teams/{team_id}/projects + * @deprecated */ - reposListInvitationsForAuthenticatedUser: ( + teamsListProjectsLegacy: ( + teamId: number, query?: { /** * Page number of the results to fetch. @@ -37354,8 +36952,15 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/repository_invitations\`, + this.request< + TeamProject[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/teams/\${teamId}/projects\`, method: "GET", query: query, format: "json", @@ -37363,53 +36968,116 @@ export class Api< }), /** - * 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 [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 repos - * @name ReposAcceptInvitation - * @summary Accept a repository invitation - * @request PATCH:/user/repository_invitations/{invitation_id} + * @tags teams + * @name TeamsCheckPermissionsForProjectLegacy + * @summary Check team permissions for a project (Legacy) + * @request GET:/teams/{team_id}/projects/{project_id} + * @deprecated */ - reposAcceptInvitation: (invitationId: number, params: RequestParams = {}) => - this.request({ - path: \`/user/repository_invitations/\${invitationId}\`, - method: "PATCH", + teamsCheckPermissionsForProjectLegacy: ( + teamId: number, + projectId: number, + params: RequestParams = {}, + ) => + this.request< + TeamProject, + void | { + documentation_url: string; + message: string; + } + >({ + path: \`/teams/\${teamId}/projects/\${projectId}\`, + method: "GET", + 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 [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 repos - * @name ReposDeclineInvitation - * @summary Decline a repository invitation - * @request DELETE:/user/repository_invitations/{invitation_id} + * @tags teams + * @name TeamsAddOrUpdateProjectPermissionsLegacy + * @summary Add or update team project permissions (Legacy) + * @request PUT:/teams/{team_id}/projects/{project_id} + * @deprecated */ - reposDeclineInvitation: ( - invitationId: 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({ - path: \`/user/repository_invitations/\${invitationId}\`, + 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, + }), + + /** + * @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 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 **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 activity - * @name ActivityListReposStarredByAuthenticatedUser - * @summary List repositories starred by the authenticated user - * @request GET:/user/starred + * @tags teams + * @name TeamsListReposLegacy + * @summary List team repositories (Legacy) + * @request GET:/teams/{team_id}/repos + * @deprecated */ - activityListReposStarredByAuthenticatedUser: ( + teamsListReposLegacy: ( + teamId: number, query?: { - /** - * One of \`asc\` (ascending) or \`desc\` (descending). - * @default "desc" - */ - direction?: "asc" | "desc"; /** * Page number of the results to fetch. * @default 1 @@ -37420,16 +37088,11 @@ export class Api< * @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\`, + this.request({ + path: \`/teams/\${teamId}/repos\`, method: "GET", query: query, format: "json", @@ -37437,102 +37100,151 @@ export class Api< }), /** - * No description + * @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 activity - * @name ActivityCheckRepoIsStarredByAuthenticatedUser - * @summary Check if a repository is starred by the authenticated user - * @request GET:/user/starred/{owner}/{repo} + * @tags teams + * @name TeamsCheckPermissionsForRepoLegacy + * @summary Check team permissions for a repository (Legacy) + * @request GET:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated */ - activityCheckRepoIsStarredByAuthenticatedUser: ( + teamsCheckPermissionsForRepoLegacy: ( + teamId: number, owner: string, repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, 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)." + * @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 activity - * @name ActivityStarRepoForAuthenticatedUser - * @summary Star a repository for the authenticated user - * @request PUT:/user/starred/{owner}/{repo} + * @tags teams + * @name TeamsAddOrUpdateRepoPermissionsLegacy + * @summary Add or update team repository permissions (Legacy) + * @request PUT:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated */ - activityStarRepoForAuthenticatedUser: ( + 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: \`/user/starred/\${owner}/\${repo}\`, + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "PUT", + body: data, + type: ContentType.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 [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 activity - * @name ActivityUnstarRepoForAuthenticatedUser - * @summary Unstar a repository for the authenticated user - * @request DELETE:/user/starred/{owner}/{repo} + * @tags teams + * @name TeamsRemoveRepoLegacy + * @summary Remove a repository from a team (Legacy) + * @request DELETE:/teams/{team_id}/repos/{owner}/{repo} + * @deprecated */ - activityUnstarRepoForAuthenticatedUser: ( + teamsRemoveRepoLegacy: ( + teamId: number, owner: string, repo: string, params: RequestParams = {}, ) => - this.request({ - path: \`/user/starred/\${owner}/\${repo}\`, + this.request({ + path: \`/teams/\${teamId}/repos/\${owner}/\${repo}\`, method: "DELETE", ...params, }), /** - * @description Lists repositories the authenticated 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 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, + }), + + /** + * @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 activity - * @name ActivityListWatchedReposForAuthenticatedUser - * @summary List repositories watched by the authenticated user - * @request GET:/user/subscriptions + * @tags teams + * @name TeamsCreateOrUpdateIdpGroupConnectionsLegacy + * @summary Create or update IdP group connections (Legacy) + * @request PATCH:/teams/{team_id}/team-sync/group-mappings + * @deprecated */ - activityListWatchedReposForAuthenticatedUser: ( - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; - /** - * Results per page (max 100) - * @default 30 - */ - per_page?: number; + 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: \`/user/subscriptions\`, - method: "GET", - query: query, + this.request({ + path: \`/teams/\${teamId}/team-sync/group-mappings\`, + method: "PATCH", + body: data, + type: ContentType.Json, 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 **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 TeamsListForAuthenticatedUser - * @summary List teams for the authenticated user - * @request GET:/user/teams + * @name TeamsListChildLegacy + * @summary List child teams (Legacy) + * @request GET:/teams/{team_id}/teams + * @deprecated */ - teamsListForAuthenticatedUser: ( + teamsListChildLegacy: ( + teamId: number, query?: { /** * Page number of the results to fetch. @@ -37547,166 +37259,193 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/user/teams\`, + this.request({ + path: \`/teams/\${teamId}/teams\`, method: "GET", query: query, format: "json", ...params, }), }; - users = { + user = { /** - * @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 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 UsersList - * @summary List users - * @request GET:/users + * @name UsersGetAuthenticated + * @summary Get the authenticated user + * @request GET:/user */ - usersList: ( - query?: { + usersGetAuthenticated: (params: RequestParams = {}) => + this.request({ + path: \`/user\`, + method: "GET", + 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 + */ + usersUpdateAuthenticated: ( + data: { + /** The new short biography of the user. */ + bio?: string; /** - * Results per page (max 100) - * @default 30 + * The new blog URL of the user. + * @example "blog.example.com" */ - per_page?: number; - /** A user ID. Only return users with an ID greater than this ID. */ - since?: number; + 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: \`/users\`, - method: "GET", - query: query, + this.request({ + path: \`/user\`, + method: "PATCH", + 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 List the users you've blocked on your personal account. * * @tags users - * @name UsersGetByUsername - * @summary Get a user - * @request GET:/users/{username} + * @name UsersListBlockedByAuthenticated + * @summary List users blocked by the authenticated user + * @request GET:/user/blocks */ - usersGetByUsername: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/users/\${username}\`, + usersListBlockedByAuthenticated: (params: RequestParams = {}) => + this.request< + SimpleUser[], + | BasicError + | { + documentation_url: string; + message: string; + } + >({ + path: \`/user/blocks\`, method: "GET", format: "json", ...params, }), /** - * @description If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. + * No description * - * @tags activity - * @name ActivityListEventsForAuthenticatedUser - * @summary List events for the authenticated user - * @request GET:/users/{username}/events + * @tags users + * @name UsersCheckBlocked + * @summary Check if a user is blocked by the authenticated user + * @request GET:/user/blocks/{username} */ - 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\`, + usersCheckBlocked: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/blocks/\${username}\`, method: "GET", - query: query, - format: "json", ...params, }), /** - * @description This is the user's organization dashboard. You must be authenticated as the user to view this. + * No description * - * @tags activity - * @name ActivityListOrgEventsForAuthenticatedUser - * @summary List organization events for the authenticated user - * @request GET:/users/{username}/events/orgs/{org} + * @tags users + * @name UsersBlock + * @summary Block a user + * @request PUT:/user/blocks/{username} */ - 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", + usersBlock: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/blocks/\${username}\`, + method: "PUT", ...params, }), /** * No description * - * @tags activity - * @name ActivityListPublicEventsForUser - * @summary List public events for a user - * @request GET:/users/{username}/events/public + * @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. + * + * @tags users + * @name UsersSetPrimaryEmailVisibilityForAuthenticated + * @summary Set primary email visibility for the authenticated user + * @request PATCH:/user/email/visibility */ - activityListPublicEventsForUser: ( - username: string, - query?: { - /** - * Page number of the results to fetch. - * @default 1 - */ - page?: number; + usersSetPrimaryEmailVisibilityForAuthenticated: ( + data: { /** - * Results per page (max 100) - * @default 30 + * An email address associated with the GitHub user account to manage. + * @example "org@example.com" */ - per_page?: number; + email: string; + /** Denotes whether an email is publically visible. */ + visibility: "public" | "private"; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/events/public\`, - method: "GET", - query: query, + this.request({ + path: \`/user/email/visibility\`, + method: "PATCH", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * @description Lists the people following the specified user. + * @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 UsersListFollowersForUser - * @summary List followers of a user - * @request GET:/users/{username}/followers + * @name UsersListEmailsForAuthenticated + * @summary List email addresses for the authenticated user + * @request GET:/user/emails */ - usersListFollowersForUser: ( - username: string, + usersListEmailsForAuthenticated: ( query?: { /** * Page number of the results to fetch. @@ -37721,8 +37460,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/followers\`, + this.request({ + path: \`/user/emails\`, method: "GET", query: query, format: "json", @@ -37730,66 +37469,70 @@ export class Api< }), /** - * @description Lists the people who the specified user follows. + * @description This endpoint is accessible with the \`user\` scope. * * @tags users - * @name UsersListFollowingForUser - * @summary List the people a user follows - * @request GET:/users/{username}/following + * @name UsersAddEmailForAuthenticated + * @summary Add an email address for the authenticated user + * @request POST:/user/emails */ - 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; - }, + 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: \`/users/\${username}/following\`, - method: "GET", - query: query, + this.request({ + path: \`/user/emails\`, + method: "POST", + body: data, + type: ContentType.Json, format: "json", ...params, }), /** - * No description + * @description This endpoint is accessible with the \`user\` scope. * * @tags users - * @name UsersCheckFollowingForUser - * @summary Check if a user follows another user - * @request GET:/users/{username}/following/{target_user} + * @name UsersDeleteEmailForAuthenticated + * @summary Delete an email address for the authenticated user + * @request DELETE:/user/emails */ - usersCheckFollowingForUser: ( - username: string, - targetUser: string, + usersDeleteEmailForAuthenticated: ( + data: + | { + /** Email addresses associated with the GitHub user account. */ + emails: string[]; + } + | string[] + | string, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/following/\${targetUser}\`, - method: "GET", + this.request({ + path: \`/user/emails\`, + method: "DELETE", + body: data, + type: ContentType.Json, ...params, }), /** - * @description Lists public gists for the specified user: + * @description Lists the people following the authenticated user. * - * @tags gists - * @name GistsListForUser - * @summary List gists for a user - * @request GET:/users/{username}/gists + * @tags users + * @name UsersListFollowersForAuthenticatedUser + * @summary List followers of the authenticated user + * @request GET:/user/followers */ - gistsListForUser: ( - username: string, + usersListFollowersForAuthenticatedUser: ( query?: { /** * Page number of the results to fetch. @@ -37801,13 +37544,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; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/gists\`, + this.request({ + path: \`/user/followers\`, method: "GET", query: query, format: "json", @@ -37815,15 +37556,14 @@ export class Api< }), /** - * @description Lists the GPG keys for a user. This information is accessible by anyone. + * @description Lists the people who the authenticated user follows. * * @tags users - * @name UsersListGpgKeysForUser - * @summary List GPG keys for a user - * @request GET:/users/{username}/gpg_keys + * @name UsersListFollowedByAuthenticated + * @summary List the people the authenticated user follows + * @request GET:/user/following */ - usersListGpgKeysForUser: ( - username: string, + usersListFollowedByAuthenticated: ( query?: { /** * Page number of the results to fetch. @@ -37838,8 +37578,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/gpg_keys\`, + this.request({ + path: \`/user/following\`, method: "GET", query: query, format: "json", @@ -37847,57 +37587,62 @@ export class Api< }), /** - * @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 \`\`\` + * No description * * @tags users - * @name UsersGetContextForUser - * @summary Get contextual information for a user - * @request GET:/users/{username}/hovercard + * @name UsersCheckPersonIsFollowedByAuthenticated + * @summary Check if a person is followed by the authenticated user + * @request GET:/user/following/{username} */ - usersGetContextForUser: ( + usersCheckPersonIsFollowedByAuthenticated: ( 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\`, + this.request({ + path: \`/user/following/\${username}\`, method: "GET", - query: query, - 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 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 apps - * @name AppsGetUserInstallation - * @summary Get a user installation for the authenticated app - * @request GET:/users/{username}/installation + * @tags users + * @name UsersFollow + * @summary Follow a user + * @request PUT:/user/following/{username} */ - appsGetUserInstallation: (username: string, params: RequestParams = {}) => - this.request({ - path: \`/users/\${username}/installation\`, - method: "GET", - format: "json", + usersFollow: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/following/\${username}\`, + method: "PUT", ...params, }), /** - * @description Lists the _verified_ public SSH keys for a user. This is accessible by anyone. + * @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 UsersListPublicKeysForUser - * @summary List public keys for a user - * @request GET:/users/{username}/keys + * @name UsersUnfollow + * @summary Unfollow a user + * @request DELETE:/user/following/{username} */ - usersListPublicKeysForUser: ( - username: string, + usersUnfollow: (username: string, params: RequestParams = {}) => + this.request({ + path: \`/user/following/\${username}\`, + 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/). + * + * @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. @@ -37912,8 +37657,8 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/keys\`, + this.request({ + path: \`/user/gpg_keys\`, method: "GET", query: query, format: "json", @@ -37921,47 +37666,75 @@ 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 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 orgs - * @name OrgsListForUser - * @summary List organizations for a user - * @request GET:/users/{username}/orgs + * @tags users + * @name UsersCreateGpgKeyForAuthenticated + * @summary Create a GPG key for the authenticated user + * @request POST:/user/gpg_keys */ - 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; + usersCreateGpgKeyForAuthenticated: ( + data: { + /** A GPG key in ASCII-armored format. */ + armored_public_key: string; }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/orgs\`, + this.request({ + path: \`/user/gpg_keys\`, + method: "POST", + 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/). + * + * @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", - query: query, format: "json", ...params, }), /** - * No description + * @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 projects - * @name ProjectsListForUser - * @summary List user projects - * @request GET:/users/{username}/projects + * @tags users + * @name UsersDeleteGpgKeyForAuthenticated + * @summary Delete a GPG key for the authenticated user + * @request DELETE:/user/gpg_keys/{gpg_key_id} */ - projectsListForUser: ( - username: string, + usersDeleteGpgKeyForAuthenticated: ( + gpgKeyId: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/gpg_keys/\${gpgKeyId}\`, + 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 + */ + appsListInstallationsForAuthenticatedUser: ( query?: { /** * Page number of the results to fetch. @@ -37973,23 +37746,21 @@ 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< - Project[], + { + installations: Installation[]; + total_count: number; + }, + | BasicError | { documentation_url: string; message: string; } - | ValidationError >({ - path: \`/users/\${username}/projects\`, + path: \`/user/installations\`, method: "GET", query: query, format: "json", @@ -37997,15 +37768,15 @@ 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. + * @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 activity - * @name ActivityListReceivedEventsForUser - * @summary List events received by the authenticated user - * @request GET:/users/{username}/received_events + * @tags apps + * @name AppsListInstallationReposForAuthenticatedUser + * @summary List repositories accessible to the user access token + * @request GET:/user/installations/{installation_id}/repositories */ - activityListReceivedEventsForUser: ( - username: string, + appsListInstallationReposForAuthenticatedUser: ( + installationId: number, query?: { /** * Page number of the results to fetch. @@ -38020,8 +37791,15 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/received_events\`, + this.request< + { + repositories: Repository[]; + repository_selection?: string; + total_count: number; + }, + BasicError + >({ + path: \`/user/installations/\${installationId}/repositories\`, method: "GET", query: query, format: "json", @@ -38029,154 +37807,126 @@ export class Api< }), /** - * No description + * @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 activity - * @name ActivityListReceivedPublicEventsForUser - * @summary List public events received by a user - * @request GET:/users/{username}/received_events/public + * @tags apps + * @name AppsAddRepoToInstallation + * @summary Add a repository to an app installation + * @request PUT:/user/installations/{installation_id}/repositories/{repository_id} */ - 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; - }, + appsAddRepoToInstallation: ( + installationId: number, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/received_events/public\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + method: "PUT", ...params, }), /** - * @description Lists public repositories for the specified user. + * @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 repos - * @name ReposListForUser - * @summary List repositories for a user - * @request GET:/users/{username}/repos + * @tags apps + * @name AppsRemoveRepoFromInstallation + * @summary Remove a repository from an app installation + * @request DELETE:/user/installations/{installation_id}/repositories/{repository_id} */ - 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"; - }, + appsRemoveRepoFromInstallation: ( + installationId: number, + repositoryId: number, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/repos\`, - method: "GET", - query: query, - format: "json", + this.request({ + path: \`/user/installations/\${installationId}/repositories/\${repositoryId}\`, + 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 \`user\` scope. + * @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 billing - * @name BillingGetGithubActionsBillingUser - * @summary Get GitHub Actions billing for a user - * @request GET:/users/{username}/settings/billing/actions + * @tags interactions + * @name InteractionsGetRestrictionsForAuthenticatedUser + * @summary Get interaction restrictions for your public repositories + * @request GET:/user/interaction-limits */ - billingGetGithubActionsBillingUser: ( - username: string, + interactionsGetRestrictionsForAuthenticatedUser: ( params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/actions\`, + this.request({ + path: \`/user/interaction-limits\`, method: "GET", 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 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 billing - * @name BillingGetGithubPackagesBillingUser - * @summary Get GitHub Packages billing for a user - * @request GET:/users/{username}/settings/billing/packages + * @tags interactions + * @name InteractionsSetRestrictionsForAuthenticatedUser + * @summary Set interaction restrictions for your public repositories + * @request PUT:/user/interaction-limits */ - billingGetGithubPackagesBillingUser: ( - username: string, + interactionsSetRestrictionsForAuthenticatedUser: ( + data: InteractionLimit, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/packages\`, - method: "GET", + this.request({ + path: \`/user/interaction-limits\`, + method: "PUT", + 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 Removes any interaction restrictions from your public repositories. * - * @tags billing - * @name BillingGetSharedStorageBillingUser - * @summary Get shared storage billing for a user - * @request GET:/users/{username}/settings/billing/shared-storage + * @tags interactions + * @name InteractionsRemoveRestrictionsForAuthenticatedUser + * @summary Remove interaction restrictions from your public repositories + * @request DELETE:/user/interaction-limits */ - billingGetSharedStorageBillingUser: ( - username: string, + interactionsRemoveRestrictionsForAuthenticatedUser: ( params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/settings/billing/shared-storage\`, - method: "GET", - format: "json", + this.request({ + path: \`/user/interaction-limits\`, + method: "DELETE", ...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 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 activity - * @name ActivityListReposStarredByUser - * @summary List repositories starred by a user - * @request GET:/users/{username}/starred + * @tags issues + * @name IssuesListForAuthenticatedUser + * @summary List user account issues assigned to the authenticated user + * @request GET:/user/issues */ - activityListReposStarredByUser: ( - username: string, + 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 @@ -38187,16 +37937,23 @@ 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). + * What to sort results by. Can be either \`created\`, \`updated\`, \`comments\`. * @default "created" */ - sort?: "created" | "updated"; + 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: \`/users/\${username}/starred\`, + this.request({ + path: \`/user/issues\`, method: "GET", query: query, format: "json", @@ -38204,15 +37961,14 @@ export class Api< }), /** - * @description Lists repositories a user is watching. + * @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 activity - * @name ActivityListReposWatchedByUser - * @summary List repositories watched by a user - * @request GET:/users/{username}/subscriptions + * @tags users + * @name UsersListPublicSshKeysForAuthenticated + * @summary List public SSH keys for the authenticated user + * @request GET:/user/keys */ - activityListReposWatchedByUser: ( - username: string, + usersListPublicSshKeysForAuthenticated: ( query?: { /** * Page number of the results to fetch. @@ -38227,1354 +37983,1597 @@ export class Api< }, params: RequestParams = {}, ) => - this.request({ - path: \`/users/\${username}/subscriptions\`, + this.request({ + path: \`/user/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, - }), - }; -} -" -`; - -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 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 */ - 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("&"); - } + 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, + }), - protected addQueryParams(rawQuery?: QueryParamsType): string { - const queryString = this.toQueryString(rawQuery); - return queryString ? \`?\${queryString}\` : ""; - } + /** + * @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, + }), - 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 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: number, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/keys/\${keyId}\`, + 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 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?: { + /** + * 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/marketplace_purchases\`, + 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 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?: { + /** + * 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/marketplace_purchases/stubbed\`, + 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 orgs + * @name OrgsListMembershipsForAuthenticatedUser + * @summary List organization memberships for the authenticated user + * @request GET:/user/memberships/orgs + */ + orgsListMembershipsForAuthenticatedUser: ( + 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 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({ + path: \`/user/memberships/orgs\`, + method: "GET", + query: query, + format: "json", + ...params, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * 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", + format: "json", + ...params, + }), - public abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * No description + * + * @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"; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/memberships/orgs/\${org}\`, + method: "PATCH", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * @description Lists all migrations a user has started. + * + * @tags migrations + * @name MigrationsListForAuthenticatedUser + * @summary List user migrations + * @request GET:/user/migrations + */ + migrationsListForAuthenticatedUser: ( + 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\`, + 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 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, + }), - 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 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[]; }, - ).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/migrations/\${migrationId}\`, + 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 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, + }), - if (cancelToken) { - this.abortControllers.delete(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 (!response.ok) throw data; - return data; - }); - }; -} + /** + * @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, + }), -/** - * @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 Lists all the repositories for this user migration. * - * @name TripList - * @request GET:/trip - * @secure + * @tags migrations + * @name MigrationsListReposForUser + * @summary List repositories for a user migration + * @request GET:/user/migrations/{migration_id}/repositories */ - tripList: (params: RequestParams = {}) => - this.request({ - path: \`/trip\`, + 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", - secure: true, + query: query, format: "json", ...params, }), /** - * @description list stops for a trip identified by {trip_id} + * @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. * - * @name StopList - * @request GET:/trip/{trip_id}/stop - * @secure + * @tags orgs + * @name OrgsListForAuthenticatedUser + * @summary List organizations for the authenticated user + * @request GET:/user/orgs */ - stopList: (tripId: string, params: RequestParams = {}) => - this.request({ - path: \`/trip/\${tripId}/stop\`, + 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", - secure: true, + query: query, 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; -} - -/** 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; -} -/** 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; -} + /** + * 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, + }), -export type QueryParamsType = Record; -export type ResponseFormat = keyof Omit; + /** + * @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; + }, + params: RequestParams = {}, + ) => + this.request({ + path: \`/user/public_emails\`, + method: "GET", + query: query, + 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 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, + }), + + /** + * @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, + }), -export type RequestParams = Omit< - FullRequestParams, - "body" | "method" | "query" | "path" ->; + /** + * @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, + }), -export interface ApiConfig { - baseUrl?: string; - baseApiParams?: Omit; - securityWorker?: ( - securityData: SecurityDataType | null, - ) => Promise | RequestParams | void; - customFetch?: typeof fetch; -} + /** + * 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, + }), -export interface HttpResponse - extends Response { - data: D; - error: E; -} + /** + * 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, + }), -type CancelToken = Symbol | string | number; + /** + * @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 enum ContentType { - Json = "application/json", - JsonApi = "application/vnd.api+json", - FormData = "multipart/form-data", - UrlEncoded = "application/x-www-form-urlencoded", - Text = "text/plain", -} + /** + * 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 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 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, + }), - private baseApiParams: RequestParams = { - credentials: "same-origin", - headers: {}, - redirect: "follow", - referrerPolicy: "no-referrer", - }; + /** + * 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, + }), - constructor(apiConfig: ApiConfig = {}) { - Object.assign(this, apiConfig); - } + /** + * @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, + }), - public setSecurityData = (data: SecurityDataType | null) => { - this.securityData = data; + /** + * @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, + }), - 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; - } + /** + * @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, + }), - 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 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, + }), - protected mergeRequestParams( - params1: RequestParams, - params2?: RequestParams, - ): RequestParams { - return { - ...this.baseApiParams, - ...params1, - ...(params2 || {}), - headers: { - ...(this.baseApiParams.headers || {}), - ...(params1.headers || {}), - ...((params2 && params2.headers) || {}), + /** + * @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, + }), - 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 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, + }), - const abortController = new AbortController(); - this.abortControllers.set(cancelToken, abortController); - return abortController.signal; - }; + /** + * @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 abortRequest = (cancelToken: CancelToken) => { - const abortController = this.abortControllers.get(cancelToken); + /** + * @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, + }), - if (abortController) { - abortController.abort(); - this.abortControllers.delete(cancelToken); - } - }; + /** + * 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, + }), - 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 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, + }), - 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 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; }, - ).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: \`/users/\${username}/gpg_keys\`, + 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 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, + }), - if (cancelToken) { - 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: string, params: RequestParams = {}) => + this.request({ + path: \`/users/\${username}/installation\`, + method: "GET", + format: "json", + ...params, + }), - if (!response.ok) throw data; - return data; - }); - }; -} + /** + * @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, + }), -/** - * @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 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 gifs - * @name GetGifsById - * @summary Get GIFs by ID - * @request GET:/gifs - * @secure + * @tags orgs + * @name OrgsListForUser + * @summary List organizations for a user + * @request GET:/users/{username}/orgs */ - getGifsById: ( + orgsListForUser: ( + username: string, query?: { - /** Filters results by specified GIF IDs, separated by commas. */ - ids?: 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; - /** 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: \`/users/\${username}/orgs\`, 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. + * No description * - * @tags gifs - * @name RandomGif - * @summary Random GIF - * @request GET:/gifs/random - * @secure + * @tags projects + * @name ProjectsListForUser + * @summary List user projects + * @request GET:/users/{username}/projects */ - randomGif: ( + projectsListForUser: ( + username: string, 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; + /** + * 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< - { - 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 + Project[], + | { + documentation_url: string; + message: string; + } + | ValidationError >({ - path: \`/gifs/random\`, + path: \`/users/\${username}/projects\`, 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 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 gifs - * @name SearchGifs - * @summary Search GIFs - * @request GET:/gifs/search - * @secure + * @tags activity + * @name ActivityListReceivedEventsForUser + * @summary List events received by the authenticated user + * @request GET:/users/{username}/received_events */ - searchGifs: ( - query: { - /** Specify default language for regional content; use a 2-letter ISO 639-1 language code. */ - lang?: string; + activityListReceivedEventsForUser: ( + username: string, + 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; }, 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: \`/users/\${username}/received_events\`, 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 + * No description * - * @tags gifs - * @name TranslateGif - * @summary Translate phrase to GIF - * @request GET:/gifs/translate - * @secure + * @tags activity + * @name ActivityListReceivedPublicEventsForUser + * @summary List public events received by a user + * @request GET:/users/{username}/received_events/public */ - translateGif: ( - query: { - /** Search term. */ - s: string; + 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< - { - 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\`, + this.request({ + path: \`/users/\${username}/received_events/public\`, 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 Lists public repositories for the specified user. * - * @tags gifs - * @name TrendingGifs - * @summary Trending GIFs - * @request GET:/gifs/trending - * @secure + * @tags repos + * @name ReposListForUser + * @summary List repositories for a user + * @request GET:/users/{username}/repos */ - trendingGifs: ( + 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; /** - * The maximum number of records to return. - * @format int32 - * @default 25 + * Can be one of \`created\`, \`updated\`, \`pushed\`, \`full_name\`. + * @default "full_name" */ - limit?: number; + sort?: "created" | "updated" | "pushed" | "full_name"; /** - * An optional results offset. - * @format int32 - * @default 0 + * Can be one of \`all\`, \`owner\`, \`member\`. + * @default "owner" */ - offset?: number; - /** Filters results by specified rating. */ - rating?: string; + type?: "all" | "owner" | "member"; }, 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: \`/users/\${username}/repos\`, method: "GET", query: query, - secure: true, format: "json", ...params, }), /** - * @description Returns a GIF given that GIF's unique ID + * @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 gifs - * @name GetGifById - * @summary Get GIF by Id - * @request GET:/gifs/{gifId} - * @secure + * @tags billing + * @name BillingGetGithubActionsBillingUser + * @summary Get GitHub Actions billing for a user + * @request GET:/users/{username}/settings/billing/actions */ - 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}\`, + billingGetGithubActionsBillingUser: ( + username: string, + params: RequestParams = {}, + ) => + this.request({ + path: \`/users/\${username}/settings/billing/actions\`, 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 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 stickers - * @name RandomSticker - * @summary Random Sticker - * @request GET:/stickers/random - * @secure + * @tags billing + * @name BillingGetGithubPackagesBillingUser + * @summary Get GitHub Packages billing for a user + * @request GET:/users/{username}/settings/billing/packages */ - randomSticker: ( - query?: { - /** Filters results by specified rating. */ - rating?: string; - /** Filters results by specified tag. */ - tag?: string; - }, + billingGetGithubPackagesBillingUser: ( + username: 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\`, + this.request({ + path: \`/users/\${username}/settings/billing/packages\`, 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. + * @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 stickers - * @name SearchStickers - * @summary Search Stickers - * @request GET:/stickers/search - * @secure + * @tags billing + * @name BillingGetSharedStorageBillingUser + * @summary Get shared storage billing for a user + * @request GET:/users/{username}/settings/billing/shared-storage */ - 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; - }, + billingGetSharedStorageBillingUser: ( + username: 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\`, + this.request({ + path: \`/users/\${username}/settings/billing/shared-storage\`, 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 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 stickers - * @name TranslateSticker - * @summary Translate phrase to Sticker - * @request GET:/stickers/translate - * @secure + * @tags activity + * @name ActivityListReposStarredByUser + * @summary List repositories starred by a user + * @request GET:/users/{username}/starred */ - translateSticker: ( - query: { - /** Search term. */ - s: string; + 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< - { - 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\`, + this.request({ + path: \`/users/\${username}/starred\`, 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. + * @description Lists repositories a user is watching. * - * @tags stickers - * @name TrendingStickers - * @summary Trending Stickers - * @request GET:/stickers/trending - * @secure + * @tags activity + * @name ActivityListReposWatchedByUser + * @summary List repositories watched by a user + * @request GET:/users/{username}/subscriptions */ - trendingStickers: ( + activityListReposWatchedByUser: ( + username: string, 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: \`/users/\${username}/subscriptions\`, method: "GET", query: query, - secure: true, 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 > 'issue-1057' 1`] = ` +exports[`simple > 'issue-1057' 2`] = ` "/* eslint-disable */ /* tslint:disable */ // @ts-nocheck 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..3a73d711e --- /dev/null +++ b/tests/spec/nullable-parent-with-nullable-children/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-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" + } + } + } + } + } +} 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 + } + } + } + } + } +}