diff --git a/package.json b/package.json index 93740bc..02c62c6 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "preopenapi-typescript:cloud": "curl --output ./src/cloud/openapi/swagger.v3.json https://dac-static.atlassian.com/cloud/bitbucket/swagger.v3.json", "openapi-typescript:cloud": "openapi-typescript ./src/cloud/openapi/swagger.v3.json --output ./src/cloud/openapi/openapi-typescript.ts --immutable --empty-objects-unknown --alphabetize --root-types", "postopenapi-typescript:cloud": "ts-autofix ./src/cloud/openapi && pnpm run lint:fix", - "preopenapi-typescript:server": "curl --output ./src/server/openapi/swagger.v3.json https://dac-static.atlassian.com/server/bitbucket/9.1.swagger.v3.json", + "preopenapi-typescript:server": "curl --output ./src/server/openapi/swagger.v3.json https://dac-static.atlassian.com/server/bitbucket/9.2.swagger.v3.json", "openapi-typescript:server": "openapi-typescript ./src/server/openapi/swagger.v3.json --output ./src/server/openapi/openapi-typescript.ts --immutable --empty-objects-unknown --alphabetize --root-types", "postopenapi-typescript:server": "ts-autofix ./src/server/openapi && pnpm run lint:fix" }, diff --git a/src/cloud/openapi/openapi-typescript.ts b/src/cloud/openapi/openapi-typescript.ts index 8533bac..3a96ec3 100644 --- a/src/cloud/openapi/openapi-typescript.ts +++ b/src/cloud/openapi/openapi-typescript.ts @@ -10368,6 +10368,11 @@ export interface paths { headers: Readonly> content?: never } + /** @description Unable to merge because one of the refs involved changed while attempting to merge */ + readonly 409: { + headers: Readonly> + content?: never + } /** @description If the merge took too long and timed out. * In this case the caller should retry the request later */ readonly 555: { @@ -10491,6 +10496,11 @@ export interface paths { headers: Readonly> content?: never } + /** @description Unable to merge because one of the refs involved changed while attempting to merge */ + readonly 409: { + headers: Readonly> + content?: never + } } } readonly put?: never @@ -18949,6 +18959,9 @@ export interface components { readonly merge_strategies?: readonly ( | "fast_forward" | "merge_commit" + | "rebase_fast_forward" + | "rebase_merge" + | "squash_fast_forward" | "squash" )[] }) @@ -22044,6 +22057,9 @@ export interface components { readonly merge_strategies?: readonly ( | "fast_forward" | "merge_commit" + | "rebase_fast_forward" + | "rebase_merge" + | "squash_fast_forward" | "squash" )[] readonly name?: string @@ -22066,7 +22082,13 @@ export interface components { * @default merge_commit * @enum {string} */ - readonly merge_strategy?: "fast_forward" | "merge_commit" | "squash" + readonly merge_strategy?: + | "fast_forward" + | "merge_commit" + | "rebase_fast_forward" + | "rebase_merge" + | "squash_fast_forward" + | "squash" /** @description The commit message that will be used on the resulting commit. Note that the size of the message is limited to 128 KiB. */ readonly message?: string readonly type: string @@ -22826,6 +22848,15 @@ export interface components { (Readonly> & { /** Format: date-time */ readonly created_on?: string + /** + * @description Controls the rules for forking repositories within this workspace. + * + * * **allow_forks**: unrestricted forking + * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories + * + * @enum {string} + */ + readonly forking_mode?: "allow_forks" | "internal_only" /** @description Indicates whether the workspace enforces private content, or whether it allows public content. */ readonly is_privacy_enforced?: boolean /** @description Indicates whether the workspace is publicly accessible, or whether it is diff --git a/src/cloud/openapi/swagger.v3.json b/src/cloud/openapi/swagger.v3.json index f7fafc1..f4a1ac1 100644 --- a/src/cloud/openapi/swagger.v3.json +++ b/src/cloud/openapi/swagger.v3.json @@ -14571,6 +14571,9 @@ "202": { "description": "In the Location header, the URL to poll for the pull request merge status" }, + "409": { + "description": "Unable to merge because one of the refs involved changed while attempting to merge" + }, "555": { "description": "If the merge took too long and timed out.\nIn this case the caller should retry the request later", "content": { @@ -14668,6 +14671,9 @@ }, "403": { "description": "The user making the request does not have permission to the repo and is different from the user who queued the task" + }, + "409": { + "description": "Unable to merge because one of the refs involved changed while attempting to merge" } }, "security": [ @@ -15821,7 +15827,10 @@ "merge_strategies": [ "merge_commit", "squash", - "fast_forward" + "fast_forward", + "squash_fast_forward", + "rebase_fast_forward", + "rebase_merge" ], "type": "branch", "target": { @@ -16133,7 +16142,10 @@ "merge_strategies": [ "merge_commit", "squash", - "fast_forward" + "fast_forward", + "squash_fast_forward", + "rebase_fast_forward", + "rebase_merge" ], "type": "branch", "target": { @@ -24659,7 +24671,7 @@ "description": "A workspace is where you create repositories, collaborate on\nyour code, and organize different streams of work in your Bitbucket\nCloud account. Workspaces replace the use of teams and users in API\ncalls.\n" } ], - "x-revision": "33b035ea9108", + "x-revision": "6e8ad69baf7f", "x-atlassian-narrative": { "documents": [ { @@ -29978,7 +29990,14 @@ "merge_strategy": { "type": "string", "description": "The merge strategy that will be used to merge the pull request.", - "enum": ["merge_commit", "squash", "fast_forward"], + "enum": [ + "merge_commit", + "squash", + "fast_forward", + "squash_fast_forward", + "rebase_fast_forward", + "rebase_merge" + ], "default": "merge_commit" } }, @@ -30004,7 +30023,14 @@ "description": "Available merge strategies, when this endpoint is the destination of the pull request.", "items": { "type": "string", - "enum": ["merge_commit", "squash", "fast_forward"] + "enum": [ + "merge_commit", + "squash", + "fast_forward", + "squash_fast_forward", + "rebase_fast_forward", + "rebase_merge" + ] } }, "default_merge_strategy": { @@ -31914,6 +31940,11 @@ "type": "boolean", "description": "Indicates whether the workspace enforces private content, or whether it allows public content." }, + "forking_mode": { + "type": "string", + "description": "Controls the rules for forking repositories within this workspace.\n\n* **allow_forks**: unrestricted forking\n* **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n", + "enum": ["allow_forks", "internal_only"] + }, "created_on": { "type": "string", "format": "date-time" @@ -32362,7 +32393,14 @@ "description": "Available merge strategies for pull requests targeting this branch.", "items": { "type": "string", - "enum": ["merge_commit", "squash", "fast_forward"] + "enum": [ + "merge_commit", + "squash", + "fast_forward", + "squash_fast_forward", + "rebase_fast_forward", + "rebase_merge" + ] } }, "default_merge_strategy": { diff --git a/src/server/openapi/openapi-typescript.ts b/src/server/openapi/openapi-typescript.ts index 56733ba..e4d80ad 100644 --- a/src/server/openapi/openapi-typescript.ts +++ b/src/server/openapi/openapi-typescript.ts @@ -8433,7 +8433,47 @@ export interface paths { readonly patch?: never readonly trace?: never } - readonly "/mirroring/latest/supportInfo/projects/{projectKey}/repos/{repoSlug}/repoSyncStatus": { + readonly "/mirroring/latest/supportInfo/out-of-sync-repos/content": { + readonly parameters: { + readonly query?: never + readonly header?: never + readonly path?: never + readonly cookie?: never + } + /** + * Get out-of-sync repositories + * @description Retrieves a list of repository IDs which have not synced on the mirror node for at least the threshold time limit after the content was changed in the corresponding upstream repositories. The threshold time limit is defined by a configuration property plugin.mirroring.repository.diagnostics.sync.tolerance. The detection of out of sync repositories is dependent on the timing of a scheduled job which is controlled by a configuration property plugin.mirroring.synchronization.interval which means in worst case it can take upto plugin.mirroring.repository.diagnostics.sync.tolerance + plugin.mirroring.synchronization.interval time to detect an out-of-sync repository.

To use this API, a configuration property plugin.mirroring.repository.diagnostics.sync.enabled has to be set to true as this feature is disabled by default. + */ + readonly get: operations["getOutOfSyncRepositories"] + readonly put?: never + readonly post?: never + readonly delete?: never + readonly options?: never + readonly head?: never + readonly patch?: never + readonly trace?: never + } + readonly "/mirroring/latest/supportInfo/projects/{projectKey}/repos/{repositorySlug}/repo-lock-owner": { + readonly parameters: { + readonly query?: never + readonly header?: never + readonly path?: never + readonly cookie?: never + } + /** + * Get the repository lock owner for the syncing process + * @description Retrieves the information about the process owning the sync lock for this repository. The process owning the lock could be running on any of the nodes in the mirror farm + */ + readonly get: operations["getRepositoryLockOwner"] + readonly put?: never + readonly post?: never + readonly delete?: never + readonly options?: never + readonly head?: never + readonly patch?: never + readonly trace?: never + } + readonly "/mirroring/latest/supportInfo/projects/{projectKey}/repos/{repositorySlug}/repoSyncStatus": { readonly parameters: { readonly query?: never readonly header?: never @@ -8493,6 +8533,26 @@ export interface paths { readonly patch?: never readonly trace?: never } + readonly "/mirroring/latest/supportInfo/repo-lock-owners": { + readonly parameters: { + readonly query?: never + readonly header?: never + readonly path?: never + readonly cookie?: never + } + /** + * Get all the repository lock owners for the syncing process + * @description Retrieves the information about all the processes from the all the nodes in the mirror farm owning sync lock for any repository + */ + readonly get: operations["getRepositoryLockOwners"] + readonly put?: never + readonly post?: never + readonly delete?: never + readonly options?: never + readonly head?: never + readonly patch?: never + readonly trace?: never + } readonly "/mirroring/latest/supportInfo/repoSyncStatus": { readonly parameters: { readonly query?: never @@ -9051,6 +9111,11 @@ export interface components { readonly lineAnchor?: boolean /** @enum {string} */ readonly lineType?: "ADDED" | "CONTEXT" | "REMOVED" + readonly multilineAnchor?: boolean + /** Format: int32 */ + readonly multilineStartLine?: number + /** @enum {string} */ + readonly multilineStartLineType?: "ADDED" | "CONTEXT" | "REMOVED" readonly orphaned?: boolean readonly path?: string readonly srcPath?: string @@ -10575,9 +10640,20 @@ export interface components { * @example 98 */ readonly line?: number - readonly lineComment?: boolean /** @enum {string} */ readonly lineType?: "ADDED" | "CONTEXT" | "REMOVED" + readonly multilineMarker?: { + /** + * Format: int32 + * @description The line number where the multiline comment will begin + */ + readonly startLine?: number + /** + * @description The segment type of the start line of the multiline comment + * @enum {string} + */ + readonly startLineType: "ADDED" | "CONTEXT" | "REMOVED" + } readonly path?: { /** @example [ * "path", @@ -10918,9 +10994,20 @@ export interface components { * @example 98 */ readonly line?: number - readonly lineComment?: boolean /** @enum {string} */ readonly lineType?: "ADDED" | "CONTEXT" | "REMOVED" + readonly multilineMarker?: { + /** + * Format: int32 + * @description The line number where the multiline comment will begin + */ + readonly startLine?: number + /** + * @description The segment type of the start line of the multiline comment + * @enum {string} + */ + readonly startLineType: "ADDED" | "CONTEXT" | "REMOVED" + } readonly path?: { /** @example [ * "path", @@ -11413,9 +11500,20 @@ export interface components { * @example 98 */ readonly line?: number - readonly lineComment?: boolean /** @enum {string} */ readonly lineType?: "ADDED" | "CONTEXT" | "REMOVED" + readonly multilineMarker?: { + /** + * Format: int32 + * @description The line number where the multiline comment will begin + */ + readonly startLine?: number + /** + * @description The segment type of the start line of the multiline comment + * @enum {string} + */ + readonly startLineType: "ADDED" | "CONTEXT" | "REMOVED" + } readonly path?: { /** @example [ * "path", @@ -13020,6 +13118,18 @@ export interface components { /** @example 8.0.0 */ readonly productVersion?: string } + readonly RestMultilineCommentMarker: { + /** + * Format: int32 + * @description The line number where the multiline comment will begin + */ + readonly startLine?: number + /** + * @description The segment type of the start line of the multiline comment + * @enum {string} + */ + readonly startLineType?: "ADDED" | "CONTEXT" | "REMOVED" + } readonly RestMultipleBuildStats: unknown readonly RestNamedLink: { /** @example https://bitbucket.example.com/scm/awesomeproject/awesomerepo.git */ @@ -14372,6 +14482,33 @@ export interface components { /** @example Insufficient branch permissions */ readonly summaryMessage?: string } + readonly RestRepositoryLockOwner: { + /** + * @description The repository ID for which the lock is held + * @example 101 + */ + readonly externalRepositoryId?: string + /** + * Format: date-time + * @description The time at which lock was last acquired + */ + readonly lockAcquireTime?: string + /** + * @description The ID of the mirror node on which the lock is being held + * @example 4da47d83-ec95-489d-ad46-012cc086c0da + */ + readonly nodeId?: string + /** + * @description The unique ID of the request for which the lock is being held + * @example *T75X1Tx955x782x0 + */ + readonly requestId?: string + /** + * @description Name of the thread that is holding the lock + * @example farm-refchange-poller:thread-2 + */ + readonly threadName?: string + } readonly RestRepositoryMirrorEvent: { /** * Format: int32 @@ -15302,9 +15439,20 @@ export interface components { * @example 98 */ readonly line?: number - readonly lineComment?: boolean /** @enum {string} */ readonly lineType?: "ADDED" | "CONTEXT" | "REMOVED" + readonly multilineMarker?: { + /** + * Format: int32 + * @description The line number where the multiline comment will begin + */ + readonly startLine?: number + /** + * @description The segment type of the start line of the multiline comment + * @enum {string} + */ + readonly startLineType: "ADDED" | "CONTEXT" | "REMOVED" + } readonly path?: { /** @example [ * "path", @@ -15645,9 +15793,20 @@ export interface components { * @example 98 */ readonly line?: number - readonly lineComment?: boolean /** @enum {string} */ readonly lineType?: "ADDED" | "CONTEXT" | "REMOVED" + readonly multilineMarker?: { + /** + * Format: int32 + * @description The line number where the multiline comment will begin + */ + readonly startLine?: number + /** + * @description The segment type of the start line of the multiline comment + * @enum {string} + */ + readonly startLineType: "ADDED" | "CONTEXT" | "REMOVED" + } readonly path?: { /** @example [ * "path", @@ -16452,6 +16611,8 @@ export type SchemaRestMirrorRepositorySynchronizationStatus = export type SchemaRestMirrorServer = components["schemas"]["RestMirrorServer"] export type SchemaRestMirrorUpgradeRequest = components["schemas"]["RestMirrorUpgradeRequest"] +export type SchemaRestMultilineCommentMarker = + components["schemas"]["RestMultilineCommentMarker"] export type SchemaRestMultipleBuildStats = components["schemas"]["RestMultipleBuildStats"] export type SchemaRestNamedLink = components["schemas"]["RestNamedLink"] @@ -16540,6 +16701,8 @@ export type SchemaRestRepositoryHook = components["schemas"]["RestRepositoryHook"] export type SchemaRestRepositoryHookVeto = components["schemas"]["RestRepositoryHookVeto"] +export type SchemaRestRepositoryLockOwner = + components["schemas"]["RestRepositoryLockOwner"] export type SchemaRestRepositoryMirrorEvent = components["schemas"]["RestRepositoryMirrorEvent"] export type SchemaRestRepositoryPolicy = @@ -35093,8 +35256,12 @@ export interface operations { * @example 0 */ readonly start?: number - /** @description (optional) if specified, it must be a valid repository state name and will limit the resulting repository list to ones that are in the specified state. The currently supported explicit state values are AVAILABLE, INITIALISING and INITIALISATION_FAILED.
Available since 5.13 */ - readonly state?: "AVAILABLE" | "INITIALISATION_FAILED" | "INITIALISING" + /** @description (optional) if specified, it must be a valid repository state name and will limit the resulting repository list to ones that are in the specified state. The currently supported explicit state values are AVAILABLE, INITIALISING, INITIALISATION_FAILED and OFFLINE.
Available since 5.13 */ + readonly state?: + | "AVAILABLE" + | "INITIALISATION_FAILED" + | "INITIALISING" + | "OFFLINE" /** @description (optional) if specified, this will limit the resulting repository list based on the repositories visibility. Valid values are public or private. */ readonly visibility?: "private" | "public" } @@ -40021,13 +40188,88 @@ export interface operations { } } } + readonly getOutOfSyncRepositories: { + readonly parameters: { + readonly query?: never + readonly header?: never + readonly path?: never + readonly cookie?: never + } + readonly requestBody?: never + readonly responses: { + /** @description The upstream IDs of the repositories that are out of sync on the mirror node */ + readonly 200: { + headers: Readonly> + content: { + readonly "application/json;charset=UTF-8": string + } + } + /** @description The currently authenticated user has insufficient permissions to call this resource. */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json;charset=UTF-8": components["schemas"]["RestErrors"] + } + } + /** @description The feature is not enabled i.e. plugin.mirroring.repository.diagnostics.sync.enabled=false */ + readonly 409: { + headers: Readonly> + content: { + readonly "application/json;charset=UTF-8": components["schemas"]["RestErrors"] + } + } + } + } + readonly getRepositoryLockOwner: { + readonly parameters: { + readonly query?: never + readonly header?: never + readonly path: { + /** @description The project key */ + readonly projectKey: string + /** @description The repository slug */ + readonly repositorySlug: string + } + readonly cookie?: never + } + readonly requestBody?: never + readonly responses: { + /** @description The information about the repository lock owner for the syncing process, if the lock is currently being held, otherwise an empty response */ + readonly 200: { + headers: Readonly> + content: { + readonly "application/json": components["schemas"]["RestRepositoryLockOwner"] + } + } + /** @description The currently authenticated user has insufficient permissions to call this resource. */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } + /** @description The specified repository does not exist */ + readonly 404: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } + } + } readonly getRepoSyncStatus_1: { readonly parameters: { readonly query?: never readonly header?: never readonly path: { + /** @description The project key */ readonly projectKey: string - readonly repoSlug: string + /** @description The repository slug */ + readonly repositorySlug: string } readonly cookie?: never } @@ -40040,6 +40282,24 @@ export interface operations { readonly "application/json": components["schemas"]["RestMirrorRepositorySynchronizationStatus"] } } + /** @description The currently authenticated user has insufficient permissions to call this resource. */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } + /** @description The specified repository does not exist */ + readonly 404: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } } } readonly getRefChangesQueue: { @@ -40058,6 +40318,13 @@ export interface operations { readonly "application/json;charset=UTF-8": components["schemas"]["RestRefSyncQueue"] } } + /** @description The currently authenticated user has insufficient permissions to call this resource. */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": components["schemas"]["RestErrors"] + } + } } } readonly getRefChangesQueueCount: { @@ -40076,6 +40343,40 @@ export interface operations { readonly "application/json": unknown } } + /** @description The currently authenticated user has insufficient permissions to call this resource. */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } + } + } + readonly getRepositoryLockOwners: { + readonly parameters: { + readonly query?: never + readonly header?: never + readonly path?: never + readonly cookie?: never + } + readonly requestBody?: never + readonly responses: { + /** @description A list of all the repository lock owners for the syncing process */ + readonly 200: { + headers: Readonly> + content: { + readonly "application/json;charset=UTF-8": readonly components["schemas"]["RestRepositoryLockOwner"][] + } + } + /** @description The currently authenticated user has insufficient permissions to call this resource. */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": components["schemas"]["RestErrors"] + } + } } } readonly getRepoSyncStatus: { @@ -40116,6 +40417,15 @@ export interface operations { } } } + /** @description The currently authenticated user has insufficient permissions to call this resource. */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } } } readonly getMirrorSettings: { @@ -40134,6 +40444,15 @@ export interface operations { readonly "application/json": components["schemas"]["RestUpstreamSettings"] } } + /** @description When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } /** @description The upstream server could not be found. */ readonly 404: { headers: Readonly> @@ -40166,6 +40485,15 @@ export interface operations { readonly "application/json": components["schemas"]["RestUpstreamSettings"] } } + /** @description When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } /** @description The upstream server could not be found. */ readonly 404: { headers: Readonly> @@ -40193,6 +40521,15 @@ export interface operations { readonly "application/json": unknown } } + /** @description When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } /** @description The upstream server could not be found. */ readonly 404: { headers: Readonly> @@ -40233,6 +40570,15 @@ export interface operations { } } } + /** @description When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } } } readonly getMirroredProjects: { @@ -40251,6 +40597,24 @@ export interface operations { readonly "application/json": unknown } } + /** @description When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } + /** @description The upstream server could not be found. */ + readonly 404: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } } } readonly startMirroringProjects: { @@ -40273,6 +40637,24 @@ export interface operations { readonly "application/json": unknown } } + /** @description When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } + /** @description The upstream server could not be found. */ + readonly 404: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } } } readonly startMirroringProject: { @@ -40293,6 +40675,24 @@ export interface operations { readonly "application/json": unknown } } + /** @description When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } + /** @description The upstream server could not be found. */ + readonly 404: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } } } readonly stopMirroringProject: { @@ -40312,6 +40712,24 @@ export interface operations { headers: Readonly> content?: never } + /** @description When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission */ + readonly 401: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } + /** @description The upstream server could not be found. */ + readonly 404: { + headers: Readonly> + content: { + readonly "application/json": { + readonly errors?: readonly components["schemas"]["RestErrorMessage"][] + } + } + } } } readonly getUpstreamServer: { diff --git a/src/server/openapi/swagger.v3.json b/src/server/openapi/swagger.v3.json index 5b07b30..afa69c3 100644 --- a/src/server/openapi/swagger.v3.json +++ b/src/server/openapi/swagger.v3.json @@ -8,7 +8,7 @@ "name": "Bitbucket Data Center Jira Project", "url": "https://jira.atlassian.com/projects/BSERV/summary" }, - "version": "9.1" + "version": "9.2" }, "servers": [ { @@ -400,35 +400,28 @@ "type": { "type": "string", "enum": ["BRANCH", "TAG"] } } }, - "RestApplicationUser": { + "RestDefaultTask": { "properties": { - "active": { "type": "boolean" }, - "avatarUrl": { "type": "string", "writeOnly": true }, - "displayName": { "type": "string", "example": "Jane Citizen" }, - "emailAddress": { "type": "string", "example": "jane@example.com" }, + "description": { + "type": "string", + "example": "Default task description", + "readOnly": true + }, + "html": { "type": "string", "writeOnly": true }, "id": { "type": "integer", - "format": "int32", - "example": 101, + "format": "int64", + "example": 1, "readOnly": true - }, - "links": { "type": "object", "properties": {}, "writeOnly": true }, - "name": { "type": "string", "example": "jcitizen" }, - "slug": { "type": "string", "example": "jcitizen" }, - "type": { "type": "string", "enum": ["NORMAL", "SERVICE"] } + } } }, - "RestDefaultReviewersRequest": { + "RestDefaultTaskRequest": { "type": "object", "properties": { - "requiredApprovals": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "reviewers": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestApplicationUser" } + "description": { + "type": "string", + "example": "Default task description" }, "sourceMatcher": { "type": "object", @@ -478,271 +471,6 @@ } } }, - "RestPullRequestCondition": { - "properties": { - "id": { - "type": "integer", - "format": "int32", - "example": 1, - "readOnly": true - }, - "requiredApprovals": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "reviewers": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestApplicationUser" } - }, - "scope": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "format": "int32", - "example": 2 - }, - "type": { - "type": "string", - "enum": ["GLOBAL", "PROJECT", "REPOSITORY"] - } - }, - "readOnly": true - }, - "sourceRefMatcher": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "main" }, - "id": { "type": "string", "example": "refs/heads/main" }, - "type": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "ANY_REF", - "BRANCH", - "PATTERN", - "MODEL_CATEGORY", - "MODEL_BRANCH" - ] - }, - "name": { "type": "string", "example": "Branch" } - } - } - } - }, - "targetRefMatcher": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "main" }, - "id": { "type": "string", "example": "refs/heads/main" }, - "type": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "ANY_REF", - "BRANCH", - "PATTERN", - "MODEL_CATEGORY", - "MODEL_BRANCH" - ] - }, - "name": { "type": "string", "example": "Branch" } - } - } - } - } - } - }, - "RestRelatedLinks": { "properties": {} }, - "RestScope": { - "properties": { - "resourceId": { "type": "integer", "format": "int32", "example": 2 }, - "type": { - "type": "string", - "enum": ["GLOBAL", "PROJECT", "REPOSITORY"] - } - } - }, - "RestBulkAddInsightAnnotationRequest": { - "type": "object", - "properties": { - "annotations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestSingleAddInsightAnnotationRequest" - }, - "maxItems": 2147483647, - "minItems": 1 - } - } - }, - "RestInsightAnnotation": { - "properties": { - "externalId": { "type": "string", "example": "external.id" }, - "line": { "type": "integer", "format": "int32", "example": 5 }, - "link": { - "type": "string", - "example": "http://example.com/my/file/analysis?line=5" - }, - "message": { - "type": "string", - "example": "This is an annotation message" - }, - "path": { - "type": "string", - "example": "src/some/structure/file.ext" - }, - "reportKey": { "type": "string", "example": "report.key" }, - "severity": { "type": "string", "example": "HIGH" }, - "type": { "type": "string", "example": "BUG" } - } - }, - "RestInsightAnnotationsResponse": { - "properties": { - "annotations": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestInsightAnnotation" } - } - } - }, - "RestInsightReport": { - "properties": { - "createdDate": { "type": "number", "example": 1630041546433 }, - "data": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestInsightReportData" } - }, - "details": { - "type": "string", - "example": "This is the details of the report, it can be a longer string describing the report" - }, - "key": { "type": "string", "example": "report.key" }, - "link": { - "type": "string", - "format": "uri", - "example": "http://integration.example.com" - }, - "logoUrl": { - "type": "string", - "format": "uri", - "example": "http://integration.example.com/logo" - }, - "reporter": { - "type": "string", - "example": "Reporter/tool that produced this report" - }, - "result": { - "type": "string", - "enum": ["FAIL", "PASS"], - "example": "PASS" - }, - "title": { "type": "string", "example": "report.title" } - } - }, - "RestInsightReportData": { - "properties": { - "title": { "type": "string", "example": "data.title" }, - "type": { - "type": "string", - "example": "NUMBER", - "pattern": "BOOLEAN|DATE|DURATION|LINK|NUMBER|PERCENTAGE|TEXT" - }, - "value": { "type": "object", "example": 9 } - } - }, - "RestSetInsightReportRequest": { - "type": "object", - "properties": { - "coverageProviderKey": { "type": "string" }, - "createdDate": { - "type": "integer", - "format": "int64", - "example": 1630041546433 - }, - "data": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestInsightReportData" }, - "maxItems": 6, - "minItems": 0 - }, - "details": { - "type": "string", - "example": "This is the details of the report, it can be a longer string describing the report." - }, - "link": { "type": "string", "example": "http://insight.example.com" }, - "logoUrl": { - "type": "string", - "example": "http://insight.example.com/logo" - }, - "reporter": { - "type": "string", - "example": "Reporter/tool that produced this report", - "maxLength": 450, - "minLength": 0 - }, - "result": { - "type": "string", - "example": "PASS", - "pattern": "FAIL|PASS" - }, - "title": { - "type": "string", - "example": "report.title", - "maxLength": 450, - "minLength": 0 - } - }, - "required": ["data", "title"] - }, - "RestSingleAddInsightAnnotationRequest": { - "type": "object", - "properties": { - "externalId": { - "type": "string", - "example": "message-1", - "maxLength": 450, - "minLength": 0 - }, - "line": { - "type": "integer", - "format": "int32", - "example": 4, - "minimum": 0 - }, - "link": { - "type": "string", - "example": "https://link.to.tool/that/produced/annotation/message-1" - }, - "message": { - "type": "string", - "example": "This is a bug here because reasons", - "maxLength": 2000, - "minLength": 0 - }, - "path": { - "type": "string", - "example": "path/to/file/in/repo", - "maxLength": 50000, - "minLength": 0 - }, - "severity": { - "type": "string", - "example": "MEDIUM", - "pattern": "LOW|MEDIUM|HIGH" - }, - "type": { - "type": "string", - "example": "CODE_SMELL", - "pattern": "VULNERABILITY|CODE_SMELL|BUG" - } - }, - "required": ["message", "severity"] - }, "Comment": { "type": "object", "properties": { @@ -810,6 +538,12 @@ "type": "string", "enum": ["ADDED", "CONTEXT", "REMOVED"] }, + "multilineAnchor": { "type": "boolean" }, + "multilineStartLine": { "type": "integer", "format": "int32" }, + "multilineStartLineType": { + "type": "string", + "enum": ["ADDED", "CONTEXT", "REMOVED"] + }, "orphaned": { "type": "boolean" }, "path": { "type": "string" }, "srcPath": { "type": "string" }, @@ -877,6 +611,24 @@ "type": { "$ref": "#/components/schemas/RefType" } } }, + "RestApplicationUser": { + "properties": { + "active": { "type": "boolean" }, + "avatarUrl": { "type": "string", "writeOnly": true }, + "displayName": { "type": "string", "example": "Jane Citizen" }, + "emailAddress": { "type": "string", "example": "jane@example.com" }, + "id": { + "type": "integer", + "format": "int32", + "example": 101, + "readOnly": true + }, + "links": { "type": "object", "properties": {}, "writeOnly": true }, + "name": { "type": "string", "example": "jcitizen" }, + "slug": { "type": "string", "example": "jcitizen" }, + "type": { "type": "string", "enum": ["NORMAL", "SERVICE"] } + } + }, "RestComment": { "properties": { "anchor": { @@ -892,11 +644,27 @@ "example": "62a0505e8204115b8b9c8a95bfa264a8c0896a93" }, "line": { "type": "integer", "format": "int32", "example": 98 }, - "lineComment": { "type": "boolean", "readOnly": true }, "lineType": { "type": "string", "enum": ["ADDED", "CONTEXT", "REMOVED"] }, + "multilineMarker": { + "type": "object", + "properties": { + "startLine": { + "type": "integer", + "format": "int32", + "description": "The line number where the multiline comment will begin" + }, + "startLineType": { + "type": "string", + "description": "The segment type of the start line of the multiline comment", + "enum": ["ADDED", "CONTEXT", "REMOVED"] + } + }, + "readOnly": true, + "required": ["startLineType"] + }, "path": { "type": "object", "properties": { @@ -1554,11 +1322,27 @@ "format": "int32", "example": 98 }, - "lineComment": { "type": "boolean", "readOnly": true }, "lineType": { "type": "string", "enum": ["ADDED", "CONTEXT", "REMOVED"] }, + "multilineMarker": { + "type": "object", + "properties": { + "startLine": { + "type": "integer", + "format": "int32", + "description": "The line number where the multiline comment will begin" + }, + "startLineType": { + "type": "string", + "description": "The segment type of the start line of the multiline comment", + "enum": ["ADDED", "CONTEXT", "REMOVED"] + } + }, + "readOnly": true, + "required": ["startLineType"] + }, "path": { "type": "object", "properties": { @@ -2449,11 +2233,27 @@ "example": "62a0505e8204115b8b9c8a95bfa264a8c0896a93" }, "line": { "type": "integer", "format": "int32", "example": 98 }, - "lineComment": { "type": "boolean", "readOnly": true }, "lineType": { "type": "string", "enum": ["ADDED", "CONTEXT", "REMOVED"] }, + "multilineMarker": { + "type": "object", + "properties": { + "startLine": { + "type": "integer", + "format": "int32", + "description": "The line number where the multiline comment will begin" + }, + "startLineType": { + "type": "string", + "description": "The segment type of the start line of the multiline comment", + "enum": ["ADDED", "CONTEXT", "REMOVED"] + } + }, + "readOnly": true, + "required": ["startLineType"] + }, "path": { "type": "object", "properties": { @@ -3020,6 +2820,20 @@ "value": { "type": "string" } } }, + "RestMultilineCommentMarker": { + "properties": { + "startLine": { + "type": "integer", + "format": "int32", + "description": "The line number where the multiline comment will begin" + }, + "startLineType": { + "type": "string", + "description": "The segment type of the start line of the multiline comment", + "enum": ["ADDED", "CONTEXT", "REMOVED"] + } + } + }, "RestPath": { "properties": { "components": { @@ -3830,6 +3644,7 @@ "type": { "type": "string", "enum": ["BRANCH", "TAG"] } } }, + "RestRelatedLinks": { "properties": {} }, "RestRepository": { "properties": { "archived": { "type": "boolean", "readOnly": true }, @@ -4050,11 +3865,27 @@ "format": "int32", "example": 98 }, - "lineComment": { "type": "boolean", "readOnly": true }, "lineType": { "type": "string", "enum": ["ADDED", "CONTEXT", "REMOVED"] }, + "multilineMarker": { + "type": "object", + "properties": { + "startLine": { + "type": "integer", + "format": "int32", + "description": "The line number where the multiline comment will begin" + }, + "startLineType": { + "type": "string", + "description": "The segment type of the start line of the multiline comment", + "enum": ["ADDED", "CONTEXT", "REMOVED"] + } + }, + "readOnly": true, + "required": ["startLineType"] + }, "path": { "type": "object", "properties": { @@ -4776,11 +4607,27 @@ "format": "int32", "example": 98 }, - "lineComment": { "type": "boolean", "readOnly": true }, "lineType": { "type": "string", "enum": ["ADDED", "CONTEXT", "REMOVED"] }, + "multilineMarker": { + "type": "object", + "properties": { + "startLine": { + "type": "integer", + "format": "int32", + "description": "The line number where the multiline comment will begin" + }, + "startLineType": { + "type": "string", + "description": "The segment type of the start line of the multiline comment", + "enum": ["ADDED", "CONTEXT", "REMOVED"] + } + }, + "readOnly": true, + "required": ["startLineType"] + }, "path": { "type": "object", "properties": { @@ -5738,266 +5585,915 @@ } } }, - "RestGitTagCreateRequest": { - "type": "object", - "properties": { - "force": { "type": "boolean" }, - "message": { "type": "string", "example": "A new release tag" }, - "name": { "type": "string", "example": "release-tag" }, - "startPoint": { "type": "string", "example": "refs/heads/master" }, - "type": { "type": "string", "enum": ["ANNOTATED", "LIGHTWEIGHT"] } - } - }, - "RestPullRequestRebaseRequest": { - "type": "object", - "properties": { - "version": { "type": "integer", "format": "int32", "example": 1 } - } - }, - "RestPullRequestRebaseResult": { - "properties": { - "refChange": { - "type": "object", - "properties": { - "fromHash": { - "type": "string", - "example": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad" - }, - "ref": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "master" }, - "id": { "type": "string", "example": "refs/heads/master" }, - "type": { "type": "string", "enum": ["BRANCH", "TAG"] } - } - }, - "refId": { "type": "string", "example": "refs/heads/master" }, - "toHash": { - "type": "string", - "example": "d6edcbf924697ab811a867421dab60d954ccad99" - }, - "type": { "type": "string", "enum": ["ADD", "DELETE", "UPDATE"] } - } - } - } - }, - "RestPullRequestRebaseability": { - "properties": { - "vetoes": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestRepositoryHookVeto" } - } - } - }, - "RestRefChange": { - "properties": { - "fromHash": { - "type": "string", - "example": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad" - }, - "ref": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "master" }, - "id": { "type": "string", "example": "refs/heads/master" }, - "type": { "type": "string", "enum": ["BRANCH", "TAG"] } - } - }, - "refId": { "type": "string", "example": "refs/heads/master" }, - "toHash": { - "type": "string", - "example": "d6edcbf924697ab811a867421dab60d954ccad99" - }, - "type": { "type": "string", "enum": ["ADD", "DELETE", "UPDATE"] } - } - }, - "RestRepositoryHookVeto": { - "properties": { - "detailedMessage": { - "type": "string", - "example": "You have insufficient permissions to rebase 'refs/heads/feature-branch'." - }, - "summaryMessage": { - "type": "string", - "example": "Insufficient branch permissions" - } - } - }, - "RestTag": { - "properties": { - "displayId": { "type": "string", "example": "master" }, - "hash": { - "type": "string", - "example": "8d51122def5632836d1cb1026e879069e10a1e13" - }, - "id": { "type": "string", "example": "refs/heads/master" }, - "latestChangeset": { - "type": "string", - "example": "8d51122def5632836d1cb1026e879069e10a1e13", - "readOnly": true - }, - "latestCommit": { - "type": "string", - "example": "8d51122def5632836d1cb1026e879069e10a1e13", - "readOnly": true - }, - "type": { "type": "string", "enum": ["BRANCH", "TAG"] } - } - }, - "RestRepositoryPolicy": { - "properties": { - "permission": { - "type": "string", - "description": "The permission required to delete repositories. Must be one of: \"SYS_ADMIN\", \"ADMIN\", \"PROJECT_ADMIN\", \"REPO_ADMIN\".", - "enum": ["SYS_ADMIN", "ADMIN", "PROJECT_ADMIN", "REPO_ADMIN"], - "example": "ADMIN" - } - } - }, - "RestGpgKey": { - "properties": { - "emailAddress": { - "type": "string", - "example": "bitbucket@example.com", - "readOnly": true - }, - "expiryDate": { - "type": "integer", - "format": "int64", - "example": 61550496000000, - "readOnly": true - }, - "fingerprint": { - "type": "string", - "example": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8", - "readOnly": true - }, - "id": { - "type": "string", - "example": "00000000000004d2", - "readOnly": true - }, - "subKeys": { - "type": "array", - "example": [], - "items": { "$ref": "#/components/schemas/RestGpgSubKey" }, - "readOnly": true - }, - "text": { - "type": "string", - "example": "-----BEGIN PGP SIGNATURE-----\n\niQEzBAABCAAdFiEEM8MrWnoxlp3K1lFY5BMGiWNefn4FAlkqKE4ACgkQ5BMGiWNe\nfn6/kggAyzKhDDqdVb3Rq02hiSqeqKa1JuKRqDmzIpa6Pxa+1CpCnxwaIVrGgIii\nvj0ZNJzL1Bm2xm0JasotJDiZq5pFKi0FfQ0WmskuhsW1VY/f08TltHpHvK2kHVRr\nGEMVDUb0nj0I7Duc8XTipiYoDGS1GvydNR/bu3SsFTcZyapXirQcTCRT6/Sn0/IP\npUeIwQo1qK4e8gTOhWhfWEiVig39lQhiZFtm5S/vfAY72/Rgp68zMYmwasMSnBgF\n/LLFW6lXAqZIoAP8AnmsMRjCH6mS98+/lxKq2+K71+2YUUIAnNEeO09Lufo3B3Da\nPbs7BpD28w4lKlzb2EQ0n0C9rrxdPA==\n=VZpm\n-----END PGP SIGNATURE-----\n", - "writeOnly": true - } - } - }, - "RestGpgSubKey": { - "properties": { - "expiryDate": { "type": "string", "format": "date-time" }, - "fingerprint": { "type": "string" } - } - }, - "RestDefaultTask": { - "properties": { - "description": { - "type": "string", - "example": "Default task description", - "readOnly": true - }, - "html": { "type": "string", "writeOnly": true }, - "id": { - "type": "integer", - "format": "int64", - "example": 1, - "readOnly": true - } - } - }, - "RestDefaultTaskRequest": { - "type": "object", + "ApplicationId": { "type": "object" }, + "RestChangeset": { "properties": { - "description": { - "type": "string", - "example": "Default task description" - }, - "sourceMatcher": { + "changes": { "type": "object", "properties": { - "displayId": { "type": "string", "example": "main" }, - "id": { "type": "string", "example": "refs/heads/main" }, - "type": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "ANY_REF", - "BRANCH", - "PATTERN", - "MODEL_CATEGORY", - "MODEL_BRANCH" - ] - }, - "name": { "type": "string", "example": "Branch" } - } - } + "isLastPage": { "type": "boolean" }, + "limit": { "type": "integer", "format": "int32" }, + "nextPageStart": { "type": "integer", "format": "int32" }, + "size": { "type": "integer", "format": "int32" }, + "start": { "type": "integer", "format": "int32" }, + "values": { "type": "object" } } }, - "targetMatcher": { + "fromCommit": { "type": "object", "properties": { - "displayId": { "type": "string", "example": "main" }, - "id": { "type": "string", "example": "refs/heads/main" }, - "type": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "ANY_REF", - "BRANCH", - "PATTERN", - "MODEL_CATEGORY", - "MODEL_BRANCH" - ] - }, - "name": { "type": "string", "example": "Branch" } - } + "displayId": { "type": "string", "example": "abcdef0" }, + "id": { + "type": "string", + "example": "abcdef0123abcdef4567abcdef8987abcdef6543" } } - } - } - }, - "Credentials": { - "type": "object", - "oneOf": [ - { "$ref": "#/components/schemas/RestUsernamePasswordCredentials" }, - { "$ref": "#/components/schemas/RestBearerTokenCredentials" }, - { "$ref": "#/components/schemas/RestSshCredentials" } - ] - }, - "EnrichedRepository": { - "properties": { - "archived": { "type": "boolean", "readOnly": true }, - "defaultBranch": { - "type": "string", - "example": "main", - "writeOnly": true - }, - "description": { - "type": "string", - "example": "My repo description", - "readOnly": true }, - "forkable": { "type": "boolean", "readOnly": true }, - "hierarchyId": { - "type": "string", - "example": "e3c939f9ef4a7fae272e", - "readOnly": true - }, - "id": { "type": "integer", "format": "int32", "readOnly": true }, "links": { "type": "object", "properties": {}, "writeOnly": true }, - "name": { "type": "string", "example": "My repo" }, - "origin": { + "repository": { + "type": "object", + "properties": { + "archived": { "type": "boolean", "readOnly": true }, + "defaultBranch": { + "type": "string", + "example": "main", + "writeOnly": true + }, + "description": { + "type": "string", + "example": "My repo description", + "readOnly": true + }, + "forkable": { "type": "boolean", "readOnly": true }, + "hierarchyId": { + "type": "string", + "example": "e3c939f9ef4a7fae272e", + "readOnly": true + }, + "id": { "type": "integer", "format": "int32", "readOnly": true }, + "links": { + "type": "object", + "properties": {}, + "writeOnly": true + }, + "name": { "type": "string", "example": "My repo" }, + "origin": { + "type": "object", + "properties": { + "archived": { "type": "boolean", "readOnly": true }, + "defaultBranch": { + "type": "string", + "example": "main", + "writeOnly": true + }, + "description": { + "type": "string", + "example": "My repo description", + "readOnly": true + }, + "forkable": { "type": "boolean", "readOnly": true }, + "hierarchyId": { + "type": "string", + "example": "e3c939f9ef4a7fae272e", + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "links": { + "type": "object", + "properties": {}, + "writeOnly": true + }, + "name": { "type": "string", "example": "My repo" }, + "partition": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "project": { + "type": "object", + "properties": { + "avatar": { "type": "string" }, + "avatarUrl": { "type": "string", "writeOnly": true }, + "description": { + "type": "string", + "example": "The description for my cool project", + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "key": { "type": "string", "example": "PRJ" }, + "links": { + "type": "object", + "properties": {}, + "writeOnly": true + }, + "name": { + "type": "string", + "example": "My Cool Project", + "pattern": "^[^~].*", + "readOnly": true + }, + "public": { "type": "boolean", "readOnly": true }, + "scope": { + "type": "string", + "example": "PROJECT", + "readOnly": true + }, + "type": { + "type": "string", + "enum": ["NORMAL", "PERSONAL"], + "readOnly": true + } + }, + "required": ["key"] + }, + "public": { "type": "boolean", "readOnly": true }, + "relatedLinks": { + "type": "object", + "properties": {}, + "readOnly": true + }, + "scmId": { "type": "string", "example": "git" }, + "scope": { + "type": "string", + "example": "REPOSITORY", + "readOnly": true + }, + "slug": { "type": "string", "example": "my-repo" }, + "state": { + "type": "string", + "enum": [ + "AVAILABLE", + "INITIALISATION_FAILED", + "INITIALISING", + "OFFLINE" + ], + "readOnly": true + }, + "statusMessage": { + "type": "string", + "example": "Available", + "readOnly": true + } + }, + "readOnly": true + }, + "partition": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "project": { + "type": "object", + "properties": { + "avatar": { "type": "string" }, + "avatarUrl": { "type": "string", "writeOnly": true }, + "description": { + "type": "string", + "example": "The description for my cool project", + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "key": { "type": "string", "example": "PRJ" }, + "links": { + "type": "object", + "properties": {}, + "writeOnly": true + }, + "name": { + "type": "string", + "example": "My Cool Project", + "pattern": "^[^~].*", + "readOnly": true + }, + "public": { "type": "boolean", "readOnly": true }, + "scope": { + "type": "string", + "example": "PROJECT", + "readOnly": true + }, + "type": { + "type": "string", + "enum": ["NORMAL", "PERSONAL"], + "readOnly": true + } + }, + "required": ["key"] + }, + "public": { "type": "boolean", "readOnly": true }, + "relatedLinks": { + "type": "object", + "properties": {}, + "readOnly": true + }, + "scmId": { "type": "string", "example": "git" }, + "scope": { + "type": "string", + "example": "REPOSITORY", + "readOnly": true + }, + "slug": { "type": "string", "example": "my-repo" }, + "state": { + "type": "string", + "enum": [ + "AVAILABLE", + "INITIALISATION_FAILED", + "INITIALISING", + "OFFLINE" + ], + "readOnly": true + }, + "statusMessage": { + "type": "string", + "example": "Available", + "readOnly": true + } + } + }, + "toCommit": { + "type": "object", + "properties": { + "author": { + "type": "object", + "properties": { + "avatarUrl": { "type": "string", "writeOnly": true }, + "emailAddress": { + "type": "string", + "example": "charlie@example.com" + }, + "name": { "type": "string", "example": "Charlie" } + } + }, + "authorTimestamp": { + "type": "integer", + "format": "int64", + "example": 1359075920 + }, + "committer": { + "type": "object", + "properties": { + "avatarUrl": { "type": "string", "writeOnly": true }, + "emailAddress": { + "type": "string", + "example": "charlie@example.com" + }, + "name": { "type": "string", "example": "Charlie" } + } + }, + "committerTimestamp": { + "type": "integer", + "format": "int64", + "example": 1449075830 + }, + "displayId": { "type": "string", "example": "abcdef0" }, + "id": { + "type": "string", + "example": "abcdef0123abcdef4567abcdef8987abcdef6543" + }, + "message": { + "type": "string", + "example": "More work on feature 1" + }, + "parents": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestMinimalCommit" } + } + } + } + } + }, + "RestCommentJiraIssue": { + "properties": { + "commentId": { "type": "integer", "format": "int64", "example": 1 }, + "issueKey": { "type": "string", "example": "TEST-123" } + } + }, + "RestCommit": { + "properties": { + "author": { + "type": "object", + "properties": { + "avatarUrl": { "type": "string", "writeOnly": true }, + "emailAddress": { + "type": "string", + "example": "charlie@example.com" + }, + "name": { "type": "string", "example": "Charlie" } + } + }, + "authorTimestamp": { + "type": "integer", + "format": "int64", + "example": 1359075920 + }, + "committer": { + "type": "object", + "properties": { + "avatarUrl": { "type": "string", "writeOnly": true }, + "emailAddress": { + "type": "string", + "example": "charlie@example.com" + }, + "name": { "type": "string", "example": "Charlie" } + } + }, + "committerTimestamp": { + "type": "integer", + "format": "int64", + "example": 1449075830 + }, + "displayId": { "type": "string", "example": "abcdef0" }, + "id": { + "type": "string", + "example": "abcdef0123abcdef4567abcdef8987abcdef6543" + }, + "message": { "type": "string", "example": "More work on feature 1" }, + "parents": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestMinimalCommit" } + } + } + }, + "RestEnhancedEntityLink": { + "properties": { + "applicationLinkId": { "type": "string", "example": "a1b54cs4wsd45" }, + "displayUrl": { "type": "string", "example": "example.com/jira" }, + "projectId": { + "type": "integer", + "format": "int64", + "example": 10000 + }, + "projectKey": { "type": "string", "example": "MPROJ" }, + "projectName": { "type": "string", "example": "My Project" } + } + }, + "RestJiraIssue": { + "type": "object", + "properties": { + "key": { "type": "string", "example": "JRA-9" }, + "url": { + "type": "string", + "example": "https://jira.atlassian.com/browse/JRA-9" + } + } + }, + "RestMinimalCommit": { + "properties": { + "displayId": { "type": "string", "example": "abcdef0" }, + "id": { + "type": "string", + "example": "abcdef0123abcdef4567abcdef8987abcdef6543" + } + } + }, + "RestPageRestChange": { + "properties": { + "isLastPage": { "type": "boolean" }, + "limit": { "type": "integer", "format": "int32" }, + "nextPageStart": { "type": "integer", "format": "int32" }, + "size": { "type": "integer", "format": "int32" }, + "start": { "type": "integer", "format": "int32" }, + "values": { "type": "object" } + } + }, + "RestPerson": { + "properties": { + "avatarUrl": { "type": "string", "writeOnly": true }, + "emailAddress": { + "type": "string", + "example": "charlie@example.com" + }, + "name": { "type": "string", "example": "Charlie" } + } + }, + "RestGitTagCreateRequest": { + "type": "object", + "properties": { + "force": { "type": "boolean" }, + "message": { "type": "string", "example": "A new release tag" }, + "name": { "type": "string", "example": "release-tag" }, + "startPoint": { "type": "string", "example": "refs/heads/master" }, + "type": { "type": "string", "enum": ["ANNOTATED", "LIGHTWEIGHT"] } + } + }, + "RestPullRequestRebaseRequest": { + "type": "object", + "properties": { + "version": { "type": "integer", "format": "int32", "example": 1 } + } + }, + "RestPullRequestRebaseResult": { + "properties": { + "refChange": { + "type": "object", + "properties": { + "fromHash": { + "type": "string", + "example": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad" + }, + "ref": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "master" }, + "id": { "type": "string", "example": "refs/heads/master" }, + "type": { "type": "string", "enum": ["BRANCH", "TAG"] } + } + }, + "refId": { "type": "string", "example": "refs/heads/master" }, + "toHash": { + "type": "string", + "example": "d6edcbf924697ab811a867421dab60d954ccad99" + }, + "type": { "type": "string", "enum": ["ADD", "DELETE", "UPDATE"] } + } + } + } + }, + "RestPullRequestRebaseability": { + "properties": { + "vetoes": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestRepositoryHookVeto" } + } + } + }, + "RestRefChange": { + "properties": { + "fromHash": { + "type": "string", + "example": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad" + }, + "ref": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "master" }, + "id": { "type": "string", "example": "refs/heads/master" }, + "type": { "type": "string", "enum": ["BRANCH", "TAG"] } + } + }, + "refId": { "type": "string", "example": "refs/heads/master" }, + "toHash": { + "type": "string", + "example": "d6edcbf924697ab811a867421dab60d954ccad99" + }, + "type": { "type": "string", "enum": ["ADD", "DELETE", "UPDATE"] } + } + }, + "RestRepositoryHookVeto": { + "properties": { + "detailedMessage": { + "type": "string", + "example": "You have insufficient permissions to rebase 'refs/heads/feature-branch'." + }, + "summaryMessage": { + "type": "string", + "example": "Insufficient branch permissions" + } + } + }, + "RestTag": { + "properties": { + "displayId": { "type": "string", "example": "master" }, + "hash": { + "type": "string", + "example": "8d51122def5632836d1cb1026e879069e10a1e13" + }, + "id": { "type": "string", "example": "refs/heads/master" }, + "latestChangeset": { + "type": "string", + "example": "8d51122def5632836d1cb1026e879069e10a1e13", + "readOnly": true + }, + "latestCommit": { + "type": "string", + "example": "8d51122def5632836d1cb1026e879069e10a1e13", + "readOnly": true + }, + "type": { "type": "string", "enum": ["BRANCH", "TAG"] } + } + }, + "RestBulkAddInsightAnnotationRequest": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestSingleAddInsightAnnotationRequest" + }, + "maxItems": 2147483647, + "minItems": 1 + } + } + }, + "RestInsightAnnotation": { + "properties": { + "externalId": { "type": "string", "example": "external.id" }, + "line": { "type": "integer", "format": "int32", "example": 5 }, + "link": { + "type": "string", + "example": "http://example.com/my/file/analysis?line=5" + }, + "message": { + "type": "string", + "example": "This is an annotation message" + }, + "path": { + "type": "string", + "example": "src/some/structure/file.ext" + }, + "reportKey": { "type": "string", "example": "report.key" }, + "severity": { "type": "string", "example": "HIGH" }, + "type": { "type": "string", "example": "BUG" } + } + }, + "RestInsightAnnotationsResponse": { + "properties": { + "annotations": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestInsightAnnotation" } + } + } + }, + "RestInsightReport": { + "properties": { + "createdDate": { "type": "number", "example": 1630041546433 }, + "data": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestInsightReportData" } + }, + "details": { + "type": "string", + "example": "This is the details of the report, it can be a longer string describing the report" + }, + "key": { "type": "string", "example": "report.key" }, + "link": { + "type": "string", + "format": "uri", + "example": "http://integration.example.com" + }, + "logoUrl": { + "type": "string", + "format": "uri", + "example": "http://integration.example.com/logo" + }, + "reporter": { + "type": "string", + "example": "Reporter/tool that produced this report" + }, + "result": { + "type": "string", + "enum": ["FAIL", "PASS"], + "example": "PASS" + }, + "title": { "type": "string", "example": "report.title" } + } + }, + "RestInsightReportData": { + "properties": { + "title": { "type": "string", "example": "data.title" }, + "type": { + "type": "string", + "example": "NUMBER", + "pattern": "BOOLEAN|DATE|DURATION|LINK|NUMBER|PERCENTAGE|TEXT" + }, + "value": { "type": "object", "example": 9 } + } + }, + "RestSetInsightReportRequest": { + "type": "object", + "properties": { + "coverageProviderKey": { "type": "string" }, + "createdDate": { + "type": "integer", + "format": "int64", + "example": 1630041546433 + }, + "data": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestInsightReportData" }, + "maxItems": 6, + "minItems": 0 + }, + "details": { + "type": "string", + "example": "This is the details of the report, it can be a longer string describing the report." + }, + "link": { "type": "string", "example": "http://insight.example.com" }, + "logoUrl": { + "type": "string", + "example": "http://insight.example.com/logo" + }, + "reporter": { + "type": "string", + "example": "Reporter/tool that produced this report", + "maxLength": 450, + "minLength": 0 + }, + "result": { + "type": "string", + "example": "PASS", + "pattern": "FAIL|PASS" + }, + "title": { + "type": "string", + "example": "report.title", + "maxLength": 450, + "minLength": 0 + } + }, + "required": ["data", "title"] + }, + "RestSingleAddInsightAnnotationRequest": { + "type": "object", + "properties": { + "externalId": { + "type": "string", + "example": "message-1", + "maxLength": 450, + "minLength": 0 + }, + "line": { + "type": "integer", + "format": "int32", + "example": 4, + "minimum": 0 + }, + "link": { + "type": "string", + "example": "https://link.to.tool/that/produced/annotation/message-1" + }, + "message": { + "type": "string", + "example": "This is a bug here because reasons", + "maxLength": 2000, + "minLength": 0 + }, + "path": { + "type": "string", + "example": "path/to/file/in/repo", + "maxLength": 50000, + "minLength": 0 + }, + "severity": { + "type": "string", + "example": "MEDIUM", + "pattern": "LOW|MEDIUM|HIGH" + }, + "type": { + "type": "string", + "example": "CODE_SMELL", + "pattern": "VULNERABILITY|CODE_SMELL|BUG" + } + }, + "required": ["message", "severity"] + }, + "RestClusterNode": { + "properties": { + "address": { + "type": "object", + "properties": { + "address": { "type": "string", "example": "node.example.com" }, + "port": { "type": "integer", "format": "int32", "example": 8230 } + } + }, + "buildVersion": { "type": "string", "example": "7.0.0" }, + "id": { + "type": "string", + "example": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d" + }, + "local": { "type": "boolean" }, + "name": { "type": "string", "example": "foo" } + } + }, + "RestFarmSynchronizationRequest": { + "type": "object", + "properties": { + "attempt": { "type": "integer", "format": "int32", "example": 1 }, + "createdAt": { + "type": "string", + "example": "2022-08-18T02:04:46.435Z" + }, + "externalRepoId": { "type": "string", "example": "1" }, + "type": { + "type": "string", + "enum": ["incremental", "snapshot"], + "example": "INCREMENTAL" + } + } + }, + "RestMirrorHashes": { + "properties": { + "content": { + "type": "string", + "example": "677513e1f2a93ff50e7b709e3c96454c23a3fcd40046ab385c4093e30809500a" + }, + "metadata": { + "type": "string", + "example": "677513e1f2a93ff50e7b709e3c96454c23a3fcd40046ab385c4093e30809500a" + } + } + }, + "RestMirrorRepositorySynchronizationStatus": { + "properties": { + "externalRepoId": { "type": "string", "example": "1" }, + "failedSyncCount": { + "type": "integer", + "format": "int32", + "example": 1 + }, + "hashes": { + "type": "object", + "properties": { + "content": { + "type": "string", + "example": "677513e1f2a93ff50e7b709e3c96454c23a3fcd40046ab385c4093e30809500a" + }, + "metadata": { + "type": "string", + "example": "677513e1f2a93ff50e7b709e3c96454c23a3fcd40046ab385c4093e30809500a" + } + } + }, + "initialSyncDate": { "type": "string", "format": "date-time" }, + "lastSyncDate": { "type": "string", "format": "date-time" }, + "localProjectId": { + "type": "integer", + "format": "int32", + "example": 1 + }, + "localRepoId": { "type": "integer", "format": "int32", "example": 1 }, + "upstreamId": { + "type": "string", + "example": "148728f5-df0f-3f3e-af11-5ca16be3725f" + } + } + }, + "RestMirroredRepository": { + "properties": { + "available": { "type": "boolean" }, + "cloneUrls": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestNamedLink" } + }, + "lastUpdated": { "type": "string", "format": "date-time" }, + "mirrorName": { "type": "string", "example": "Saigon Mirror" }, + "pushUrls": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestNamedLink" } + }, + "repositoryId": { "type": "string", "example": "1" }, + "status": { + "type": "string", + "enum": [ + "NOT_MIRRORED", + "INITIALIZING", + "AVAILABLE", + "ERROR_INITIALIZING", + "ERROR_AVAILABLE" + ] + } + } + }, + "RestNamedLink": { + "properties": { + "href": { + "type": "string", + "example": "https://bitbucket.example.com/scm/awesomeproject/awesomerepo.git" + }, + "name": { "type": "string", "example": "http" } + } + }, + "RestRefSyncQueue": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestFarmSynchronizationRequest" + } + } + } + }, + "RestRepositoryLockOwner": { + "properties": { + "externalRepositoryId": { + "type": "string", + "description": "The repository ID for which the lock is held", + "example": "101" + }, + "lockAcquireTime": { + "type": "string", + "format": "date-time", + "description": "The time at which lock was last acquired" + }, + "nodeId": { + "type": "string", + "description": "The ID of the mirror node on which the lock is being held", + "example": "4da47d83-ec95-489d-ad46-012cc086c0da" + }, + "requestId": { + "type": "string", + "description": "The unique ID of the request for which the lock is being held", + "example": "*T75X1Tx955x782x0" + }, + "threadName": { + "type": "string", + "description": "Name of the thread that is holding the lock", + "example": "farm-refchange-poller:thread-2" + } + } + }, + "RestRollingUpgradeState": { + "properties": { + "rollingUpgradeEnabled": { "type": "boolean", "example": true }, + "version": { "type": "string", "example": "9.0.0" } + } + }, + "RestSyncProgress": { + "properties": { + "discovering": { "type": "boolean" }, + "syncedRepos": { "type": "integer", "format": "int32" }, + "totalRepos": { "type": "integer", "format": "int32" } + } + }, + "RestUpstreamServer": { + "properties": { + "baseUrl": { + "type": "string", + "example": "https://bitbucket.example.com" + }, + "id": { + "type": "string", + "example": "f76a35c5-4592-425d-bf85-b4d9db68e809" + }, + "state": { + "type": "string", + "enum": [ + "INITIALIZING", + "PENDING", + "INSTALLED", + "UNKNOWN", + "REMOVED" + ], + "example": "INSTALLED" + } + } + }, + "RestUpstreamSettings": { + "properties": { + "mode": { + "type": "string", + "enum": ["ALL_PROJECTS", "SELECTED_PROJECTS"] + }, + "projectIds": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true + } + } + }, + "Credentials": { + "type": "object", + "oneOf": [ + { "$ref": "#/components/schemas/RestUsernamePasswordCredentials" }, + { "$ref": "#/components/schemas/RestBearerTokenCredentials" }, + { "$ref": "#/components/schemas/RestSshCredentials" } + ] + }, + "EnrichedRepository": { + "properties": { + "archived": { "type": "boolean", "readOnly": true }, + "defaultBranch": { + "type": "string", + "example": "main", + "writeOnly": true + }, + "description": { + "type": "string", + "example": "My repo description", + "readOnly": true + }, + "forkable": { "type": "boolean", "readOnly": true }, + "hierarchyId": { + "type": "string", + "example": "e3c939f9ef4a7fae272e", + "readOnly": true + }, + "id": { "type": "integer", "format": "int32", "readOnly": true }, + "links": { "type": "object", "properties": {}, "writeOnly": true }, + "name": { "type": "string", "example": "My repo" }, + "origin": { "type": "object", "properties": { "archived": { "type": "boolean", "readOnly": true }, @@ -6359,179 +6855,290 @@ }, "required": ["password", "username"] }, - "RestClusterNode": { + "RestRepositoryPolicy": { "properties": { - "address": { - "type": "object", - "properties": { - "address": { "type": "string", "example": "node.example.com" }, - "port": { "type": "integer", "format": "int32", "example": 8230 } - } - }, - "buildVersion": { "type": "string", "example": "7.0.0" }, - "id": { + "permission": { "type": "string", - "example": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d" - }, - "local": { "type": "boolean" }, - "name": { "type": "string", "example": "foo" } + "description": "The permission required to delete repositories. Must be one of: \"SYS_ADMIN\", \"ADMIN\", \"PROJECT_ADMIN\", \"REPO_ADMIN\".", + "enum": ["SYS_ADMIN", "ADMIN", "PROJECT_ADMIN", "REPO_ADMIN"], + "example": "ADMIN" + } } }, - "RestFarmSynchronizationRequest": { + "Context": { "type": "object", "properties": { - "attempt": { "type": "integer", "format": "int32", "example": 1 }, - "createdAt": { - "type": "string", - "example": "2022-08-18T02:04:46.435Z" - }, - "externalRepoId": { "type": "string", "example": "1" }, - "type": { + "commitMessage": { "type": "string", - "enum": ["incremental", "snapshot"], - "example": "INCREMENTAL" + "example": "Merging in latest from upstream." } } }, - "RestMirrorHashes": { + "RestRefSyncRequest": { + "type": "object", "properties": { - "content": { + "action": { "type": "string", - "example": "677513e1f2a93ff50e7b709e3c96454c23a3fcd40046ab385c4093e30809500a" + "enum": ["DISCARD", "MERGE", "REBASE"], + "example": "MERGE" }, - "metadata": { - "type": "string", - "example": "677513e1f2a93ff50e7b709e3c96454c23a3fcd40046ab385c4093e30809500a" - } + "context": { "$ref": "#/components/schemas/Context" }, + "refId": { "type": "string", "example": "refs/heads/master" } } }, - "RestMirrorRepositorySynchronizationStatus": { + "RestRefSyncStatus": { "properties": { - "externalRepoId": { "type": "string", "example": "1" }, - "failedSyncCount": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "hashes": { + "aheadRefs": { "type": "object", "properties": { - "content": { + "displayId": { "type": "string", "example": "master" }, + "id": { "type": "string", "example": "refs/heads/master" }, + "state": { "type": "string", - "example": "677513e1f2a93ff50e7b709e3c96454c23a3fcd40046ab385c4093e30809500a" + "enum": ["AHEAD", "DIVERGED", "ORPHANED"] }, - "metadata": { + "tag": { "type": "boolean" }, + "type": { "type": "string", "enum": ["BRANCH", "TAG"] } + }, + "readOnly": true + }, + "available": { "type": "boolean", "readOnly": true }, + "divergedRefs": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "master" }, + "id": { "type": "string", "example": "refs/heads/master" }, + "state": { "type": "string", - "example": "677513e1f2a93ff50e7b709e3c96454c23a3fcd40046ab385c4093e30809500a" - } - } + "enum": ["AHEAD", "DIVERGED", "ORPHANED"] + }, + "tag": { "type": "boolean" }, + "type": { "type": "string", "enum": ["BRANCH", "TAG"] } + }, + "readOnly": true }, - "initialSyncDate": { "type": "string", "format": "date-time" }, - "lastSyncDate": { "type": "string", "format": "date-time" }, - "localProjectId": { - "type": "integer", - "format": "int32", - "example": 1 + "enabled": { "type": "boolean" }, + "lastSync": { + "type": "number", + "example": 1331038800000, + "readOnly": true }, - "localRepoId": { "type": "integer", "format": "int32", "example": 1 }, - "upstreamId": { - "type": "string", - "example": "148728f5-df0f-3f3e-af11-5ca16be3725f" + "orphanedRefs": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "master" }, + "id": { "type": "string", "example": "refs/heads/master" }, + "state": { + "type": "string", + "enum": ["AHEAD", "DIVERGED", "ORPHANED"] + }, + "tag": { "type": "boolean" }, + "type": { "type": "string", "enum": ["BRANCH", "TAG"] } + }, + "readOnly": true } } }, - "RestMirroredRepository": { + "RestRejectedRef": { "properties": { - "available": { "type": "boolean" }, - "cloneUrls": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestNamedLink" } + "displayId": { "type": "string", "example": "master" }, + "id": { "type": "string", "example": "refs/heads/master" }, + "state": { + "type": "string", + "enum": ["AHEAD", "DIVERGED", "ORPHANED"] }, - "lastUpdated": { "type": "string", "format": "date-time" }, - "mirrorName": { "type": "string", "example": "Saigon Mirror" }, - "pushUrls": { + "tag": { "type": "boolean" }, + "type": { "type": "string", "enum": ["BRANCH", "TAG"] } + } + }, + "RestGpgKey": { + "properties": { + "emailAddress": { + "type": "string", + "example": "bitbucket@example.com", + "readOnly": true + }, + "expiryDate": { + "type": "integer", + "format": "int64", + "example": 61550496000000, + "readOnly": true + }, + "fingerprint": { + "type": "string", + "example": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8", + "readOnly": true + }, + "id": { + "type": "string", + "example": "00000000000004d2", + "readOnly": true + }, + "subKeys": { "type": "array", - "items": { "$ref": "#/components/schemas/RestNamedLink" } + "example": [], + "items": { "$ref": "#/components/schemas/RestGpgSubKey" }, + "readOnly": true }, - "repositoryId": { "type": "string", "example": "1" }, - "status": { + "text": { "type": "string", - "enum": [ - "NOT_MIRRORED", - "INITIALIZING", - "AVAILABLE", - "ERROR_INITIALIZING", - "ERROR_AVAILABLE" - ] + "example": "-----BEGIN PGP SIGNATURE-----\n\niQEzBAABCAAdFiEEM8MrWnoxlp3K1lFY5BMGiWNefn4FAlkqKE4ACgkQ5BMGiWNe\nfn6/kggAyzKhDDqdVb3Rq02hiSqeqKa1JuKRqDmzIpa6Pxa+1CpCnxwaIVrGgIii\nvj0ZNJzL1Bm2xm0JasotJDiZq5pFKi0FfQ0WmskuhsW1VY/f08TltHpHvK2kHVRr\nGEMVDUb0nj0I7Duc8XTipiYoDGS1GvydNR/bu3SsFTcZyapXirQcTCRT6/Sn0/IP\npUeIwQo1qK4e8gTOhWhfWEiVig39lQhiZFtm5S/vfAY72/Rgp68zMYmwasMSnBgF\n/LLFW6lXAqZIoAP8AnmsMRjCH6mS98+/lxKq2+K71+2YUUIAnNEeO09Lufo3B3Da\nPbs7BpD28w4lKlzb2EQ0n0C9rrxdPA==\n=VZpm\n-----END PGP SIGNATURE-----\n", + "writeOnly": true } } }, - "RestNamedLink": { + "RestGpgSubKey": { "properties": { - "href": { - "type": "string", - "example": "https://bitbucket.example.com/scm/awesomeproject/awesomerepo.git" - }, - "name": { "type": "string", "example": "http" } + "expiryDate": { "type": "string", "format": "date-time" }, + "fingerprint": { "type": "string" } } }, - "RestRefSyncQueue": { + "RestDefaultReviewersRequest": { "type": "object", "properties": { - "values": { + "requiredApprovals": { + "type": "integer", + "format": "int32", + "example": 1 + }, + "reviewers": { "type": "array", - "items": { - "$ref": "#/components/schemas/RestFarmSynchronizationRequest" + "items": { "$ref": "#/components/schemas/RestApplicationUser" } + }, + "sourceMatcher": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "main" }, + "id": { "type": "string", "example": "refs/heads/main" }, + "type": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "ANY_REF", + "BRANCH", + "PATTERN", + "MODEL_CATEGORY", + "MODEL_BRANCH" + ] + }, + "name": { "type": "string", "example": "Branch" } + } + } + } + }, + "targetMatcher": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "main" }, + "id": { "type": "string", "example": "refs/heads/main" }, + "type": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "ANY_REF", + "BRANCH", + "PATTERN", + "MODEL_CATEGORY", + "MODEL_BRANCH" + ] + }, + "name": { "type": "string", "example": "Branch" } + } + } } } } }, - "RestRollingUpgradeState": { - "properties": { - "rollingUpgradeEnabled": { "type": "boolean", "example": true }, - "version": { "type": "string", "example": "9.0.0" } - } - }, - "RestSyncProgress": { - "properties": { - "discovering": { "type": "boolean" }, - "syncedRepos": { "type": "integer", "format": "int32" }, - "totalRepos": { "type": "integer", "format": "int32" } - } - }, - "RestUpstreamServer": { + "RestPullRequestCondition": { "properties": { - "baseUrl": { - "type": "string", - "example": "https://bitbucket.example.com" - }, "id": { - "type": "string", - "example": "f76a35c5-4592-425d-bf85-b4d9db68e809" + "type": "integer", + "format": "int32", + "example": 1, + "readOnly": true }, - "state": { - "type": "string", - "enum": [ - "INITIALIZING", - "PENDING", - "INSTALLED", - "UNKNOWN", - "REMOVED" - ], - "example": "INSTALLED" + "requiredApprovals": { + "type": "integer", + "format": "int32", + "example": 1 + }, + "reviewers": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestApplicationUser" } + }, + "scope": { + "type": "object", + "properties": { + "resourceId": { + "type": "integer", + "format": "int32", + "example": 2 + }, + "type": { + "type": "string", + "enum": ["GLOBAL", "PROJECT", "REPOSITORY"] + } + }, + "readOnly": true + }, + "sourceRefMatcher": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "main" }, + "id": { "type": "string", "example": "refs/heads/main" }, + "type": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "ANY_REF", + "BRANCH", + "PATTERN", + "MODEL_CATEGORY", + "MODEL_BRANCH" + ] + }, + "name": { "type": "string", "example": "Branch" } + } + } + } + }, + "targetRefMatcher": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "main" }, + "id": { "type": "string", "example": "refs/heads/main" }, + "type": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "ANY_REF", + "BRANCH", + "PATTERN", + "MODEL_CATEGORY", + "MODEL_BRANCH" + ] + }, + "name": { "type": "string", "example": "Branch" } + } + } + } } } }, - "RestUpstreamSettings": { + "RestScope": { "properties": { - "mode": { + "resourceId": { "type": "integer", "format": "int32", "example": 2 }, + "type": { "type": "string", - "enum": ["ALL_PROJECTS", "SELECTED_PROJECTS"] - }, - "projectIds": { - "type": "array", - "items": { "type": "string" }, - "uniqueItems": true + "enum": ["GLOBAL", "PROJECT", "REPOSITORY"] } } }, @@ -7028,484 +7635,6 @@ } } }, - "Context": { - "type": "object", - "properties": { - "commitMessage": { - "type": "string", - "example": "Merging in latest from upstream." - } - } - }, - "RestRefSyncRequest": { - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": ["DISCARD", "MERGE", "REBASE"], - "example": "MERGE" - }, - "context": { "$ref": "#/components/schemas/Context" }, - "refId": { "type": "string", "example": "refs/heads/master" } - } - }, - "RestRefSyncStatus": { - "properties": { - "aheadRefs": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "master" }, - "id": { "type": "string", "example": "refs/heads/master" }, - "state": { - "type": "string", - "enum": ["AHEAD", "DIVERGED", "ORPHANED"] - }, - "tag": { "type": "boolean" }, - "type": { "type": "string", "enum": ["BRANCH", "TAG"] } - }, - "readOnly": true - }, - "available": { "type": "boolean", "readOnly": true }, - "divergedRefs": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "master" }, - "id": { "type": "string", "example": "refs/heads/master" }, - "state": { - "type": "string", - "enum": ["AHEAD", "DIVERGED", "ORPHANED"] - }, - "tag": { "type": "boolean" }, - "type": { "type": "string", "enum": ["BRANCH", "TAG"] } - }, - "readOnly": true - }, - "enabled": { "type": "boolean" }, - "lastSync": { - "type": "number", - "example": 1331038800000, - "readOnly": true - }, - "orphanedRefs": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "master" }, - "id": { "type": "string", "example": "refs/heads/master" }, - "state": { - "type": "string", - "enum": ["AHEAD", "DIVERGED", "ORPHANED"] - }, - "tag": { "type": "boolean" }, - "type": { "type": "string", "enum": ["BRANCH", "TAG"] } - }, - "readOnly": true - } - } - }, - "RestRejectedRef": { - "properties": { - "displayId": { "type": "string", "example": "master" }, - "id": { "type": "string", "example": "refs/heads/master" }, - "state": { - "type": "string", - "enum": ["AHEAD", "DIVERGED", "ORPHANED"] - }, - "tag": { "type": "boolean" }, - "type": { "type": "string", "enum": ["BRANCH", "TAG"] } - } - }, - "ApplicationId": { "type": "object" }, - "RestChangeset": { - "properties": { - "changes": { - "type": "object", - "properties": { - "isLastPage": { "type": "boolean" }, - "limit": { "type": "integer", "format": "int32" }, - "nextPageStart": { "type": "integer", "format": "int32" }, - "size": { "type": "integer", "format": "int32" }, - "start": { "type": "integer", "format": "int32" }, - "values": { "type": "object" } - } - }, - "fromCommit": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "abcdef0" }, - "id": { - "type": "string", - "example": "abcdef0123abcdef4567abcdef8987abcdef6543" - } - } - }, - "links": { "type": "object", "properties": {}, "writeOnly": true }, - "repository": { - "type": "object", - "properties": { - "archived": { "type": "boolean", "readOnly": true }, - "defaultBranch": { - "type": "string", - "example": "main", - "writeOnly": true - }, - "description": { - "type": "string", - "example": "My repo description", - "readOnly": true - }, - "forkable": { "type": "boolean", "readOnly": true }, - "hierarchyId": { - "type": "string", - "example": "e3c939f9ef4a7fae272e", - "readOnly": true - }, - "id": { "type": "integer", "format": "int32", "readOnly": true }, - "links": { - "type": "object", - "properties": {}, - "writeOnly": true - }, - "name": { "type": "string", "example": "My repo" }, - "origin": { - "type": "object", - "properties": { - "archived": { "type": "boolean", "readOnly": true }, - "defaultBranch": { - "type": "string", - "example": "main", - "writeOnly": true - }, - "description": { - "type": "string", - "example": "My repo description", - "readOnly": true - }, - "forkable": { "type": "boolean", "readOnly": true }, - "hierarchyId": { - "type": "string", - "example": "e3c939f9ef4a7fae272e", - "readOnly": true - }, - "id": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "links": { - "type": "object", - "properties": {}, - "writeOnly": true - }, - "name": { "type": "string", "example": "My repo" }, - "partition": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "project": { - "type": "object", - "properties": { - "avatar": { "type": "string" }, - "avatarUrl": { "type": "string", "writeOnly": true }, - "description": { - "type": "string", - "example": "The description for my cool project", - "readOnly": true - }, - "id": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "key": { "type": "string", "example": "PRJ" }, - "links": { - "type": "object", - "properties": {}, - "writeOnly": true - }, - "name": { - "type": "string", - "example": "My Cool Project", - "pattern": "^[^~].*", - "readOnly": true - }, - "public": { "type": "boolean", "readOnly": true }, - "scope": { - "type": "string", - "example": "PROJECT", - "readOnly": true - }, - "type": { - "type": "string", - "enum": ["NORMAL", "PERSONAL"], - "readOnly": true - } - }, - "required": ["key"] - }, - "public": { "type": "boolean", "readOnly": true }, - "relatedLinks": { - "type": "object", - "properties": {}, - "readOnly": true - }, - "scmId": { "type": "string", "example": "git" }, - "scope": { - "type": "string", - "example": "REPOSITORY", - "readOnly": true - }, - "slug": { "type": "string", "example": "my-repo" }, - "state": { - "type": "string", - "enum": [ - "AVAILABLE", - "INITIALISATION_FAILED", - "INITIALISING", - "OFFLINE" - ], - "readOnly": true - }, - "statusMessage": { - "type": "string", - "example": "Available", - "readOnly": true - } - }, - "readOnly": true - }, - "partition": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "project": { - "type": "object", - "properties": { - "avatar": { "type": "string" }, - "avatarUrl": { "type": "string", "writeOnly": true }, - "description": { - "type": "string", - "example": "The description for my cool project", - "readOnly": true - }, - "id": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "key": { "type": "string", "example": "PRJ" }, - "links": { - "type": "object", - "properties": {}, - "writeOnly": true - }, - "name": { - "type": "string", - "example": "My Cool Project", - "pattern": "^[^~].*", - "readOnly": true - }, - "public": { "type": "boolean", "readOnly": true }, - "scope": { - "type": "string", - "example": "PROJECT", - "readOnly": true - }, - "type": { - "type": "string", - "enum": ["NORMAL", "PERSONAL"], - "readOnly": true - } - }, - "required": ["key"] - }, - "public": { "type": "boolean", "readOnly": true }, - "relatedLinks": { - "type": "object", - "properties": {}, - "readOnly": true - }, - "scmId": { "type": "string", "example": "git" }, - "scope": { - "type": "string", - "example": "REPOSITORY", - "readOnly": true - }, - "slug": { "type": "string", "example": "my-repo" }, - "state": { - "type": "string", - "enum": [ - "AVAILABLE", - "INITIALISATION_FAILED", - "INITIALISING", - "OFFLINE" - ], - "readOnly": true - }, - "statusMessage": { - "type": "string", - "example": "Available", - "readOnly": true - } - } - }, - "toCommit": { - "type": "object", - "properties": { - "author": { - "type": "object", - "properties": { - "avatarUrl": { "type": "string", "writeOnly": true }, - "emailAddress": { - "type": "string", - "example": "charlie@example.com" - }, - "name": { "type": "string", "example": "Charlie" } - } - }, - "authorTimestamp": { - "type": "integer", - "format": "int64", - "example": 1359075920 - }, - "committer": { - "type": "object", - "properties": { - "avatarUrl": { "type": "string", "writeOnly": true }, - "emailAddress": { - "type": "string", - "example": "charlie@example.com" - }, - "name": { "type": "string", "example": "Charlie" } - } - }, - "committerTimestamp": { - "type": "integer", - "format": "int64", - "example": 1449075830 - }, - "displayId": { "type": "string", "example": "abcdef0" }, - "id": { - "type": "string", - "example": "abcdef0123abcdef4567abcdef8987abcdef6543" - }, - "message": { - "type": "string", - "example": "More work on feature 1" - }, - "parents": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestMinimalCommit" } - } - } - } - } - }, - "RestCommentJiraIssue": { - "properties": { - "commentId": { "type": "integer", "format": "int64", "example": 1 }, - "issueKey": { "type": "string", "example": "TEST-123" } - } - }, - "RestCommit": { - "properties": { - "author": { - "type": "object", - "properties": { - "avatarUrl": { "type": "string", "writeOnly": true }, - "emailAddress": { - "type": "string", - "example": "charlie@example.com" - }, - "name": { "type": "string", "example": "Charlie" } - } - }, - "authorTimestamp": { - "type": "integer", - "format": "int64", - "example": 1359075920 - }, - "committer": { - "type": "object", - "properties": { - "avatarUrl": { "type": "string", "writeOnly": true }, - "emailAddress": { - "type": "string", - "example": "charlie@example.com" - }, - "name": { "type": "string", "example": "Charlie" } - } - }, - "committerTimestamp": { - "type": "integer", - "format": "int64", - "example": 1449075830 - }, - "displayId": { "type": "string", "example": "abcdef0" }, - "id": { - "type": "string", - "example": "abcdef0123abcdef4567abcdef8987abcdef6543" - }, - "message": { "type": "string", "example": "More work on feature 1" }, - "parents": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestMinimalCommit" } - } - } - }, - "RestEnhancedEntityLink": { - "properties": { - "applicationLinkId": { "type": "string", "example": "a1b54cs4wsd45" }, - "displayUrl": { "type": "string", "example": "example.com/jira" }, - "projectId": { - "type": "integer", - "format": "int64", - "example": 10000 - }, - "projectKey": { "type": "string", "example": "MPROJ" }, - "projectName": { "type": "string", "example": "My Project" } - } - }, - "RestJiraIssue": { - "type": "object", - "properties": { - "key": { "type": "string", "example": "JRA-9" }, - "url": { - "type": "string", - "example": "https://jira.atlassian.com/browse/JRA-9" - } - } - }, - "RestMinimalCommit": { - "properties": { - "displayId": { "type": "string", "example": "abcdef0" }, - "id": { - "type": "string", - "example": "abcdef0123abcdef4567abcdef8987abcdef6543" - } - } - }, - "RestPageRestChange": { - "properties": { - "isLastPage": { "type": "boolean" }, - "limit": { "type": "integer", "format": "int32" }, - "nextPageStart": { "type": "integer", "format": "int32" }, - "size": { "type": "integer", "format": "int32" }, - "start": { "type": "integer", "format": "int32" }, - "values": { "type": "object" } - } - }, - "RestPerson": { - "properties": { - "avatarUrl": { "type": "string", "writeOnly": true }, - "emailAddress": { - "type": "string", - "example": "charlie@example.com" - }, - "name": { "type": "string", "example": "Charlie" } - } - }, "RestSshAccessKeyLocations": { "type": "object", "properties": { @@ -13775,6 +13904,38 @@ "tags": ["Builds and Deployments"] } }, + "/audit/latest/notification-settings/retention-config-review": { + "delete": { + "description": "Dismisses the retention config review notification displayed by the audit plugin for the user that's currently logged in.", + "operationId": "dismissRetentionConfigReviewNotification", + "responses": { + "200": { + "content": { "application/json": {} }, + "description": "A blank response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to dismiss the notification." + } + }, + "summary": "Dismiss retention config notification", + "tags": ["System Maintenance"] + } + }, "/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches": { "delete": { "description": " Deletes a branch in the specified repository.\n\n\n If the branch does not exist, this operation will not raise an error. In other words after calling this resource\n and receiving a 204 response the branch provided in the request is guaranteed to not exist in the specified\n repository any more, regardless of its existence beforehand.\n\n\n The optional 'endPoint' parameter of the request may contain a commit ID that the provided ref name is\n expected to point to. Should the ref point to a different commit ID, a 400 response will be returned with\n appropriate error details.\n\n\n The authenticated user must have an effective REPO_WRITE permission to call this resource. If\n branch permissions are set up in the repository, the authenticated user must also have access to the branch name\n that is to be deleted.", @@ -13809,7 +13970,364 @@ "204": { "description": "An empty response indicating that the branch no longer exists in the repository" }, - "400": { + "400": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The branch was not deleted because the request was invalid, e.g. no ref name\nto delete was provided, or the provided ref name points to the default branch\nin the repository that cannot be deleted" + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to delete a\nbranch. This could be due to insufficient repository permissions, or lack of\nbranch permission for the provided ref name." + } + }, + "summary": "Delete branch", + "tags": ["Repository"] + }, + "post": { + "description": " Creates a branch in the specified repository.\n\n\nThe authenticated user must have an effective REPO_WRITE permission to call this resource. If\nbranch permissions are set up in the repository, the authenticated user must also have access to the branch name\nthat is to be created.", + "operationId": "createBranch", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestBranchCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestBranch" } + } + }, + "description": "JSON representation of the newly created branch" + }, + "400": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The branch was not created because the request was invalid, e.g. the provided\nref name already existed in the repository, or was not a valid ref name in the\nrepository" + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to create a branch. This could be due to insufficient repository permissions, or lack of branch permission for the provided ref name" + }, + "409": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The branch name overlapped with an existing branch" + } + }, + "summary": "Create branch", + "tags": ["Repository"] + } + }, + "/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches/info/{commitId}": { + "get": { + "description": "Gets the branch information associated with a single commit from a given repository.", + "operationId": "findByCommit", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "content": { + "application/json": { + "schema": { "type": "string", "maxLength": 40 } + } + }, + "in": "path", + "name": "commitId", + "required": true + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "Start number for the page (inclusive). If not passed, first page is assumed.", + "example": 0, + "in": "query", + "name": "start", + "required": false, + "schema": { "type": "number", "example": 0 } + }, + { + "description": "Number of items to return. If not passed, a page size of 25 is used.", + "example": 25, + "in": "query", + "name": "limit", + "required": false, + "schema": { "type": "number", "example": 25 } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "isLastPage": { "type": "boolean" }, + "limit": { "type": "number", "example": 25 }, + "nextPageStart": { "type": "integer", "format": "int32" }, + "size": { "type": "number", "example": 1 }, + "start": { "type": "integer", "format": "int32" }, + "values": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestMinimalRef" } + } + } + } + } + }, + "description": "A page of branch refs associated with the commit" + }, + "500": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The request has timed out processing the branch request" + } + }, + "summary": "Get branch", + "tags": ["Repository"] + } + }, + "/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks": { + "delete": { + "description": "Delete all the default tasks for the supplied repository\n\nThe authenticated user must have **REPO_ADMIN** permission for this repository to call the resource.", + "operationId": "deleteAllDefaultTasks_1", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "204": { + "description": "The default tasks have been deleted successfully." + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to delete default tasks" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The specified repository does not exist" + } + }, + "summary": "Deletes all default tasks for the repository", + "tags": ["Repository"] + }, + "get": { + "description": "Retrieves the default tasks for the supplied repository.\n\nThe authenticated user must have **REPO_VIEW** permission for this repository to call the resource.", + "operationId": "getDefaultTasks_1", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "If present or `\"true\"`, includes a markup-rendered description", + "in": "query", + "name": "markup", + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "Start number for the page (inclusive). If not passed, first page is assumed.", + "example": 0, + "in": "query", + "name": "start", + "required": false, + "schema": { "type": "number", "example": 0 } + }, + { + "description": "Number of items to return. If not passed, a page size of 25 is used.", + "example": 25, + "in": "query", + "name": "limit", + "required": false, + "schema": { "type": "number", "example": 25 } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "isLastPage": { "type": "boolean" }, + "limit": { "type": "number", "example": 25 }, + "nextPageStart": { "type": "integer", "format": "int32" }, + "size": { "type": "number", "example": 1 }, + "start": { "type": "integer", "format": "int32" }, + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestDefaultTask" + } + } + } + } + } + }, + "description": "A page of default tasks" + }, + "401": { "content": { "application/json": { "schema": { @@ -13825,9 +14343,9 @@ } } }, - "description": "The branch was not deleted because the request was invalid, e.g. no ref name\nto delete was provided, or the provided ref name points to the default branch\nin the repository that cannot be deleted" + "description": "The currently authenticated user has insufficient permissions to delete default tasks" }, - "401": { + "404": { "content": { "application/json": { "schema": { @@ -13843,15 +14361,15 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete a\nbranch. This could be due to insufficient repository permissions, or lack of\nbranch permission for the provided ref name." + "description": "The specified repository does not exist" } }, - "summary": "Delete branch", + "summary": "Get a page of default tasks", "tags": ["Repository"] }, "post": { - "description": " Creates a branch in the specified repository.\n\n\nThe authenticated user must have an effective REPO_WRITE permission to call this resource. If\nbranch permissions are set up in the repository, the authenticated user must also have access to the branch name\nthat is to be created.", - "operationId": "createBranch", + "description": "Creates a default task for the supplied repository.\n\nThe authenticated user must have **REPO_ADMIN** permission for this repository to call the resource.", + "operationId": "addDefaultTask_1", "parameters": [ { "description": "The project key.", @@ -13872,20 +14390,21 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestBranchCreateRequest" + "$ref": "#/components/schemas/RestDefaultTaskRequest" } } }, + "description": "The task to be added", "required": true }, "responses": { - "201": { + "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestBranch" } + "schema": { "$ref": "#/components/schemas/RestDefaultTask" } } }, - "description": "JSON representation of the newly created branch" + "description": "The default task" }, "400": { "content": { @@ -13903,7 +14422,7 @@ } } }, - "description": "The branch was not created because the request was invalid, e.g. the provided\nref name already existed in the repository, or was not a valid ref name in the\nrepository" + "description": "One or more of the following error cases occurred (check the error message for more details): \n\n\n- the description is empty- the sourceMatcher or targetMatcher is invalid" }, "401": { "content": { @@ -13921,9 +14440,9 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to create a branch. This could be due to insufficient repository permissions, or lack of branch permission for the provided ref name" + "description": "The currently authenticated user has insufficient permissions to add a default task" }, - "409": { + "404": { "content": { "application/json": { "schema": { @@ -13939,17 +14458,17 @@ } } }, - "description": "The branch name overlapped with an existing branch" + "description": "The specified repository does not exist" } }, - "summary": "Create branch", + "summary": "Add a default task", "tags": ["Repository"] } }, - "/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches/info/{commitId}": { - "get": { - "description": "Gets the branch information associated with a single commit from a given repository.", - "operationId": "findByCommit", + "/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks/{taskId}": { + "delete": { + "description": "Delete a specific default task for a repository.\n\nThe authenticated user must have **REPO_ADMIN** permission for this repository to call the resource.", + "operationId": "deleteDefaultTask_1", "parameters": [ { "description": "The project key.", @@ -13958,16 +14477,6 @@ "required": true, "schema": { "type": "string" } }, - { - "content": { - "application/json": { - "schema": { "type": "string", "maxLength": 40 } - } - }, - "in": "path", - "name": "commitId", - "required": true - }, { "description": "The repository slug.", "in": "path", @@ -13976,45 +14485,18 @@ "schema": { "type": "string" } }, { - "description": "Start number for the page (inclusive). If not passed, first page is assumed.", - "example": 0, - "in": "query", - "name": "start", - "required": false, - "schema": { "type": "number", "example": 0 } - }, - { - "description": "Number of items to return. If not passed, a page size of 25 is used.", - "example": 25, - "in": "query", - "name": "limit", - "required": false, - "schema": { "type": "number", "example": 25 } + "description": "The ID of the default task", + "in": "path", + "name": "taskId", + "required": true, + "schema": { "type": "string" } } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "isLastPage": { "type": "boolean" }, - "limit": { "type": "number", "example": 25 }, - "nextPageStart": { "type": "integer", "format": "int32" }, - "size": { "type": "number", "example": 1 }, - "start": { "type": "integer", "format": "int32" }, - "values": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestMinimalRef" } - } - } - } - } - }, - "description": "A page of branch refs associated with the commit" + "204": { + "description": "The default task has been deleted successfully." }, - "500": { + "401": { "content": { "application/json": { "schema": { @@ -14030,23 +14512,9 @@ } } }, - "description": "The request has timed out processing the branch request" - } - }, - "summary": "Get branch", - "tags": ["Repository"] - } - }, - "/audit/latest/notification-settings/retention-config-review": { - "delete": { - "description": "Dismisses the retention config review notification displayed by the audit plugin for the user that's currently logged in.", - "operationId": "dismissRetentionConfigReviewNotification", - "responses": { - "200": { - "content": { "application/json": {} }, - "description": "A blank response" + "description": "The currently authenticated user has insufficient permissions to delete default tasks" }, - "401": { + "404": { "content": { "application/json": { "schema": { @@ -14062,17 +14530,15 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to dismiss the notification." + "description": "The specified repository or task does not exist" } }, - "summary": "Dismiss retention config notification", - "tags": ["System Maintenance"] - } - }, - "/default-reviewers/latest/projects/{projectKey}/condition": { - "post": { - "description": "Create a default reviewer pull request condition for the given project.", - "operationId": "createPullRequestCondition", + "summary": "Delete a specific default task", + "tags": ["Repository"] + }, + "put": { + "description": "Updates a default task for the supplied repository.\n\nThe authenticated user must have **REPO_ADMIN** permission for this repository to call the resource.", + "operationId": "updateDefaultTask_1", "parameters": [ { "description": "The project key.", @@ -14080,30 +14546,61 @@ "name": "projectKey", "required": true, "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The ID of the default task", + "in": "path", + "name": "taskId", + "required": true, + "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestDefaultReviewersRequest" + "$ref": "#/components/schemas/RestDefaultTaskRequest" } } }, - "description": "The details needed to create a default reviewer pull request condition." + "description": "The task to be updated", + "required": true }, "responses": { "200": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestDefaultTask" } + } + }, + "description": "The default task" + }, + "400": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestPullRequestCondition" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } } } }, - "description": "The default reviewer pull request condition that was created." + "description": "One or more of the following error cases occurred (check the error message for more details): \n\n\n- the provided taskId does not exist- the description is empty- the sourceMatcher or targetMatcher is invalid" }, - "400": { + "401": { "content": { "application/json": { "schema": { @@ -14119,17 +14616,35 @@ } } }, - "description": "The request was malformed." + "description": "The currently authenticated user has insufficient permissions to add a default task" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The specified repository does not exist" } }, - "summary": "Create default reviewer", - "tags": ["Pull Requests"] + "summary": "Update a default task", + "tags": ["Repository"] } }, - "/default-reviewers/latest/projects/{projectKey}/condition/{id}": { + "/default-tasks/latest/projects/{projectKey}/tasks": { "delete": { - "description": "Delete the default reviewer pull request condition associated with the given ID.", - "operationId": "deletePullRequestCondition", + "description": "Delete all the default tasks for the supplied project\n\nThe authenticated user must have **PROJECT_ADMIN** permission for this project to call the resource.", + "operationId": "deleteAllDefaultTasks", "parameters": [ { "description": "The project key.", @@ -14137,18 +14652,29 @@ "name": "projectKey", "required": true, "schema": { "type": "string" } - }, - { - "description": "The ID of the pull request condition.", - "in": "path", - "name": "id", - "required": true, - "schema": { "type": "string" } } ], "responses": { "204": { - "description": "An empty response indicating that the pull request condition was deleted." + "description": "The default tasks have been deleted successfully." + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to delete default tasks" }, "404": { "content": { @@ -14166,15 +14692,15 @@ } } }, - "description": "An empty response indicating a pull request condition with the given ID could not be found." + "description": "The specified project does not exist" } }, - "summary": "Remove default reviewer", - "tags": ["Pull Requests"] + "summary": "Deletes all default tasks for the project", + "tags": ["Project"] }, - "put": { - "description": "Update the default reviewer pull request condition for the given ID.", - "operationId": "updatePullRequestCondition", + "get": { + "description": "Retrieves the default tasks for the supplied project.\n\nThe authenticated user must have **PROJECT_VIEW** permission for this project to call the resource.", + "operationId": "getDefaultTasks", "parameters": [ { "description": "The project key.", @@ -14184,35 +14710,53 @@ "schema": { "type": "string" } }, { - "description": "The ID of the pull request condition.", - "in": "path", - "name": "id", - "required": true, + "description": "If present or \"true\", includes a markup-rendered description", + "in": "query", + "name": "markup", "schema": { "type": "string" } + }, + { + "description": "Start number for the page (inclusive). If not passed, first page is assumed.", + "example": 0, + "in": "query", + "name": "start", + "required": false, + "schema": { "type": "number", "example": 0 } + }, + { + "description": "Number of items to return. If not passed, a page size of 25 is used.", + "example": 25, + "in": "query", + "name": "limit", + "required": false, + "schema": { "type": "number", "example": 25 } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestDefaultReviewersRequest" - } - } - }, - "description": "The new details for the default reviewer pull request condition." - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestPullRequestCondition" + "type": "object", + "properties": { + "isLastPage": { "type": "boolean" }, + "limit": { "type": "number", "example": 25 }, + "nextPageStart": { "type": "integer", "format": "int32" }, + "size": { "type": "number", "example": 1 }, + "start": { "type": "integer", "format": "int32" }, + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestDefaultTask" + } + } + } } } }, - "description": "The updated default reviewer pull request condition." + "description": "A page of default tasks" }, - "400": { + "401": { "content": { "application/json": { "schema": { @@ -14228,49 +14772,33 @@ } } }, - "description": "The request was malformed" - } - }, - "summary": "Update the default reviewer", - "tags": ["Pull Requests"] - } - }, - "/default-reviewers/latest/projects/{projectKey}/conditions": { - "get": { - "description": "Return a page of default reviewer pull request conditions that have been configured for this project.", - "operationId": "getPullRequestConditions", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - } - ], - "responses": { - "200": { + "description": "The currently authenticated user has insufficient permissions to delete default tasks" + }, + "404": { "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestPullRequestCondition" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } } } } }, - "description": "The default reviewer pull request conditions associated with the given project." + "description": "The specified project does not exist" } }, - "summary": "Get default reviewers", - "tags": ["Pull Requests"] - } - }, - "/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition": { + "summary": "Get a page of default tasks", + "tags": ["Project"] + }, "post": { - "description": "Create a default reviewer pull request condition for the given repository.", - "operationId": "createPullRequestCondition_1", + "description": "Creates a default task for the project.\n\nThe authenticated user must have **PROJECT_ADMIN** permission for this project to call the resource.", + "operationId": "addDefaultTask", "parameters": [ { "description": "The project key.", @@ -14278,35 +14806,27 @@ "name": "projectKey", "required": true, "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestDefaultReviewersRequest" + "$ref": "#/components/schemas/RestDefaultTaskRequest" } } }, - "description": "The details needed to create a default reviewer pull request condition." + "description": "The task to be added", + "required": true }, "responses": { "200": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/RestPullRequestCondition" - } + "schema": { "$ref": "#/components/schemas/RestDefaultTask" } } }, - "description": "The default reviewer pull request condition that was created." + "description": "The default task" }, "400": { "content": { @@ -14324,42 +14844,25 @@ } } }, - "description": "The request was malformed." - } - }, - "summary": "Create default reviewers condition", - "tags": ["Pull Requests"] - } - }, - "/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}": { - "delete": { - "description": "Delete the default reviewer pull request condition associated with the given ID.", - "operationId": "deletePullRequestCondition_1", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { "type": "integer", "format": "int32" } + "description": "One or more of the following error cases occurred (check the error message for more details): \n\n\n- the description is empty- the sourceMatcher or targetMatcher is invalid" }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "responses": { - "204": { - "description": "An empty response indicating that the pull request condition was deleted" + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to add a default task" }, "404": { "content": { @@ -14377,118 +14880,56 @@ } } }, - "description": "An empty response indicating a pull request condition with the given ID could not be found." + "description": "The specified project does not exist" } }, - "summary": "Delete a default reviewer condition", - "tags": ["Pull Requests"] - }, - "put": { - "description": "Update the default reviewer pull request condition for the given ID.", - "operationId": "updatePullRequestCondition_1", + "summary": "Add a default task", + "tags": ["Project"] + } + }, + "/default-tasks/latest/projects/{projectKey}/tasks/{taskId}": { + "delete": { + "description": "Delete a specific default task for a project.\n\nThe authenticated user must have **PROJECT_ADMIN** permission for this project to call the resource.", + "operationId": "deleteDefaultTask", "parameters": [ { "description": "The project key.", "in": "path", "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The ID of the pull request condition", - "in": "path", - "name": "id", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "requiredApprovals": { - "type": "integer", - "format": "int32", - "example": 1 - }, - "reviewers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestApplicationUser" - } - }, - "sourceMatcher": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "main" }, - "id": { "type": "string", "example": "refs/heads/main" }, - "type": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "ANY_REF", - "BRANCH", - "PATTERN", - "MODEL_CATEGORY", - "MODEL_BRANCH" - ] - }, - "name": { "type": "string", "example": "Branch" } - } - } - } - }, - "targetMatcher": { - "type": "object", - "properties": { - "displayId": { "type": "string", "example": "main" }, - "id": { "type": "string", "example": "refs/heads/main" }, - "type": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "ANY_REF", - "BRANCH", - "PATTERN", - "MODEL_CATEGORY", - "MODEL_BRANCH" - ] - }, - "name": { "type": "string", "example": "Branch" } - } - } - } - } - } - } - } + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The ID of the default task", + "in": "path", + "name": "taskId", + "required": true, + "schema": { "type": "string" } } - }, + ], "responses": { - "200": { + "204": { + "description": "The default task has been deleted successfully." + }, + "401": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestPullRequestCondition" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } } } }, - "description": "The updated default reviewer pull request condition." + "description": "The currently authenticated user has insufficient permissions to delete default tasks" }, - "400": { + "404": { "content": { "application/json": { "schema": { @@ -14504,17 +14945,15 @@ } } }, - "description": "The request was malformed." + "description": "The specified project or task does not exist" } }, - "summary": "Update a default reviewer condition", - "tags": ["Pull Requests"] - } - }, - "/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditions": { - "get": { - "description": "Return a page of default reviewer pull request conditions that have been configured for this repository.", - "operationId": "getPullRequestConditions_1", + "summary": "Delete a specific default task", + "tags": ["Project"] + }, + "put": { + "description": "Updates a default task for the supplied project.\n\nThe authenticated user must have **PROJECT_ADMIN** permission for this project to call the resource.", + "operationId": "updateDefaultTask", "parameters": [ { "description": "The project key.", @@ -14524,43 +14963,141 @@ "schema": { "type": "string" } }, { - "description": "The repository slug.", + "description": "The ID of the default task", "in": "path", - "name": "repositorySlug", + "name": "taskId", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestDefaultTaskRequest" + } + } + }, + "description": "The task to be updated", + "required": true + }, "responses": { "200": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestDefaultTask" } + } + }, + "description": "The default task" + }, + "400": { "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestPullRequestCondition" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } } } } }, - "description": "The default reviewer pull request conditions associated with the given repository." + "description": "One or more of the following error cases occurred (check the error message for more details): \n\n\n- the provided taskId does not exist- the description is empty- the sourceMatcher or targetMatcher is invalid" + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to add a default task" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The specified project does not exist" } }, - "summary": "Get configured default reviewers", - "tags": ["Pull Requests"] + "summary": "Update a default task", + "tags": ["Project"] } }, - "/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/reviewers": { - "get": { - "description": "Return a set of users who are required reviewers for pull requests created from the given source repository and ref to the given target ref in this repository.", - "operationId": "getReviewers", + "/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}/reactions/{emoticon}": { + "delete": { + "description": "Remove an emoticon reaction from a comment", + "operationId": "unReact", "parameters": [ { - "description": "The ID of the repository in which the target ref exists", - "in": "query", - "name": "targetRepoId", + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The comment id", + "in": "path", + "name": "commentId", + "required": true, "schema": { "type": "string" } }, + { + "description": "The commit id", + "in": "path", + "name": "commitId", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The emoticon to remove", + "in": "path", + "name": "emoticon", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { "204": { "description": "The added reaction" } }, + "summary": "Remove a reaction from comment", + "tags": ["Repository"] + }, + "put": { + "description": "Add an emoticon reaction to a comment", + "operationId": "react", + "parameters": [ { "description": "The project key.", "in": "path", @@ -14569,21 +15106,24 @@ "schema": { "type": "string" } }, { - "description": "The ID of the repository in which the source ref exists", - "in": "query", - "name": "sourceRepoId", + "description": "The comment id", + "in": "path", + "name": "commentId", + "required": true, "schema": { "type": "string" } }, { - "description": "The ID of the source ref", - "in": "query", - "name": "sourceRefId", + "description": "The commit id", + "in": "path", + "name": "commitId", + "required": true, "schema": { "type": "string" } }, { - "description": "The ID of the target ref", - "in": "query", - "name": "targetRefId", + "description": "The emoticon to add", + "in": "path", + "name": "emoticon", + "required": true, "schema": { "type": "string" } }, { @@ -14598,46 +15138,65 @@ "200": { "content": { "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestPullRequestCondition" - } - } - } - }, - "description": "The default reviewer pull request conditions associated with the given repository." - }, - "400": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestErrors" } + "schema": { "$ref": "#/components/schemas/RestUserReaction" } } }, - "description": "The request was malformed." + "description": "The added reaction" } }, - "summary": "Get required reviewers for PR creation", - "tags": ["Pull Requests"] + "summary": "React to a comment", + "tags": ["Repository"] } }, - "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/annotations": { - "get": { - "description": "Get annotations for the given commit ID, filtered by any query parameters given.", - "operationId": "getAnnotations_1", + "/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}": { + "delete": { + "description": "Remove an emoticon reaction from a pull request comment", + "operationId": "unReact_1", "parameters": [ { - "description": "Return only annotations that have one of the given severities. Can be specified more than once to filter by more than one severity. Valid severities are LOW, MEDIUM and HIGH.", - "in": "query", - "name": "severity", + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, "schema": { "type": "string" } }, { - "description": "Return only annotations that appear on one of the provided paths. Can be specified more than once to filter by more than one path.", - "in": "query", - "name": "path", + "description": "The comment id.", + "in": "path", + "name": "commentId", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The pull request id.", + "in": "path", + "name": "pullRequestId", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The emoticon to remove", + "in": "path", + "name": "emoticon", + "required": true, "schema": { "type": "string" } }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { "204": { "description": "The added reaction" } }, + "summary": "Remove a reaction from a PR comment", + "tags": ["Pull Requests"] + }, + "put": { + "description": "Add an emoticon reaction to a pull request comment", + "operationId": "react_1", + "parameters": [ { "description": "The project key.", "in": "path", @@ -14646,22 +15205,24 @@ "schema": { "type": "string" } }, { - "description": "Return only annotations that have one of the provided external IDs. Can be specified more than once to filter by more than one external ID.", - "in": "query", - "name": "externalId", + "description": "The comment id.", + "in": "path", + "name": "commentId", + "required": true, "schema": { "type": "string" } }, { - "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "description": "The pull request id.", "in": "path", - "name": "commitId", + "name": "pullRequestId", "required": true, "schema": { "type": "string" } }, { - "description": "Return only annotations that have one of the given types. Can be specified more than once to filter by multiple types. Valid types are BUG, CODE_SMELL, and VULNERABILITY.", - "in": "query", - "name": "type", + "description": "The emoticon to add", + "in": "path", + "name": "emoticon", + "required": true, "schema": { "type": "string" } }, { @@ -14670,26 +15231,61 @@ "name": "repositorySlug", "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestUserReaction" } + } + }, + "description": "The added reaction" + } + }, + "summary": "React to a PR comment", + "tags": ["Pull Requests"] + } + }, + "/jira/latest/comments/{commentId}/issues": { + "post": { + "description": "Create a Jira issue and associate it with a comment on a pull request.\n\nThis resource can only be used with comments on a pull request. Attempting to call this resource with a different type of comment (for example, a comment on a commit) will result in an error. \n\n The authenticated user must have REPO_READ permission for the repository containing the comment to call this resource.\n\nThe JSON structure for the create issue format is specified by Jira's REST v2 API.", + "operationId": "createIssue", + "parameters": [ + { + "description": "the comment to associate the created Jira issue to", + "in": "path", + "name": "commentId", + "required": true, + "schema": { "type": "string" } }, { - "description": "Return only annotations that belong to one of the provided report keys. Can be specified more than once to filter by more than one report", + "description": "id of the Jira server", "in": "query", - "name": "key", + "name": "applicationId", "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { "type": "string", "description": "application/json" } + } + }, + "description": "A String representation of the JSON format Jira create issue request see: Jira REST API" + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestInsightAnnotationsResponse" + "$ref": "#/components/schemas/RestCommentJiraIssue" } } }, - "description": "The requested annotations." + "description": "The created Jira issue key and the associated comment ID" }, - "401": { + "400": { "content": { "application/json": { "schema": { @@ -14705,9 +15301,9 @@ } } }, - "description": "The currently authenticated user has insufficient permissions (REPO_READ) to get insight annotations." + "description": "The specified application link ID does not match any linked Jira instance." }, - "404": { + "401": { "content": { "application/json": { "schema": { @@ -14723,37 +15319,29 @@ } } }, - "description": "The specified project, repository, commit, or report does not exist." + "description": "Authentication with the Jira instance is required." } }, - "summary": "Get Code Insights annotations for a commit", - "tags": ["Builds and Deployments"] + "summary": "Create Jira Issue", + "tags": ["Jira Integration"] } }, - "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports": { + "/jira/latest/issues/{issueKey}/commits": { "get": { - "description": "Retrieve all reports for the given commit.", - "operationId": "getReports", + "description": "Retrieve a page of changesets associated with the given issue key.", + "operationId": "getCommitsByIssueKey", "parameters": [ { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "description": "The issue key to search by", "in": "path", - "name": "commitId", + "name": "issueKey", "required": true, "schema": { "type": "string" } }, { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, + "description": "The maximum number of changes to retrieve for each changeset", + "in": "query", + "name": "maxChanges", "schema": { "type": "string" } }, { @@ -14787,138 +15375,96 @@ "start": { "type": "integer", "format": "int32" }, "values": { "type": "array", - "items": { - "$ref": "#/components/schemas/RestInsightReport" - } - } - } - } - } - }, - "description": "A page of reports" - }, - "401": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } + "items": { "$ref": "#/components/schemas/RestChangeset" } } } } } }, - "description": "The currently authenticated user has insufficient permissions (REPO_READ) to get insight reports." - }, - "404": { + "description": "A page of detailed changesets" + } + }, + "summary": "Get changesets for issue key", + "tags": ["Jira Integration"] + } + }, + "/jira/latest/projects/{projectKey}/primary-enhanced-entitylink": { + "get": { + "description": "Retrieves the enchanced primary entitylink \n\nThe authenticated user must have PROJECT_READ permission for the project having the primary enhanced entitylink. \n\n", + "operationId": "getEnhancedEntityLinkForProject", + "parameters": [ + { + "description": "The project key", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } + "$ref": "#/components/schemas/RestEnhancedEntityLink" } } }, - "description": "The specified project, repository or commit does not exist." + "description": "The primary enhanced entitylink." } }, - "summary": "Get all Code Insights reports for a commit", - "tags": ["Builds and Deployments"] + "summary": "Get entity link", + "tags": ["Jira Integration"] } }, - "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports/{key}": { - "delete": { - "description": "Delete a report for the given commit. Also deletes any annotations associated with this report.", - "operationId": "deleteACodeInsightsReport", + "/jira/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/issues": { + "get": { + "description": "Retrieves Jira issue keys that are associated with the commits in the specified pull request. The number of commits checked for issues is limited to a default of 100.", + "operationId": "getIssueKeysForPullRequest", "parameters": [ { - "description": "The project key.", + "description": "The project key", "in": "path", "name": "projectKey", "required": true, "schema": { "type": "string" } }, { - "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "description": "The pull request id", "in": "path", - "name": "commitId", + "name": "pullRequestId", "required": true, "schema": { "type": "string" } }, { - "description": "The repository slug.", + "description": "The repository slug", "in": "path", "name": "repositorySlug", "required": true, "schema": { "type": "string" } - }, - { - "description": "The key of the report to which this annotation belongs.", - "in": "path", - "name": "key", - "required": true, - "schema": { "type": "string" } } ], "responses": { - "204": { - "description": "The report and associated annotations were successfully deleted." - }, - "401": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The currently authenticated user has insufficient permissions to delete insight reports or was not the author (REPO_READ for author otherwise REPO_ADMIN)." - }, - "404": { + "200": { "content": { - "application/json": { + "application/json;charset=UTF-8": { "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } + "type": "array", + "items": { "$ref": "#/components/schemas/RestJiraIssue" } } } }, - "description": "The specified project, repository, commit or report does not exist." + "description": "A list of Jira issues keys for the pull request" } }, - "summary": "Delete a Code Insights report", - "tags": ["Builds and Deployments"] - }, + "summary": "Get issues for a pull request", + "tags": ["Jira Integration"] + } + }, + "/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebase": { "get": { - "description": "Retrieve the specified report.", - "operationId": "getACodeInsightsReport", + "description": "Checks preconditions to determine whether the pull request can be rebased.\n\nSome of the preconditions are:\n\n- The pull request is between Git repositories\n- The pull request is currently open\n- The pull request's {@link PullRequest#getFromRef \"from\" ref} is a branch\n - In other words, the qualified ID for the \"from\" ref must start with refs/heads/\n - Tags, and other non-standard refs, cannot be rebased\n- The current user has an e-mail address\n - Pull requests cannot be rebased anonymously\n - `git rebase` records the current user as the committer for the rebased commits, which requires a name and e-mail address\n- The current user has write access to the {@link PullRequest#getFromRef \"from\" ref}'s repository\n - Note that in order to view a pull request a user is only required to have read access to the {@link PullRequest#getToRef toRef}'s repository, so just because a user can see a pull request does not mean they can request a rebase\n\n\nThis list is not exhaustive, and the exact set of preconditions applied can be extended by third-party add-ons.\n\nThe authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.", + "operationId": "canRebase", "parameters": [ { "description": "The project key.", @@ -14928,23 +15474,16 @@ "schema": { "type": "string" } }, { - "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "description": "The ID of the pull request within the repository.", "in": "path", - "name": "commitId", + "name": "pullRequestId", "required": true, "schema": { "type": "string" } }, { "description": "The repository slug.", "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The report key.", - "in": "path", - "name": "key", + "name": "repositorySlug", "required": true, "schema": { "type": "string" } } @@ -14953,10 +15492,12 @@ "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestInsightReport" } + "schema": { + "$ref": "#/components/schemas/RestPullRequestRebaseability" + } } }, - "description": "The specified report." + "description": "The rebaseability status of the pull request." }, "401": { "content": { @@ -14974,7 +15515,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions (REPO_READ needed) to get insight reports." + "description": "The currently authenticated user has insufficient permissions to view the specified pull request." }, "404": { "content": { @@ -14992,19 +15533,15 @@ } } }, - "description": "The specified project, repository, commit, or report does not exist." + "description": "The specified repository or pull request does not exist." } }, - "summary": "Get a Code Insights report", - "tags": ["Builds and Deployments"] + "summary": "Check PR rebase precondition", + "tags": ["Pull Requests"] }, - "put": { - "description": "Create a new insight report, or replace the existing one if a report already exists for the given repository, commit, and report key. A request to replace an existing report will be rejected if the authenticated user was not the creator of the specified report.\n\nThe report key should be a unique string chosen by the reporter and should be unique enough not to potentially clash with report keys from other reporters. We recommend using reverse DNS namespacing or a similar standard to ensure that collision is avoided.

Report parameters

Parameter Description Required? Restrictions Type
title A short string representing the name of the report Yes Max length: 450 characters (but we recommend that it is shorter so that the display is nicer) String
details A string to describe the purpose of the report. This string may contain escaped newlines and if it does it will display the content accordingly. No Max length: 2000 characters String
result Indicates whether the report is in a passed or failed state No One of: PASS, FAIL String
data An array of data fields (described below) to display information on the report No Maximum 6 data fields Array
reporter A string to describe the tool or company who created the report No Max length: 450 characters String
link A URL linking to the results of the report in an external tool. No Must be a valid http or https URL String
logoUrl A URL to the report logo. If none is provided, the default insights logo will be used. No Must be a valid http or https URL String

Data parameters

The data field on the report is an array with at most 6 data fields (JSON maps) containing information that is to be displayed on the report (see the request example).
Parameter Description Type
title A string describing what this data field represents String
type The type of data contained in the value field. If not provided, then the value will be detected as a boolean, number or string. One of: BOOLEAN, DATE, DURATION, LINK, NUMBER, PERCENTAGE, TEXT String
value A value based on the type provided. Either a raw value (string, number or boolean) or a map. See below.
Type Field Value Field Type Value Field Display
None/Omitted Number, String or Boolean (not an array or object) Plain text
BOOLEAN Boolean The value will be read as a JSON boolean and displayed as 'Yes' or 'No'.
DATE Number The value will be read as a JSON number in the form of a Unix timestamp (milliseconds) and will be displayed as a relative date if the date is less than one week ago, otherwise it will be displayed as an absolute date.
DURATION Number The value will be read as a JSON number in milliseconds and will be displayed in a human readable duration format.
LINK Object: {\"linktext\": \"Link text here\", \"href\": \"https://link.to.annotation/in/external/tool\"} The value will be read as a JSON object containing the fields \"linktext\" and \"href\" and will be displayed as a clickable link on the report.
NUMBER Number The value will be read as a JSON number and large numbers will be displayed in a human readable format (e.g. 14.3k).
PERCENTAGE Number (between 0 and 100) The value will be read as a JSON number between 0 and 100 and will be displayed with a percentage sign.
TEXT String The value will be read as a JSON string and will be displayed as-is
", - "externalDocs": { - "description": "Tutorial adding Code Insights to your CI system", - "url": "https://developer.atlassian.com/server/bitbucket/tutorials-and-examples/code-insights-tutorial/" - }, - "operationId": "setACodeInsightsReport", + "post": { + "description": "Rebases the specified pull request, rewriting the incoming commits to start from the tip commit of the pull request's target branch. This operation alters the pull request's source branch and cannot be undone.\n\nThe authenticated user must have REPO_READ permission for the repository that this pull request targets and REPO_WRITE permission for the pull request's source repository to call this resource.", + "operationId": "rebase", "parameters": [ { "description": "The project key.", @@ -15014,9 +15551,9 @@ "schema": { "type": "string" } }, { - "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "description": "The ID of the pull request within the repository.", "in": "path", - "name": "commitId", + "name": "pullRequestId", "required": true, "schema": { "type": "string" } }, @@ -15026,35 +15563,30 @@ "name": "repositorySlug", "required": true, "schema": { "type": "string" } - }, - { - "description": "A unique string representing the report as chosen by the reporter. This should be unique enough to not clash with other report's keys. To do this, we recommend namespacing the key using reverse DNS", - "in": "path", - "name": "key", - "required": true, - "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestSetInsightReportRequest" + "$ref": "#/components/schemas/RestPullRequestRebaseRequest" } } }, - "description": "The request object containing the details of the report to create (see example)." + "description": "The pull request rebase request." }, "responses": { "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestInsightReport" } + "schema": { + "$ref": "#/components/schemas/RestPullRequestRebaseResult" + } } }, - "description": "The created report." + "description": "The merged pull request." }, - "400": { + "401": { "content": { "application/json": { "schema": { @@ -15070,9 +15602,9 @@ } } }, - "description": "One of the following error cases occurred (check the error message for more details):\n\n- The request does not contain a report title.\n- The data field contains unsupported objects.\n- The request does not contain a report key/\n- The provided commit hash is invalid, according to the validation rules mentioned for the commitId above.\n" + "description": "The currently authenticated user has insufficient permissions to view the pull request and/or to update its source branch." }, - "401": { + "404": { "content": { "application/json": { "schema": { @@ -15088,17 +15620,35 @@ } } }, - "description": "The currently authenticated user is not permitted to create an insight report or authentication failed." + "description": "The specified repository or pull request does not exist." + }, + "409": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "Any of the following error cases occurred (check the error message for more details):\n\n- The rebase encountered conflicts.\n- The rebase discarded all of the incoming commits and would have left the pull request empty\n- A PreRepositoryHook vetoed the rebase.\n- The specified version is out of date.\n- The specified pull request is not open.\n- The target repository is archived." } }, - "summary": "Create a Code Insights report", - "tags": ["Builds and Deployments"] + "summary": "Rebase pull request", + "tags": ["Pull Requests"] } }, - "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports/{key}/annotations": { - "delete": { - "description": "Delete annotations for a given report that match the given external IDs, or all annotations if no external IDs are provided.", - "operationId": "deleteAnnotations", + "/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags": { + "post": { + "description": "Creates a tag in the specified repository.\n\nThe authenticated user must have an effective REPO_WRITE permission to call this resource.\n\n'LIGHTWEIGHT' and 'ANNOTATED' are the two type of tags that can be created. The 'startPoint' can either be a ref or a 'commit'.", + "operationId": "createTag", "parameters": [ { "description": "The project key.", @@ -15107,39 +15657,34 @@ "required": true, "schema": { "type": "string" } }, - { - "description": "The external IDs for the annotations that are to be deleted. Can be specified more than once to delete by more than one external ID, or can be unspecified to delete all annotations.", - "in": "query", - "name": "externalId", - "schema": { "type": "string" } - }, - { - "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", - "in": "path", - "name": "commitId", - "required": true, - "schema": { "type": "string" } - }, { "description": "The repository slug.", "in": "path", "name": "repositorySlug", "required": true, "schema": { "type": "string" } - }, - { - "description": "The key of the report to which this annotation belongs.", - "in": "path", - "name": "key", - "required": true, - "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestGitTagCreateRequest" + } + } + }, + "description": "The create git tag request." + }, "responses": { - "204": { - "description": "The annotations were successfully deleted." + "201": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestTag" } + } + }, + "description": "A JSON representation of the newly created tag." }, - "401": { + "400": { "content": { "application/json": { "schema": { @@ -15155,9 +15700,9 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete insight reports or was not the author (REPO_READ for author otherwise REPO_ADMIN)." + "description": "The tag was not created because the request was invalid, e.g. the provided ref name already existed in the repository, or was not a valid ref name in the repository, or the start point is invalid." }, - "404": { + "401": { "content": { "application/json": { "schema": { @@ -15173,15 +15718,17 @@ } } }, - "description": "The specified project, repository, commit or report does not exist." + "description": "The currently authenticated user has insufficient permissions to create a tag. This could be due to insufficient repository permissions." } }, - "summary": "Delete Code Insights annotations", - "tags": ["Builds and Deployments"] - }, - "get": { - "description": "Retrieve the specified report's annotations.", - "operationId": "getAnnotations", + "summary": "Create tag", + "tags": ["Repository"] + } + }, + "/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}": { + "delete": { + "description": "Deletes a tag in the specified repository.\n\nThe authenticated user must have an effective REPO_WRITE permission to call this resource.", + "operationId": "deleteTag", "parameters": [ { "description": "The project key.", @@ -15191,11 +15738,11 @@ "schema": { "type": "string" } }, { - "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "description": "The name of the tag to be deleted.", "in": "path", - "name": "commitId", + "name": "name", "required": true, - "schema": { "type": "string" } + "schema": { "type": "string", "pattern": ".*" } }, { "description": "The repository slug.", @@ -15203,25 +15750,29 @@ "name": "repositorySlug", "required": true, "schema": { "type": "string" } - }, - { - "description": "The report key.", - "in": "path", - "name": "key", - "required": true, - "schema": { "type": "string" } } ], "responses": { - "200": { + "204": { + "description": "An empty response indicating that the tag no longer exists in the repository." + }, + "400": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestInsightAnnotationsResponse" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } } } }, - "description": "The specified annotations." + "description": "The tag was not deleted because repository is either empty, or is not a git repository." }, "401": { "content": { @@ -15239,7 +15790,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions (REPO_READ needed) to get insight reports." + "description": "The currently authenticated user has insufficient permissions to delete a tag. This could be due to insufficient repository permissions." }, "404": { "content": { @@ -15257,16 +15808,30 @@ } } }, - "description": "The specified project, repository, commit, or report does not exist." + "description": "If the tag doesn't exist in the repository." } }, - "summary": "Get Code Insights annotations for a report", - "tags": ["Builds and Deployments"] - }, - "post": { - "description": "Add annotations to the given report. The request should be a JSON object mapping the string \"annotations\" to an array of maps containing the annotation data, as described below. See also the example request.\n\nA few things to note:- Annotations are an extension of a report, so a report must first exist in order to post annotations. Annotations are posted separately from the report, and can be posted in bulk using this endpoint.\n- Only the annotations that are on lines changed in the unified diff will be displayed. This means it is likely not all annotations posted will be displayed on the pull request It also means that if the user is viewing a side-by-side diff, commit diff or iterative review diff they will not be able to view the annotations.\n- A report cannot have more than 1000 annotations by default, however this property is congurable at an instance level. If the request would result in more than the maximum number of annotations being stored then the entire request is rejected and no new annotations are stored. \n- There is no de-duplication of annotations on Bitbucket so be sure that reruns of builds will first delete the report and annotations before creating them.\n\n# Annotation parameters\n\n|Parameter|Description|Required?|Restrictions|Type|\n|--- |--- |--- |--- |--- |\n|path|The path of the file on which this annotation should be placed. This is the path of the filerelative to the git repository. If no path is provided, then it will appear in the overview modalon all pull requests where the tip of the branch is the given commit, regardless of which files weremodified.|No||String|\n|line|The line number that the annotation should belong to. If no line number is provided, then it willdefault to 0 and in a pull request it will appear at the top of the file specified by the path field.|No|Non-negative integer|Integer|\n|message|The message to display to users|Yes|The maximum length accepted is 2000 characters, however the user interface may truncate this valuefor display purposes. We recommend that the message is short and succinct, with further detailsavailable to the user if needed on the page linked to by the the annotation link.|String|\n|severity|The severity of the annotation|Yes|One of: LOW, MEDIUM, HIGH|String|\n|link|An http or https URL representing the location of the annotation in the external tool|No||String|\n|type|The type of annotation posted|No|One of: VULNERABILITY, CODE_SMELL, BUG|String|\n|externalId|If the caller requires a link to get or modify this annotation, then an ID must be provided. It isnot used or required by Bitbucket, but only by the annotation creator for updating or deleting thisspecific annotation.|No|A string value shorter than 450 characters|String|", - "operationId": "addAnnotations", + "summary": "Delete tag", + "tags": ["Repository"] + } + }, + "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/annotations": { + "get": { + "description": "Get annotations for the given commit ID, filtered by any query parameters given.", + "operationId": "getAnnotations_1", "parameters": [ + { + "description": "Return only annotations that have one of the given severities. Can be specified more than once to filter by more than one severity. Valid severities are LOW, MEDIUM and HIGH.", + "in": "query", + "name": "severity", + "schema": { "type": "string" } + }, + { + "description": "Return only annotations that appear on one of the provided paths. Can be specified more than once to filter by more than one path.", + "in": "query", + "name": "path", + "schema": { "type": "string" } + }, { "description": "The project key.", "in": "path", @@ -15274,6 +15839,12 @@ "required": true, "schema": { "type": "string" } }, + { + "description": "Return only annotations that have one of the provided external IDs. Can be specified more than once to filter by more than one external ID.", + "in": "query", + "name": "externalId", + "schema": { "type": "string" } + }, { "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", "in": "path", @@ -15281,6 +15852,12 @@ "required": true, "schema": { "type": "string" } }, + { + "description": "Return only annotations that have one of the given types. Can be specified more than once to filter by multiple types. Valid types are BUG, CODE_SMELL, and VULNERABILITY.", + "in": "query", + "name": "type", + "schema": { "type": "string" } + }, { "description": "The repository slug.", "in": "path", @@ -15289,26 +15866,22 @@ "schema": { "type": "string" } }, { - "description": "The key of the report to which this annotation belongs.", - "in": "path", + "description": "Return only annotations that belong to one of the provided report keys. Can be specified more than once to filter by more than one report", + "in": "query", "name": "key", - "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestBulkAddInsightAnnotationRequest" - } - } - }, - "description": "The annotations to add." - }, "responses": { - "204": { - "description": "An empty response indicating that the request succeeded." + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestInsightAnnotationsResponse" + } + } + }, + "description": "The requested annotations." }, "401": { "content": { @@ -15326,7 +15899,7 @@ } } }, - "description": "The currently authenticated user is not the author of the report, or the author no longer has sufficient permissions (REPO_READ)." + "description": "The currently authenticated user has insufficient permissions (REPO_READ) to get insight annotations." }, "404": { "content": { @@ -15347,14 +15920,14 @@ "description": "The specified project, repository, commit, or report does not exist." } }, - "summary": "Add Code Insights annotations", + "summary": "Get Code Insights annotations for a commit", "tags": ["Builds and Deployments"] } }, - "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports/{key}/annotations/{externalId}": { - "put": { - "description": "Create an annotation with the given external ID, or replace it if it already exists. A request to replace an existing annotation will be rejected if the authenticated user was not the creator of the specified report.", - "operationId": "setAnnotation", + "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports": { + "get": { + "description": "Retrieve all reports for the given commit.", + "operationId": "getReports", "parameters": [ { "description": "The project key.", @@ -15363,13 +15936,6 @@ "required": true, "schema": { "type": "string" } }, - { - "description": "The external ID of the annotation that is to be updated or created", - "in": "path", - "name": "externalId", - "required": true, - "schema": { "type": "string" } - }, { "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", "in": "path", @@ -15385,46 +15951,47 @@ "schema": { "type": "string" } }, { - "description": "The key of the report to which this annotation belongs", - "in": "path", - "name": "key", - "required": true, - "schema": { "type": "string" } + "description": "Start number for the page (inclusive). If not passed, first page is assumed.", + "example": 0, + "in": "query", + "name": "start", + "required": false, + "schema": { "type": "number", "example": 0 } + }, + { + "description": "Number of items to return. If not passed, a page size of 25 is used.", + "example": 25, + "in": "query", + "name": "limit", + "required": false, + "schema": { "type": "number", "example": 25 } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestSingleAddInsightAnnotationRequest" - } - } - }, - "description": "The new annotation that is to replace the existing one." - }, "responses": { - "204": { - "description": "No content, indicating that the request succeeded." - }, - "401": { + "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { - "errors": { + "isLastPage": { "type": "boolean" }, + "limit": { "type": "number", "example": 25 }, + "nextPageStart": { "type": "integer", "format": "int32" }, + "size": { "type": "number", "example": 1 }, + "start": { "type": "integer", "format": "int32" }, + "values": { "type": "array", "items": { - "$ref": "#/components/schemas/RestErrorMessage" + "$ref": "#/components/schemas/RestInsightReport" } } } } } }, - "description": "The currently authenticated user is not the author of the report, or the author no longer has sufficient permissions (REPO_READ)." + "description": "A page of reports" }, - "404": { + "401": { "content": { "application/json": { "schema": { @@ -15440,215 +16007,35 @@ } } }, - "description": "The specified project, repository, commit, report or annotation does not exist." - } - }, - "summary": "Create or replace a Code Insights annotation", - "tags": ["Builds and Deployments"] - } - }, - "/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}/reactions/{emoticon}": { - "delete": { - "description": "Remove an emoticon reaction from a comment", - "operationId": "unReact", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The comment id", - "in": "path", - "name": "commentId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The commit id", - "in": "path", - "name": "commitId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The emoticon to remove", - "in": "path", - "name": "emoticon", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "responses": { "204": { "description": "The added reaction" } }, - "summary": "Remove a reaction from comment", - "tags": ["Repository"] - }, - "put": { - "description": "Add an emoticon reaction to a comment", - "operationId": "react", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The comment id", - "in": "path", - "name": "commentId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The commit id", - "in": "path", - "name": "commitId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The emoticon to add", - "in": "path", - "name": "emoticon", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestUserReaction" } - } - }, - "description": "The added reaction" - } - }, - "summary": "React to a comment", - "tags": ["Repository"] - } - }, - "/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/reactions/{emoticon}": { - "delete": { - "description": "Remove an emoticon reaction from a pull request comment", - "operationId": "unReact_1", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The comment id.", - "in": "path", - "name": "commentId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The pull request id.", - "in": "path", - "name": "pullRequestId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The emoticon to remove", - "in": "path", - "name": "emoticon", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "responses": { "204": { "description": "The added reaction" } }, - "summary": "Remove a reaction from a PR comment", - "tags": ["Pull Requests"] - }, - "put": { - "description": "Add an emoticon reaction to a pull request comment", - "operationId": "react_1", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The comment id.", - "in": "path", - "name": "commentId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The pull request id.", - "in": "path", - "name": "pullRequestId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The emoticon to add", - "in": "path", - "name": "emoticon", - "required": true, - "schema": { "type": "string" } + "description": "The currently authenticated user has insufficient permissions (REPO_READ) to get insight reports." }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "responses": { - "200": { + "404": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestUserReaction" } + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } } }, - "description": "The added reaction" + "description": "The specified project, repository or commit does not exist." } }, - "summary": "React to a PR comment", - "tags": ["Pull Requests"] + "summary": "Get all Code Insights reports for a commit", + "tags": ["Builds and Deployments"] } }, - "/git/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/rebase": { - "get": { - "description": "Checks preconditions to determine whether the pull request can be rebased.\n\nSome of the preconditions are:\n\n- The pull request is between Git repositories\n- The pull request is currently open\n- The pull request's {@link PullRequest#getFromRef \"from\" ref} is a branch\n - In other words, the qualified ID for the \"from\" ref must start with refs/heads/\n - Tags, and other non-standard refs, cannot be rebased\n- The current user has an e-mail address\n - Pull requests cannot be rebased anonymously\n - `git rebase` records the current user as the committer for the rebased commits, which requires a name and e-mail address\n- The current user has write access to the {@link PullRequest#getFromRef \"from\" ref}'s repository\n - Note that in order to view a pull request a user is only required to have read access to the {@link PullRequest#getToRef toRef}'s repository, so just because a user can see a pull request does not mean they can request a rebase\n\n\nThis list is not exhaustive, and the exact set of preconditions applied can be extended by third-party add-ons.\n\nThe authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.", - "operationId": "canRebase", + "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports/{key}": { + "delete": { + "description": "Delete a report for the given commit. Also deletes any annotations associated with this report.", + "operationId": "deleteACodeInsightsReport", "parameters": [ { "description": "The project key.", @@ -15658,9 +16045,9 @@ "schema": { "type": "string" } }, { - "description": "The ID of the pull request within the repository.", + "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", "in": "path", - "name": "pullRequestId", + "name": "commitId", "required": true, "schema": { "type": "string" } }, @@ -15670,18 +16057,18 @@ "name": "repositorySlug", "required": true, "schema": { "type": "string" } + }, + { + "description": "The key of the report to which this annotation belongs.", + "in": "path", + "name": "key", + "required": true, + "schema": { "type": "string" } } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestPullRequestRebaseability" - } - } - }, - "description": "The rebaseability status of the pull request." + "204": { + "description": "The report and associated annotations were successfully deleted." }, "401": { "content": { @@ -15699,7 +16086,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to view the specified pull request." + "description": "The currently authenticated user has insufficient permissions to delete insight reports or was not the author (REPO_READ for author otherwise REPO_ADMIN)." }, "404": { "content": { @@ -15717,15 +16104,15 @@ } } }, - "description": "The specified repository or pull request does not exist." + "description": "The specified project, repository, commit or report does not exist." } }, - "summary": "Check PR rebase precondition", - "tags": ["Pull Requests"] + "summary": "Delete a Code Insights report", + "tags": ["Builds and Deployments"] }, - "post": { - "description": "Rebases the specified pull request, rewriting the incoming commits to start from the tip commit of the pull request's target branch. This operation alters the pull request's source branch and cannot be undone.\n\nThe authenticated user must have REPO_READ permission for the repository that this pull request targets and REPO_WRITE permission for the pull request's source repository to call this resource.", - "operationId": "rebase", + "get": { + "description": "Retrieve the specified report.", + "operationId": "getACodeInsightsReport", "parameters": [ { "description": "The project key.", @@ -15735,9 +16122,9 @@ "schema": { "type": "string" } }, { - "description": "The ID of the pull request within the repository.", + "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", "in": "path", - "name": "pullRequestId", + "name": "commitId", "required": true, "schema": { "type": "string" } }, @@ -15747,28 +16134,23 @@ "name": "repositorySlug", "required": true, "schema": { "type": "string" } + }, + { + "description": "The report key.", + "in": "path", + "name": "key", + "required": true, + "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestPullRequestRebaseRequest" - } - } - }, - "description": "The pull request rebase request." - }, "responses": { "200": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/RestPullRequestRebaseResult" - } + "schema": { "$ref": "#/components/schemas/RestInsightReport" } } }, - "description": "The merged pull request." + "description": "The specified report." }, "401": { "content": { @@ -15786,7 +16168,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to view the pull request and/or to update its source branch." + "description": "The currently authenticated user has insufficient permissions (REPO_READ needed) to get insight reports." }, "404": { "content": { @@ -15804,35 +16186,19 @@ } } }, - "description": "The specified repository or pull request does not exist." - }, - "409": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "Any of the following error cases occurred (check the error message for more details):\n\n- The rebase encountered conflicts.\n- The rebase discarded all of the incoming commits and would have left the pull request empty\n- A PreRepositoryHook vetoed the rebase.\n- The specified version is out of date.\n- The specified pull request is not open.\n- The target repository is archived." + "description": "The specified project, repository, commit, or report does not exist." } }, - "summary": "Rebase pull request", - "tags": ["Pull Requests"] - } - }, - "/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags": { - "post": { - "description": "Creates a tag in the specified repository.\n\nThe authenticated user must have an effective REPO_WRITE permission to call this resource.\n\n'LIGHTWEIGHT' and 'ANNOTATED' are the two type of tags that can be created. The 'startPoint' can either be a ref or a 'commit'.", - "operationId": "createTag", + "summary": "Get a Code Insights report", + "tags": ["Builds and Deployments"] + }, + "put": { + "description": "Create a new insight report, or replace the existing one if a report already exists for the given repository, commit, and report key. A request to replace an existing report will be rejected if the authenticated user was not the creator of the specified report.\n\nThe report key should be a unique string chosen by the reporter and should be unique enough not to potentially clash with report keys from other reporters. We recommend using reverse DNS namespacing or a similar standard to ensure that collision is avoided.

Report parameters

Parameter Description Required? Restrictions Type
title A short string representing the name of the report Yes Max length: 450 characters (but we recommend that it is shorter so that the display is nicer) String
details A string to describe the purpose of the report. This string may contain escaped newlines and if it does it will display the content accordingly. No Max length: 2000 characters String
result Indicates whether the report is in a passed or failed state No One of: PASS, FAIL String
data An array of data fields (described below) to display information on the report No Maximum 6 data fields Array
reporter A string to describe the tool or company who created the report No Max length: 450 characters String
link A URL linking to the results of the report in an external tool. No Must be a valid http or https URL String
logoUrl A URL to the report logo. If none is provided, the default insights logo will be used. No Must be a valid http or https URL String

Data parameters

The data field on the report is an array with at most 6 data fields (JSON maps) containing information that is to be displayed on the report (see the request example).
Parameter Description Type
title A string describing what this data field represents String
type The type of data contained in the value field. If not provided, then the value will be detected as a boolean, number or string. One of: BOOLEAN, DATE, DURATION, LINK, NUMBER, PERCENTAGE, TEXT String
value A value based on the type provided. Either a raw value (string, number or boolean) or a map. See below.
Type Field Value Field Type Value Field Display
None/Omitted Number, String or Boolean (not an array or object) Plain text
BOOLEAN Boolean The value will be read as a JSON boolean and displayed as 'Yes' or 'No'.
DATE Number The value will be read as a JSON number in the form of a Unix timestamp (milliseconds) and will be displayed as a relative date if the date is less than one week ago, otherwise it will be displayed as an absolute date.
DURATION Number The value will be read as a JSON number in milliseconds and will be displayed in a human readable duration format.
LINK Object: {\"linktext\": \"Link text here\", \"href\": \"https://link.to.annotation/in/external/tool\"} The value will be read as a JSON object containing the fields \"linktext\" and \"href\" and will be displayed as a clickable link on the report.
NUMBER Number The value will be read as a JSON number and large numbers will be displayed in a human readable format (e.g. 14.3k).
PERCENTAGE Number (between 0 and 100) The value will be read as a JSON number between 0 and 100 and will be displayed with a percentage sign.
TEXT String The value will be read as a JSON string and will be displayed as-is
", + "externalDocs": { + "description": "Tutorial adding Code Insights to your CI system", + "url": "https://developer.atlassian.com/server/bitbucket/tutorials-and-examples/code-insights-tutorial/" + }, + "operationId": "setACodeInsightsReport", "parameters": [ { "description": "The project key.", @@ -15841,32 +16207,46 @@ "required": true, "schema": { "type": "string" } }, + { + "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "in": "path", + "name": "commitId", + "required": true, + "schema": { "type": "string" } + }, { "description": "The repository slug.", "in": "path", "name": "repositorySlug", "required": true, "schema": { "type": "string" } + }, + { + "description": "A unique string representing the report as chosen by the reporter. This should be unique enough to not clash with other report's keys. To do this, we recommend namespacing the key using reverse DNS", + "in": "path", + "name": "key", + "required": true, + "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestGitTagCreateRequest" + "$ref": "#/components/schemas/RestSetInsightReportRequest" } } }, - "description": "The create git tag request." + "description": "The request object containing the details of the report to create (see example)." }, "responses": { - "201": { + "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestTag" } + "schema": { "$ref": "#/components/schemas/RestInsightReport" } } }, - "description": "A JSON representation of the newly created tag." + "description": "The created report." }, "400": { "content": { @@ -15884,7 +16264,7 @@ } } }, - "description": "The tag was not created because the request was invalid, e.g. the provided ref name already existed in the repository, or was not a valid ref name in the repository, or the start point is invalid." + "description": "One of the following error cases occurred (check the error message for more details):\n\n- The request does not contain a report title.\n- The data field contains unsupported objects.\n- The request does not contain a report key/\n- The provided commit hash is invalid, according to the validation rules mentioned for the commitId above.\n" }, "401": { "content": { @@ -15902,17 +16282,17 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to create a tag. This could be due to insufficient repository permissions." + "description": "The currently authenticated user is not permitted to create an insight report or authentication failed." } }, - "summary": "Create tag", - "tags": ["Repository"] + "summary": "Create a Code Insights report", + "tags": ["Builds and Deployments"] } }, - "/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}": { + "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports/{key}/annotations": { "delete": { - "description": "Deletes a tag in the specified repository.\n\nThe authenticated user must have an effective REPO_WRITE permission to call this resource.", - "operationId": "deleteTag", + "description": "Delete annotations for a given report that match the given external IDs, or all annotations if no external IDs are provided.", + "operationId": "deleteAnnotations", "parameters": [ { "description": "The project key.", @@ -15922,11 +16302,17 @@ "schema": { "type": "string" } }, { - "description": "The name of the tag to be deleted.", + "description": "The external IDs for the annotations that are to be deleted. Can be specified more than once to delete by more than one external ID, or can be unspecified to delete all annotations.", + "in": "query", + "name": "externalId", + "schema": { "type": "string" } + }, + { + "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", "in": "path", - "name": "name", + "name": "commitId", "required": true, - "schema": { "type": "string", "pattern": ".*" } + "schema": { "type": "string" } }, { "description": "The repository slug.", @@ -15934,29 +16320,18 @@ "name": "repositorySlug", "required": true, "schema": { "type": "string" } + }, + { + "description": "The key of the report to which this annotation belongs.", + "in": "path", + "name": "key", + "required": true, + "schema": { "type": "string" } } ], "responses": { "204": { - "description": "An empty response indicating that the tag no longer exists in the repository." - }, - "400": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The tag was not deleted because repository is either empty, or is not a git repository." + "description": "The annotations were successfully deleted." }, "401": { "content": { @@ -15974,7 +16349,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete a tag. This could be due to insufficient repository permissions." + "description": "The currently authenticated user has insufficient permissions to delete insight reports or was not the author (REPO_READ for author otherwise REPO_ADMIN)." }, "404": { "content": { @@ -15992,89 +16367,55 @@ } } }, - "description": "If the tag doesn't exist in the repository." + "description": "The specified project, repository, commit or report does not exist." } }, - "summary": "Delete tag", - "tags": ["Repository"] - } - }, - "/policies/latest/admin/repos/archive": { + "summary": "Delete Code Insights annotations", + "tags": ["Builds and Deployments"] + }, "get": { - "description": "Retrieves the repository archive policy for the instance.\n\nThe user must be authenticated to access this resource.", - "operationId": "getRepositoryArchivePolicy", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestRepositoryPolicy" - } - } - }, - "description": "A response containing the repository archive policy for the instance" + "description": "Retrieve the specified report's annotations.", + "operationId": "getAnnotations", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } }, - "401": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The currently authenticated user has insufficient permissions to retrieve the repository archive policy" - } - }, - "summary": "Get repository archive policy", - "tags": ["System Maintenance"] - }, - "put": { - "description": "Sets the repository archive policy for the instance.\n\nThe authenticated user must have SYS_ADMIN permission.", - "operationId": "setRepositoryArchivePolicy", - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestRepositoryPolicy" } - } + { + "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "in": "path", + "name": "commitId", + "required": true, + "schema": { "type": "string" } }, - "description": "The request containing the details of the policy." - }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The report key.", + "in": "path", + "name": "key", + "required": true, + "schema": { "type": "string" } + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestRepositoryPolicy" - } - } - }, - "description": "A response containing the repository archive policy for the instance" - }, - "400": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } + "$ref": "#/components/schemas/RestInsightAnnotationsResponse" } } }, - "description": "The permission was invalid or does not exist" + "description": "The specified annotations." }, "401": { "content": { @@ -16092,29 +16433,9 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to set the repository archive policy" - } - }, - "summary": "Update repository archive policy", - "tags": ["System Maintenance"] - } - }, - "/policies/latest/admin/repos/delete": { - "get": { - "description": "Retrieves the repository delete policy for the instance.\n\nThe user must be authenticated to access this resource.", - "operationId": "getRepositoryDeletePolicy", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestRepositoryPolicy" - } - } - }, - "description": "A response containing the repository delete policy for the instance" + "description": "The currently authenticated user has insufficient permissions (REPO_READ needed) to get insight reports." }, - "401": { + "404": { "content": { "application/json": { "schema": { @@ -16130,35 +16451,60 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to retrieve the repository delete policy" + "description": "The specified project, repository, commit, or report does not exist." } }, - "summary": "Get repository delete policy", - "tags": ["System Maintenance"] + "summary": "Get Code Insights annotations for a report", + "tags": ["Builds and Deployments"] }, - "put": { - "description": "Sets the repository delete policy for the instance.\n\nThe authenticated user must have SYS_ADMIN permission.", - "operationId": "setRepositoryDeletePolicy", + "post": { + "description": "Add annotations to the given report. The request should be a JSON object mapping the string \"annotations\" to an array of maps containing the annotation data, as described below. See also the example request.\n\nA few things to note:- Annotations are an extension of a report, so a report must first exist in order to post annotations. Annotations are posted separately from the report, and can be posted in bulk using this endpoint.\n- Only the annotations that are on lines changed in the unified diff will be displayed. This means it is likely not all annotations posted will be displayed on the pull request It also means that if the user is viewing a side-by-side diff, commit diff or iterative review diff they will not be able to view the annotations.\n- A report cannot have more than 1000 annotations by default, however this property is congurable at an instance level. If the request would result in more than the maximum number of annotations being stored then the entire request is rejected and no new annotations are stored. \n- There is no de-duplication of annotations on Bitbucket so be sure that reruns of builds will first delete the report and annotations before creating them.\n\n# Annotation parameters\n\n|Parameter|Description|Required?|Restrictions|Type|\n|--- |--- |--- |--- |--- |\n|path|The path of the file on which this annotation should be placed. This is the path of the filerelative to the git repository. If no path is provided, then it will appear in the overview modalon all pull requests where the tip of the branch is the given commit, regardless of which files weremodified.|No||String|\n|line|The line number that the annotation should belong to. If no line number is provided, then it willdefault to 0 and in a pull request it will appear at the top of the file specified by the path field.|No|Non-negative integer|Integer|\n|message|The message to display to users|Yes|The maximum length accepted is 2000 characters, however the user interface may truncate this valuefor display purposes. We recommend that the message is short and succinct, with further detailsavailable to the user if needed on the page linked to by the the annotation link.|String|\n|severity|The severity of the annotation|Yes|One of: LOW, MEDIUM, HIGH|String|\n|link|An http or https URL representing the location of the annotation in the external tool|No||String|\n|type|The type of annotation posted|No|One of: VULNERABILITY, CODE_SMELL, BUG|String|\n|externalId|If the caller requires a link to get or modify this annotation, then an ID must be provided. It isnot used or required by Bitbucket, but only by the annotation creator for updating or deleting thisspecific annotation.|No|A string value shorter than 450 characters|String|", + "operationId": "addAnnotations", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "in": "path", + "name": "commitId", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The key of the report to which this annotation belongs.", + "in": "path", + "name": "key", + "required": true, + "schema": { "type": "string" } + } + ], "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestRepositoryPolicy" } + "schema": { + "$ref": "#/components/schemas/RestBulkAddInsightAnnotationRequest" + } } }, - "description": "The request containing the details of the policy." + "description": "The annotations to add." }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestRepositoryPolicy" - } - } - }, - "description": "A response containing the repository delete policy for the instance" + "204": { + "description": "An empty response indicating that the request succeeded." }, - "400": { + "401": { "content": { "application/json": { "schema": { @@ -16174,9 +16520,9 @@ } } }, - "description": "The permission was invalid or does not exist" + "description": "The currently authenticated user is not the author of the report, or the author no longer has sufficient permissions (REPO_READ)." }, - "401": { + "404": { "content": { "application/json": { "schema": { @@ -16192,28 +16538,67 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to set the repository delete policy" + "description": "The specified project, repository, commit, or report does not exist." } }, - "summary": "Update the repository delete policy", - "tags": ["System Maintenance"] + "summary": "Add Code Insights annotations", + "tags": ["Builds and Deployments"] } }, - "/gpg/latest/keys": { - "delete": { - "description": "Delete all GPG keys for a supplied user.", - "operationId": "deleteForUser", + "/insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports/{key}/annotations/{externalId}": { + "put": { + "description": "Create an annotation with the given external ID, or replace it if it already exists. A request to replace an existing annotation will be rejected if the authenticated user was not the creator of the specified report.", + "operationId": "setAnnotation", "parameters": [ { - "description": "The username of the user to delete the keys for. If no username is specified, the GPG keys will be deleted for the currently authenticated user.", - "in": "query", - "name": "user", + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The external ID of the annotation that is to be updated or created", + "in": "path", + "name": "externalId", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The commit ID on which to record the annotation. This must be a full 40 character commit hash.", + "in": "path", + "name": "commitId", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The key of the report to which this annotation belongs", + "in": "path", + "name": "key", + "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestSingleAddInsightAnnotationRequest" + } + } + }, + "description": "The new annotation that is to replace the existing one." + }, "responses": { "204": { - "description": "The GPG keys matching the supplied user were deleted." + "description": "No content, indicating that the request succeeded." }, "401": { "content": { @@ -16231,7 +16616,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete the GPG keys. This is only possible when a user is explicitly supplied." + "description": "The currently authenticated user is not the author of the report, or the author no longer has sufficient permissions (REPO_READ)." }, "404": { "content": { @@ -16249,112 +16634,67 @@ } } }, - "description": "No user matches the supplied user." + "description": "The specified project, repository, commit, report or annotation does not exist." } }, - "summary": "Delete all GPG keys for user", - "tags": ["Security"] - }, + "summary": "Create or replace a Code Insights annotation", + "tags": ["Builds and Deployments"] + } + }, + "/mirroring/latest/farmNodes": { "get": { - "description": "Find all the keys for the currently authenticated user. Optionally, users with ADMIN and higher permissions may choose to specify the user parameter to retrieve GPG keys for another user.\n\nOnly authenticated users may call this endpoint.", - "operationId": "getKeysForUser", - "parameters": [ - { - "description": "The name of the user to get keys for (optional; requires ADMIN permission or higher).", - "in": "query", - "name": "user", - "schema": { "type": "string" } - }, - { - "description": "Start number for the page (inclusive). If not passed, first page is assumed.", - "example": 0, - "in": "query", - "name": "start", - "required": false, - "schema": { "type": "number", "example": 0 } - }, - { - "description": "Number of items to return. If not passed, a page size of 25 is used.", - "example": 25, - "in": "query", - "name": "limit", - "required": false, - "schema": { "type": "number", "example": 25 } - } - ], + "description": "Retrieves the list of farm nodes in this cluster", + "operationId": "getFarmNodes", "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "isLastPage": { "type": "boolean" }, - "limit": { "type": "number", "example": 25 }, - "nextPageStart": { "type": "integer", "format": "int32" }, - "size": { "type": "number", "example": 1 }, - "start": { "type": "integer", "format": "int32" }, - "values": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestGpgKey" } - } - } + "200": { + "content": { + "application/json;charset=UTF-8": { + "schema": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestClusterNode" } } } }, - "description": "Returns a paged response of of keys for the user." + "description": "The list of farm nodes" }, - "401": { + "404": { "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } + "application/json;charset=UTF-8": { + "schema": { "$ref": "#/components/schemas/RestErrors" } } }, - "description": "The currently authenticated user has insufficient permissions to perform this operation." + "description": "The upstream server could not be found" } }, - "summary": "Get all GPG keys", - "tags": ["Security"] - }, - "post": { - "description": "Add a GPG key to the authenticated user's account. Optionally, users with ADMIN and higher permissions may choose to specify the user parameter to add a GPG key for another user.\n\nOnly authenticated users may call this endpoint.", - "operationId": "addKey", + "summary": "Get farm nodes", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/mirrorRepos/{externalRepositoryId}": { + "get": { + "description": "Retrieves all available clone urls for the specified repository.", + "operationId": "getMirroredRepository", "parameters": [ { - "description": "The name of the user to add a key for (optional; requires ADMIN permission or higher).", - "in": "query", - "name": "user", + "description": "the repository ID", + "in": "path", + "name": "externalRepositoryId", + "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestGpgKey" } - } - }, - "description": "The request body." - }, "responses": { "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestGpgKey" } + "schema": { + "$ref": "#/components/schemas/RestMirroredRepository" + } } }, - "description": "Response contains the GPG key that was just created." + "description": "The mirrored repository's information." }, - "400": { + "404": { "content": { "application/json": { "schema": { @@ -16370,9 +16710,27 @@ } } }, - "description": "The request has failed validation." + "description": "The upstream server or the repository could not be found." + } + }, + "summary": "Get clone URLs", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/progress": { + "get": { + "description": " Retrieves synchronization progress state.If there's no progress to report, this resource will return
 {\"discovering\":false,\"syncedRepos\":0,\"totalRepos\":0}
If there are repositories in the process of synchronizing, but the precise number hasn't been discovered yet, this resource will return:
 {\"discovering\":true,\"syncedRepos\":3,\"totalRepos\":100}
If there is progress to report and the total number of repositories is known, this resource will return:
  {\"discovering\":false,\"syncedRepos\":242,\"totalRepos\":1071} 
", + "operationId": "getSynchronizationProgress", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestSyncProgress" } + } + }, + "description": "the synchronization progress state" }, - "401": { + "404": { "content": { "application/json": { "schema": { @@ -16388,65 +16746,61 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to perform this operation." + "description": "The upstream server could not be found." } }, - "summary": "Create a GPG key", - "tags": ["Security"] + "summary": "Get synchronization progress state", + "tags": ["Mirroring (Mirror)"] } }, - "/gpg/latest/keys/{fingerprintOrId}": { - "delete": { - "description": "Delete the GPG key with the specified ID or Key Fingerprint.", - "operationId": "deleteKey", - "parameters": [ - { - "description": "The GPG fingerprint or ID.", - "in": "path", - "name": "fingerprintOrId", - "required": true, - "schema": { "type": "string" } - } - ], + "/mirroring/latest/supportInfo/out-of-sync-repos/content": { + "get": { + "description": "Retrieves a list of repository IDs which have not synced on the mirror node for at least the threshold time limit after the content was changed in the corresponding upstream repositories. The threshold time limit is defined by a configuration property plugin.mirroring.repository.diagnostics.sync.tolerance. The detection of out of sync repositories is dependent on the timing of a scheduled job which is controlled by a configuration property plugin.mirroring.synchronization.interval which means in worst case it can take upto plugin.mirroring.repository.diagnostics.sync.tolerance + plugin.mirroring.synchronization.interval time to detect an out-of-sync repository.

To use this API, a configuration property plugin.mirroring.repository.diagnostics.sync.enabled has to be set to true as this feature is disabled by default.", + "operationId": "getOutOfSyncRepositories", "responses": { - "204": { "description": "The key has been deleted successfully." }, + "200": { + "content": { + "application/json;charset=UTF-8": { + "schema": { "type": "string" } + } + }, + "description": "The upstream IDs of the repositories that are out of sync on the mirror node" + }, "401": { "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } + "application/json;charset=UTF-8": { + "schema": { "$ref": "#/components/schemas/RestErrors" } } }, - "description": "The currently authenticated user has insufficient permissions to perform this operation." + "description": "The currently authenticated user has insufficient permissions to call this resource." + }, + "409": { + "content": { + "application/json;charset=UTF-8": { + "schema": { "$ref": "#/components/schemas/RestErrors" } + } + }, + "description": "The feature is not enabled i.e. plugin.mirroring.repository.diagnostics.sync.enabled=false" } }, - "summary": "Delete a GPG key", - "tags": ["Security"] + "summary": "Get out-of-sync repositories", + "tags": ["Mirroring (Mirror)"] } }, - "/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks": { - "delete": { - "description": "Delete all the default tasks for the supplied repository\n\nThe authenticated user must have **REPO_ADMIN** permission for this repository to call the resource.", - "operationId": "deleteAllDefaultTasks_1", + "/mirroring/latest/supportInfo/projects/{projectKey}/repos/{repositorySlug}/repo-lock-owner": { + "get": { + "description": "Retrieves the information about the process owning the sync lock for this repository. The process owning the lock could be running on any of the nodes in the mirror farm", + "operationId": "getRepositoryLockOwner", "parameters": [ { - "description": "The project key.", + "description": "The project key", "in": "path", "name": "projectKey", "required": true, "schema": { "type": "string" } }, { - "description": "The repository slug.", + "description": "The repository slug", "in": "path", "name": "repositorySlug", "required": true, @@ -16454,8 +16808,15 @@ } ], "responses": { - "204": { - "description": "The default tasks have been deleted successfully." + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestRepositoryLockOwner" + } + } + }, + "description": "The information about the repository lock owner for the syncing process, if the lock is currently being held, otherwise an empty response" }, "401": { "content": { @@ -16473,7 +16834,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete default tasks" + "description": "The currently authenticated user has insufficient permissions to call this resource." }, "404": { "content": { @@ -16494,48 +16855,28 @@ "description": "The specified repository does not exist" } }, - "summary": "Deletes all default tasks for the repository", - "tags": ["Repository"] - }, + "summary": "Get the repository lock owner for the syncing process", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/supportInfo/projects/{projectKey}/repos/{repositorySlug}/repoSyncStatus": { "get": { - "description": "Retrieves the default tasks for the supplied repository.\n\nThe authenticated user must have **REPO_VIEW** permission for this repository to call the resource.", - "operationId": "getDefaultTasks_1", + "description": "Retrieves information about an external repository mirrored by the mirror server. Particularly the local ID & external ID of the repository", + "operationId": "getRepoSyncStatus_1", "parameters": [ { - "description": "The project key.", + "description": "The project key", "in": "path", "name": "projectKey", "required": true, "schema": { "type": "string" } }, { - "description": "If present or `\"true\"`, includes a markup-rendered description", - "in": "query", - "name": "markup", - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", + "description": "The repository slug", "in": "path", "name": "repositorySlug", "required": true, "schema": { "type": "string" } - }, - { - "description": "Start number for the page (inclusive). If not passed, first page is assumed.", - "example": 0, - "in": "query", - "name": "start", - "required": false, - "schema": { "type": "number", "example": 0 } - }, - { - "description": "Number of items to return. If not passed, a page size of 25 is used.", - "example": 25, - "in": "query", - "name": "limit", - "required": false, - "schema": { "type": "number", "example": 25 } } ], "responses": { @@ -16543,24 +16884,11 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "isLastPage": { "type": "boolean" }, - "limit": { "type": "number", "example": 25 }, - "nextPageStart": { "type": "integer", "format": "int32" }, - "size": { "type": "number", "example": 1 }, - "start": { "type": "integer", "format": "int32" }, - "values": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestDefaultTask" - } - } - } + "$ref": "#/components/schemas/RestMirrorRepositorySynchronizationStatus" } } }, - "description": "A page of default tasks" + "description": "The sync status of the repository on this node" }, "401": { "content": { @@ -16578,7 +16906,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete default tasks" + "description": "The currently authenticated user has insufficient permissions to call this resource." }, "404": { "content": { @@ -16599,49 +16927,46 @@ "description": "The specified repository does not exist" } }, - "summary": "Get a page of default tasks", - "tags": ["Repository"] - }, - "post": { - "description": "Creates a default task for the supplied repository.\n\nThe authenticated user must have **REPO_ADMIN** permission for this repository to call the resource.", - "operationId": "addDefaultTask_1", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestDefaultTaskRequest" - } - } - }, - "description": "The task to be added", - "required": true - }, + "summary": "Gets information about the mirrored repository", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/supportInfo/refChangesQueue": { + "get": { + "description": "Retrieves a list of up to plugin.mirroring.farm.max.ref.change.queue.dump.size items currently in the ref changes queue. The ref changes queue is an internal component of every mirror farm, and is shared between all nodes. When the contents of an upstream repository changes, an item is added to this queue so that the mirror farm nodes know to synchronize. The mirror farm constantly polls and removes items from this queue for processing, so it is empty most of the time.", + "operationId": "getRefChangesQueue", "responses": { "200": { + "content": { + "application/json;charset=UTF-8": { + "schema": { "$ref": "#/components/schemas/RestRefSyncQueue" } + } + }, + "description": "The contents of the ref changes queue" + }, + "401": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestDefaultTask" } + "schema": { "$ref": "#/components/schemas/RestErrors" } } }, - "description": "The default task" + "description": "The currently authenticated user has insufficient permissions to call this resource." + } + }, + "summary": "Get items in ref changes queue", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/supportInfo/refChangesQueue/count": { + "get": { + "description": "Retrieves the total number of items currently in the ref changes queue", + "operationId": "getRefChangesQueueCount", + "responses": { + "200": { + "content": { "application/json": {} }, + "description": "The total number of items currently in the ref changes queue" }, - "400": { + "401": { "content": { "application/json": { "schema": { @@ -16657,27 +16982,91 @@ } } }, - "description": "One or more of the following error cases occurred (check the error message for more details): \n\n\n- the description is empty- the sourceMatcher or targetMatcher is invalid" + "description": "The currently authenticated user has insufficient permissions to call this resource." + } + }, + "summary": "Get total number of items in ref changes queue", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/supportInfo/repo-lock-owners": { + "get": { + "description": "Retrieves the information about all the processes from the all the nodes in the mirror farm owning sync lock for any repository", + "operationId": "getRepositoryLockOwners", + "responses": { + "200": { + "content": { + "application/json;charset=UTF-8": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestRepositoryLockOwner" + } + } + } + }, + "description": "A list of all the repository lock owners for the syncing process" }, "401": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestErrors" } + } + }, + "description": "The currently authenticated user has insufficient permissions to call this resource." + } + }, + "summary": "Get all the repository lock owners for the syncing process", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/supportInfo/repoSyncStatus": { + "get": { + "description": "Retrieves a page of sync statuses of the repositories on this mirror node", + "operationId": "getRepoSyncStatus", + "parameters": [ + { + "description": "Start number for the page (inclusive). If not passed, first page is assumed.", + "example": 0, + "in": "query", + "name": "start", + "required": false, + "schema": { "type": "number", "example": 0 } + }, + { + "description": "Number of items to return. If not passed, a page size of 25 is used.", + "example": 25, + "in": "query", + "name": "limit", + "required": false, + "schema": { "type": "number", "example": 25 } + } + ], + "responses": { + "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { - "errors": { + "isLastPage": { "type": "boolean" }, + "limit": { "type": "number", "example": 25 }, + "nextPageStart": { "type": "integer", "format": "int32" }, + "size": { "type": "number", "example": 1 }, + "start": { "type": "integer", "format": "int32" }, + "values": { "type": "array", "items": { - "$ref": "#/components/schemas/RestErrorMessage" + "$ref": "#/components/schemas/RestMirrorRepositorySynchronizationStatus" } } } } } }, - "description": "The currently authenticated user has insufficient permissions to add a default task" + "description": "The sync status of the repositories on this node" }, - "404": { + "401": { "content": { "application/json": { "schema": { @@ -16693,43 +17082,27 @@ } } }, - "description": "The specified repository does not exist" + "description": "The currently authenticated user has insufficient permissions to call this resource." } }, - "summary": "Add a default task", - "tags": ["Repository"] + "summary": "Get sync status of repositories", + "tags": ["Mirroring (Mirror)"] } }, - "/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks/{taskId}": { - "delete": { - "description": "Delete a specific default task for a repository.\n\nThe authenticated user must have **REPO_ADMIN** permission for this repository to call the resource.", - "operationId": "deleteDefaultTask_1", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The ID of the default task", - "in": "path", - "name": "taskId", - "required": true, - "schema": { "type": "string" } - } - ], + "/mirroring/latest/syncSettings": { + "get": { + "description": "Retrieves upstream settings", + "operationId": "getMirrorSettings", "responses": { - "204": { - "description": "The default task has been deleted successfully." + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestUpstreamSettings" + } + } + }, + "description": "the mirror settings" }, "401": { "content": { @@ -16747,7 +17120,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete default tasks" + "description": "When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission" }, "404": { "content": { @@ -16765,59 +17138,35 @@ } } }, - "description": "The specified repository or task does not exist" + "description": "The upstream server could not be found." } }, - "summary": "Delete a specific default task", - "tags": ["Repository"] + "summary": "Get upstream settings", + "tags": ["Mirroring (Mirror)"] }, "put": { - "description": "Updates a default task for the supplied repository.\n\nThe authenticated user must have **REPO_ADMIN** permission for this repository to call the resource.", - "operationId": "updateDefaultTask_1", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The ID of the default task", - "in": "path", - "name": "taskId", - "required": true, - "schema": { "type": "string" } - } - ], + "description": "Sets the settings for the specified upstream", + "operationId": "setMirrorSettings", "requestBody": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/RestDefaultTaskRequest" - } + "schema": { "$ref": "#/components/schemas/RestUpstreamSettings" } } }, - "description": "The task to be updated", - "required": true + "description": "the mirror settings to update to" }, "responses": { "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestDefaultTask" } + "schema": { + "$ref": "#/components/schemas/RestUpstreamSettings" + } } }, - "description": "The default task" + "description": "the updated mirror settings" }, - "400": { + "401": { "content": { "application/json": { "schema": { @@ -16833,7 +17182,39 @@ } } }, - "description": "One or more of the following error cases occurred (check the error message for more details): \n\n\n- the provided taskId does not exist- the description is empty- the sourceMatcher or targetMatcher is invalid" + "description": "When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The upstream server could not be found." + } + }, + "summary": "Update upstream settings", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/syncSettings/mode": { + "get": { + "description": "Gets the current mirror mode", + "operationId": "getMirrorMode", + "responses": { + "200": { + "content": { "application/json": {} }, + "description": "the current mirror mode" }, "401": { "content": { @@ -16851,7 +17232,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to add a default task" + "description": "When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission" }, "404": { "content": { @@ -16869,31 +17250,24 @@ } } }, - "description": "The specified repository does not exist" + "description": "The upstream server could not be found." } }, - "summary": "Update a default task", - "tags": ["Repository"] - } - }, - "/default-tasks/latest/projects/{projectKey}/tasks": { - "delete": { - "description": "Delete all the default tasks for the supplied project\n\nThe authenticated user must have **PROJECT_ADMIN** permission for this project to call the resource.", - "operationId": "deleteAllDefaultTasks", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - } - ], + "summary": "Get mirror mode", + "tags": ["Mirroring (Mirror)"] + }, + "put": { + "description": "Sets the mirror mode for the specified upstream", + "operationId": "setMirrorMode", + "requestBody": { + "content": { "application/json": { "schema": { "type": "string" } } } + }, "responses": { - "204": { - "description": "The default tasks have been deleted successfully." + "200": { + "content": { "application/json": {} }, + "description": "the mode to set" }, - "401": { + "400": { "content": { "application/json": { "schema": { @@ -16909,9 +17283,9 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete default tasks" + "description": "The provided mode is invalid" }, - "404": { + "401": { "content": { "application/json": { "schema": { @@ -16927,69 +17301,21 @@ } } }, - "description": "The specified project does not exist" + "description": "When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission" } }, - "summary": "Deletes all default tasks for the project", - "tags": ["Project"] - }, + "summary": "Update mirror mode", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/syncSettings/projects": { "get": { - "description": "Retrieves the default tasks for the supplied project.\n\nThe authenticated user must have **PROJECT_VIEW** permission for this project to call the resource.", - "operationId": "getDefaultTasks", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "If present or \"true\", includes a markup-rendered description", - "in": "query", - "name": "markup", - "schema": { "type": "string" } - }, - { - "description": "Start number for the page (inclusive). If not passed, first page is assumed.", - "example": 0, - "in": "query", - "name": "start", - "required": false, - "schema": { "type": "number", "example": 0 } - }, - { - "description": "Number of items to return. If not passed, a page size of 25 is used.", - "example": 25, - "in": "query", - "name": "limit", - "required": false, - "schema": { "type": "number", "example": 25 } - } - ], + "description": "Returns the IDs of the projects that the mirror is configured to mirror", + "operationId": "getMirroredProjects", "responses": { "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "isLastPage": { "type": "boolean" }, - "limit": { "type": "number", "example": 25 }, - "nextPageStart": { "type": "integer", "format": "int32" }, - "size": { "type": "number", "example": 1 }, - "start": { "type": "integer", "format": "int32" }, - "values": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestDefaultTask" - } - } - } - } - } - }, - "description": "A page of default tasks" + "content": { "application/json": {} }, + "description": "the currently mirrored project IDs" }, "401": { "content": { @@ -17007,7 +17333,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete default tasks" + "description": "When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission" }, "404": { "content": { @@ -17025,45 +17351,46 @@ } } }, - "description": "The specified project does not exist" + "description": "The upstream server could not be found." } }, - "summary": "Get a page of default tasks", - "tags": ["Project"] + "summary": "Get mirrored project IDs", + "tags": ["Mirroring (Mirror)"] }, "post": { - "description": "Creates a default task for the project.\n\nThe authenticated user must have **PROJECT_ADMIN** permission for this project to call the resource.", - "operationId": "addDefaultTask", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - } - ], + "description": "Configures the mirror to mirror the provided projects", + "operationId": "startMirroringProjects", "requestBody": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/RestDefaultTaskRequest" - } + "schema": { "type": "array", "items": { "type": "string" } } } - }, - "description": "The task to be added", - "required": true + } }, "responses": { "200": { + "content": { "application/json": {} }, + "description": "the currently mirrored project IDs" + }, + "401": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestDefaultTask" } + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } } }, - "description": "The default task" + "description": "When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission" }, - "400": { + "404": { "content": { "application/json": { "schema": { @@ -17079,8 +17406,28 @@ } } }, - "description": "One or more of the following error cases occurred (check the error message for more details): \n\n\n- the description is empty- the sourceMatcher or targetMatcher is invalid" - }, + "description": "The upstream server could not be found." + } + }, + "summary": "Add multiple projects to be mirrored", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/syncSettings/projects/{projectId}": { + "delete": { + "description": "Configures the mirror to no longer mirror the provided project", + "operationId": "stopMirroringProject", + "parameters": [ + { + "description": "the project ID to stop mirroring", + "in": "path", + "name": "projectId", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "204": { "description": "the request has been processed" }, "401": { "content": { "application/json": { @@ -17097,7 +17444,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to add a default task" + "description": "When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission" }, "404": { "content": { @@ -17115,36 +17462,27 @@ } } }, - "description": "The specified project does not exist" + "description": "The upstream server could not be found." } }, - "summary": "Add a default task", - "tags": ["Project"] - } - }, - "/default-tasks/latest/projects/{projectKey}/tasks/{taskId}": { - "delete": { - "description": "Delete a specific default task for a project.\n\nThe authenticated user must have **PROJECT_ADMIN** permission for this project to call the resource.", - "operationId": "deleteDefaultTask", + "summary": "Stop mirroring project", + "tags": ["Mirroring (Mirror)"] + }, + "post": { + "description": "Configures the mirror to mirror the provided project", + "operationId": "startMirroringProject", "parameters": [ { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The ID of the default task", "in": "path", - "name": "taskId", + "name": "projectId", "required": true, "schema": { "type": "string" } } ], "responses": { - "204": { - "description": "The default task has been deleted successfully." + "200": { + "content": { "application/json": {} }, + "description": "the currently mirrored project IDs" }, "401": { "content": { @@ -17162,7 +17500,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to delete default tasks" + "description": "When the user is not a service user for the currently registered upstream or doesn't have ADMIN permission" }, "404": { "content": { @@ -17180,52 +17518,27 @@ } } }, - "description": "The specified project or task does not exist" - } - }, - "summary": "Delete a specific default task", - "tags": ["Project"] - }, - "put": { - "description": "Updates a default task for the supplied project.\n\nThe authenticated user must have **PROJECT_ADMIN** permission for this project to call the resource.", - "operationId": "updateDefaultTask", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "The ID of the default task", - "in": "path", - "name": "taskId", - "required": true, - "schema": { "type": "string" } + "description": "The upstream server could not be found." } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestDefaultTaskRequest" - } - } - }, - "description": "The task to be updated", - "required": true }, + "summary": "Add project to be mirrored", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/upstreamServer": { + "get": { + "description": "Retrieves upstream server details.", + "operationId": "getUpstreamServer", "responses": { "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestDefaultTask" } + "schema": { "$ref": "#/components/schemas/RestUpstreamServer" } } }, - "description": "The default task" + "description": "The upstream server." }, - "400": { + "404": { "content": { "application/json": { "schema": { @@ -17241,7 +17554,27 @@ } } }, - "description": "One or more of the following error cases occurred (check the error message for more details): \n\n\n- the provided taskId does not exist- the description is empty- the sourceMatcher or targetMatcher is invalid" + "description": "The upstream server could not be found" + } + }, + "summary": "Get upstream server", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/zdu/end": { + "post": { + "description": "Finalizes the ZDU upgrade on the mirror farm denying heterogeneous cluster formation", + "operationId": "endRollingUpgrade", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestRollingUpgradeState" + } + } + }, + "description": "The state of the rolling upgrade which includes the current version on all the nodes in the farm." }, "401": { "content": { @@ -17259,9 +17592,29 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to add a default task" + "description": "When the user doesn't have SYS_ADMIN permission" + } + }, + "summary": "End ZDU upgrade on mirror farm", + "tags": ["Mirroring (Mirror)"] + } + }, + "/mirroring/latest/zdu/start": { + "post": { + "description": "Enables upgrading of individual nodes within the cluster, allowing a heterogeneous cluster formation", + "operationId": "startRollingUpgrade", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestRollingUpgradeState" + } + } + }, + "description": "The state of the rolling upgrade which includes the minimum version of all the nodes in the farm." }, - "404": { + "401": { "content": { "application/json": { "schema": { @@ -17277,11 +17630,11 @@ } } }, - "description": "The specified project does not exist" + "description": "When the user doesn't have SYS_ADMIN permission" } }, - "summary": "Update a default task", - "tags": ["Project"] + "summary": "Start ZDU upgrade on mirror farm", + "tags": ["Mirroring (Mirror)"] } }, "/mirroring/latest/account/settings/preferred-mirror": { @@ -18132,12 +18485,257 @@ "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestMirrorServer" } + "schema": { "$ref": "#/components/schemas/RestMirrorServer" } + } + }, + "description": "The accepted mirror server" + }, + "409": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The request could not be found" + } + }, + "summary": "Accept a mirroring request", + "tags": ["Mirroring (Upstream)"] + } + }, + "/mirroring/latest/requests/{mirroringRequestId}/reject": { + "post": { + "description": "Rejects a mirroring request", + "operationId": "reject", + "parameters": [ + { + "description": "the ID of the request to reject", + "in": "path", + "name": "mirroringRequestId", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestMirrorServer" } + } + }, + "description": "The rejected mirror server" + }, + "409": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The request could not be found" + } + }, + "summary": "Reject a mirroring request", + "tags": ["Mirroring (Upstream)"] + } + }, + "/policies/latest/admin/repos/archive": { + "get": { + "description": "Retrieves the repository archive policy for the instance.\n\nThe user must be authenticated to access this resource.", + "operationId": "getRepositoryArchivePolicy", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestRepositoryPolicy" + } + } + }, + "description": "A response containing the repository archive policy for the instance" + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to retrieve the repository archive policy" + } + }, + "summary": "Get repository archive policy", + "tags": ["System Maintenance"] + }, + "put": { + "description": "Sets the repository archive policy for the instance.\n\nThe authenticated user must have SYS_ADMIN permission.", + "operationId": "setRepositoryArchivePolicy", + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestRepositoryPolicy" } + } + }, + "description": "The request containing the details of the policy." + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestRepositoryPolicy" + } + } + }, + "description": "A response containing the repository archive policy for the instance" + }, + "400": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The permission was invalid or does not exist" + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to set the repository archive policy" + } + }, + "summary": "Update repository archive policy", + "tags": ["System Maintenance"] + } + }, + "/policies/latest/admin/repos/delete": { + "get": { + "description": "Retrieves the repository delete policy for the instance.\n\nThe user must be authenticated to access this resource.", + "operationId": "getRepositoryDeletePolicy", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestRepositoryPolicy" + } + } + }, + "description": "A response containing the repository delete policy for the instance" + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to retrieve the repository delete policy" + } + }, + "summary": "Get repository delete policy", + "tags": ["System Maintenance"] + }, + "put": { + "description": "Sets the repository delete policy for the instance.\n\nThe authenticated user must have SYS_ADMIN permission.", + "operationId": "setRepositoryDeletePolicy", + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestRepositoryPolicy" } + } + }, + "description": "The request containing the details of the policy." + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestRepositoryPolicy" + } + } + }, + "description": "A response containing the repository delete policy for the instance" + }, + "400": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } } }, - "description": "The accepted mirror server" + "description": "The permission was invalid or does not exist" }, - "409": { + "401": { "content": { "application/json": { "schema": { @@ -18153,22 +18751,35 @@ } } }, - "description": "The request could not be found" + "description": "The currently authenticated user has insufficient permissions to set the repository delete policy" } }, - "summary": "Accept a mirroring request", - "tags": ["Mirroring (Upstream)"] + "summary": "Update the repository delete policy", + "tags": ["System Maintenance"] } }, - "/mirroring/latest/requests/{mirroringRequestId}/reject": { - "post": { - "description": "Rejects a mirroring request", - "operationId": "reject", + "/sync/latest/projects/{projectKey}/repos/{repositorySlug}": { + "get": { + "description": "Retrieves the synchronization status for the specified repository. In addition to listing refs which cannot be synchronized, if any, the status also provides the timestamp for the most recent synchronization and indicates whether synchronization is available and enabled. If \"?at\" is specified in the URL, the synchronization status for the specified ref is returned, rather than the complete repository status.\n\nThe authenticated user must have REPO_READ permission for the repository, or it must be public if the request is anonymous. Additionally, after synchronization is enabled for a repository, meaning synchronization was available at that time, permission changes and other actions can cause it to become unavailable. Even when synchronization is enabled, if it is no longer available for the repository it will not be performed.", + "operationId": "getStatus", "parameters": [ { - "description": "the ID of the request to reject", + "description": "The project key.", "in": "path", - "name": "mirroringRequestId", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "Retrieves the synchronization status for the specified ref within the repository, rather than for the entire repository", + "in": "query", + "name": "at", + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", "required": true, "schema": { "type": "string" } } @@ -18177,12 +18788,12 @@ "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestMirrorServer" } + "schema": { "$ref": "#/components/schemas/RestRefSyncStatus" } } }, - "description": "The rejected mirror server" + "description": "Synchronization status for the specified repository, or specific ref within that repository." }, - "409": { + "401": { "content": { "application/json": { "schema": { @@ -18198,67 +18809,69 @@ } } }, - "description": "The request could not be found" - } - }, - "summary": "Reject a mirroring request", - "tags": ["Mirroring (Upstream)"] - } - }, - "/mirroring/latest/farmNodes": { - "get": { - "description": "Retrieves the list of farm nodes in this cluster", - "operationId": "getFarmNodes", - "responses": { - "200": { - "content": { - "application/json;charset=UTF-8": { - "schema": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestClusterNode" } - } - } - }, - "description": "The list of farm nodes" + "description": "The currently authenticated user has insufficient permissions to view the repository, or the repository is not public if the request is anonymous." }, "404": { "content": { - "application/json;charset=UTF-8": { - "schema": { "$ref": "#/components/schemas/RestErrors" } + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } } }, - "description": "The upstream server could not be found" + "description": "The specified repository does not exist." } }, - "summary": "Get farm nodes", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/mirrorRepos/{externalRepositoryId}": { - "get": { - "description": "Retrieves all available clone urls for the specified repository.", - "operationId": "getMirroredRepository", + "summary": "Get synchronization status", + "tags": ["Repository"] + }, + "post": { + "description": "Enables or disables synchronization for the specified repository. When synchronization is enabled, branches within the repository are immediately synchronized and the status is updated with the outcome. That initial synchronization is performed before the REST request returns, allowing it to return the updated status.\n\nThe authenticated user must have REPO_ADMIN permission for the specified repository. Anonymous users cannot manage synchronization, even on public repositories. Additionally, synchronization must be available for the specified repository. Synchronization is only available if:\n\n- The repository is a fork, since its origin is used as upstream\n- The owning user still has access to the fork's origin, if the repository is a personalfork", + "operationId": "setEnabled", "parameters": [ { - "description": "the repository ID", + "description": "The project key.", "in": "path", - "name": "externalRepositoryId", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestRefSyncStatus" } + } + } + }, "responses": { "200": { "content": { "application/json": { - "schema": { - "$ref": "#/components/schemas/RestMirroredRepository" - } + "schema": { "$ref": "#/components/schemas/RestRefSyncStatus" } } }, - "description": "The mirrored repository's information." + "description": "The updated synchronization status for the repository, after enabling synchronization. 204 NO CONTENT is returned instead after disabling synchronization." }, - "404": { + "204": { + "description": "Synchronization has successfully been disabled. 200 OK, with updated status information, is returned instead after enabling synchronization." + }, + "400": { "content": { "application/json": { "schema": { @@ -18274,25 +18887,25 @@ } } }, - "description": "The upstream server or the repository could not be found." - } - }, - "summary": "Get clone URLs", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/progress": { - "get": { - "description": " Retrieves synchronization progress state.If there's no progress to report, this resource will return

 {\"discovering\":false,\"syncedRepos\":0,\"totalRepos\":0}
If there are repositories in the process of synchronizing, but the precise number hasn't been discovered yet, this resource will return:
 {\"discovering\":true,\"syncedRepos\":3,\"totalRepos\":100}
If there is progress to report and the total number of repositories is known, this resource will return:
  {\"discovering\":false,\"syncedRepos\":242,\"totalRepos\":1071} 
", - "operationId": "getSynchronizationProgress", - "responses": { - "200": { + "description": "The JSON payload for the request did not define the \"enabled\" property." + }, + "401": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestSyncProgress" } + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } } }, - "description": "the synchronization progress state" + "description": "The currently authenticated user has insufficient permissions to manage synchronization in the specified repository." }, "404": { "content": { @@ -18310,144 +18923,87 @@ } } }, - "description": "The upstream server could not be found." + "description": "The specified repository does not exist." } }, - "summary": "Get synchronization progress state", - "tags": ["Mirroring (Mirror)"] + "summary": "Disable synchronization", + "tags": ["Repository"] } }, - "/mirroring/latest/supportInfo/projects/{projectKey}/repos/{repoSlug}/repoSyncStatus": { - "get": { - "description": "Retrieves information about an external repository mirrored by the mirror server. Particularly the local ID & external ID of the repository", - "operationId": "getRepoSyncStatus_1", + "/sync/latest/projects/{projectKey}/repos/{repositorySlug}/synchronize": { + "post": { + "description": "Allows developers to apply a manual operation to bring a ref back in sync with upstream when it becomes out of sync due to conflicting changes. The following actions are supported:\n\n- MERGE: Merges in commits from the upstream ref. After applying this action, the synchronized ref will be AHEAD (as it still includes commits that do not exist upstream.\n - This action is only supported for DIVERGED refs\n - If a \"commitMessage\" is provided in the context, it will be used on the merge commit. Otherwise a default message is used.\n- DISCARD: Throws away local changes in favour of those made upstream. This is a destructive operation where commits in the local repository are lost.\n - No context entries are supported for this action\n - If the upstream ref has been deleted, the local ref is deleted as well\n - Otherwise, the local ref is updated to reference the same commit as upstream, even if the update is not fast-forward (similar to a forced push)\n\n\nThe authenticated user must have REPO_WRITE permission for the specified repository. Anonymous users cannot synchronize refs, even on public repositories. Additionally, synchronization must be enabled and available for the specified repository.", + "operationId": "synchronize", "parameters": [ { + "description": "The project key.", "in": "path", - "name": "repoSlug", + "name": "projectKey", "required": true, "schema": { "type": "string" } }, { + "description": "The repository slug.", "in": "path", - "name": "projectKey", + "name": "repositorySlug", "required": true, "schema": { "type": "string" } } ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestMirrorRepositorySynchronizationStatus" - } - } - }, - "description": "The sync status of the repository on this node" + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestRefSyncRequest" } + } } }, - "summary": "Gets information about the mirrored repository", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/supportInfo/refChangesQueue": { - "get": { - "description": "Retrieves a list of up to plugin.mirroring.farm.max.ref.change.queue.dump.size items currently in the ref changes queue. The ref changes queue is an internal component of every mirror farm, and is shared between all nodes. When the contents of an upstream repository changes, an item is added to this queue so that the mirror farm nodes know to synchronize. The mirror farm constantly polls and removes items from this queue for processing, so it is empty most of the time.", - "operationId": "getRefChangesQueue", "responses": { "200": { "content": { - "application/json;charset=UTF-8": { - "schema": { "$ref": "#/components/schemas/RestRefSyncQueue" } + "application/json": { + "schema": { "$ref": "#/components/schemas/RestRejectedRef" } } }, - "description": "The contents of the ref changes queue" - } - }, - "summary": "Get items in ref changes queue", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/supportInfo/refChangesQueue/count": { - "get": { - "description": "Retrieves the total number of items currently in the ref changes queue", - "operationId": "getRefChangesQueueCount", - "responses": { - "200": { - "content": { "application/json": {} }, - "description": "The total number of items currently in the ref changes queue" - } - }, - "summary": "Get total number of items in ref changes queue", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/supportInfo/repoSyncStatus": { - "get": { - "description": "Retrieves a page of sync statuses of the repositories on this mirror node", - "operationId": "getRepoSyncStatus", - "parameters": [ - { - "description": "Start number for the page (inclusive). If not passed, first page is assumed.", - "example": 0, - "in": "query", - "name": "start", - "required": false, - "schema": { "type": "number", "example": 0 } + "description": "The requested action was successfully performed, and has updated the ref's state, but the ref if is still not in sync with upstream. For example, after applying the MERGE action, the ref will still be AHEAD of upstream. If the action brings the ref in sync with upstream, 204 NO CONTENT is returned instead." }, - { - "description": "Number of items to return. If not passed, a page size of 25 is used.", - "example": 25, - "in": "query", - "name": "limit", - "required": false, - "schema": { "type": "number", "example": 25 } - } - ], - "responses": { - "200": { + "204": { + "description": "The requested action was successfully performed and the ref is now in sync with upstream. If the action updates the ref but does not bring it in sync with upstream, 200 OK is returned instead." + }, + "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { - "isLastPage": { "type": "boolean" }, - "limit": { "type": "number", "example": 25 }, - "nextPageStart": { "type": "integer", "format": "int32" }, - "size": { "type": "number", "example": 1 }, - "start": { "type": "integer", "format": "int32" }, - "values": { + "errors": { "type": "array", "items": { - "$ref": "#/components/schemas/RestMirrorRepositorySynchronizationStatus" + "$ref": "#/components/schemas/RestErrorMessage" } } } } } }, - "description": "The sync status of the repositories on this node" - } - }, - "summary": "Get sync status of repositories", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/syncSettings": { - "get": { - "description": "Retrieves upstream settings", - "operationId": "getMirrorSettings", - "responses": { - "200": { + "description": "The requested synchronization action was not understood." + }, + "401": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestUpstreamSettings" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } } } }, - "description": "the mirror settings" + "description": "The currently authenticated user has insufficient permissions to update refs within the specified repository." }, "404": { "content": { @@ -18465,35 +19021,27 @@ } } }, - "description": "The upstream server could not be found." - } - }, - "summary": "Get upstream settings", - "tags": ["Mirroring (Mirror)"] - }, - "put": { - "description": "Sets the settings for the specified upstream", - "operationId": "setMirrorSettings", - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestUpstreamSettings" } - } + "description": "The specified repository does not exist." }, - "description": "the mirror settings to update to" - }, - "responses": { - "200": { + "409": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestUpstreamSettings" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } } } }, - "description": "the updated mirror settings" + "description": "Synchronization is not available or enabled for the specified repository, or the ref is already in sync with upstream." }, - "404": { + "501": { "content": { "application/json": { "schema": { @@ -18509,23 +19057,30 @@ } } }, - "description": "The upstream server could not be found." + "description": "The requested synchronization action was understood by the server, but the mechanism to apply it has not been implemented." } }, - "summary": "Update upstream settings", - "tags": ["Mirroring (Mirror)"] + "summary": "Manual synchronization", + "tags": ["Repository"] } }, - "/mirroring/latest/syncSettings/mode": { - "get": { - "description": "Gets the current mirror mode", - "operationId": "getMirrorMode", + "/gpg/latest/keys": { + "delete": { + "description": "Delete all GPG keys for a supplied user.", + "operationId": "deleteForUser", + "parameters": [ + { + "description": "The username of the user to delete the keys for. If no username is specified, the GPG keys will be deleted for the currently authenticated user.", + "in": "query", + "name": "user", + "schema": { "type": "string" } + } + ], "responses": { - "200": { - "content": { "application/json": {} }, - "description": "the current mirror mode" + "204": { + "description": "The GPG keys matching the supplied user were deleted." }, - "404": { + "401": { "content": { "application/json": { "schema": { @@ -18541,24 +19096,9 @@ } } }, - "description": "The upstream server could not be found." - } - }, - "summary": "Get mirror mode", - "tags": ["Mirroring (Mirror)"] - }, - "put": { - "description": "Sets the mirror mode for the specified upstream", - "operationId": "setMirrorMode", - "requestBody": { - "content": { "application/json": { "schema": { "type": "string" } } } - }, - "responses": { - "200": { - "content": { "application/json": {} }, - "description": "the mode to set" + "description": "The currently authenticated user has insufficient permissions to delete the GPG keys. This is only possible when a user is explicitly supplied." }, - "400": { + "404": { "content": { "application/json": { "schema": { @@ -18574,100 +19114,112 @@ } } }, - "description": "The provided mode is invalid" - } - }, - "summary": "Update mirror mode", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/syncSettings/projects": { - "get": { - "description": "Returns the IDs of the projects that the mirror is configured to mirror", - "operationId": "getMirroredProjects", - "responses": { - "200": { - "content": { "application/json": {} }, - "description": "the currently mirrored project IDs" + "description": "No user matches the supplied user." } }, - "summary": "Get mirrored project IDs", - "tags": ["Mirroring (Mirror)"] + "summary": "Delete all GPG keys for user", + "tags": ["Security"] }, - "post": { - "description": "Configures the mirror to mirror the provided projects", - "operationId": "startMirroringProjects", - "requestBody": { - "content": { - "application/json": { - "schema": { "type": "array", "items": { "type": "string" } } - } - } - }, - "responses": { - "200": { - "content": { "application/json": {} }, - "description": "the currently mirrored project IDs" - } - }, - "summary": "Add multiple projects to be mirrored", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/syncSettings/projects/{projectId}": { - "delete": { - "description": "Configures the mirror to no longer mirror the provided project", - "operationId": "stopMirroringProject", + "get": { + "description": "Find all the keys for the currently authenticated user. Optionally, users with ADMIN and higher permissions may choose to specify the user parameter to retrieve GPG keys for another user.\n\nOnly authenticated users may call this endpoint.", + "operationId": "getKeysForUser", "parameters": [ { - "description": "the project ID to stop mirroring", - "in": "path", - "name": "projectId", - "required": true, + "description": "The name of the user to get keys for (optional; requires ADMIN permission or higher).", + "in": "query", + "name": "user", "schema": { "type": "string" } + }, + { + "description": "Start number for the page (inclusive). If not passed, first page is assumed.", + "example": 0, + "in": "query", + "name": "start", + "required": false, + "schema": { "type": "number", "example": 0 } + }, + { + "description": "Number of items to return. If not passed, a page size of 25 is used.", + "example": 25, + "in": "query", + "name": "limit", + "required": false, + "schema": { "type": "number", "example": 25 } } ], "responses": { - "204": { "description": "the request has been processed" } + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "isLastPage": { "type": "boolean" }, + "limit": { "type": "number", "example": 25 }, + "nextPageStart": { "type": "integer", "format": "int32" }, + "size": { "type": "number", "example": 1 }, + "start": { "type": "integer", "format": "int32" }, + "values": { + "type": "array", + "items": { "$ref": "#/components/schemas/RestGpgKey" } + } + } + } + } + }, + "description": "Returns a paged response of of keys for the user." + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to perform this operation." + } }, - "summary": "Stop mirroring project", - "tags": ["Mirroring (Mirror)"] + "summary": "Get all GPG keys", + "tags": ["Security"] }, "post": { - "description": "Configures the mirror to mirror the provided project", - "operationId": "startMirroringProject", + "description": "Add a GPG key to the authenticated user's account. Optionally, users with ADMIN and higher permissions may choose to specify the user parameter to add a GPG key for another user.\n\nOnly authenticated users may call this endpoint.", + "operationId": "addKey", "parameters": [ { - "in": "path", - "name": "projectId", - "required": true, + "description": "The name of the user to add a key for (optional; requires ADMIN permission or higher).", + "in": "query", + "name": "user", "schema": { "type": "string" } } ], - "responses": { - "200": { - "content": { "application/json": {} }, - "description": "the currently mirrored project IDs" - } + "requestBody": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestGpgKey" } + } + }, + "description": "The request body." }, - "summary": "Add project to be mirrored", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/upstreamServer": { - "get": { - "description": "Retrieves upstream server details.", - "operationId": "getUpstreamServer", "responses": { "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestUpstreamServer" } + "schema": { "$ref": "#/components/schemas/RestGpgKey" } } }, - "description": "The upstream server." + "description": "Response contains the GPG key that was just created." }, - "404": { + "400": { "content": { "application/json": { "schema": { @@ -18683,28 +19235,46 @@ } } }, - "description": "The upstream server could not be found" - } - }, - "summary": "Get upstream server", - "tags": ["Mirroring (Mirror)"] - } - }, - "/mirroring/latest/zdu/end": { - "post": { - "description": "Finalizes the ZDU upgrade on the mirror farm denying heterogeneous cluster formation", - "operationId": "endRollingUpgrade", - "responses": { - "200": { + "description": "The request has failed validation." + }, + "401": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestRollingUpgradeState" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } } } }, - "description": "The state of the rolling upgrade which includes the current version on all the nodes in the farm." - }, + "description": "The currently authenticated user has insufficient permissions to perform this operation." + } + }, + "summary": "Create a GPG key", + "tags": ["Security"] + } + }, + "/gpg/latest/keys/{fingerprintOrId}": { + "delete": { + "description": "Delete the GPG key with the specified ID or Key Fingerprint.", + "operationId": "deleteKey", + "parameters": [ + { + "description": "The GPG fingerprint or ID.", + "in": "path", + "name": "fingerprintOrId", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "204": { "description": "The key has been deleted successfully." }, "401": { "content": { "application/json": { @@ -18721,29 +19291,48 @@ } } }, - "description": "When the user doesn't have SYS_ADMIN permission" + "description": "The currently authenticated user has insufficient permissions to perform this operation." } }, - "summary": "End ZDU upgrade on mirror farm", - "tags": ["Mirroring (Mirror)"] + "summary": "Delete a GPG key", + "tags": ["Security"] } }, - "/mirroring/latest/zdu/start": { + "/default-reviewers/latest/projects/{projectKey}/condition": { "post": { - "description": "Enables upgrading of individual nodes within the cluster, allowing a heterogeneous cluster formation", - "operationId": "startRollingUpgrade", + "description": "Create a default reviewer pull request condition for the given project.", + "operationId": "createPullRequestCondition", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestDefaultReviewersRequest" + } + } + }, + "description": "The details needed to create a default reviewer pull request condition." + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestRollingUpgradeState" + "$ref": "#/components/schemas/RestPullRequestCondition" } } }, - "description": "The state of the rolling upgrade which includes the minimum version of all the nodes in the farm." + "description": "The default reviewer pull request condition that was created." }, - "401": { + "400": { "content": { "application/json": { "schema": { @@ -18759,17 +19348,17 @@ } } }, - "description": "When the user doesn't have SYS_ADMIN permission" + "description": "The request was malformed." } }, - "summary": "Start ZDU upgrade on mirror farm", - "tags": ["Mirroring (Mirror)"] + "summary": "Create default reviewer", + "tags": ["Pull Requests"] } }, - "/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions": { - "get": { - "description": "Search for restrictions using the supplied parameters.\n\nThe authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", - "operationId": "getRestrictions_1", + "/default-reviewers/latest/projects/{projectKey}/condition/{id}": { + "delete": { + "description": "Delete the default reviewer pull request condition associated with the given ID.", + "operationId": "deletePullRequestCondition", "parameters": [ { "description": "The project key.", @@ -18779,101 +19368,80 @@ "schema": { "type": "string" } }, { - "description": "Matcher type to filter on", - "in": "query", - "name": "matcherType", - "schema": { - "type": "string", - "enum": ["BRANCH", "PATTERN", "MODEL_CATEGORY", "MODEL_BRANCH"] - } - }, - { - "description": "Matcher id to filter on. Requires the matcherType parameter to be specified also.", - "in": "query", - "name": "matcherId", - "schema": { "type": "string" } - }, - { - "description": "Types of restrictions to filter on.", - "in": "query", - "name": "type", - "schema": { - "type": "string", - "enum": [ - "read-only", - "no-deletes", - "fast-forward-only", - "pull-request-only" - ] - } - }, - { - "description": "The repository slug.", + "description": "The ID of the pull request condition.", "in": "path", - "name": "repositorySlug", + "name": "id", "required": true, "schema": { "type": "string" } - }, - { - "description": "Start number for the page (inclusive). If not passed, first page is assumed.", - "example": 0, - "in": "query", - "name": "start", - "required": false, - "schema": { "type": "number", "example": 0 } - }, - { - "description": "Number of items to return. If not passed, a page size of 25 is used.", - "example": 25, - "in": "query", - "name": "limit", - "required": false, - "schema": { "type": "number", "example": 25 } } ], "responses": { - "200": { + "204": { + "description": "An empty response indicating that the pull request condition was deleted." + }, + "404": { "content": { "application/json": { "schema": { "type": "object", "properties": { - "isLastPage": { "type": "boolean" }, - "limit": { "type": "number", "example": 25 }, - "nextPageStart": { "type": "integer", "format": "int32" }, - "size": { "type": "number", "example": 1 }, - "start": { "type": "integer", "format": "int32" }, - "values": { + "errors": { "type": "array", "items": { - "$ref": "#/components/schemas/RestRefRestriction" + "$ref": "#/components/schemas/RestErrorMessage" } } } } } }, - "description": "A response containing a page of restrictions." + "description": "An empty response indicating a pull request condition with the given ID could not be found." + } + }, + "summary": "Remove default reviewer", + "tags": ["Pull Requests"] + }, + "put": { + "description": "Update the default reviewer pull request condition for the given ID.", + "operationId": "updatePullRequestCondition", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } }, - "400": { + { + "description": "The ID of the pull request condition.", + "in": "path", + "name": "id", + "required": true, + "schema": { "type": "string" } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RestDefaultReviewersRequest" + } + } + }, + "description": "The new details for the default reviewer pull request condition." + }, + "responses": { + "200": { "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } + "$ref": "#/components/schemas/RestPullRequestCondition" } } }, - "description": "The request has failed validation." + "description": "The updated default reviewer pull request condition." }, - "401": { + "400": { "content": { "application/json": { "schema": { @@ -18889,33 +19457,49 @@ } } }, - "description": "The currently authenticated user is not permitted to get restrictions on the provided project" - }, - "404": { + "description": "The request was malformed" + } + }, + "summary": "Update the default reviewer", + "tags": ["Pull Requests"] + } + }, + "/default-reviewers/latest/projects/{projectKey}/conditions": { + "get": { + "description": "Return a page of default reviewer pull request conditions that have been configured for this project.", + "operationId": "getPullRequestConditions", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } + "type": "array", + "items": { + "$ref": "#/components/schemas/RestPullRequestCondition" } } } }, - "description": "No restriction exists for the provided ID." + "description": "The default reviewer pull request conditions associated with the given project." } }, - "summary": "Search for ref restrictions", - "tags": ["Repository"] - }, + "summary": "Get default reviewers", + "tags": ["Pull Requests"] + } + }, + "/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition": { "post": { - "description": "Allows creating multiple restrictions at once.", - "operationId": "createRestrictions_1", + "description": "Create a default reviewer pull request condition for the given repository.", + "operationId": "createPullRequestCondition_1", "parameters": [ { "description": "The project key.", @@ -18934,45 +19518,26 @@ ], "requestBody": { "content": { - "application/vnd.atl.bitbucket.bulk+json": { + "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestRestrictionRequest" - } + "$ref": "#/components/schemas/RestDefaultReviewersRequest" } } }, - "description": "The request containing a list of the details of the restrictions to create." + "description": "The details needed to create a default reviewer pull request condition." }, "responses": { "200": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestRefRestriction" } - } - }, - "description": "Response contains the ref restriction that was just created." - }, - "400": { "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } + "$ref": "#/components/schemas/RestPullRequestCondition" } } }, - "description": "The request has failed validation." + "description": "The default reviewer pull request condition that was created." }, - "401": { + "400": { "content": { "application/json": { "schema": { @@ -18988,17 +19553,17 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to perform this operation." + "description": "The request was malformed." } }, - "summary": "Create multiple ref restrictions", - "tags": ["Repository"] + "summary": "Create default reviewers condition", + "tags": ["Pull Requests"] } }, - "/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}": { + "/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/condition/{id}": { "delete": { - "description": "Deletes a restriction as specified by a restriction id.\n\nThe authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", - "operationId": "deleteRestriction_1", + "description": "Delete the default reviewer pull request condition associated with the given ID.", + "operationId": "deletePullRequestCondition_1", "parameters": [ { "description": "The project key.", @@ -19008,11 +19573,10 @@ "schema": { "type": "string" } }, { - "description": "The restriction id.", "in": "path", "name": "id", "required": true, - "schema": { "type": "string" } + "schema": { "type": "integer", "format": "int32" } }, { "description": "The repository slug.", @@ -19024,27 +19588,9 @@ ], "responses": { "204": { - "description": "An empty response indicating that the operation was successful" - }, - "400": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The request has failed validation." + "description": "An empty response indicating that the pull request condition was deleted" }, - "401": { + "404": { "content": { "application/json": { "schema": { @@ -19060,15 +19606,15 @@ } } }, - "description": "The currently authenticated user is not permitted to delete restrictions on the provided project" + "description": "An empty response indicating a pull request condition with the given ID could not be found." } }, - "summary": "Delete a ref restriction", - "tags": ["Repository"] + "summary": "Delete a default reviewer condition", + "tags": ["Pull Requests"] }, - "get": { - "description": "Returns a restriction as specified by a restriction id. \n\nThe authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", - "operationId": "getRestriction_1", + "put": { + "description": "Update the default reviewer pull request condition for the given ID.", + "operationId": "updatePullRequestCondition_1", "parameters": [ { "description": "The project key.", @@ -19078,7 +19624,7 @@ "schema": { "type": "string" } }, { - "description": "The restriction id.", + "description": "The ID of the pull request condition", "in": "path", "name": "id", "required": true, @@ -19092,14 +19638,84 @@ "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "requiredApprovals": { + "type": "integer", + "format": "int32", + "example": 1 + }, + "reviewers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestApplicationUser" + } + }, + "sourceMatcher": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "main" }, + "id": { "type": "string", "example": "refs/heads/main" }, + "type": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "ANY_REF", + "BRANCH", + "PATTERN", + "MODEL_CATEGORY", + "MODEL_BRANCH" + ] + }, + "name": { "type": "string", "example": "Branch" } + } + } + } + }, + "targetMatcher": { + "type": "object", + "properties": { + "displayId": { "type": "string", "example": "main" }, + "id": { "type": "string", "example": "refs/heads/main" }, + "type": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "ANY_REF", + "BRANCH", + "PATTERN", + "MODEL_CATEGORY", + "MODEL_BRANCH" + ] + }, + "name": { "type": "string", "example": "Branch" } + } + } + } + } + } + } + } + } + }, "responses": { "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestRefRestriction" } + "schema": { + "$ref": "#/components/schemas/RestPullRequestCondition" + } } }, - "description": "A response containing the restriction." + "description": "The updated default reviewer pull request condition." }, "400": { "content": { @@ -19117,53 +19733,127 @@ } } }, - "description": "The request has failed validation." + "description": "The request was malformed." + } + }, + "summary": "Update a default reviewer condition", + "tags": ["Pull Requests"] + } + }, + "/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditions": { + "get": { + "description": "Return a page of default reviewer pull request conditions that have been configured for this repository.", + "operationId": "getPullRequestConditions_1", + "parameters": [ + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestPullRequestCondition" + } + } + } + }, + "description": "The default reviewer pull request conditions associated with the given repository." + } + }, + "summary": "Get configured default reviewers", + "tags": ["Pull Requests"] + } + }, + "/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/reviewers": { + "get": { + "description": "Return a set of users who are required reviewers for pull requests created from the given source repository and ref to the given target ref in this repository.", + "operationId": "getReviewers", + "parameters": [ + { + "description": "The ID of the repository in which the target ref exists", + "in": "query", + "name": "targetRepoId", + "schema": { "type": "string" } + }, + { + "description": "The project key.", + "in": "path", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The ID of the repository in which the source ref exists", + "in": "query", + "name": "sourceRepoId", + "schema": { "type": "string" } + }, + { + "description": "The ID of the source ref", + "in": "query", + "name": "sourceRefId", + "schema": { "type": "string" } }, - "401": { + { + "description": "The ID of the target ref", + "in": "query", + "name": "targetRefId", + "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } + "type": "array", + "items": { + "$ref": "#/components/schemas/RestPullRequestCondition" } } } }, - "description": "The currently authenticated user is not permitted to get restrictions on the provided project" + "description": "The default reviewer pull request conditions associated with the given repository." }, - "404": { + "400": { "content": { "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } + "schema": { "$ref": "#/components/schemas/RestErrors" } } }, - "description": "No restriction exists for the provided ID." + "description": "The request was malformed." } }, - "summary": "Get a ref restriction", - "tags": ["Repository"] + "summary": "Get required reviewers for PR creation", + "tags": ["Pull Requests"] } }, - "/branch-permissions/latest/projects/{projectKey}/restrictions": { + "/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions": { "get": { - "description": "Search for restrictions using the supplied parameters.\n\nThe authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", - "operationId": "getRestrictions", + "description": "Search for restrictions using the supplied parameters.\n\nThe authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", + "operationId": "getRestrictions_1", "parameters": [ { "description": "The project key.", @@ -19201,6 +19891,13 @@ ] } }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } + }, { "description": "Start number for the page (inclusive). If not passed, first page is assumed.", "example": 0, @@ -19298,11 +19995,11 @@ } }, "summary": "Search for ref restrictions", - "tags": ["Project"] + "tags": ["Repository"] }, "post": { "description": "Allows creating multiple restrictions at once.", - "operationId": "createRestrictions", + "operationId": "createRestrictions_1", "parameters": [ { "description": "The project key.", @@ -19310,6 +20007,13 @@ "name": "projectKey", "required": true, "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } } ], "requestBody": { @@ -19372,13 +20076,13 @@ } }, "summary": "Create multiple ref restrictions", - "tags": ["Project"] + "tags": ["Repository"] } }, - "/branch-permissions/latest/projects/{projectKey}/restrictions/{id}": { + "/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}": { "delete": { - "description": "Deletes a restriction as specified by a restriction id.\n\nThe authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", - "operationId": "deleteRestriction", + "description": "Deletes a restriction as specified by a restriction id.\n\nThe authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", + "operationId": "deleteRestriction_1", "parameters": [ { "description": "The project key.", @@ -19393,6 +20097,13 @@ "name": "id", "required": true, "schema": { "type": "string" } + }, + { + "description": "The repository slug.", + "in": "path", + "name": "repositorySlug", + "required": true, + "schema": { "type": "string" } } ], "responses": { @@ -19437,11 +20148,11 @@ } }, "summary": "Delete a ref restriction", - "tags": ["Project"] + "tags": ["Repository"] }, "get": { - "description": "Returns a restriction as specified by a restriction id.\n\nThe authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", - "operationId": "getRestriction", + "description": "Returns a restriction as specified by a restriction id. \n\nThe authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", + "operationId": "getRestriction_1", "parameters": [ { "description": "The project key.", @@ -19456,161 +20167,6 @@ "name": "id", "required": true, "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestRefRestriction" } - } - }, - "description": "A response containing the restriction." - }, - "400": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The request has failed validation." - }, - "401": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The currently authenticated user is not permitted to get restrictions on the provided project" - }, - "404": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "No restriction exists for the provided ID." - } - }, - "summary": "Get a ref restriction", - "tags": ["Project"] - } - }, - "/sync/latest/projects/{projectKey}/repos/{repositorySlug}": { - "get": { - "description": "Retrieves the synchronization status for the specified repository. In addition to listing refs which cannot be synchronized, if any, the status also provides the timestamp for the most recent synchronization and indicates whether synchronization is available and enabled. If \"?at\" is specified in the URL, the synchronization status for the specified ref is returned, rather than the complete repository status.\n\nThe authenticated user must have REPO_READ permission for the repository, or it must be public if the request is anonymous. Additionally, after synchronization is enabled for a repository, meaning synchronization was available at that time, permission changes and other actions can cause it to become unavailable. Even when synchronization is enabled, if it is no longer available for the repository it will not be performed.", - "operationId": "getStatus", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "Retrieves the synchronization status for the specified ref within the repository, rather than for the entire repository", - "in": "query", - "name": "at", - "schema": { "type": "string" } - }, - { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestRefSyncStatus" } - } - }, - "description": "Synchronization status for the specified repository, or specific ref within that repository." - }, - "401": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The currently authenticated user has insufficient permissions to view the repository, or the repository is not public if the request is anonymous." - }, - "404": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The specified repository does not exist." - } - }, - "summary": "Get synchronization status", - "tags": ["Repository"] - }, - "post": { - "description": "Enables or disables synchronization for the specified repository. When synchronization is enabled, branches within the repository are immediately synchronized and the status is updated with the outcome. That initial synchronization is performed before the REST request returns, allowing it to return the updated status.\n\nThe authenticated user must have REPO_ADMIN permission for the specified repository. Anonymous users cannot manage synchronization, even on public repositories. Additionally, synchronization must be available for the specified repository. Synchronization is only available if:\n\n- The repository is a fork, since its origin is used as upstream\n- The owning user still has access to the fork's origin, if the repository is a personalfork", - "operationId": "setEnabled", - "parameters": [ - { - "description": "The project key.", - "in": "path", - "name": "projectKey", - "required": true, - "schema": { "type": "string" } }, { "description": "The repository slug.", @@ -19620,24 +20176,14 @@ "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestRefSyncStatus" } - } - } - }, "responses": { "200": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RestRefSyncStatus" } + "schema": { "$ref": "#/components/schemas/RestRefRestriction" } } }, - "description": "The updated synchronization status for the repository, after enabling synchronization. 204 NO CONTENT is returned instead after disabling synchronization." - }, - "204": { - "description": "Synchronization has successfully been disabled. 200 OK, with updated status information, is returned instead after enabling synchronization." + "description": "A response containing the restriction." }, "400": { "content": { @@ -19655,7 +20201,7 @@ } } }, - "description": "The JSON payload for the request did not define the \"enabled\" property." + "description": "The request has failed validation." }, "401": { "content": { @@ -19673,7 +20219,7 @@ } } }, - "description": "The currently authenticated user has insufficient permissions to manage synchronization in the specified repository." + "description": "The currently authenticated user is not permitted to get restrictions on the provided project" }, "404": { "content": { @@ -19691,17 +20237,17 @@ } } }, - "description": "The specified repository does not exist." + "description": "No restriction exists for the provided ID." } }, - "summary": "Disable synchronization", + "summary": "Get a ref restriction", "tags": ["Repository"] } }, - "/sync/latest/projects/{projectKey}/repos/{repositorySlug}/synchronize": { - "post": { - "description": "Allows developers to apply a manual operation to bring a ref back in sync with upstream when it becomes out of sync due to conflicting changes. The following actions are supported:\n\n- MERGE: Merges in commits from the upstream ref. After applying this action, the synchronized ref will be AHEAD (as it still includes commits that do not exist upstream.\n - This action is only supported for DIVERGED refs\n - If a \"commitMessage\" is provided in the context, it will be used on the merge commit. Otherwise a default message is used.\n- DISCARD: Throws away local changes in favour of those made upstream. This is a destructive operation where commits in the local repository are lost.\n - No context entries are supported for this action\n - If the upstream ref has been deleted, the local ref is deleted as well\n - Otherwise, the local ref is updated to reference the same commit as upstream, even if the update is not fast-forward (similar to a forced push)\n\n\nThe authenticated user must have REPO_WRITE permission for the specified repository. Anonymous users cannot synchronize refs, even on public repositories. Additionally, synchronization must be enabled and available for the specified repository.", - "operationId": "synchronize", + "/branch-permissions/latest/projects/{projectKey}/restrictions": { + "get": { + "description": "Search for restrictions using the supplied parameters.\n\nThe authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", + "operationId": "getRestrictions", "parameters": [ { "description": "The project key.", @@ -19711,223 +20257,33 @@ "schema": { "type": "string" } }, { - "description": "The repository slug.", - "in": "path", - "name": "repositorySlug", - "required": true, - "schema": { "type": "string" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestRefSyncRequest" } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/RestRejectedRef" } - } - }, - "description": "The requested action was successfully performed, and has updated the ref's state, but the ref if is still not in sync with upstream. For example, after applying the MERGE action, the ref will still be AHEAD of upstream. If the action brings the ref in sync with upstream, 204 NO CONTENT is returned instead." - }, - "204": { - "description": "The requested action was successfully performed and the ref is now in sync with upstream. If the action updates the ref but does not bring it in sync with upstream, 200 OK is returned instead." - }, - "400": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The requested synchronization action was not understood." - }, - "401": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The currently authenticated user has insufficient permissions to update refs within the specified repository." - }, - "404": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The specified repository does not exist." - }, - "409": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "Synchronization is not available or enabled for the specified repository, or the ref is already in sync with upstream." - }, - "501": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The requested synchronization action was understood by the server, but the mechanism to apply it has not been implemented." - } - }, - "summary": "Manual synchronization", - "tags": ["Repository"] - } - }, - "/jira/latest/comments/{commentId}/issues": { - "post": { - "description": "Create a Jira issue and associate it with a comment on a pull request.\n\nThis resource can only be used with comments on a pull request. Attempting to call this resource with a different type of comment (for example, a comment on a commit) will result in an error. \n\n The authenticated user must have REPO_READ permission for the repository containing the comment to call this resource.\n\nThe JSON structure for the create issue format is specified by Jira's REST v2 API.", - "operationId": "createIssue", - "parameters": [ - { - "description": "the comment to associate the created Jira issue to", - "in": "path", - "name": "commentId", - "required": true, - "schema": { "type": "string" } - }, - { - "description": "id of the Jira server", + "description": "Matcher type to filter on", "in": "query", - "name": "applicationId", - "schema": { "type": "string" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { "type": "string", "description": "application/json" } + "name": "matcherType", + "schema": { + "type": "string", + "enum": ["BRANCH", "PATTERN", "MODEL_CATEGORY", "MODEL_BRANCH"] } }, - "description": "A String representation of the JSON format Jira create issue request see: Jira REST API" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RestCommentJiraIssue" - } - } - }, - "description": "The created Jira issue key and the associated comment ID" - }, - "400": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "The specified application link ID does not match any linked Jira instance." - }, - "401": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RestErrorMessage" - } - } - } - } - } - }, - "description": "Authentication with the Jira instance is required." - } - }, - "summary": "Create Jira Issue", - "tags": ["Jira Integration"] - } - }, - "/jira/latest/issues/{issueKey}/commits": { - "get": { - "description": "Retrieve a page of changesets associated with the given issue key.", - "operationId": "getCommitsByIssueKey", - "parameters": [ { - "description": "The issue key to search by", - "in": "path", - "name": "issueKey", - "required": true, + "description": "Matcher id to filter on. Requires the matcherType parameter to be specified also.", + "in": "query", + "name": "matcherId", "schema": { "type": "string" } }, { - "description": "The maximum number of changes to retrieve for each changeset", + "description": "Types of restrictions to filter on.", "in": "query", - "name": "maxChanges", - "schema": { "type": "string" } + "name": "type", + "schema": { + "type": "string", + "enum": [ + "read-only", + "no-deletes", + "fast-forward-only", + "pull-request-only" + ] + } }, { "description": "Start number for the page (inclusive). If not passed, first page is assumed.", @@ -19960,71 +20316,228 @@ "start": { "type": "integer", "format": "int32" }, "values": { "type": "array", - "items": { "$ref": "#/components/schemas/RestChangeset" } + "items": { + "$ref": "#/components/schemas/RestRefRestriction" + } } } } } }, - "description": "A page of detailed changesets" + "description": "A response containing a page of restrictions." + }, + "400": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The request has failed validation." + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user is not permitted to get restrictions on the provided project" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "No restriction exists for the provided ID." } }, - "summary": "Get changesets for issue key", - "tags": ["Jira Integration"] - } - }, - "/jira/latest/projects/{projectKey}/primary-enhanced-entitylink": { - "get": { - "description": "Retrieves the enchanced primary entitylink \n\nThe authenticated user must have PROJECT_READ permission for the project having the primary enhanced entitylink. \n\n", - "operationId": "getEnhancedEntityLinkForProject", + "summary": "Search for ref restrictions", + "tags": ["Project"] + }, + "post": { + "description": "Allows creating multiple restrictions at once.", + "operationId": "createRestrictions", "parameters": [ { - "description": "The project key", + "description": "The project key.", "in": "path", "name": "projectKey", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/vnd.atl.bitbucket.bulk+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestRestrictionRequest" + } + } + } + }, + "description": "The request containing a list of the details of the restrictions to create." + }, "responses": { "200": { + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestRefRestriction" } + } + }, + "description": "Response contains the ref restriction that was just created." + }, + "400": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RestEnhancedEntityLink" + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } } } }, - "description": "The primary enhanced entitylink." + "description": "The request has failed validation." + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user has insufficient permissions to perform this operation." } }, - "summary": "Get entity link", - "tags": ["Jira Integration"] + "summary": "Create multiple ref restrictions", + "tags": ["Project"] } }, - "/jira/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/issues": { - "get": { - "description": "Retrieves Jira issue keys that are associated with the commits in the specified pull request. The number of commits checked for issues is limited to a default of 100.", - "operationId": "getIssueKeysForPullRequest", + "/branch-permissions/latest/projects/{projectKey}/restrictions/{id}": { + "delete": { + "description": "Deletes a restriction as specified by a restriction id.\n\nThe authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", + "operationId": "deleteRestriction", "parameters": [ { - "description": "The project key", + "description": "The project key.", "in": "path", "name": "projectKey", "required": true, "schema": { "type": "string" } }, { - "description": "The pull request id", + "description": "The restriction id.", "in": "path", - "name": "pullRequestId", + "name": "id", "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "204": { + "description": "An empty response indicating that the operation was successful" + }, + "400": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The request has failed validation." }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user is not permitted to delete restrictions on the provided project" + } + }, + "summary": "Delete a ref restriction", + "tags": ["Project"] + }, + "get": { + "description": "Returns a restriction as specified by a restriction id.\n\nThe authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.", + "operationId": "getRestriction", + "parameters": [ { - "description": "The repository slug", + "description": "The project key.", "in": "path", - "name": "repositorySlug", + "name": "projectKey", + "required": true, + "schema": { "type": "string" } + }, + { + "description": "The restriction id.", + "in": "path", + "name": "id", "required": true, "schema": { "type": "string" } } @@ -20032,18 +20545,69 @@ "responses": { "200": { "content": { - "application/json;charset=UTF-8": { + "application/json": { + "schema": { "$ref": "#/components/schemas/RestRefRestriction" } + } + }, + "description": "A response containing the restriction." + }, + "400": { + "content": { + "application/json": { "schema": { - "type": "array", - "items": { "$ref": "#/components/schemas/RestJiraIssue" } + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } } } }, - "description": "A list of Jira issues keys for the pull request" + "description": "The request has failed validation." + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "The currently authenticated user is not permitted to get restrictions on the provided project" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RestErrorMessage" + } + } + } + } + } + }, + "description": "No restriction exists for the provided ID." } }, - "summary": "Get issues for a pull request", - "tags": ["Jira Integration"] + "summary": "Get a ref restriction", + "tags": ["Project"] } }, "/admin": { @@ -50938,12 +51502,17 @@ } }, { - "description": "(optional) if specified, it must be a valid repository state name and will limit the resulting repository list to ones that are in the specified state. The currently supported explicit state values are AVAILABLE, INITIALISING and INITIALISATION_FAILED.
Available since 5.13", + "description": "(optional) if specified, it must be a valid repository state name and will limit the resulting repository list to ones that are in the specified state. The currently supported explicit state values are AVAILABLE, INITIALISING, INITIALISATION_FAILED and OFFLINE.
Available since 5.13", "in": "query", "name": "state", "schema": { "type": "string", - "enum": ["AVAILABLE", "INITIALISING", "INITIALISATION_FAILED"] + "enum": [ + "AVAILABLE", + "INITIALISING", + "INITIALISATION_FAILED", + "OFFLINE" + ] } }, {