// Generated from openapi/openapi.json. Do not edit by hand.

import type { PrivateContentNoticeAckResponse, PrivateContentNoticeAckRequest, CreditAdjustmentResponse, CreditAdjustmentRequest, AdminServiceHealthCheckRequest, BrowserSupportSuccess, BrowserSupportRequest, AccountDeletionResponse, AccountDeletionCompleteRequest, AdminLoginCompleteResponse, AdminLoginCompleteRequest, LoginCompleteResponse, LoginCompleteRequest, RegistrationCompleteResponse, RegistrationCompleteRequest, GenerationCreateResponse, AccountSettingsResponse, AdminDiagnosticsResponse, AdminOperationAuditResponse, AdminOverviewResponse, AdminServicesResponse, AdminServicesStorageResponse, AdminSessionResponse, CreditBalanceResponse, BootstrapResponse, GenerationTaskResponse, SseEvent, ModelConfig, ModelConfigurationResponse, CreditLedgerResponse, PrivateContentAccessAuditResponse, ProjectDetailResponse, UserSessionResponse, AdminGenerationListResponse, ProjectListResponse, RecentAssetListResponse, LogoutResponse, PrivateContentPromptResponse, ProjectPurgeResponse, RecentAssetRecordResponse, RecentAssetRecordRequest, AdminServiceRecoveryRequest, ProjectRenameResponse, ProjectRenameRequest, ModelConfigUpdateRequest, ProjectRestoreResponse, ReverseGeocodeResponse, ReverseGeocodeRequest, LatestExportSaveResponse, ProjectStateSaveResponse, ProjectEditableState, AccountDeletionSendResponse, RegistrationSendResponse, AdminLoginSendRequest, LoginSendRequest, RegistrationSendRequest, FailedEmptyTrashResponse, FailedEmptyTrashRequest, ProjectTrashResponse, AccountProfileUpdateResponse, AccountProfileUpdateRequest, AdminServiceLimitRequest } from "./types.gen.js";

export interface ClientOptions { baseUrl?: string; fetch?: typeof globalThis.fetch; headers?: HeadersInit; }

export async function ackPrivateContentNotice(body: PrivateContentNoticeAckRequest, options: ClientOptions = {}): Promise<PrivateContentNoticeAckResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/private-content-notice/ack`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<PrivateContentNoticeAckResponse>;
}

export async function adjustAdminUserCredits(body: CreditAdjustmentRequest, options: ClientOptions = {}): Promise<CreditAdjustmentResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/users/{userId}/credit-adjustments`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<CreditAdjustmentResponse>;
}

export async function checkAdminServiceHealth(body: AdminServiceHealthCheckRequest, options: ClientOptions = {}): Promise<{
  "available": boolean;
  "check_id": string;
  "checked_at": string;
}> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/services/{service_id}/health-check`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<{
  "available": boolean;
  "check_id": string;
  "checked_at": string;
}>;
}

export async function checkBrowserSupport(body: BrowserSupportRequest, options: ClientOptions = {}): Promise<BrowserSupportSuccess> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/support/check`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<BrowserSupportSuccess>;
}

export async function completeAccountDeletion(body: AccountDeletionCompleteRequest, options: ClientOptions = {}): Promise<AccountDeletionResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/account/deletion/complete`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AccountDeletionResponse>;
}

export async function completeAdminLogin(body: AdminLoginCompleteRequest, options: ClientOptions = {}): Promise<AdminLoginCompleteResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin-auth/login/complete`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminLoginCompleteResponse>;
}

export async function completeLogin(body: LoginCompleteRequest, options: ClientOptions = {}): Promise<LoginCompleteResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/auth/login/complete`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<LoginCompleteResponse>;
}

export async function completeRegistration(body: RegistrationCompleteRequest, options: ClientOptions = {}): Promise<RegistrationCompleteResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/auth/register/complete`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<RegistrationCompleteResponse>;
}

