/*! * Copyright Adaptavist 2022 (c) All rights reserved */ import { PullRequestSimpleAsResponse } from "../definitions/PullRequestSimpleAsResponse"; import { ValidationErrorAsResponse } from "../definitions/ValidationErrorAsResponse"; import { ErrorStrategyOption } from "../errorStrategy"; import { HeadersOption } from "@managed-api/commons-core"; import { PullRequestAsResponse } from "../definitions/PullRequestAsResponse"; import { BasicErrorAsResponse } from "../definitions/BasicErrorAsResponse"; import { CommitAsResponse } from "../definitions/CommitAsResponse"; import { DiffEntryAsResponse } from "../definitions/DiffEntryAsResponse"; import { PullRequestMergeResultAsResponse } from "../definitions/PullRequestMergeResultAsResponse"; import { MessageAsResponse } from "../definitions/MessageAsResponse"; export interface GetPullRequestsRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; /** * Either `open`, `closed`, or `all` to filter by state. */ state?: "open" | "closed" | "all"; /** * Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`. */ head?: string; /** * Filter pulls by base branch name. Example: `gh-pages`. */ base?: string; /** * What to sort results by. `popularity` will sort by the number of comments. `long-running` will sort by date created and will limit the results to pull requests that have been open for more than a month and have had activity within the past month. */ sort?: "created" | "updated" | "popularity" | "long-running"; /** * The direction of the sort. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`. */ direction?: "asc" | "desc"; /** * The number of results per page (max 100). */ per_page?: number; /** * Page number of the results to fetch. */ page?: number; } declare type GetPullRequestsResponseOKType = Array; export interface GetPullRequestsResponseOK extends GetPullRequestsResponseOKType { } declare type GetPullRequestsResponseErrorType = ValidationErrorAsResponse; export interface GetPullRequestsResponseError extends GetPullRequestsResponseErrorType { } export interface CreatePullRequestRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; body: { /** * The title of the new pull request. Required unless `issue` is specified. */ title?: string; /** * The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. */ head: string; /** * The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization. */ head_repo?: string; /** * The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. */ base: string; /** * The contents of the pull request. */ body?: string; /** * Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ maintainer_can_modify?: boolean; /** * Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://docs.github.com/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. */ draft?: boolean; /** * An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified. */ issue?: number; }; } declare type CreatePullRequestResponseOKType = PullRequestAsResponse; export interface CreatePullRequestResponseOK extends CreatePullRequestResponseOKType { } declare type CreatePullRequestResponseErrorType = BasicErrorAsResponse & ValidationErrorAsResponse; export interface CreatePullRequestResponseError extends CreatePullRequestResponseErrorType { } export interface GetPullRequestRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; /** * The number that identifies the pull request. */ pull_number: number; } declare type GetPullRequestResponseOKType = PullRequestAsResponse; export interface GetPullRequestResponseOK extends GetPullRequestResponseOKType { } declare type GetPullRequestResponseErrorType = BasicErrorAsResponse & BasicErrorAsResponse & { code?: string; message?: string; documentation_url?: string; }; export interface GetPullRequestResponseError extends GetPullRequestResponseErrorType { } export interface UpdatePullRequestRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; /** * The number that identifies the pull request. */ pull_number: number; body: { /** * The title of the pull request. */ title?: string; /** * The contents of the pull request. */ body?: string; /** * State of this Pull Request. Either `open` or `closed`. */ state?: "open" | "closed"; /** * The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. */ base?: string; /** * Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ maintainer_can_modify?: boolean; }; } declare type UpdatePullRequestResponseOKType = PullRequestAsResponse; export interface UpdatePullRequestResponseOK extends UpdatePullRequestResponseOKType { } declare type UpdatePullRequestResponseErrorType = BasicErrorAsResponse & ValidationErrorAsResponse; export interface UpdatePullRequestResponseError extends UpdatePullRequestResponseErrorType { } export interface GetPullRequestCommitsRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; /** * The number that identifies the pull request. */ pull_number: number; /** * The number of results per page (max 100). */ per_page?: number; /** * Page number of the results to fetch. */ page?: number; } declare type GetPullRequestCommitsResponseOKType = Array; export interface GetPullRequestCommitsResponseOK extends GetPullRequestCommitsResponseOKType { } export declare type GetPullRequestCommitsResponseError = undefined; export interface GetPullRequestFilesRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; /** * The number that identifies the pull request. */ pull_number: number; /** * The number of results per page (max 100). */ per_page?: number; /** * Page number of the results to fetch. */ page?: number; } declare type GetPullRequestFilesResponseOKType = Array; export interface GetPullRequestFilesResponseOK extends GetPullRequestFilesResponseOKType { } declare type GetPullRequestFilesResponseErrorType = ValidationErrorAsResponse & BasicErrorAsResponse & { code?: string; message?: string; documentation_url?: string; }; export interface GetPullRequestFilesResponseError extends GetPullRequestFilesResponseErrorType { } export interface IsPullRequestMergedRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; /** * The number that identifies the pull request. */ pull_number: number; } export declare type IsPullRequestMergedResponseOK = undefined; export declare type IsPullRequestMergedResponseError = undefined; export interface MergePullRequestRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; /** * The number that identifies the pull request. */ pull_number: number; body: { /** * Title for the automatic commit message. */ commit_title?: string; /** * Extra detail to append to automatic commit message. */ commit_message?: string; /** * SHA that pull request head must match to allow merge. */ sha?: string; /** * The merge method to use. */ merge_method?: "merge" | "squash" | "rebase"; } | null; } declare type MergePullRequestResponseOKType = PullRequestMergeResultAsResponse; export interface MergePullRequestResponseOK extends MergePullRequestResponseOKType { } declare type MergePullRequestResponseErrorType = BasicErrorAsResponse & BasicErrorAsResponse & { message?: string; documentation_url?: string; } & { message?: string; documentation_url?: string; } & ValidationErrorAsResponse; export interface MergePullRequestResponseError extends MergePullRequestResponseErrorType { } export interface UpdatePullRequestBranchRequest extends HeadersOption, ErrorStrategyOption { /** * The account owner of the repository. The name is not case sensitive. */ owner: string; /** * The name of the repository. The name is not case sensitive. */ repo: string; /** * The number that identifies the pull request. */ pull_number: number; body: { /** * The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/rest/reference/repos#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. */ expected_head_sha?: string; } | null; } declare type UpdatePullRequestBranchResponseOKType = MessageAsResponse; export interface UpdatePullRequestBranchResponseOK extends UpdatePullRequestBranchResponseOKType { } declare type UpdatePullRequestBranchResponseErrorType = BasicErrorAsResponse & ValidationErrorAsResponse; export interface UpdatePullRequestBranchResponseError extends UpdatePullRequestBranchResponseErrorType { } export {}; //# sourceMappingURL=pull.d.ts.map