/*! * Copyright Adaptavist 2022 (c) All rights reserved */ import { ShortBranchAsResponse } from "../definitions/ShortBranchAsResponse"; import { BasicErrorAsResponse } from "../definitions/BasicErrorAsResponse"; import { ErrorStrategyOption } from "../errorStrategy"; import { HeadersOption } from "@managed-api/commons-core"; import { BranchWithProtectionAsResponse } from "../definitions/BranchWithProtectionAsResponse"; import { ValidationErrorAsResponse } from "../definitions/ValidationErrorAsResponse"; import { MergedUpstreamAsResponse } from "../definitions/MergedUpstreamAsResponse"; import { CommitAsResponse } from "../definitions/CommitAsResponse"; export interface GetBranchesRequest 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; /** * Setting to `true` returns only protected branches. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches. */ protected?: boolean; /** * The number of results per page (max 100). */ per_page?: number; /** * Page number of the results to fetch. */ page?: number; } declare type GetBranchesResponseOKType = Array; export interface GetBranchesResponseOK extends GetBranchesResponseOKType { } declare type GetBranchesResponseErrorType = BasicErrorAsResponse; export interface GetBranchesResponseError extends GetBranchesResponseErrorType { } export interface GetBranchRequest 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 name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use [the GraphQL API](https://docs.github.com/graphql). */ branch: string; } declare type GetBranchResponseOKType = BranchWithProtectionAsResponse; export interface GetBranchResponseOK extends GetBranchResponseOKType { } declare type GetBranchResponseErrorType = BasicErrorAsResponse & BasicErrorAsResponse; export interface GetBranchResponseError extends GetBranchResponseErrorType { } export interface RenameBranchRequest 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 name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use [the GraphQL API](https://docs.github.com/graphql). */ branch: string; body: { /** * The new name of the branch. */ new_name: string; }; } declare type RenameBranchResponseOKType = BranchWithProtectionAsResponse; export interface RenameBranchResponseOK extends RenameBranchResponseOKType { } declare type RenameBranchResponseErrorType = BasicErrorAsResponse & BasicErrorAsResponse & ValidationErrorAsResponse; export interface RenameBranchResponseError extends RenameBranchResponseErrorType { } export interface SyncForkBranchRequest 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 name of the branch which should be updated to match upstream. */ branch: string; }; } declare type SyncForkBranchResponseOKType = MergedUpstreamAsResponse; export interface SyncForkBranchResponseOK extends SyncForkBranchResponseOKType { } export declare type SyncForkBranchResponseError = undefined; export interface MergeBranchRequest 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 name of the base branch that the head will be merged into. */ base: string; /** * The head to merge. This can be a branch name or a commit SHA1. */ head: string; /** * Commit message to use for the merge commit. If omitted, a default message will be used. */ commit_message?: string; }; } declare type MergeBranchResponseOKType = CommitAsResponse; export interface MergeBranchResponseOK extends MergeBranchResponseOKType { } declare type MergeBranchResponseErrorType = BasicErrorAsResponse & ValidationErrorAsResponse; export interface MergeBranchResponseError extends MergeBranchResponseErrorType { } export {}; //# sourceMappingURL=branch.d.ts.map