export async function createGeneration(body: FormData, options: ClientOptions = {}): Promise<GenerationCreateResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  const response = await request(`${options.baseUrl ?? ""}/api/v1/generations`, { body: body, method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<GenerationCreateResponse>;
}

export async function downloadLatestExport(options: ClientOptions = {}): Promise<Blob> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/{projectId}/latest-exports/{format}`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.blob() as Promise<Blob>;
}

export async function downloadOriginalGeneration(options: ClientOptions = {}): Promise<Blob> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/private-assets/projects/{projectId}/images/{imageId}`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.blob() as Promise<Blob>;
}

export async function getAccountSettings(options: ClientOptions = {}): Promise<AccountSettingsResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/account/settings`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AccountSettingsResponse>;
}

export async function getAdminDiagnostics(options: ClientOptions = {}): Promise<AdminDiagnosticsResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/diagnostics`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminDiagnosticsResponse>;
}

export async function getAdminOperationAudit(options: ClientOptions = {}): Promise<AdminOperationAuditResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/audit/operations`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminOperationAuditResponse>;
}

export async function getAdminOverview(options: ClientOptions = {}): Promise<AdminOverviewResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/overview`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminOverviewResponse>;
}

export async function getAdminServices(options: ClientOptions = {}): Promise<AdminServicesResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/services`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminServicesResponse>;
}

export async function getAdminServicesStorage(options: ClientOptions = {}): Promise<AdminServicesStorageResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/services-storage`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminServicesStorageResponse>;
}

export async function getAdminSession(options: ClientOptions = {}): Promise<AdminSessionResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin-auth/session`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminSessionResponse>;
}

export async function getAdminUserCredits(options: ClientOptions = {}): Promise<CreditBalanceResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/users/{userId}/credits`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<CreditBalanceResponse>;
}

export async function getBootstrap(options: ClientOptions = {}): Promise<BootstrapResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/bootstrap`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<BootstrapResponse>;
}

export async function getCurrentGeneration(options: ClientOptions = {}): Promise<GenerationTaskResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/generations/current`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<GenerationTaskResponse>;
}

export function getEvents(options: Pick<ClientOptions, "baseUrl"> = {}): string {
  return `${options.baseUrl ?? ""}/api/v1/events`;
}

export async function getGeneration(options: ClientOptions = {}): Promise<GenerationTaskResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/generations/{generationId}`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<GenerationTaskResponse>;
}

export async function getModel(options: ClientOptions = {}): Promise<ModelConfig> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/models/{model_id}`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ModelConfig>;
}

export async function getModels(options: ClientOptions = {}): Promise<ModelConfigurationResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/models`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ModelConfigurationResponse>;
}

export async function getMyCreditLedger(options: ClientOptions = {}): Promise<CreditLedgerResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/me/credit-ledger`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<CreditLedgerResponse>;
}

export async function getMyCredits(options: ClientOptions = {}): Promise<CreditBalanceResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/me/credits`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<CreditBalanceResponse>;
}

export async function getPrivateContentAccessAudit(options: ClientOptions = {}): Promise<PrivateContentAccessAuditResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/audit/private-content`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<PrivateContentAccessAuditResponse>;
}

export async function getProject(options: ClientOptions = {}): Promise<ProjectDetailResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/{projectId}`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ProjectDetailResponse>;
}

export async function getUserSession(options: ClientOptions = {}): Promise<UserSessionResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/auth/session`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<UserSessionResponse>;
}

export async function listAdminGenerations(options: ClientOptions = {}): Promise<AdminGenerationListResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/generations`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminGenerationListResponse>;
}

export async function listProjects(options: ClientOptions = {}): Promise<ProjectListResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ProjectListResponse>;
}

export async function listRecentAssets(options: ClientOptions = {}): Promise<RecentAssetListResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/assets/recent`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<RecentAssetListResponse>;
}

export async function logoutUser(options: ClientOptions = {}): Promise<LogoutResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/auth/logout`, { method: "POST", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<LogoutResponse>;
}

export async function openAdminGenerationImage(options: ClientOptions = {}): Promise<Blob> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/private-content/generations/{generationId}/image`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.blob() as Promise<Blob>;
}

