/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AcceptInvitationRequest } from '../models/AcceptInvitationRequest';
import type { AddDomainParams } from '../models/AddDomainParams';
import type { AddMemberParams } from '../models/AddMemberParams';
import type { ApiEmptyResponse } from '../models/ApiEmptyResponse';
import type { ApiListResponse_Value } from '../models/ApiListResponse_Value';
import type { ApiResponse_CreateInvitationResponse } from '../models/ApiResponse_CreateInvitationResponse';
import type { ApiResponse_Vec_WorkspaceAuditLog } from '../models/ApiResponse_Vec_WorkspaceAuditLog';
import type { ApiResponse_Vec_WorkspaceDetail } from '../models/ApiResponse_Vec_WorkspaceDetail';
import type { ApiResponse_Vec_WorkspaceDomain } from '../models/ApiResponse_Vec_WorkspaceDomain';
import type { ApiResponse_Vec_WorkspaceIntegration } from '../models/ApiResponse_Vec_WorkspaceIntegration';
import type { ApiResponse_Vec_WorkspaceInvitation } from '../models/ApiResponse_Vec_WorkspaceInvitation';
import type { ApiResponse_Vec_WorkspaceMember } from '../models/ApiResponse_Vec_WorkspaceMember';
import type { ApiResponse_Vec_WorkspacePendingApproval } from '../models/ApiResponse_Vec_WorkspacePendingApproval';
import type { ApiResponse_Vec_WorkspaceWebhook } from '../models/ApiResponse_Vec_WorkspaceWebhook';
import type { ApiResponse_Workspace } from '../models/ApiResponse_Workspace';
import type { ApiResponse_WorkspaceBilling } from '../models/ApiResponse_WorkspaceBilling';
import type { ApiResponse_WorkspaceCustomBranding } from '../models/ApiResponse_WorkspaceCustomBranding';
import type { ApiResponse_WorkspaceDetail } from '../models/ApiResponse_WorkspaceDetail';
import type { ApiResponse_WorkspaceDomain } from '../models/ApiResponse_WorkspaceDomain';
import type { ApiResponse_WorkspaceIntegration } from '../models/ApiResponse_WorkspaceIntegration';
import type { ApiResponse_WorkspaceInvitation } from '../models/ApiResponse_WorkspaceInvitation';
import type { ApiResponse_WorkspaceMember } from '../models/ApiResponse_WorkspaceMember';
import type { ApiResponse_WorkspacePendingApproval } from '../models/ApiResponse_WorkspacePendingApproval';
import type { ApiResponse_WorkspaceSettings } from '../models/ApiResponse_WorkspaceSettings';
import type { ApiResponse_WorkspaceStats } from '../models/ApiResponse_WorkspaceStats';
import type { ApiResponse_WorkspaceWebhook } from '../models/ApiResponse_WorkspaceWebhook';
import type { CreateIntegrationParams } from '../models/CreateIntegrationParams';
import type { CreateInvitationParams } from '../models/CreateInvitationParams';
import type { CreateWebhookParams } from '../models/CreateWebhookParams';
import type { CreateWorkspaceParams } from '../models/CreateWorkspaceParams';
import type { RequestApprovalParams } from '../models/RequestApprovalParams';
import type { ReviewApprovalRequest } from '../models/ReviewApprovalRequest';
import type { TransferOwnerRequest } from '../models/TransferOwnerRequest';
import type { UpdateBillingParams } from '../models/UpdateBillingParams';
import type { UpdateBrandingParams } from '../models/UpdateBrandingParams';
import type { UpdateDomainParams } from '../models/UpdateDomainParams';
import type { UpdateIntegrationParams } from '../models/UpdateIntegrationParams';
import type { UpdateMemberRoleParams } from '../models/UpdateMemberRoleParams';
import type { UpdateWebhookParams } from '../models/UpdateWebhookParams';
import type { UpdateWorkspaceParams } from '../models/UpdateWorkspaceParams';
import type { UpdateWorkspaceSettingsParams } from '../models/UpdateWorkspaceSettingsParams';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class WorkspacesService {
	/**
	 * List accessible workspaces
	 * Return workspaces owned by, joined by, or publicly accessible to the current user.
	 * @returns ApiResponse_Vec_WorkspaceDetail List of workspaces.
	 * @throws ApiError
	 */
	public static workspaceList({
		limit,
		offset,
	}: {
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_WorkspaceDetail> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Create a workspace
	 * Create a new workspace. The creator automatically becomes the owner.
	 * @returns ApiResponse_WorkspaceDetail Workspace created.
	 * @throws ApiError
	 */
	public static workspaceCreate({
		requestBody,
	}: {
		/**
		 * Workspace creation parameters.
		 */
		requestBody: CreateWorkspaceParams,
	}): CancelablePromise<ApiResponse_WorkspaceDetail> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces',
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Name is required or visibility is invalid.`,
				401: `Unauthenticated.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Accept an invitation
	 * Accept a workspace invitation using the token from the invitation email. The authenticated user's verified email must match the invited email.
	 * @returns ApiResponse_WorkspaceInvitation Invitation accepted and user added as a member.
	 * @throws ApiError
	 */
	public static workspaceAcceptInvitation({
		requestBody,
	}: {
		/**
		 * Invitation token.
		 */
		requestBody: AcceptInvitationRequest,
	}): CancelablePromise<ApiResponse_WorkspaceInvitation> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/invitations/accept',
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid or expired invitation, or already a member.`,
				401: `Unauthenticated or email mismatch.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Get a workspace
	 * Return the workspace identified by name, subject to visibility checks.
	 * @returns ApiResponse_WorkspaceDetail Workspace data.
	 * @throws ApiError
	 */
	public static workspaceGet({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiResponse_WorkspaceDetail> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated.`,
				404: `Workspace not found or not accessible.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Update a workspace
	 * Update workspace name, description, visibility, or default role. Requires admin role.
	 * @returns ApiResponse_WorkspaceDetail Workspace updated.
	 * @throws ApiError
	 */
	public static workspaceUpdate({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Workspace update parameters — only included fields are changed.
		 */
		requestBody: UpdateWorkspaceParams,
	}): CancelablePromise<ApiResponse_WorkspaceDetail> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Bad request — invalid visibility or default_role.`,
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Delete a workspace
	 * Soft-delete a workspace. Requires owner role.
	 * @returns ApiEmptyResponse Workspace deleted.
	 * @throws ApiError
	 */
	public static workspaceDelete({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * List pending approvals
	 * Return pending approval requests for the workspace. Requires admin role.
	 * @returns ApiResponse_Vec_WorkspacePendingApproval List of pending approvals.
	 * @throws ApiError
	 */
	public static workspaceListApprovals({
		workspaceName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_WorkspacePendingApproval> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/approvals',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Request an approval
	 * Submit a request for workspace admin approval. Readable by anyone with workspace access.
	 * @returns ApiResponse_WorkspacePendingApproval Approval request created.
	 * @throws ApiError
	 */
	public static workspaceRequestApproval({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Approval request type and optional reason.
		 */
		requestBody: RequestApprovalParams,
	}): CancelablePromise<ApiResponse_WorkspacePendingApproval> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/approvals',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid request type.`,
				401: `Unauthenticated.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * @returns ApiResponse_WorkspacePendingApproval Approval retrieved successfully
	 * @throws ApiError
	 */
	public static workspaceGetApproval({
		workspaceName,
		approvalId,
	}: {
		workspaceName: string,
		approvalId: string,
	}): CancelablePromise<ApiResponse_WorkspacePendingApproval> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/approvals/{approval_id}',
			path: {
				'workspace_name': workspaceName,
				'approval_id': approvalId,
			},
			errors: {
				401: `Authentication required`,
				404: `Approval not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Review an approval request
	 * Approve or reject a pending approval request. Requires owner role.
	 * @returns ApiEmptyResponse Approval reviewed.
	 * @throws ApiError
	 */
	public static workspaceReviewApproval({
		workspaceName,
		approvalId,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Approval record ID.
		 */
		approvalId: string,
		/**
		 * Whether to approve or reject.
		 */
		requestBody: ReviewApprovalRequest,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/approvals/{approval_id}',
			path: {
				'workspace_name': workspaceName,
				'approval_id': approvalId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Approval not found or already reviewed.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Archive a workspace
	 * Archive a workspace. Requires owner role. All repos become read-only.
	 * @returns ApiEmptyResponse Workspace archived.
	 * @throws ApiError
	 */
	public static workspaceArchive({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/archive',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found or already archived.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Get audit logs
	 * Return recent audit log entries for the workspace. Requires admin role.
	 * @returns ApiResponse_Vec_WorkspaceAuditLog List of audit log entries.
	 * @throws ApiError
	 */
	public static workspaceAuditLogs({
		workspaceName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_WorkspaceAuditLog> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/audit-logs',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Upload workspace avatar
	 * Upload an avatar image for a workspace. Requires admin role. Maximum size 5 MB. Supported: png, jpg, gif, webp. Accepts multipart/form-data with a single 'avatar' field.
	 * @returns ApiResponse_Workspace Avatar uploaded.
	 * @throws ApiError
	 */
	public static workspaceUploadAvatar({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Avatar image file in a multipart form field named 'avatar'.
		 */
		requestBody?: any,
	}): CancelablePromise<ApiResponse_Workspace> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/avatar',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			errors: {
				400: `Unsupported image format or file too large.`,
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found.`,
				500: `Storage or database failure.`,
			},
		});
	}
	/**
	 * Get billing information
	 * Return billing information for a workspace. Requires owner role.
	 * @returns ApiResponse_WorkspaceBilling Billing information.
	 * @throws ApiError
	 */
	public static workspaceGetBilling({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiResponse_WorkspaceBilling> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/billing',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Update billing information
	 * Update billing plan, email, or seat count. Requires owner role.
	 * @returns ApiResponse_WorkspaceBilling Billing updated.
	 * @throws ApiError
	 */
	public static workspaceUpdateBilling({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Billing update parameters — only included fields are changed.
		 */
		requestBody: UpdateBillingParams,
	}): CancelablePromise<ApiResponse_WorkspaceBilling> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/billing',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * List billing history
	 * Return billing history for a workspace. Requires owner role.
	 * @returns ApiListResponse_Value List of billing history entries (currently empty).
	 * @throws ApiError
	 */
	public static workspaceBillingHistory({
		workspaceName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiListResponse_Value> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/billing/history',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Internal server error.`,
			},
		});
	}
	/**
	 * Get custom branding
	 * Return custom branding settings for a workspace. Requires admin role.
	 * @returns ApiResponse_WorkspaceCustomBranding Branding settings.
	 * @throws ApiError
	 */
	public static workspaceGetBranding({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiResponse_WorkspaceCustomBranding> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/branding',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Update custom branding
	 * Update workspace custom branding including logo, favicon, colors, CSS, and support URL. Requires admin role.
	 * @returns ApiResponse_WorkspaceCustomBranding Branding updated.
	 * @throws ApiError
	 */
	public static workspaceUpdateBranding({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Branding update parameters — only included fields are changed.
		 */
		requestBody: UpdateBrandingParams,
	}): CancelablePromise<ApiResponse_WorkspaceCustomBranding> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/branding',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * List domains
	 * Return domains associated with the workspace. Requires admin role.
	 * @returns ApiResponse_Vec_WorkspaceDomain List of domains.
	 * @throws ApiError
	 */
	public static workspaceListDomains({
		workspaceName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_WorkspaceDomain> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/domains',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Add a domain
	 * Add a domain for verification. The first domain added is auto-set as primary. Requires admin role.
	 * @returns ApiResponse_WorkspaceDomain Domain added (unverified).
	 * @throws ApiError
	 */
	public static workspaceAddDomain({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Domain name to add.
		 */
		requestBody: AddDomainParams,
	}): CancelablePromise<ApiResponse_WorkspaceDomain> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/domains',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Domain is empty.`,
				401: `Unauthenticated or insufficient role.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * @returns ApiResponse_WorkspaceDomain Domain retrieved successfully
	 * @throws ApiError
	 */
	public static workspaceGetDomain({
		workspaceName,
		domainId,
	}: {
		workspaceName: string,
		domainId: string,
	}): CancelablePromise<ApiResponse_WorkspaceDomain> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/domains/{domain_id}',
			path: {
				'workspace_name': workspaceName,
				'domain_id': domainId,
			},
			errors: {
				401: `Authentication required`,
				404: `Domain not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update a domain
	 * Update a domain name. Requires admin role.
	 * @returns ApiResponse_WorkspaceDomain Domain updated.
	 * @throws ApiError
	 */
	public static workspaceUpdateDomain({
		workspaceName,
		domainId,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Domain record ID.
		 */
		domainId: string,
		/**
		 * Updated domain name.
		 */
		requestBody: UpdateDomainParams,
	}): CancelablePromise<ApiResponse_WorkspaceDomain> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/domains/{domain_id}',
			path: {
				'workspace_name': workspaceName,
				'domain_id': domainId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Domain is empty.`,
				401: `Unauthenticated or insufficient role.`,
				404: `Domain not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Delete a domain
	 * Remove a domain from the workspace. Cannot delete the primary domain. Requires admin role.
	 * @returns ApiEmptyResponse Domain deleted.
	 * @throws ApiError
	 */
	public static workspaceDeleteDomain({
		workspaceName,
		domainId,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Domain record ID.
		 */
		domainId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/domains/{domain_id}',
			path: {
				'workspace_name': workspaceName,
				'domain_id': domainId,
			},
			errors: {
				400: `Cannot delete primary domain.`,
				401: `Unauthenticated or insufficient role.`,
				404: `Domain not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Set primary domain
	 * Set a verified domain as the primary domain for the workspace. Requires owner role.
	 * @returns ApiEmptyResponse Primary domain set.
	 * @throws ApiError
	 */
	public static workspaceSetPrimaryDomain({
		workspaceName,
		domainId,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Domain record ID.
		 */
		domainId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/domains/{domain_id}/primary',
			path: {
				'workspace_name': workspaceName,
				'domain_id': domainId,
			},
			errors: {
				400: `Domain must be verified first.`,
				401: `Unauthenticated or insufficient role.`,
				404: `Domain not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Verify a domain
	 * Mark a domain as verified. Requires admin role.
	 * @returns ApiEmptyResponse Domain verified.
	 * @throws ApiError
	 */
	public static workspaceVerifyDomain({
		workspaceName,
		domainId,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Domain record ID.
		 */
		domainId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/domains/{domain_id}/verify',
			path: {
				'workspace_name': workspaceName,
				'domain_id': domainId,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Domain not found or already verified.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * List integrations
	 * Return integrations configured for the workspace. Requires admin role.
	 * @returns ApiResponse_Vec_WorkspaceIntegration List of integrations.
	 * @throws ApiError
	 */
	public static workspaceListIntegrations({
		workspaceName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_WorkspaceIntegration> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/integrations',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Create an integration
	 * Add a third-party integration to the workspace. Requires admin role.
	 * @returns ApiResponse_WorkspaceIntegration Integration created.
	 * @throws ApiError
	 */
	public static workspaceCreateIntegration({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Integration provider, name, config, and optional secret.
		 */
		requestBody: CreateIntegrationParams,
	}): CancelablePromise<ApiResponse_WorkspaceIntegration> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/integrations',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid provider or name is empty.`,
				401: `Unauthenticated or insufficient role.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * @returns ApiResponse_WorkspaceIntegration Integration retrieved successfully
	 * @throws ApiError
	 */
	public static workspaceGetIntegration({
		workspaceName,
		integrationId,
	}: {
		workspaceName: string,
		integrationId: string,
	}): CancelablePromise<ApiResponse_WorkspaceIntegration> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/integrations/{integration_id}',
			path: {
				'workspace_name': workspaceName,
				'integration_id': integrationId,
			},
			errors: {
				401: `Authentication required`,
				404: `Integration not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update an integration
	 * Update an integration's name, config, secret, or enabled state. Requires admin role.
	 * @returns ApiResponse_WorkspaceIntegration Integration updated.
	 * @throws ApiError
	 */
	public static workspaceUpdateIntegration({
		workspaceName,
		integrationId,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Integration ID.
		 */
		integrationId: string,
		/**
		 * Integration update parameters — only included fields are changed.
		 */
		requestBody: UpdateIntegrationParams,
	}): CancelablePromise<ApiResponse_WorkspaceIntegration> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/integrations/{integration_id}',
			path: {
				'workspace_name': workspaceName,
				'integration_id': integrationId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Integration not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Delete an integration
	 * Remove an integration from the workspace. Requires admin role.
	 * @returns ApiEmptyResponse Integration deleted.
	 * @throws ApiError
	 */
	public static workspaceDeleteIntegration({
		workspaceName,
		integrationId,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Integration ID.
		 */
		integrationId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/integrations/{integration_id}',
			path: {
				'workspace_name': workspaceName,
				'integration_id': integrationId,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Integration not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * List pending invitations
	 * Return pending (un-expired, un-revoked, un-accepted) invitations for a workspace. Requires admin role.
	 * @returns ApiResponse_Vec_WorkspaceInvitation List of invitations.
	 * @throws ApiError
	 */
	public static workspaceListInvitations({
		workspaceName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_WorkspaceInvitation> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/invitations',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Create an invitation
	 * Invite a user by email to join the workspace. An invitation email is sent. Requires admin role.
	 * @returns ApiResponse_CreateInvitationResponse Invitation created and email sent.
	 * @throws ApiError
	 */
	public static workspaceCreateInvitation({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Email and optional role.
		 */
		requestBody: CreateInvitationParams,
	}): CancelablePromise<ApiResponse_CreateInvitationResponse> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/invitations',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Email is empty, role is invalid, or invitation already exists.`,
				401: `Unauthenticated or insufficient role.`,
				500: `Database or email service failed.`,
			},
		});
	}
	/**
	 * @returns ApiResponse_WorkspaceInvitation Invitation retrieved successfully
	 * @throws ApiError
	 */
	public static workspaceGetInvitation({
		workspaceName,
		invitationId,
	}: {
		workspaceName: string,
		invitationId: string,
	}): CancelablePromise<ApiResponse_WorkspaceInvitation> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/invitations/{invitation_id}',
			path: {
				'workspace_name': workspaceName,
				'invitation_id': invitationId,
			},
			errors: {
				401: `Authentication required`,
				404: `Invitation not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Revoke an invitation
	 * Revoke a pending invitation so it can no longer be accepted. Requires admin role.
	 * @returns ApiEmptyResponse Invitation revoked.
	 * @throws ApiError
	 */
	public static workspaceRevokeInvitation({
		workspaceName,
		invitationId,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Invitation ID.
		 */
		invitationId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/invitations/{invitation_id}',
			path: {
				'workspace_name': workspaceName,
				'invitation_id': invitationId,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Invitation not found or already used.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Leave a workspace
	 * Remove the current user from the workspace. The owner cannot leave; transfer ownership first.
	 * @returns ApiEmptyResponse Left the workspace.
	 * @throws ApiError
	 */
	public static workspaceLeave({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/leave',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				400: `Owner cannot leave.`,
				401: `Unauthenticated or not a member.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * List workspace members
	 * Return active members of a workspace. Viewable by anyone with read access.
	 * @returns ApiResponse_Vec_WorkspaceMember List of members.
	 * @throws ApiError
	 */
	public static workspaceListMembers({
		workspaceName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_WorkspaceMember> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/members',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or not readable.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Add a member
	 * Add a user to a workspace. Requires admin role. Cannot add members with role equal to or higher than the caller.
	 * @returns ApiResponse_WorkspaceMember Member added.
	 * @throws ApiError
	 */
	public static workspaceAddMember({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * User ID and optional role.
		 */
		requestBody: AddMemberParams,
	}): CancelablePromise<ApiResponse_WorkspaceMember> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/members',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Cannot add owner, invalid role, or member invites disabled.`,
				401: `Unauthenticated or insufficient role.`,
				409: `User is already a member.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * @returns ApiResponse_WorkspaceMember Member retrieved successfully
	 * @throws ApiError
	 */
	public static workspaceGetMember({
		workspaceName,
		memberId,
	}: {
		workspaceName: string,
		memberId: string,
	}): CancelablePromise<ApiResponse_WorkspaceMember> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/members/{member_id}',
			path: {
				'workspace_name': workspaceName,
				'member_id': memberId,
			},
			errors: {
				401: `Authentication required`,
				404: `Member not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Remove a member
	 * Remove a member from the workspace. Requires admin role. Cannot remove owner.
	 * @returns ApiEmptyResponse Member removed.
	 * @throws ApiError
	 */
	public static workspaceRemoveMember({
		workspaceName,
		memberId,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Member record ID.
		 */
		memberId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/members/{member_id}',
			path: {
				'workspace_name': workspaceName,
				'member_id': memberId,
			},
			errors: {
				400: `Cannot remove owner or member with equal/higher role.`,
				401: `Unauthenticated or insufficient role.`,
				404: `Member not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Update a member's role
	 * Change the role of a workspace member. Requires admin role. Cannot change owner role; use transfer-owner instead.
	 * @returns ApiResponse_WorkspaceMember Member role updated.
	 * @throws ApiError
	 */
	public static workspaceUpdateMemberRole({
		workspaceName,
		memberId,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Member record ID.
		 */
		memberId: string,
		/**
		 * New role value.
		 */
		requestBody: UpdateMemberRoleParams,
	}): CancelablePromise<ApiResponse_WorkspaceMember> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/members/{member_id}/role',
			path: {
				'workspace_name': workspaceName,
				'member_id': memberId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid role, cannot change owner, or insufficient role.`,
				401: `Unauthenticated or insufficient role.`,
				404: `Member not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Restore a soft-deleted workspace
	 * Restore a workspace that was previously soft-deleted. Requires owner role.
	 * @returns ApiEmptyResponse Workspace restored.
	 * @throws ApiError
	 */
	public static workspaceRestore({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/restore',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found or not deleted.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Get workspace settings
	 * Return workspace settings — readable by anyone with workspace access.
	 * @returns ApiResponse_WorkspaceSettings Workspace settings.
	 * @throws ApiError
	 */
	public static workspaceGetSettings({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiResponse_WorkspaceSettings> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/settings',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or not readable.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Update workspace settings
	 * Update workspace settings such as repo visibility defaults, feature toggles, and member invite permissions. Requires admin role.
	 * @returns ApiResponse_WorkspaceSettings Settings updated.
	 * @throws ApiError
	 */
	public static workspaceUpdateSettings({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Settings update parameters — only included fields are changed.
		 */
		requestBody: UpdateWorkspaceSettingsParams,
	}): CancelablePromise<ApiResponse_WorkspaceSettings> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/settings',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Get workspace statistics
	 * Return workspace statistics including member, repository, issue, and pull request counts. Readable by anyone with workspace access.
	 * @returns ApiResponse_WorkspaceStats Workspace statistics.
	 * @throws ApiError
	 */
	public static workspaceGetStats({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiResponse_WorkspaceStats> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/stats',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or not readable.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Refresh workspace statistics
	 * Recalculate workspace statistics by counting members, repos, issues, and PRs from live data. Requires admin role.
	 * @returns ApiResponse_WorkspaceStats Refreshed statistics.
	 * @throws ApiError
	 */
	public static workspaceRefreshStats({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiResponse_WorkspaceStats> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/stats/refresh',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Database read or write failed.`,
			},
		});
	}
	/**
	 * Transfer workspace ownership
	 * Transfer workspace ownership to another active member. The current owner becomes admin.
	 * @returns ApiResponse_WorkspaceDetail Ownership transferred.
	 * @throws ApiError
	 */
	public static workspaceTransferOwner({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * New owner user ID.
		 */
		requestBody: TransferOwnerRequest,
	}): CancelablePromise<ApiResponse_WorkspaceDetail> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/transfer-owner',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `New owner must be an active member and different from current owner.`,
				401: `Unauthenticated or insufficient role.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Unarchive a workspace
	 * Restore an archived workspace to active status. Requires owner role.
	 * @returns ApiEmptyResponse Workspace unarchived.
	 * @throws ApiError
	 */
	public static workspaceUnarchive({
		workspaceName,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/unarchive',
			path: {
				'workspace_name': workspaceName,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Workspace not found or not archived.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * List webhooks
	 * Return webhooks configured for the workspace. Requires admin role.
	 * @returns ApiResponse_Vec_WorkspaceWebhook List of webhooks.
	 * @throws ApiError
	 */
	public static workspaceListWebhooks({
		workspaceName,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_WorkspaceWebhook> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/webhooks',
			path: {
				'workspace_name': workspaceName,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Database read failed.`,
			},
		});
	}
	/**
	 * Create a webhook
	 * Create a webhook for the workspace. Requires admin role. The URL must use HTTPS and cannot point to localhost or internal IPs.
	 * @returns ApiResponse_WorkspaceWebhook Webhook created.
	 * @throws ApiError
	 */
	public static workspaceCreateWebhook({
		workspaceName,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * HTTPS webhook URL, optional secret ciphertext, event types, and active flag.
		 */
		requestBody: CreateWebhookParams,
	}): CancelablePromise<ApiResponse_WorkspaceWebhook> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/webhooks',
			path: {
				'workspace_name': workspaceName,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid URL, missing events, or SSRF check failed.`,
				401: `Unauthenticated or insufficient role.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * @returns ApiResponse_WorkspaceWebhook Webhook retrieved successfully
	 * @throws ApiError
	 */
	public static workspaceGetWebhook({
		workspaceName,
		webhookId,
	}: {
		workspaceName: string,
		webhookId: string,
	}): CancelablePromise<ApiResponse_WorkspaceWebhook> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/webhooks/{webhook_id}',
			path: {
				'workspace_name': workspaceName,
				'webhook_id': webhookId,
			},
			errors: {
				401: `Authentication required`,
				404: `Webhook not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update a webhook
	 * Update a webhook's URL, secret, events, or active state. Requires admin role.
	 * @returns ApiResponse_WorkspaceWebhook Webhook updated.
	 * @throws ApiError
	 */
	public static workspaceUpdateWebhook({
		workspaceName,
		webhookId,
		requestBody,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Webhook ID.
		 */
		webhookId: string,
		/**
		 * Webhook update parameters — only included fields are changed.
		 */
		requestBody: UpdateWebhookParams,
	}): CancelablePromise<ApiResponse_WorkspaceWebhook> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/workspaces/{workspace_name}/webhooks/{webhook_id}',
			path: {
				'workspace_name': workspaceName,
				'webhook_id': webhookId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid URL.`,
				401: `Unauthenticated or insufficient role.`,
				404: `Webhook not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * Delete a webhook
	 * Remove a webhook from the workspace. Requires admin role.
	 * @returns ApiEmptyResponse Webhook deleted.
	 * @throws ApiError
	 */
	public static workspaceDeleteWebhook({
		workspaceName,
		webhookId,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Webhook ID.
		 */
		webhookId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/workspaces/{workspace_name}/webhooks/{webhook_id}',
			path: {
				'workspace_name': workspaceName,
				'webhook_id': webhookId,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Webhook not found.`,
				500: `Database transaction failed.`,
			},
		});
	}
	/**
	 * List webhook deliveries
	 * Return delivery logs for a webhook. Requires admin role.
	 * @returns ApiListResponse_Value List of deliveries (currently empty).
	 * @throws ApiError
	 */
	public static workspaceListWebhookDeliveries({
		workspaceName,
		webhookId,
		limit,
		offset,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Webhook ID.
		 */
		webhookId: string,
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiListResponse_Value> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/workspaces/{workspace_name}/webhooks/{webhook_id}/deliveries',
			path: {
				'workspace_name': workspaceName,
				'webhook_id': webhookId,
			},
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				500: `Internal server error.`,
			},
		});
	}
	/**
	 * Retry a webhook delivery
	 * Retry a failed webhook delivery. Requires admin role.
	 * @returns ApiEmptyResponse Retry scheduled.
	 * @throws ApiError
	 */
	public static workspaceRetryWebhookDelivery({
		workspaceName,
		webhookId,
		deliveryId,
	}: {
		/**
		 * Workspace name.
		 */
		workspaceName: string,
		/**
		 * Webhook ID.
		 */
		webhookId: string,
		/**
		 * Delivery ID.
		 */
		deliveryId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/workspaces/{workspace_name}/webhooks/{webhook_id}/deliveries/{delivery_id}/retry',
			path: {
				'workspace_name': workspaceName,
				'webhook_id': webhookId,
				'delivery_id': deliveryId,
			},
			errors: {
				401: `Unauthenticated or insufficient role.`,
				404: `Delivery not found.`,
				500: `Internal server error.`,
			},
		});
	}
}
