/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AddReplyParams } from '../models/AddReplyParams';
import type { ApiResponse_PrAssignee } from '../models/ApiResponse_PrAssignee';
import type { ApiResponse_PrCheckRun } from '../models/ApiResponse_PrCheckRun';
import type { ApiResponse_PrLabel } from '../models/ApiResponse_PrLabel';
import type { ApiResponse_PrLabelRelation } from '../models/ApiResponse_PrLabelRelation';
import type { ApiResponse_PrMergeStrategy } from '../models/ApiResponse_PrMergeStrategy';
import type { ApiResponse_PrReaction } from '../models/ApiResponse_PrReaction';
import type { ApiResponse_PrReviewComment } from '../models/ApiResponse_PrReviewComment';
import type { ApiResponse_PrReviewDetail } from '../models/ApiResponse_PrReviewDetail';
import type { ApiResponse_PrStatus } from '../models/ApiResponse_PrStatus';
import type { ApiResponse_PrSubscription } from '../models/ApiResponse_PrSubscription';
import type { ApiResponse_PullRequest } from '../models/ApiResponse_PullRequest';
import type { ApiResponse_PullRequestDetail } from '../models/ApiResponse_PullRequestDetail';
import type { ApiResponse_String } from '../models/ApiResponse_String';
import type { ApiResponse_Vec_PrAssignee } from '../models/ApiResponse_Vec_PrAssignee';
import type { ApiResponse_Vec_PrCheckRun } from '../models/ApiResponse_Vec_PrCheckRun';
import type { ApiResponse_Vec_PrCommit } from '../models/ApiResponse_Vec_PrCommit';
import type { ApiResponse_Vec_PrEvent } from '../models/ApiResponse_Vec_PrEvent';
import type { ApiResponse_Vec_PrFile } from '../models/ApiResponse_Vec_PrFile';
import type { ApiResponse_Vec_PrLabel } from '../models/ApiResponse_Vec_PrLabel';
import type { ApiResponse_Vec_PrLabelRelation } from '../models/ApiResponse_Vec_PrLabelRelation';
import type { ApiResponse_Vec_PrReaction } from '../models/ApiResponse_Vec_PrReaction';
import type { ApiResponse_Vec_PrReviewComment } from '../models/ApiResponse_Vec_PrReviewComment';
import type { ApiResponse_Vec_PrReviewDetail } from '../models/ApiResponse_Vec_PrReviewDetail';
import type { ApiResponse_Vec_PrSubscription } from '../models/ApiResponse_Vec_PrSubscription';
import type { ApiResponse_Vec_PullRequestDetail } from '../models/ApiResponse_Vec_PullRequestDetail';
import type { CreateCheckRunParams } from '../models/CreateCheckRunParams';
import type { CreatePrLabelParams } from '../models/CreatePrLabelParams';
import type { CreatePrParams } from '../models/CreatePrParams';
import type { CreateReactionParams } from '../models/CreateReactionParams';
import type { CreateReviewParams } from '../models/CreateReviewParams';
import type { DismissReviewParams } from '../models/DismissReviewParams';
import type { LockPrParams } from '../models/LockPrParams';
import type { MergePrParams } from '../models/MergePrParams';
import type { MutePrParams } from '../models/MutePrParams';
import type { SubmitReviewParams } from '../models/SubmitReviewParams';
import type { UpdateCheckRunParams } from '../models/UpdateCheckRunParams';
import type { UpdateMergeStrategyParams } from '../models/UpdateMergeStrategyParams';
import type { UpdatePrLabelParams } from '../models/UpdatePrLabelParams';
import type { UpdatePrParams } from '../models/UpdatePrParams';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class PullRequestsService {
	/**
	 * List pull requests in a repository
	 * Returns a paginated list of pull requests, sorted by number (newest first).
	 * Supports filtering by state, author, and draft status.
	 * Requires read access to the repository.
	 * @returns ApiResponse_Vec_PullRequestDetail PRs listed successfully. Returns filtered array of PR objects.
	 * @throws ApiError
	 */
	public static prList({
		workspaceName,
		repoName,
		state,
		authorId,
		draft,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Filter by PR state ("open", "closed", "merged")
		 */
		state?: string | null,
		/**
		 * Filter by author user ID
		 */
		authorId?: string | null,
		/**
		 * Filter by draft status
		 */
		draft?: boolean | null,
		/**
		 * Maximum number of PRs to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of PRs to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PullRequestDetail> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			query: {
				'state': state,
				'author_id': authorId,
				'draft': draft,
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to access this repository`,
				404: `Repository or workspace not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Create a pull request
	 * Creates a new pull request proposing changes from a source branch to a target branch.
	 * Requires at least Member role in the repository.
	 *
	 * Parameters:
	 * - title: PR title (required)
	 * - body: PR description in markdown (optional)
	 * - source_repo_id: Source repository ID (supports cross-repo PRs from forks)
	 * - source_branch: Source branch name (must exist)
	 * - target_branch: Target branch name (must exist in the repo)
	 * - head_commit_sha: Head commit SHA from the source branch
	 * - base_commit_sha: Base commit SHA for diff calculation (optional)
	 * - draft: Whether this is a draft PR (optional, defaults to false)
	 *
	 * Effects:
	 * - PR is created with auto-incrementing number
	 * - PR status tracking is initialized
	 * - Author is automatically subscribed
	 * - Repository stats are updated
	 *
	 * Returns the created PR with full metadata.
	 * @returns ApiResponse_PullRequestDetail PR created successfully. Returns the newly created PR with full metadata.
	 * @throws ApiError
	 */
	public static prCreate({
		workspaceName,
		repoName,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR creation parameters
		 */
		requestBody: CreatePrParams,
	}): CancelablePromise<ApiResponse_PullRequestDetail> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty title, non-existent branch/commit, or invalid fork relationship`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Member role or higher)`,
				404: `Repository or workspace not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List PR labels in a repository
	 * @returns ApiResponse_Vec_PrLabel Labels listed successfully.
	 * @throws ApiError
	 */
	public static prListLabels({
		workspaceName,
		repoName,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
	}): CancelablePromise<ApiResponse_Vec_PrLabel> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/labels',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			errors: {
				401: `Authentication required`,
				404: `Repo not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Create a PR label. Requires Member role.
	 * @returns ApiResponse_PrLabel Label created.
	 * @throws ApiError
	 */
	public static prCreateLabel({
		workspaceName,
		repoName,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Label creation parameters
		 */
		requestBody: CreatePrLabelParams,
	}): CancelablePromise<ApiResponse_PrLabel> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/labels',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters`,
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `Repo not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update a PR label. Requires Admin role.
	 * @returns ApiResponse_PrLabel Label updated.
	 * @throws ApiError
	 */
	public static prUpdateLabel({
		workspaceName,
		repoName,
		labelId,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Label ID (UUID)
		 */
		labelId: string,
		/**
		 * Label update parameters
		 */
		requestBody: UpdatePrLabelParams,
	}): CancelablePromise<ApiResponse_PrLabel> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/labels/{label_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'label_id': labelId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required`,
				403: `Insufficient permissions (Admin required)`,
				404: `Label not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete a PR label. Requires Admin role.
	 * @returns ApiResponse_String Label deleted.
	 * @throws ApiError
	 */
	public static prDeleteLabel({
		workspaceName,
		repoName,
		labelId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Label ID (UUID)
		 */
		labelId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/labels/{label_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'label_id': labelId,
			},
			errors: {
				401: `Authentication required`,
				403: `Insufficient permissions (Admin required)`,
				404: `Label not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Get a pull request by number
	 * Returns detailed information about a specific pull request.
	 * Requires read access to the repository.
	 * @returns ApiResponse_PullRequestDetail PR retrieved successfully. Returns complete PR with all metadata.
	 * @throws ApiError
	 */
	public static prGet({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_PullRequestDetail> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to access this repository`,
				404: `Repository, workspace, or PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update a pull request
	 * Updates an existing pull request's metadata such as title, body, target branch, and draft status.
	 * Requires write access to the PR (author or repository member).
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated PR with full metadata.
	 * @returns ApiResponse_PullRequest PR updated successfully. Returns the updated PR with full metadata.
	 * @throws ApiError
	 */
	public static prUpdate({
		workspaceName,
		repoName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * PR update parameters (all fields optional)
		 */
		requestBody: UpdatePrParams,
	}): CancelablePromise<ApiResponse_PullRequest> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this PR`,
				404: `Repository, workspace, or PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete a pull request
	 * Soft-deletes a PR. Requires Admin role in the repository.
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String PR deleted successfully.
	 * @throws ApiError
	 */
	public static prDelete({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Admin role)`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List assignees of a PR
	 * @returns ApiResponse_Vec_PrAssignee Assignees listed.
	 * @throws ApiError
	 */
	public static prListAssignees({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrAssignee> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/assignees',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Assign a user to a PR. Assignee is auto-subscribed.
	 * @returns ApiResponse_PrAssignee User assigned.
	 * @throws ApiError
	 */
	public static prAssign({
		workspaceName,
		repoName,
		number,
		userId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * User ID (UUID) to assign/unassign
		 */
		userId: string,
	}): CancelablePromise<ApiResponse_PrAssignee> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/assignees/{user_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'user_id': userId,
			},
			errors: {
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				409: `User already assigned`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unassign a user from a PR
	 * @returns ApiResponse_String User unassigned.
	 * @throws ApiError
	 */
	public static prUnassign({
		workspaceName,
		repoName,
		number,
		userId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * User ID (UUID) to assign/unassign
		 */
		userId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/assignees/{user_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'user_id': userId,
			},
			errors: {
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `Assignee not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List check runs for a PR
	 * @returns ApiResponse_Vec_PrCheckRun Check runs listed.
	 * @throws ApiError
	 */
	public static prListCheckRuns({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrCheckRun> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/check-runs',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Create a check run. Requires Member role.
	 * @returns ApiResponse_PrCheckRun Check run created.
	 * @throws ApiError
	 */
	public static prCreateCheckRun({
		workspaceName,
		repoName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Check run parameters
		 */
		requestBody: CreateCheckRunParams,
	}): CancelablePromise<ApiResponse_PrCheckRun> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/check-runs',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid status`,
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update a check run. Requires Member role.
	 * @returns ApiResponse_PrCheckRun Check run updated.
	 * @throws ApiError
	 */
	public static prUpdateCheckRun({
		workspaceName,
		repoName,
		number,
		checkRunId,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Check run ID (UUID)
		 */
		checkRunId: string,
		/**
		 * Check run update parameters
		 */
		requestBody: UpdateCheckRunParams,
	}): CancelablePromise<ApiResponse_PrCheckRun> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/check-runs/{check_run_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'check_run_id': checkRunId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid status`,
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `Check run not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete a check run. Requires Admin role.
	 * @returns ApiResponse_String Check run deleted.
	 * @throws ApiError
	 */
	public static prDeleteCheckRun({
		workspaceName,
		repoName,
		number,
		checkRunId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Check run ID (UUID)
		 */
		checkRunId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/check-runs/{check_run_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'check_run_id': checkRunId,
			},
			errors: {
				401: `Authentication required`,
				403: `Insufficient permissions (Admin required)`,
				404: `Check run not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Close a pull request
	 * Closes an open PR without merging.
	 * Requires write access to the PR.
	 *
	 * Returns the closed PR.
	 * @returns ApiResponse_PullRequest PR closed successfully.
	 * @throws ApiError
	 */
	public static prClose({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_PullRequest> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/close',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				400: `PR is not open`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update a review comment (own comments only)
	 * @returns ApiResponse_PrReviewComment Comment updated.
	 * @throws ApiError
	 */
	public static prUpdateReviewComment({
		workspaceName,
		repoName,
		number,
		commentId,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Comment ID (UUID)
		 */
		commentId: string,
		/**
		 * Update parameters
		 */
		requestBody: AddReplyParams,
	}): CancelablePromise<ApiResponse_PrReviewComment> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/comments/{comment_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'comment_id': commentId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required`,
				403: `Cannot edit other users' comments`,
				404: `Comment not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete a review comment. Own comments or Admin role.
	 * @returns ApiResponse_String Comment deleted.
	 * @throws ApiError
	 */
	public static prDeleteReviewComment({
		workspaceName,
		repoName,
		number,
		commentId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Comment ID (UUID)
		 */
		commentId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/comments/{comment_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'comment_id': commentId,
			},
			errors: {
				401: `Authentication required`,
				403: `Cannot delete other users' comments (Admin required)`,
				404: `Comment not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Reply to a review comment
	 * @returns ApiResponse_PrReviewComment Reply added.
	 * @throws ApiError
	 */
	public static prAddReviewReply({
		workspaceName,
		repoName,
		number,
		commentId,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Comment ID (UUID)
		 */
		commentId: string,
		/**
		 * Reply parameters
		 */
		requestBody: AddReplyParams,
	}): CancelablePromise<ApiResponse_PrReviewComment> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/comments/{comment_id}/reply',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'comment_id': commentId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Empty body`,
				401: `Authentication required`,
				404: `Comment not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List commits in a pull request
	 * Returns a paginated list of all commits included in the PR, sorted by position.
	 * Requires read access to the repository.
	 * @returns ApiResponse_Vec_PrCommit Commits listed successfully.
	 * @throws ApiError
	 */
	public static prListCommits({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Maximum number of commits to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of commits to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrCommit> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/commits',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List PR events (timeline). Returns chronological activity log.
	 * @returns ApiResponse_Vec_PrEvent Events listed.
	 * @throws ApiError
	 */
	public static prListEvents({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrEvent> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/events',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List changed files in a pull request
	 * Returns a paginated list of all files changed in the PR, sorted by path.
	 * Includes additions, deletions, and patch diffs for each file.
	 * Requires read access to the repository.
	 * @returns ApiResponse_Vec_PrFile Files listed successfully.
	 * @throws ApiError
	 */
	public static prListFiles({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Maximum number of files to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of files to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrFile> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/files',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List labels assigned to a PR
	 * @returns ApiResponse_Vec_PrLabelRelation Label relations listed.
	 * @throws ApiError
	 */
	public static prListLabelRelations({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrLabelRelation> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/labels',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Assign a label to a PR
	 * @returns ApiResponse_PrLabelRelation Label assigned.
	 * @throws ApiError
	 */
	public static prAssignLabel({
		workspaceName,
		repoName,
		number,
		labelId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Label ID (UUID)
		 */
		labelId: string,
	}): CancelablePromise<ApiResponse_PrLabelRelation> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/labels/{label_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'label_id': labelId,
			},
			errors: {
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `PR or label not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unassign a label from a PR
	 * @returns ApiResponse_String Label unassigned.
	 * @throws ApiError
	 */
	public static prUnassignLabel({
		workspaceName,
		repoName,
		number,
		labelId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Label ID (UUID)
		 */
		labelId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/labels/{label_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'label_id': labelId,
			},
			errors: {
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `Label not assigned`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Lock or unlock a pull request conversation
	 * When locked, only repository maintainers and admins can comment on the PR.
	 * Requires write access to the PR.
	 *
	 * Returns the updated PR.
	 * @returns ApiResponse_PullRequest PR lock status updated.
	 * @throws ApiError
	 */
	public static prLock({
		workspaceName,
		repoName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Lock/unlock parameters
		 */
		requestBody: LockPrParams,
	}): CancelablePromise<ApiResponse_PullRequest> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/lock',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Merge a pull request
	 * Merges the source branch into the target branch.
	 * Requires at least Maintainer role in the repository.
	 *
	 * Branch protection rules are enforced:
	 * - Required approvals count (self-approval not allowed)
	 * - Required status checks must pass
	 * - Admins can bypass protection rules
	 *
	 * Parameters:
	 * - strategy: Merge strategy ("merge", "squash", "rebase", default: "merge")
	 * - squash_title: Custom title for squash merge (optional)
	 * - squash_message: Custom message for squash merge (optional)
	 * - delete_source_branch: Delete source branch after merge (optional, only same-repo)
	 *
	 * Returns the merged PR with merge commit SHA.
	 * @returns ApiResponse_PullRequest PR merged successfully. Returns the merged PR with merge commit SHA.
	 * @throws ApiError
	 */
	public static prMerge({
		workspaceName,
		repoName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Merge parameters
		 */
		requestBody: MergePrParams,
	}): CancelablePromise<ApiResponse_PullRequest> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/merge',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Cannot merge: PR not open, is draft, or branch protection requirements not met`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Maintainer role or higher)`,
				404: `PR not found`,
				500: `Internal server error or git merge failure`,
			},
		});
	}
	/**
	 * Get PR merge strategy
	 * Returns the current merge strategy settings for a PR.
	 * Requires read access to the repository.
	 * @returns ApiResponse_PrMergeStrategy Merge strategy retrieved successfully.
	 * @throws ApiError
	 */
	public static prGetMergeStrategy({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_PrMergeStrategy> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/merge-strategy',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `PR or merge strategy not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update PR merge strategy
	 * Updates the merge strategy settings for a PR.
	 * Requires write access to the PR.
	 *
	 * Updatable fields:
	 * - strategy: Merge strategy type ("merge", "squash", "rebase")
	 * - auto_merge: Enable auto-merge when all checks pass
	 * - squash_title: Custom title for squash merge
	 * - squash_message: Custom message for squash merge
	 * - delete_source_branch: Delete source branch after merge
	 * - merge_when_checks_pass: Auto-merge when checks pass
	 *
	 * All fields are optional; only provided fields are updated.
	 * @returns ApiResponse_PrMergeStrategy Merge strategy updated successfully.
	 * @throws ApiError
	 */
	public static prUpdateMergeStrategy({
		workspaceName,
		repoName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Merge strategy update parameters (all fields optional)
		 */
		requestBody: UpdateMergeStrategyParams,
	}): CancelablePromise<ApiResponse_PrMergeStrategy> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/merge-strategy',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: unsupported strategy`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Mute or unmute notifications for a PR
	 * @returns ApiResponse_String Mute status updated.
	 * @throws ApiError
	 */
	public static prMute({
		workspaceName,
		repoName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Mute/unmute parameters
		 */
		requestBody: MutePrParams,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/mute',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required`,
				404: `Not subscribed`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List reactions on a PR
	 * @returns ApiResponse_Vec_PrReaction Reactions listed.
	 * @throws ApiError
	 */
	public static prListReactions({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrReaction> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reactions',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Add a reaction to a PR
	 * @returns ApiResponse_PrReaction Reaction added.
	 * @throws ApiError
	 */
	public static prAddReaction({
		workspaceName,
		repoName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Reaction parameters
		 */
		requestBody: CreateReactionParams,
	}): CancelablePromise<ApiResponse_PrReaction> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reactions',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid content or target type`,
				401: `Authentication required`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Remove a reaction. Only the reaction author can remove it.
	 * @returns ApiResponse_String Reaction removed.
	 * @throws ApiError
	 */
	public static prRemoveReaction({
		workspaceName,
		repoName,
		number,
		reactionId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Reaction ID (UUID)
		 */
		reactionId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reactions/{reaction_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'reaction_id': reactionId,
			},
			errors: {
				401: `Authentication required`,
				403: `Cannot remove another user's reaction`,
				404: `Reaction not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Mark a draft PR as ready for review
	 * Converts a draft pull request to a ready-for-review state.
	 * Requires write access to the PR.
	 *
	 * Effects:
	 * - Draft flag is set to false
	 * - A "DraftReady" event is logged
	 * - Reviewers are notified that the PR is ready
	 *
	 * Returns the updated PR.
	 * @returns ApiResponse_PullRequest PR marked as ready for review.
	 * @throws ApiError
	 */
	public static prMarkReady({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_PullRequest> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/ready',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				400: `PR is already ready for review`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Reopen a pull request
	 * Reopens a closed (but not merged) PR.
	 * Requires write access to the PR.
	 *
	 * Returns the reopened PR.
	 * @returns ApiResponse_PullRequest PR reopened successfully.
	 * @throws ApiError
	 */
	public static prReopen({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_PullRequest> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reopen',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				400: `PR is not closed or already merged`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List reviews on a PR
	 * @returns ApiResponse_Vec_PrReviewDetail Reviews listed.
	 * @throws ApiError
	 */
	public static prListReviews({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrReviewDetail> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reviews',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Create a review. States: pending, approved, changes_requested, commented. Authors cannot approve their own PRs.
	 * @returns ApiResponse_PrReviewDetail Review created.
	 * @throws ApiError
	 */
	public static prCreateReview({
		workspaceName,
		repoName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Review parameters
		 */
		requestBody: CreateReviewParams,
	}): CancelablePromise<ApiResponse_PrReviewDetail> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reviews',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid state or self-approval`,
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List comments for a specific review
	 * @returns ApiResponse_Vec_PrReviewComment Review comments listed.
	 * @throws ApiError
	 */
	public static prListReviewComments({
		workspaceName,
		repoName,
		number,
		reviewId,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Review ID (UUID)
		 */
		reviewId: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrReviewComment> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reviews/{review_id}/comments',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'review_id': reviewId,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required`,
				404: `Review not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Dismiss a submitted review. Requires Admin role.
	 * @returns ApiResponse_PrReviewDetail Review dismissed.
	 * @throws ApiError
	 */
	public static prDismissReview({
		workspaceName,
		repoName,
		number,
		reviewId,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Review ID (UUID)
		 */
		reviewId: string,
		/**
		 * Dismiss parameters
		 */
		requestBody: DismissReviewParams,
	}): CancelablePromise<ApiResponse_PrReviewDetail> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reviews/{review_id}/dismiss',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'review_id': reviewId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required`,
				403: `Insufficient permissions (Admin required)`,
				404: `Review not found or not submitted`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Submit a pending review. Changes its state to approved, changes_requested, or commented.
	 * @returns ApiResponse_PrReviewDetail Review submitted.
	 * @throws ApiError
	 */
	public static prSubmitReview({
		workspaceName,
		repoName,
		number,
		reviewId,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		/**
		 * Review ID (UUID)
		 */
		reviewId: string,
		/**
		 * Submit parameters
		 */
		requestBody: SubmitReviewParams,
	}): CancelablePromise<ApiResponse_PrReviewDetail> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/reviews/{review_id}/submit',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
				'review_id': reviewId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid state or self-approval`,
				401: `Authentication required`,
				403: `Insufficient permissions`,
				404: `Review not found or already submitted`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Get PR status summary
	 * Returns the current status of a PR including checks state, mergeability,
	 * approval count, and file change statistics.
	 * Requires read access to the repository.
	 * @returns ApiResponse_PrStatus PR status retrieved successfully.
	 * @throws ApiError
	 */
	public static prGetStatus({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_PrStatus> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/status',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `PR or status not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Subscribe to a PR to receive notifications
	 * @returns ApiResponse_PrSubscription Subscribed.
	 * @throws ApiError
	 */
	public static prSubscribe({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_PrSubscription> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/subscribe',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				401: `Authentication required`,
				404: `PR not found`,
				409: `Already subscribed`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unsubscribe from a PR
	 * @returns ApiResponse_String Unsubscribed.
	 * @throws ApiError
	 */
	public static prUnsubscribe({
		workspaceName,
		repoName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/subscribe',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			errors: {
				401: `Authentication required`,
				404: `Not subscribed`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List subscriptions on a PR
	 * @returns ApiResponse_Vec_PrSubscription Subscriptions listed.
	 * @throws ApiError
	 */
	public static prListSubscriptions({
		workspaceName,
		repoName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * PR number (unique within the repository)
		 */
		number: number,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_PrSubscription> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/prs/{number}/subscriptions',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required`,
				404: `PR not found`,
				500: `Internal server error`,
			},
		});
	}
}
