/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ApiResponse_Issue } from '../models/ApiResponse_Issue';
import type { ApiResponse_IssueAssignee } from '../models/ApiResponse_IssueAssignee';
import type { ApiResponse_IssueComment } from '../models/ApiResponse_IssueComment';
import type { ApiResponse_IssueCommentDetail } from '../models/ApiResponse_IssueCommentDetail';
import type { ApiResponse_IssueDetail } from '../models/ApiResponse_IssueDetail';
import type { ApiResponse_IssueLabel } from '../models/ApiResponse_IssueLabel';
import type { ApiResponse_IssueLabelRelation } from '../models/ApiResponse_IssueLabelRelation';
import type { ApiResponse_IssueMilestone } from '../models/ApiResponse_IssueMilestone';
import type { ApiResponse_IssuePrRelation } from '../models/ApiResponse_IssuePrRelation';
import type { ApiResponse_IssueReaction } from '../models/ApiResponse_IssueReaction';
import type { ApiResponse_IssueRepoRelation } from '../models/ApiResponse_IssueRepoRelation';
import type { ApiResponse_IssueSubscriber } from '../models/ApiResponse_IssueSubscriber';
import type { ApiResponse_IssueTemplate } from '../models/ApiResponse_IssueTemplate';
import type { ApiResponse_String } from '../models/ApiResponse_String';
import type { ApiResponse_Vec_IssueAssignee } from '../models/ApiResponse_Vec_IssueAssignee';
import type { ApiResponse_Vec_IssueCommentDetail } from '../models/ApiResponse_Vec_IssueCommentDetail';
import type { ApiResponse_Vec_IssueDetail } from '../models/ApiResponse_Vec_IssueDetail';
import type { ApiResponse_Vec_IssueEvent } from '../models/ApiResponse_Vec_IssueEvent';
import type { ApiResponse_Vec_IssueLabel } from '../models/ApiResponse_Vec_IssueLabel';
import type { ApiResponse_Vec_IssueLabelRelation } from '../models/ApiResponse_Vec_IssueLabelRelation';
import type { ApiResponse_Vec_IssueMilestone } from '../models/ApiResponse_Vec_IssueMilestone';
import type { ApiResponse_Vec_IssuePrRelation } from '../models/ApiResponse_Vec_IssuePrRelation';
import type { ApiResponse_Vec_IssueReaction } from '../models/ApiResponse_Vec_IssueReaction';
import type { ApiResponse_Vec_IssueRepoRelation } from '../models/ApiResponse_Vec_IssueRepoRelation';
import type { ApiResponse_Vec_IssueSubscriber } from '../models/ApiResponse_Vec_IssueSubscriber';
import type { ApiResponse_Vec_IssueTemplate } from '../models/ApiResponse_Vec_IssueTemplate';
import type { CreateCommentParams } from '../models/CreateCommentParams';
import type { CreateIssueParams } from '../models/CreateIssueParams';
import type { CreateIssueReactionParams } from '../models/CreateIssueReactionParams';
import type { CreateLabelParams } from '../models/CreateLabelParams';
import type { CreateMilestoneParams } from '../models/CreateMilestoneParams';
import type { CreateTemplateParams } from '../models/CreateTemplateParams';
import type { LinkPrParams } from '../models/LinkPrParams';
import type { LinkRepoParams } from '../models/LinkRepoParams';
import type { LockIssueParams } from '../models/LockIssueParams';
import type { MuteIssueParams } from '../models/MuteIssueParams';
import type { TransferIssueParams } from '../models/TransferIssueParams';
import type { UpdateCommentParams } from '../models/UpdateCommentParams';
import type { UpdateIssueParams } from '../models/UpdateIssueParams';
import type { UpdateLabelParams } from '../models/UpdateLabelParams';
import type { UpdateMilestoneParams } from '../models/UpdateMilestoneParams';
import type { UpdateTemplateParams } from '../models/UpdateTemplateParams';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class IssuesService {
	/**
	 * List issues in a workspace
	 * Returns a paginated list of issues in the workspace, sorted by issue number (newest first).
	 * Supports filtering by state, priority, author, assignee, milestone, and label.
	 * Only returns issues visible to the authenticated user (public + workspace member access).
	 * Requires authentication.
	 * @returns ApiResponse_Vec_IssueDetail Issues listed successfully. Returns filtered array of issue objects with metadata.
	 * @throws ApiError
	 */
	public static issueList({
		workspaceName,
		state,
		priority,
		authorId,
		assigneeId,
		milestoneId,
		labelId,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Filter by issue state ("open" or "closed")
		 */
		state?: string | null,
		/**
		 * Filter by priority level
		 */
		priority?: string | null,
		/**
		 * Filter by author user ID
		 */
		authorId?: string | null,
		/**
		 * Filter by assignee user ID
		 */
		assigneeId?: string | null,
		/**
		 * Filter by milestone ID
		 */
		milestoneId?: string | null,
		/**
		 * Filter by label ID
		 */
		labelId?: string | null,
		/**
		 * Maximum number of issues to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of issues to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueDetail> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'state': state,
				'priority': priority,
				'author_id': authorId,
				'assignee_id': assigneeId,
				'milestone_id': milestoneId,
				'label_id': labelId,
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `Workspace not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Create an issue
	 * Creates a new issue in the specified workspace.
	 * Requires at least Member role in the workspace.
	 *
	 * Parameters:
	 * - title: Issue title (required)
	 * - body: Issue body in markdown (optional)
	 * - priority: Priority level (optional, defaults to "none")
	 * - visibility: Visibility setting (optional, defaults to "public")
	 * - due_at: Due date (optional)
	 * - repo_ids: Related repository IDs
	 * - label_ids: Label IDs to apply
	 * - assignee_ids: User IDs to assign
	 * - milestone_id: Milestone ID to attach
	 *
	 * Effects:
	 * - Issue is created with auto-incrementing number
	 * - Author is automatically subscribed
	 * - Relations, labels, and assignees are attached
	 * - Workspace stats are updated
	 *
	 * Returns the created issue with full metadata.
	 * @returns ApiResponse_IssueDetail Issue created successfully. Returns the newly created issue with full metadata.
	 * @throws ApiError
	 */
	public static issueCreate({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue creation parameters
		 */
		requestBody: CreateIssueParams,
	}): CancelablePromise<ApiResponse_IssueDetail> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty title, invalid repository/label/milestone references`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Member role or higher)`,
				404: `Workspace or referenced resource not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Get an issue by number
	 * Returns detailed information about a specific issue, identified by workspace name and issue number.
	 * Requires read access to the issue (public or workspace member).
	 * @returns ApiResponse_IssueDetail Issue retrieved successfully. Returns complete issue with all metadata.
	 * @throws ApiError
	 */
	public static issueGet({
		workspaceName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_IssueDetail> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Workspace or issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update an issue
	 * Updates an existing issue's metadata such as title, body, priority, visibility, due date, and milestone.
	 * Requires write access to the issue (author or workspace member).
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated issue with full metadata.
	 * @returns ApiResponse_Issue Issue updated successfully. Returns the updated issue with full metadata.
	 * @throws ApiError
	 */
	public static issueUpdate({
		workspaceName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Issue update parameters (all fields optional)
		 */
		requestBody: UpdateIssueParams,
	}): CancelablePromise<ApiResponse_Issue> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: invalid priority, visibility, or milestone`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `Workspace, issue, or referenced resource not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete an issue
	 * Soft-deletes an issue. The issue is marked as deleted but remains in the database.
	 * Requires Admin role in the workspace (or issue author).
	 *
	 * Effects:
	 * - Issue is marked as deleted (soft-delete)
	 * - Workspace issue count is decremented
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Issue deleted successfully.
	 * @throws ApiError
	 */
	public static issueDelete({
		workspaceName,
		number,
	}: {
		workspaceName: string,
		number: number,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Admin role or issue author)`,
				404: `Workspace or issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List assignees of an issue
	 * Returns a paginated list of all users assigned to the given issue.
	 * Shows who is assigned, when they were assigned, and who assigned them.
	 * Requires read access to the issue.
	 * @returns ApiResponse_Vec_IssueAssignee Assignees listed successfully. Returns array of assignee objects with assignment metadata.
	 * @throws ApiError
	 */
	public static issueListAssignees({
		workspaceName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Maximum number of assignees to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of assignees to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueAssignee> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/assignees',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Assign a user to an issue
	 * Assigns a workspace member to the given issue.
	 * Requires write access to the issue (author or workspace member).
	 *
	 * Effects:
	 * - User is assigned to the issue
	 * - Assignee is automatically subscribed to the issue
	 * - Issue assignee count is incremented
	 *
	 * Returns the created assignment record.
	 * @returns ApiResponse_IssueAssignee User assigned successfully. Returns the created assignment record.
	 * @throws ApiError
	 */
	public static issueAssign({
		workspaceName,
		number,
		userId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * User ID (UUID) to assign
		 */
		userId: string,
	}): CancelablePromise<ApiResponse_IssueAssignee> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/assignees/{user_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'user_id': userId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `Issue or user not found`,
				409: `User is already assigned to this issue`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unassign a user from an issue
	 * Removes a user from the issue's assignee list.
	 * Requires write access to the issue (author or workspace member).
	 *
	 * Effects:
	 * - User is removed from the issue's assignees
	 * - Issue assignee count is decremented
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String User unassigned successfully.
	 * @throws ApiError
	 */
	public static issueUnassign({
		workspaceName,
		number,
		userId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * User ID (UUID) to unassign
		 */
		userId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/assignees/{user_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'user_id': userId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `User is not assigned to this issue or not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Close an issue
	 * Closes an open issue. The issue is marked as closed and the closing user is recorded.
	 * Requires write access to the issue (author or workspace member).
	 *
	 * Effects:
	 * - Issue state changes to "closed"
	 * - Closed by and closed at are recorded
	 * - A "Closed" event is logged
	 *
	 * Returns the closed issue with updated metadata.
	 * @returns ApiResponse_Issue Issue closed successfully. Returns the closed issue with updated metadata.
	 * @throws ApiError
	 */
	public static issueClose({
		workspaceName,
		number,
	}: {
		workspaceName: string,
		number: number,
	}): CancelablePromise<ApiResponse_Issue> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/close',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			errors: {
				400: `Issue is already closed`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to close this issue`,
				404: `Workspace or issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List issue comments
	 * Returns a paginated list of comments on an issue, sorted by creation date (oldest first).
	 * Requires read access to the issue.
	 * @returns ApiResponse_Vec_IssueCommentDetail Comments listed successfully.
	 * @throws ApiError
	 */
	public static issueListComments({
		workspaceName,
		number,
		limit,
		offset,
	}: {
		workspaceName: string,
		number: number,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueCommentDetail> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/comments',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Workspace or issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Create a comment on an issue
	 * Adds a new comment to an issue. Users with read access can comment unless the issue is locked
	 * (in which case only users with write access can comment).
	 *
	 * Parameters:
	 * - body: Comment body in markdown format (required)
	 * - reply_to_comment_id: ID of parent comment for threaded replies (optional)
	 *
	 * Effects:
	 * - Comment is created and attached to the issue
	 * - Commenter is automatically subscribed to the issue
	 * - Issue comment count is incremented
	 *
	 * Returns the created comment with metadata.
	 * @returns ApiResponse_IssueCommentDetail Comment created successfully.
	 * @throws ApiError
	 */
	public static issueCreateComment({
		workspaceName,
		number,
		requestBody,
	}: {
		workspaceName: string,
		number: number,
		/**
		 * Comment creation parameters
		 */
		requestBody: CreateCommentParams,
	}): CancelablePromise<ApiResponse_IssueCommentDetail> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/comments',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty body or issue is locked`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (issue locked and user lacks write access)`,
				404: `Workspace or issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update an issue comment
	 * Updates the body of an existing comment. Only the comment author can update their own comments.
	 * Requires read access to the issue.
	 *
	 * Returns the updated comment with edit timestamp.
	 * @returns ApiResponse_IssueComment Comment updated successfully.
	 * @throws ApiError
	 */
	public static issueUpdateComment({
		workspaceName,
		number,
		commentId,
		requestBody,
	}: {
		workspaceName: string,
		number: number,
		commentId: string,
		/**
		 * Comment update parameters
		 */
		requestBody: UpdateCommentParams,
	}): CancelablePromise<ApiResponse_IssueComment> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/comments/{comment_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'comment_id': commentId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty body`,
				401: `Authentication required or session expired`,
				403: `Cannot edit other users' comments`,
				404: `Workspace, issue, or comment not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete an issue comment
	 * Soft-deletes a comment. The comment author can delete their own comments.
	 * Workspace admins can delete any comment.
	 *
	 * Effects:
	 * - Comment is marked as deleted
	 * - Issue comment count is decremented
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Comment deleted successfully.
	 * @throws ApiError
	 */
	public static issueDeleteComment({
		workspaceName,
		number,
		commentId,
	}: {
		workspaceName: string,
		number: number,
		commentId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/comments/{comment_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'comment_id': commentId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Cannot delete other users' comments (requires admin)`,
				404: `Workspace, issue, or comment not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List issue events
	 * Returns a chronological timeline of all events for the given issue.
	 * Events include creation, updates, state changes, assignments, label changes, etc.
	 * Sorted by creation date (oldest first for timeline display).
	 * Requires read access to the issue.
	 * @returns ApiResponse_Vec_IssueEvent Events listed successfully. Returns chronological array of event objects.
	 * @throws ApiError
	 */
	public static issueListEvents({
		workspaceName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Maximum number of events to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of events to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueEvent> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/events',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List labels assigned to an issue
	 * Returns a paginated list of all label relations for the given issue.
	 * Shows which labels are attached to the issue, with assignment metadata.
	 * Requires read access to the issue.
	 * @returns ApiResponse_Vec_IssueLabelRelation Label relations listed successfully. Returns array of label relation objects with metadata.
	 * @throws ApiError
	 */
	public static issueListLabelRelations({
		workspaceName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Maximum number of label relations to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of label relations to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueLabelRelation> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/labels',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Assign a label to an issue
	 * Attaches a label to the given issue. The label must belong to a repository in the same workspace.
	 * Requires write access to the issue (author or workspace member).
	 *
	 * Effects:
	 * - Label is attached to the issue
	 * - Issue label count is incremented
	 *
	 * Returns the created label relation.
	 * @returns ApiResponse_IssueLabelRelation Label assigned successfully. Returns the created label relation.
	 * @throws ApiError
	 */
	public static issueAssignLabel({
		workspaceName,
		number,
		labelId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Label ID (UUID) to assign
		 */
		labelId: string,
	}): CancelablePromise<ApiResponse_IssueLabelRelation> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/labels/{label_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'label_id': labelId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `Issue or label not found`,
				409: `Label is already assigned to this issue`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unassign a label from an issue
	 * Removes a label from the given issue.
	 * Requires write access to the issue (author or workspace member).
	 *
	 * Effects:
	 * - Label relation is removed from the issue
	 * - Issue label count is decremented
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Label unassigned successfully.
	 * @throws ApiError
	 */
	public static issueUnassignLabel({
		workspaceName,
		number,
		labelId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Label ID (UUID) to unassign
		 */
		labelId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/labels/{label_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'label_id': labelId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `Label is not assigned to this issue or not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Lock or unlock an issue
	 * Locks or unlocks conversation on an issue. When locked, only users with write access can comment.
	 * Requires write access to the issue (author or workspace member).
	 *
	 * Returns the updated issue with lock status.
	 * @returns ApiResponse_Issue Issue lock status updated successfully.
	 * @throws ApiError
	 */
	public static issueLock({
		workspaceName,
		number,
		requestBody,
	}: {
		workspaceName: string,
		number: number,
		/**
		 * Lock/unlock parameters
		 */
		requestBody: LockIssueParams,
	}): CancelablePromise<ApiResponse_Issue> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/lock',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to manage this issue`,
				404: `Workspace or issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Mute or unmute issue notifications
	 * Mutes or unmutes notifications for the given issue without unsubscribing.
	 * Requires an active subscription to the issue.
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Mute status updated successfully.
	 * @throws ApiError
	 */
	public static issueMute({
		workspaceName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Mute/unmute parameters
		 */
		requestBody: MuteIssueParams,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/mute',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required or session expired`,
				404: `Not currently subscribed to this issue`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List pull request relations for an issue
	 * Returns a paginated list of all pull requests linked to the given issue.
	 * Shows relation type (closes, references, depends_on, etc.) and link metadata.
	 * Requires read access to the issue.
	 * @returns ApiResponse_Vec_IssuePrRelation PR relations listed successfully. Returns array of PR relation objects.
	 * @throws ApiError
	 */
	public static issueListPrRelations({
		workspaceName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Maximum number of relations to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of relations to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssuePrRelation> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/prs',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Link a pull request to an issue
	 * Creates a relation between the given issue and a pull request.
	 * Commonly used to mark a PR as closing or referencing an issue.
	 * Requires write access to the issue.
	 *
	 * Parameters:
	 * - pull_request_id: Pull request ID (UUID) to link
	 * - relation_type: Relation type ("closes", "references", "depends_on", default: "references")
	 *
	 * Returns the created relation.
	 * @returns ApiResponse_IssuePrRelation Pull request linked successfully. Returns the created relation.
	 * @throws ApiError
	 */
	public static issueLinkPr({
		workspaceName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Link pull request parameters
		 */
		requestBody: LinkPrParams,
	}): CancelablePromise<ApiResponse_IssuePrRelation> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/prs',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: invalid relation type`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `Issue or pull request not found`,
				409: `Pull request is already linked to this issue`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unlink a pull request from an issue
	 * Removes a pull request relation from the given issue.
	 * Requires write access to the issue.
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Pull request unlinked successfully.
	 * @throws ApiError
	 */
	public static issueUnlinkPr({
		workspaceName,
		number,
		relationId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Relation ID (UUID)
		 */
		relationId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/prs/{relation_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'relation_id': relationId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `PR relation not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List reactions on an issue
	 * Returns a paginated list of all emoji reactions on the given issue.
	 * Includes reaction content, target type, and user who added each reaction.
	 * Requires read access to the issue.
	 * @returns ApiResponse_Vec_IssueReaction Reactions listed successfully. Returns array of reaction objects.
	 * @throws ApiError
	 */
	public static issueListReactions({
		workspaceName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Maximum number of reactions to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of reactions to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueReaction> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/reactions',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Add a reaction to an issue
	 * Adds an emoji reaction to the given issue.
	 * Requires read access to the issue.
	 *
	 * Parameters:
	 * - content: Reaction content (e.g., "👍", "❤️", "🎉")
	 * - target_type: Target type for the reaction (defaults to "Issue")
	 * - target_id: Target ID for reactions on specific comments (optional)
	 *
	 * Returns the created reaction.
	 * @returns ApiResponse_IssueReaction Reaction added successfully. Returns the created reaction.
	 * @throws ApiError
	 */
	public static issueAddReaction({
		workspaceName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Reaction creation parameters
		 */
		requestBody: CreateIssueReactionParams,
	}): CancelablePromise<ApiResponse_IssueReaction> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/reactions',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty content or invalid target type`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `Issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Remove a reaction from an issue
	 * Removes a previously added reaction. Only the user who added the reaction can remove it.
	 * Requires read access to the issue.
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Reaction removed successfully.
	 * @throws ApiError
	 */
	public static issueRemoveReaction({
		workspaceName,
		number,
		reactionId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Reaction ID (UUID)
		 */
		reactionId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/reactions/{reaction_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'reaction_id': reactionId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Cannot remove another user's reaction`,
				404: `Reaction not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Reopen an issue
	 * Reopens a closed issue. The issue state changes back to "open" and closed metadata is cleared.
	 * Requires write access to the issue (author or workspace member).
	 *
	 * Returns the reopened issue with updated metadata.
	 * @returns ApiResponse_Issue Issue reopened successfully. Returns the reopened issue with updated metadata.
	 * @throws ApiError
	 */
	public static issueReopen({
		workspaceName,
		number,
	}: {
		workspaceName: string,
		number: number,
	}): CancelablePromise<ApiResponse_Issue> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/reopen',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			errors: {
				400: `Issue is not closed`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to reopen this issue`,
				404: `Workspace or issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List repository relations for an issue
	 * Returns a paginated list of all repositories linked to the given issue.
	 * Shows relation type (references, duplicates, blocks, etc.) and link metadata.
	 * Requires read access to the issue.
	 * @returns ApiResponse_Vec_IssueRepoRelation Repository relations listed successfully. Returns array of relation objects.
	 * @throws ApiError
	 */
	public static issueListRepoRelations({
		workspaceName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Maximum number of relations to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of relations to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueRepoRelation> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/repos',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Link a repository to an issue
	 * Creates a relation between the given issue and a repository.
	 * Requires write access to the issue.
	 *
	 * Parameters:
	 * - repo_id: Repository ID (UUID) to link
	 * - relation_type: Relation type ("references", "duplicates", "blocks", "depends_on", default: "references")
	 *
	 * Returns the created relation.
	 * @returns ApiResponse_IssueRepoRelation Repository linked successfully. Returns the created relation.
	 * @throws ApiError
	 */
	public static issueLinkRepo({
		workspaceName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Link repository parameters
		 */
		requestBody: LinkRepoParams,
	}): CancelablePromise<ApiResponse_IssueRepoRelation> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/repos',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: invalid relation type`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `Issue or repository not found`,
				409: `Repository is already linked to this issue`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unlink a repository from an issue
	 * Removes a repository relation from the given issue.
	 * Requires write access to the issue.
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Repository unlinked successfully.
	 * @throws ApiError
	 */
	public static issueUnlinkRepo({
		workspaceName,
		number,
		relationId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Relation ID (UUID)
		 */
		relationId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/repos/{relation_id}',
			path: {
				'workspace_name': workspaceName,
				'number': number,
				'relation_id': relationId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to edit this issue`,
				404: `Repository relation not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Subscribe to an issue
	 * Subscribes the authenticated user to the given issue to receive notifications.
	 * Requires read access to the issue.
	 *
	 * Effects:
	 * - User is added as a subscriber with "manual" reason
	 * - User receives notifications for all issue activity
	 *
	 * Returns the created subscription record.
	 * @returns ApiResponse_IssueSubscriber Subscribed successfully. Returns the subscription record.
	 * @throws ApiError
	 */
	public static issueSubscribe({
		workspaceName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_IssueSubscriber> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/subscribe',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Issue not found`,
				409: `Already subscribed to this issue`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unsubscribe from an issue
	 * Removes the authenticated user's subscription to the given issue.
	 * Stops all notifications for this issue.
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Unsubscribed successfully.
	 * @throws ApiError
	 */
	public static issueUnsubscribe({
		workspaceName,
		number,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/subscribe',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `Not currently subscribed to this issue`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List subscribers of an issue
	 * Returns a paginated list of all users subscribed to the given issue.
	 * Shows who receives notifications and their subscription reason (author, assignee, manual).
	 * Requires read access to the issue.
	 * @returns ApiResponse_Vec_IssueSubscriber Subscribers listed successfully. Returns array of subscriber objects.
	 * @throws ApiError
	 */
	public static issueListSubscribers({
		workspaceName,
		number,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Maximum number of subscribers to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of subscribers to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueSubscriber> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/subscribers',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions to view this issue`,
				404: `Issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Transfer an issue to another workspace
	 * Moves an issue from the current workspace to a different workspace.
	 * Requires Admin role in both the source and target workspaces.
	 *
	 * Effects:
	 * - Issue is transferred to the target workspace with a new number
	 * - Source workspace issue count is decremented
	 * - Target workspace issue count is incremented
	 *
	 * Returns the transferred issue with updated workspace and number.
	 * @returns ApiResponse_Issue Issue transferred successfully. Returns the issue with new workspace assignment.
	 * @throws ApiError
	 */
	public static issueTransfer({
		workspaceName,
		number,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Issue number (unique within the workspace)
		 */
		number: number,
		/**
		 * Transfer parameters
		 */
		requestBody: TransferIssueParams,
	}): CancelablePromise<ApiResponse_Issue> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/issues/{number}/transfer',
			path: {
				'workspace_name': workspaceName,
				'number': number,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid target workspace`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions in source or target workspace`,
				404: `Workspace or issue not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List labels in a repository
	 * Returns all issue labels defined in the repository, sorted alphabetically.
	 * Requires read access to the repository.
	 * @returns ApiResponse_Vec_IssueLabel Labels listed successfully.
	 * @throws ApiError
	 */
	public static issueListLabels({
		workspaceName,
		repoName,
	}: {
		workspaceName: string,
		repoName: string,
	}): CancelablePromise<ApiResponse_Vec_IssueLabel> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/labels',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions`,
				404: `Repository or workspace not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Create a label
	 * Creates a new issue label in a repository.
	 * Requires at least Member role in the repository.
	 *
	 * Parameters:
	 * - name: Label name (required, e.g., "bug", "feature")
	 * - color: Hex color code (required, e.g., "#FF0000")
	 * - description: Label description (optional)
	 *
	 * Returns the created label with metadata.
	 * @returns ApiResponse_IssueLabel Label created successfully.
	 * @throws ApiError
	 */
	public static issueCreateLabel({
		workspaceName,
		repoName,
		requestBody,
	}: {
		workspaceName: string,
		repoName: string,
		/**
		 * Label creation parameters
		 */
		requestBody: CreateLabelParams,
	}): CancelablePromise<ApiResponse_IssueLabel> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/labels',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty name or invalid color`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Member role)`,
				404: `Repository or workspace not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update a label
	 * Updates an existing issue label's name, color, or description.
	 * Requires Admin role in the repository.
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated label.
	 * @returns ApiResponse_IssueLabel Label updated successfully.
	 * @throws ApiError
	 */
	public static issueUpdateLabel({
		workspaceName,
		repoName,
		labelId,
		requestBody,
	}: {
		workspaceName: string,
		repoName: string,
		labelId: string,
		/**
		 * Label update parameters (all fields optional)
		 */
		requestBody: UpdateLabelParams,
	}): CancelablePromise<ApiResponse_IssueLabel> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/labels/{label_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'label_id': labelId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Admin role)`,
				404: `Repository, workspace, or label not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete a label
	 * Permanently removes an issue label from a repository.
	 * Requires Admin role in the repository.
	 *
	 * Effects:
	 * - Label is permanently deleted
	 * - All issue-label relations using this label are removed
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Label deleted successfully.
	 * @throws ApiError
	 */
	public static issueDeleteLabel({
		workspaceName,
		repoName,
		labelId,
	}: {
		workspaceName: string,
		repoName: string,
		labelId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/labels/{label_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'label_id': labelId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Admin role)`,
				404: `Repository, workspace, or label not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List milestones in a repository
	 * Returns a paginated list of milestones in the repository, sorted by state (open first) then by due date.
	 * Includes milestone metadata such as title, description, state, due date, and progress.
	 * Requires read access to the repository.
	 * @returns ApiResponse_Vec_IssueMilestone Milestones listed successfully. Returns array of milestone objects with metadata.
	 * @throws ApiError
	 */
	public static issueListMilestones({
		workspaceName,
		repoName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Maximum number of milestones to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of milestones to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueMilestone> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/milestones',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			query: {
				'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 milestone
	 * Creates a new milestone in a repository for tracking issue progress.
	 * Requires at least Member role in the repository.
	 *
	 * Parameters:
	 * - title: Milestone title (required)
	 * - description: Description of the milestone (optional)
	 * - due_at: Target due date (optional)
	 *
	 * Returns the created milestone with metadata.
	 * @returns ApiResponse_IssueMilestone Milestone created successfully. Returns the newly created milestone with metadata.
	 * @throws ApiError
	 */
	public static issueCreateMilestone({
		workspaceName,
		repoName,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Milestone creation parameters
		 */
		requestBody: CreateMilestoneParams,
	}): CancelablePromise<ApiResponse_IssueMilestone> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/milestones',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty title`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Member role or higher)`,
				404: `Repository or workspace not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update a milestone
	 * Updates an existing milestone's metadata. Can also close or reopen the milestone via the state field.
	 * Requires at least Member role in the repository.
	 *
	 * Updatable fields:
	 * - title: Milestone title (optional)
	 * - description: Description (optional)
	 * - due_at: Target due date (optional)
	 * - state: State ("open" or "closed") for closing/reopening the milestone (optional)
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated milestone with full metadata.
	 * @returns ApiResponse_IssueMilestone Milestone updated successfully. Returns the updated milestone with full metadata.
	 * @throws ApiError
	 */
	public static issueUpdateMilestone({
		workspaceName,
		repoName,
		milestoneId,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Milestone ID (UUID)
		 */
		milestoneId: string,
		/**
		 * Milestone update parameters (all fields optional)
		 */
		requestBody: UpdateMilestoneParams,
	}): CancelablePromise<ApiResponse_IssueMilestone> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/milestones/{milestone_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'milestone_id': milestoneId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Member role or higher)`,
				404: `Repository, workspace, or milestone not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete a milestone
	 * Permanently removes a milestone from the repository.
	 * Requires Admin role in the repository.
	 *
	 * Effects:
	 * - Milestone is permanently deleted
	 * - Issues attached to this milestone lose their milestone association
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Milestone deleted successfully.
	 * @throws ApiError
	 */
	public static issueDeleteMilestone({
		workspaceName,
		repoName,
		milestoneId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Milestone ID (UUID)
		 */
		milestoneId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/milestones/{milestone_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'milestone_id': milestoneId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Admin role)`,
				404: `Repository, workspace, or milestone not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List issue templates in a repository
	 * Returns a paginated list of all active issue templates in the repository.
	 * Templates provide pre-filled content for creating new issues.
	 * Sorted alphabetically by name.
	 * Requires read access to the repository.
	 * @returns ApiResponse_Vec_IssueTemplate Templates listed successfully. Returns array of template objects.
	 * @throws ApiError
	 */
	public static issueListTemplates({
		workspaceName,
		repoName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Maximum number of templates to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of templates to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_IssueTemplate> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/templates',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			query: {
				'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 an issue template
	 * Creates a new issue template in the repository.
	 * Requires at least Member role in the repository.
	 *
	 * Parameters:
	 * - name: Template name (required)
	 * - description: Template description (optional)
	 * - title_template: Default title for issues (optional, supports placeholders)
	 * - body_template: Default body content in markdown (required)
	 * - labels: List of label names to auto-apply (optional)
	 *
	 * Returns the created template with metadata.
	 * @returns ApiResponse_IssueTemplate Template created successfully. Returns the newly created template.
	 * @throws ApiError
	 */
	public static issueCreateTemplate({
		workspaceName,
		repoName,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Template creation parameters
		 */
		requestBody: CreateTemplateParams,
	}): CancelablePromise<ApiResponse_IssueTemplate> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/templates',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty name or body template`,
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Member role or higher)`,
				404: `Repository or workspace not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update an issue template
	 * Updates an existing issue template's metadata and content.
	 * Requires Admin role in the repository.
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated template.
	 * @returns ApiResponse_IssueTemplate Template updated successfully. Returns the updated template.
	 * @throws ApiError
	 */
	public static issueUpdateTemplate({
		workspaceName,
		repoName,
		templateId,
		requestBody,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Template ID (UUID)
		 */
		templateId: string,
		/**
		 * Template update parameters (all fields optional)
		 */
		requestBody: UpdateTemplateParams,
	}): CancelablePromise<ApiResponse_IssueTemplate> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/templates/{template_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'template_id': templateId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Admin role)`,
				404: `Repository, workspace, or template not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete an issue template
	 * Permanently removes an issue template from the repository.
	 * Requires Admin role in the repository.
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Template deleted successfully.
	 * @throws ApiError
	 */
	public static issueDeleteTemplate({
		workspaceName,
		repoName,
		templateId,
	}: {
		/**
		 * Workspace name (unique identifier)
		 */
		workspaceName: string,
		/**
		 * Repository name (unique within the workspace)
		 */
		repoName: string,
		/**
		 * Template ID (UUID)
		 */
		templateId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/repos/{repo_name}/issues/templates/{template_id}',
			path: {
				'workspace_name': workspaceName,
				'repo_name': repoName,
				'template_id': templateId,
			},
			errors: {
				401: `Authentication required or session expired`,
				403: `Insufficient permissions (requires Admin role)`,
				404: `Template not found`,
				500: `Internal server error`,
			},
		});
	}
}
