@coderabbitai/bitbucket
Version:
CodeRabbit's TypeScript API client for connecting to Bitbucket Cloud and Bitbucket Data Center
1,132 lines (1,131 loc) • 1.25 MB
TypeScript
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
readonly "/addon": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
readonly get?: never;
/**
* Update an installed app
* @description Updates the application installation for the user.
*
* This endpoint is intended to be used by Bitbucket Connect apps
* and only supports JWT authentication -- that is how Bitbucket
* identifies the particular installation of the app. Developers
* with applications registered in the "Develop Apps" section
* of Bitbucket need not use this endpoint as updates for those
* applications can be sent out via the UI of that section.
*
* Passing an empty body will update the installation using the
* existing descriptor URL.
*
* ```
* $ curl -X PUT https://api.bitbucket.org/2.0/addon \
* -H "Authorization: JWT <JWT Token>" \
* --header "Content-Type: application/json" \
* --data '{}'
* ```
*
* The new `descriptor` for the installation can be also provided
* in the body directly.
*
* ```
* $ curl -X PUT https://api.bitbucket.org/2.0/addon \
* -H "Authorization: JWT <JWT Token>" \
* --header "Content-Type: application/json" \
* --data '{"descriptor": $NEW_DESCRIPTOR}'
* ```
*
* In both these modes the URL of the descriptor cannot be changed. To
* change the descriptor location and upgrade an installation
* the request must be made exclusively with a `descriptor_url`.
*
* ```
* $ curl -X PUT https://api.bitbucket.org/2.0/addon \
* -H "Authorization: JWT <JWT Token>" \
* --header "Content-Type: application/json" \
* --data '{"descriptor_url": $NEW_URL}'
* ```
*
* The `descriptor_url` must exactly match the marketplace registration
* that Atlassian has for the application. Contact your Atlassian
* developer advocate to update this registration. Once the registration
* has been updated you may call this resource for each installation.
*
* Note that the scopes of the application cannot be increased
* in the new descriptor nor reduced to none.
*/
readonly put: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Request has succeeded. The installation has been updated to the new descriptor. */
readonly 204: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Scopes have increased or decreased to none. */
readonly 400: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description No authorization. */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description Improper authentication. */
readonly 403: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly post?: never;
/**
* Delete an app
* @description Deletes the application for the user.
*
* This endpoint is intended to be used by Bitbucket Connect apps
* and only supports JWT authentication -- that is how Bitbucket
* identifies the particular installation of the app. Developers
* with applications registered in the "Develop Apps" section
* of Bitbucket Marketplace need not use this endpoint as
* updates for those applications can be sent out via the
* UI of that section.
*
* ```
* $ curl -X DELETE https://api.bitbucket.org/2.0/addon \
* -H "Authorization: JWT <JWT Token>"
* ```
*/
readonly delete: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Request has succeeded. The application has been deleted for the user. */
readonly 204: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description No authorization. */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description Improper authentication. */
readonly 403: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/addon/linkers": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
/**
* List linkers for an app
* @description Gets a list of all [linkers](/cloud/bitbucket/modules/linker/)
* for the authenticated application.
*/
readonly get: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Successful. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Authentication must use app JWT */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly put?: never;
readonly post?: never;
readonly delete?: never;
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/addon/linkers/{linker_key}": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
};
readonly cookie?: never;
};
/**
* Get a linker for an app
* @description Gets a [linker](/cloud/bitbucket/modules/linker/) specified by `linker_key`
* for the authenticated application.
*/
readonly get: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Successful. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Authentication must use app JWT */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description The linker does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly put?: never;
readonly post?: never;
readonly delete?: never;
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/addon/linkers/{linker_key}/values": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
};
readonly cookie?: never;
};
/**
* List linker values for a linker
* @description Gets a list of all [linker](/cloud/bitbucket/modules/linker/) values for the
* specified linker of the authenticated application.
*
* A linker value lets applications supply values to modify its regular expression.
*
* The base regular expression must use a Bitbucket-specific match group `(?K)`
* which will be translated to `([\w\-]+)`. A value must match this pattern.
*
* [Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)
*/
readonly get: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Successful. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Authentication must use app JWT */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description The linker does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
/**
* Update a linker value
* @description Bulk update [linker](/cloud/bitbucket/modules/linker/) values for the specified
* linker of the authenticated application.
*
* A linker value lets applications supply values to modify its regular expression.
*
* The base regular expression must use a Bitbucket-specific match group `(?K)`
* which will be translated to `([\w\-]+)`. A value must match this pattern.
*
* [Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)
*/
readonly put: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Successfully updated the linker values. */
readonly 204: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Invalid input. */
readonly 400: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description Authentication must use app JWT */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description The linker does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
/**
* Create a linker value
* @description Creates a [linker](/cloud/bitbucket/modules/linker/) value for the specified
* linker of authenticated application.
*
* A linker value lets applications supply values to modify its regular expression.
*
* The base regular expression must use a Bitbucket-specific match group `(?K)`
* which will be translated to `([\w\-]+)`. A value must match this pattern.
*
* [Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)
*/
readonly post: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Successfully created the linker value. */
readonly 201: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Authentication must use app JWT */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description The linker does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description The linker already has the value being added. */
readonly 409: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
/**
* Delete all linker values
* @description Delete all [linker](/cloud/bitbucket/modules/linker/) values for the
* specified linker of the authenticated application.
*/
readonly delete: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Successfully deleted the linker values. */
readonly 204: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Authentication must use app JWT */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description The linker does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/addon/linkers/{linker_key}/values/{value_id}": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
/** @description The numeric ID of the linker value. */
readonly value_id: number;
};
readonly cookie?: never;
};
/**
* Get a linker value
* @description Get a single [linker](/cloud/bitbucket/modules/linker/) value
* of the authenticated application.
*/
readonly get: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
/** @description The numeric ID of the linker value. */
readonly value_id: number;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Successful. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Authentication must use app JWT */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description The linker value does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly put?: never;
readonly post?: never;
/**
* Delete a linker value
* @description Delete a single [linker](/cloud/bitbucket/modules/linker/) value
* of the authenticated application.
*/
readonly delete: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
* as defined in an application descriptor. */
readonly linker_key: string;
/** @description The numeric ID of the linker value. */
readonly value_id: number;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Successfully deleted the linker value. */
readonly 204: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description Authentication must use app JWT */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description The linker value does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/hook_events": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
/**
* Get a webhook resource
* @description Returns the webhook resource or subject types on which webhooks can
* be registered.
*
* Each resource/subject type contains an `events` link that returns the
* paginated list of specific events each individual subject type can
* emit.
*
* This endpoint is publicly accessible and does not require
* authentication or scopes.
*/
readonly get: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description A mapping of resource/subject types pointing to their individual event types. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["subject_types"];
};
};
};
};
readonly put?: never;
readonly post?: never;
readonly delete?: never;
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/hook_events/{subject_type}": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description A resource or subject type. */
readonly subject_type: "repository" | "workspace";
};
readonly cookie?: never;
};
/**
* List subscribable webhook types
* @description Returns a paginated list of all valid webhook events for the
* specified entity.
* **The team and user webhooks are deprecated, and you should use workspace instead.
* For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).**
*
* This is public data that does not require any scopes or authentication.
*
* NOTE: The example response is a truncated response object for the `workspace` `subject_type`.
* We return the same structure for the other `subject_type` objects.
*/
readonly get: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description A resource or subject type. */
readonly subject_type: "repository" | "workspace";
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description A paginated list of webhook types available to subscribe on. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["paginated_hook_events"];
};
};
/** @description If an invalid `{subject_type}` value was specified. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly put?: never;
readonly post?: never;
readonly delete?: never;
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/repositories": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
/**
* List public repositories
* @description Returns a paginated list of all public repositories.
*
* This endpoint also supports filtering and sorting of the results. See
* [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details.
*/
readonly get: {
readonly parameters: {
readonly query?: {
/** @description Filter the results to include only repositories created on or
* after this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)
* timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ` */
readonly after?: string;
/** @description Query string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).
* `role` parameter must also be specified.
* */
readonly q?: string;
/** @description Filters the result based on the authenticated user's role on each repository.
*
* * **member**: returns repositories to which the user has explicit read access
* * **contributor**: returns repositories to which the user has explicit write access
* * **admin**: returns repositories to which the user has explicit administrator access
* * **owner**: returns all repositories owned by the current user
* */
readonly role?: "admin" | "contributor" | "member" | "owner";
/** @description Field by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).
* */
readonly sort?: string;
};
readonly header?: never;
readonly path?: never;
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description All public repositories. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["paginated_repositories"];
};
};
};
};
readonly put?: never;
readonly post?: never;
readonly delete?: never;
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/repositories/{workspace}": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description This can either be the workspace ID (slug) or the workspace UUID
* surrounded by curly-braces, for example: `{workspace UUID}`.
* */
readonly workspace: string;
};
readonly cookie?: never;
};
/**
* List repositories in a workspace
* @description Returns a paginated list of all repositories owned by the specified
* workspace.
*
* The result can be narrowed down based on the authenticated user's role.
*
* E.g. with `?role=contributor`, only those repositories that the
* authenticated user has write access to are returned (this includes any
* repo the user is an admin on, as that implies write access).
*
* This endpoint also supports filtering and sorting of the results. See
* [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details.
*/
readonly get: {
readonly parameters: {
readonly query?: {
/** @description
* Query string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).
* */
readonly q?: string;
/** @description
* Filters the result based on the authenticated user's role on each repository.
*
* * **member**: returns repositories to which the user has explicit read access
* * **contributor**: returns repositories to which the user has explicit write access
* * **admin**: returns repositories to which the user has explicit administrator access
* * **owner**: returns all repositories owned by the current user
* */
readonly role?: "admin" | "contributor" | "member" | "owner";
/** @description
* Field by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).
* */
readonly sort?: string;
};
readonly header?: never;
readonly path: {
/** @description This can either be the workspace ID (slug) or the workspace UUID
* surrounded by curly-braces, for example: `{workspace UUID}`.
* */
readonly workspace: string;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description The repositories owned by the specified account. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["paginated_repositories"];
};
};
/** @description If the specified account does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description If the specified account marked as spam. */
readonly 410: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly put?: never;
readonly post?: never;
readonly delete?: never;
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/repositories/{workspace}/{repo_slug}": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description This can either be the repository slug or the UUID of the repository,
* surrounded by curly-braces, for example: `{repository UUID}`.
* */
readonly repo_slug: string;
/** @description This can either be the workspace ID (slug) or the workspace UUID
* surrounded by curly-braces, for example: `{workspace UUID}`.
* */
readonly workspace: string;
};
readonly cookie?: never;
};
/**
* Get a repository
* @description Returns the object describing this repository.
*/
readonly get: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description This can either be the repository slug or the UUID of the repository,
* surrounded by curly-braces, for example: `{repository UUID}`.
* */
readonly repo_slug: string;
/** @description This can either be the workspace ID (slug) or the workspace UUID
* surrounded by curly-braces, for example: `{workspace UUID}`.
* */
readonly workspace: string;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description The repository object. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["repository"];
};
};
/** @description If the repository is private and the authenticated user does not have access to it. */
readonly 403: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description If no repository exists at this location. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
/**
* Update a repository
* @description Since this endpoint can be used to both update and to create a
* repository, the request body depends on the intent.
*
* #### Creation
*
* See the POST documentation for the repository endpoint for an example
* of the request body.
*
* #### Update
*
* Note: Changing the `name` of the repository will cause the location to
* be changed. This is because the URL of the repo is derived from the
* name (a process called slugification). In such a scenario, it is
* possible for the request to fail if the newly created slug conflicts
* with an existing repository's slug. But if there is no conflict,
* the new location will be returned in the `Location` header of the
* response.
*/
readonly put: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description This can either be the repository slug or the UUID of the repository,
* surrounded by curly-braces, for example: `{repository UUID}`.
* */
readonly repo_slug: string;
/** @description This can either be the workspace ID (slug) or the workspace UUID
* surrounded by curly-braces, for example: `{workspace UUID}`.
* */
readonly workspace: string;
};
readonly cookie?: never;
};
/** @description The repository that is to be updated.
*
* Note that the elements "owner" and "full_name" are ignored since the
* URL implies them.
* */
readonly requestBody?: {
readonly content: {
readonly "application/json": components["schemas"]["repository"];
};
};
readonly responses: {
/** @description The existing repository has been updated */
readonly 200: {
headers: {
/** @description The location of the repository. This header is only
* provided when the repository's name is changed. */
readonly Location?: string;
readonly [name: string]: unknown;
};
content: {
readonly "application/json": components["schemas"]["repository"];
};
};
/** @description A new repository has been created */
readonly 201: {
headers: {
/** @description The location of the newly created repository */
readonly Location?: string;
readonly [name: string]: unknown;
};
content: {
readonly "application/json": components["schemas"]["repository"];
};
};
/** @description If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account. */
readonly 400: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description If the request was not authenticated. */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
/**
* Create a repository
* @description Creates a new repository.
*
* Note: In order to set the project for the newly created repository,
* pass in either the project key or the project UUID as part of the
* request body as shown in the examples below:
*
* ```
* $ curl -X POST -H "Content-Type: application/json" -d '{
* "scm": "git",
* "project": {
* "key": "MARS"
* }
* }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
* ```
*
* or
*
* ```
* $ curl -X POST -H "Content-Type: application/json" -d '{
* "scm": "git",
* "project": {
* "key": "{ba516952-992a-4c2d-acbd-17d502922f96}"
* }
* }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
* ```
*
* The project must be assigned for all repositories. If the project is not provided,
* the repository is automatically assigned to the oldest project in the workspace.
*
* Note: In the examples above, the workspace ID `teamsinspace`,
* and/or the repository name `hablanding` can be replaced by UUIDs.
*/
readonly post: {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description This can either be the repository slug or the UUID of the repository,
* surrounded by curly-braces, for example: `{repository UUID}`.
* */
readonly repo_slug: string;
/** @description This can either be the workspace ID (slug) or the workspace UUID
* surrounded by curly-braces, for example: `{workspace UUID}`.
* */
readonly workspace: string;
};
readonly cookie?: never;
};
/** @description The repository that is to be created. Note that most object elements are optional. Elements "owner" and "full_name" are ignored as the URL implies them. */
readonly requestBody?: {
readonly content: {
readonly "application/json": components["schemas"]["repository"];
};
};
readonly responses: {
/** @description The newly created repository. */
readonly 200: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["repository"];
};
};
/** @description If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account. */
readonly 400: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description If the request was not authenticated. */
readonly 401: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
/**
* Delete a repository
* @description Deletes the repository. This is an irreversible operation.
*
* This does not affect its forks.
*/
readonly delete: {
readonly parameters: {
readonly query?: {
/** @description If a repository has been moved to a new location, use this parameter to
* show users a friendly message in the Bitbucket UI that the repository
* has moved to a new location. However, a GET to this endpoint will still
* return a 404.
* */
readonly redirect_to?: string;
};
readonly header?: never;
readonly path: {
/** @description This can either be the repository slug or the UUID of the repository,
* surrounded by curly-braces, for example: `{repository UUID}`.
* */
readonly repo_slug: string;
/** @description This can either be the workspace ID (slug) or the workspace UUID
* surrounded by curly-braces, for example: `{workspace UUID}`.
* */
readonly workspace: string;
};
readonly cookie?: never;
};
readonly requestBody?: never;
readonly responses: {
/** @description Indicates successful deletion. */
readonly 204: {
headers: Readonly<Record<string, unknown>>;
content?: never;
};
/** @description If the caller either does not have admin access to the repository, or the repository is set to read-only. */
readonly 403: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
/** @description If the repository does not exist. */
readonly 404: {
headers: Readonly<Record<string, unknown>>;
content: {
readonly "application/json": components["schemas"]["error"];
};
};
};
};
readonly options?: never;
readonly head?: never;
readonly patch?: never;
readonly trace?: never;
};
readonly "/repositories/{workspace}/{repo_slug}/branch-restrictions": {
readonly parameters: {
readonly query?: never;
readonly header?: never;
readonly path: {
/** @description This can either be the repository slug or the UUID of the repository,
* surrounded by curly-braces, for example: `{repository UUID}`.
* */
readonly repo_slug: string;
/** @description This can either be the workspace ID (slug) or the workspace UUID
* surrounded by curly-braces, for example: `{workspace UUID}`.
* */
readonly workspace: string;
};
readonly cookie?: never;
};
/**
* List branch restrictions
* @description Returns a paginated list of all branch restrictions on the
* repository.
*/
readonly get: {
readonly parameters: {
readonly query?: {
/** @description Branch restrictions of this type */
readonly kind?: string;
/** @description Branch restrictions applied to branches of this pattern */
readonly pattern?: string;
};
readonly header?: never;
readonly path: {
/** @description This can either be the repository slug or the UUID of the repository,