export async function openAdminGenerationPrompt(options: ClientOptions = {}): Promise<PrivateContentPromptResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/private-content/generations/{generationId}/prompt`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<PrivateContentPromptResponse>;
}

export async function purgeProject(options: ClientOptions = {}): Promise<ProjectPurgeResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/{projectId}/purge`, { method: "POST", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ProjectPurgeResponse>;
}

export async function recordRecentAsset(body: RecentAssetRecordRequest, options: ClientOptions = {}): Promise<RecentAssetRecordResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/assets/recent`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<RecentAssetRecordResponse>;
}

export async function recoverAdminService(body: AdminServiceRecoveryRequest, options: ClientOptions = {}): Promise<{
  "status": "active";
}> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/services/{service_id}/recover`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<{
  "status": "active";
}>;
}

export async function renameProject(body: ProjectRenameRequest, options: ClientOptions = {}): Promise<ProjectRenameResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/{projectId}`, { body: JSON.stringify(body), method: "PATCH", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ProjectRenameResponse>;
}

export async function replaceModelConfiguration(body: ModelConfigUpdateRequest, options: ClientOptions = {}): Promise<ModelConfigurationResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/models/configuration`, { body: JSON.stringify(body), method: "PUT", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ModelConfigurationResponse>;
}

export async function restoreProject(options: ClientOptions = {}): Promise<ProjectRestoreResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/{projectId}/restore`, { method: "POST", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ProjectRestoreResponse>;
}

export async function reverseGeocodeLocation(body: ReverseGeocodeRequest, options: ClientOptions = {}): Promise<ReverseGeocodeResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/location/reverse-geocode`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ReverseGeocodeResponse>;
}

export async function saveLatestExport(body: FormData, options: ClientOptions = {}): Promise<LatestExportSaveResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/{projectId}/latest-exports/{format}`, { body: body, method: "PUT", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<LatestExportSaveResponse>;
}

export async function saveProjectState(body: ProjectEditableState, options: ClientOptions = {}): Promise<ProjectStateSaveResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/{projectId}/state`, { body: JSON.stringify(body), method: "PUT", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ProjectStateSaveResponse>;
}

export async function sendAccountDeletionCode(options: ClientOptions = {}): Promise<AccountDeletionSendResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/account/deletion/send`, { method: "POST", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AccountDeletionSendResponse>;
}

export async function sendAdminLoginCode(body: AdminLoginSendRequest, options: ClientOptions = {}): Promise<RegistrationSendResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin-auth/login/send`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<RegistrationSendResponse>;
}

export async function sendLoginCode(body: LoginSendRequest, options: ClientOptions = {}): Promise<RegistrationSendResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/auth/login/send`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<RegistrationSendResponse>;
}

export async function sendRegistrationCode(body: RegistrationSendRequest, options: ClientOptions = {}): Promise<RegistrationSendResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/auth/register/send`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<RegistrationSendResponse>;
}

export async function trashFailedEmptyProjects(body: FailedEmptyTrashRequest, options: ClientOptions = {}): Promise<FailedEmptyTrashResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/failed-empty/trash`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<FailedEmptyTrashResponse>;
}

export async function trashProject(options: ClientOptions = {}): Promise<ProjectTrashResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/projects/{projectId}/trash`, { method: "POST", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<ProjectTrashResponse>;
}

export async function updateAccountProfile(body: AccountProfileUpdateRequest, options: ClientOptions = {}): Promise<AccountProfileUpdateResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/account/settings/profile`, { body: JSON.stringify(body), method: "PUT", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AccountProfileUpdateResponse>;
}

export async function updateAdminServiceHardLimit(body: AdminServiceLimitRequest, options: ClientOptions = {}): Promise<AdminServicesResponse> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/admin/services/{service_id}/limits`, { body: JSON.stringify(body), method: "PATCH", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<AdminServicesResponse>;
}
