// This file is auto-generated by @hey-api/openapi-ts

export type RegisterData = {
	body?: {
		password: string;
		username: string;
	};
	path?: never;
	query?: never;
	url: "/api/v1/auth/register";
};

export type RegisterResponses = {
	/**
	 * User created successfully
	 */
	201: {
		message: string;
		success: boolean;
		user?: {
			hasDownloadedResticPassword: boolean;
			id: number;
			username: string;
		};
	};
};

export type RegisterResponse = RegisterResponses[keyof RegisterResponses];

export type LoginData = {
	body?: {
		password: string;
		username: string;
	};
	path?: never;
	query?: never;
	url: "/api/v1/auth/login";
};

export type LoginResponses = {
	/**
	 * Login successful
	 */
	200: {
		message: string;
		success: boolean;
		user?: {
			hasDownloadedResticPassword: boolean;
			id: number;
			username: string;
		};
	};
};

export type LoginResponse = LoginResponses[keyof LoginResponses];

export type LogoutData = {
	body?: never;
	path?: never;
	query?: never;
	url: "/api/v1/auth/logout";
};

export type LogoutResponses = {
	/**
	 * Logout successful
	 */
	200: {
		success: boolean;
	};
};

export type LogoutResponse = LogoutResponses[keyof LogoutResponses];

export type GetMeData = {
	body?: never;
	path?: never;
	query?: never;
	url: "/api/v1/auth/me";
};

export type GetMeResponses = {
	/**
	 * Current user information
	 */
	200: {
		message: string;
		success: boolean;
		user?: {
			hasDownloadedResticPassword: boolean;
			id: number;
			username: string;
		};
	};
};

export type GetMeResponse = GetMeResponses[keyof GetMeResponses];

export type GetStatusData = {
	body?: never;
	path?: never;
	query?: never;
	url: "/api/v1/auth/status";
};

export type GetStatusResponses = {
	/**
	 * Authentication system status
	 */
	200: {
		hasUsers: boolean;
	};
};

export type GetStatusResponse = GetStatusResponses[keyof GetStatusResponses];

export type ChangePasswordData = {
	body?: {
		currentPassword: string;
		newPassword: string;
	};
	path?: never;
	query?: never;
	url: "/api/v1/auth/change-password";
};

export type ChangePasswordResponses = {
	/**
	 * Password changed successfully
	 */
	200: {
		message: string;
		success: boolean;
	};
};

export type ChangePasswordResponse = ChangePasswordResponses[keyof ChangePasswordResponses];

export type ListVolumesData = {
	body?: never;
	path?: never;
	query?: never;
	url: "/api/v1/volumes";
};

export type ListVolumesResponses = {
	/**
	 * A list of volumes
	 */
	200: Array<{
		autoRemount: boolean;
		config:
			| {
					backend: "directory";
					path: string;
					readOnly?: false;
			  }
			| {
					backend: "nfs";
					exportPath: string;
					server: string;
					version: "3" | "4" | "4.1";
					port?: number;
					readOnly?: boolean;
			  }
			| {
					backend: "smb";
					password: string;
					server: string;
					share: string;
					username: string;
					vers?: "1.0" | "2.0" | "2.1" | "3.0";
					port?: number;
					domain?: string;
					readOnly?: boolean;
			  }
			| {
					backend: "webdav";
					path: string;
					server: string;
					port?: number;
					password?: string;
					readOnly?: boolean;
					ssl?: boolean;
					username?: string;
			  };
		createdAt: number;
		id: number;
		lastError: string | null;
		lastHealthCheck: number;
		name: string;
		status: "error" | "mounted" | "unmounted";
		type: "directory" | "nfs" | "smb" | "webdav";
		updatedAt: number;
	}>;
};

export type ListVolumesResponse = ListVolumesResponses[keyof ListVolumesResponses];

export type CreateVolumeData = {
	body?: {
		config:
			| {
					backend: "directory";
					path: string;
					readOnly?: false;
			  }
			| {
					backend: "nfs";
					exportPath: string;
					server: string;
					version: "3" | "4" | "4.1";
					port?: number;
					readOnly?: boolean;
			  }
			| {
					backend: "smb";
					password: string;
					server: string;
					share: string;
					username: string;
					vers?: "1.0" | "2.0" | "2.1" | "3.0";
					port?: number;
					domain?: string;
					readOnly?: boolean;
			  }
			| {
					backend: "webdav";
					path: string;
					server: string;
					port?: number;
					password?: string;
					readOnly?: boolean;
					ssl?: boolean;
					username?: string;
			  };
		name: string;
	};
	path?: never;
	query?: never;
	url: "/api/v1/volumes";
};

export type CreateVolumeResponses = {
	/**
	 * Volume created successfully
	 */
	201: {
		autoRemount: boolean;
		config:
			| {
					backend: "directory";
					path: string;
					readOnly?: false;
			  }
			| {
					backend: "nfs";
					exportPath: string;
					server: string;
					version: "3" | "4" | "4.1";
					port?: number;
					readOnly?: boolean;
			  }
			| {
					backend: "smb";
					password: string;
					server: string;
					share: string;
					username: string;
					vers?: "1.0" | "2.0" | "2.1" | "3.0";
					port?: number;
					domain?: string;
					readOnly?: boolean;
			  }
			| {
					backend: "webdav";
					path: string;
					server: string;
					port?: number;
					password?: string;
					readOnly?: boolean;
					ssl?: boolean;
					username?: string;
			  };
		createdAt: number;
		id: number;
		lastError: string | null;
		lastHealthCheck: number;
		name: string;
		status: "error" | "mounted" | "unmounted";
		type: "directory" | "nfs" | "smb" | "webdav";
		updatedAt: number;
	};
};

export type CreateVolumeResponse = CreateVolumeResponses[keyof CreateVolumeResponses];

export type TestConnectionData = {
	body?: {
		config:
			| {
					backend: "directory";
					path: string;
					readOnly?: false;
			  }
			| {
					backend: "nfs";
					exportPath: string;
					server: string;
					version: "3" | "4" | "4.1";
					port?: number;
					readOnly?: boolean;
			  }
			| {
					backend: "smb";
					password: string;
					server: string;
					share: string;
					username: string;
					vers?: "1.0" | "2.0" | "2.1" | "3.0";
					port?: number;
					domain?: string;
					readOnly?: boolean;
			  }
			| {
					backend: "webdav";
					path: string;
					server: string;
					port?: number;
					password?: string;
					readOnly?: boolean;
					ssl?: boolean;
					username?: string;
			  };
	};
	path?: never;
	query?: never;
	url: "/api/v1/volumes/test-connection";
};

export type TestConnectionResponses = {
	/**
	 * Connection test result
	 */
	200: {
		message: string;
		success: boolean;
	};
};

export type TestConnectionResponse = TestConnectionResponses[keyof TestConnectionResponses];

export type DeleteVolumeData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/volumes/{name}";
};

export type DeleteVolumeResponses = {
	/**
	 * Volume deleted successfully
	 */
	200: {
		message: string;
	};
};

export type DeleteVolumeResponse = DeleteVolumeResponses[keyof DeleteVolumeResponses];

export type GetVolumeData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/volumes/{name}";
};

export type GetVolumeErrors = {
	/**
	 * Volume not found
	 */
	404: unknown;
};

export type GetVolumeResponses = {
	/**
	 * Volume details
	 */
	200: {
		statfs: {
			free: number;
			total: number;
			used: number;
		};
		volume: {
			autoRemount: boolean;
			config:
				| {
						backend: "directory";
						path: string;
						readOnly?: false;
				  }
				| {
						backend: "nfs";
						exportPath: string;
						server: string;
						version: "3" | "4" | "4.1";
						port?: number;
						readOnly?: boolean;
				  }
				| {
						backend: "smb";
						password: string;
						server: string;
						share: string;
						username: string;
						vers?: "1.0" | "2.0" | "2.1" | "3.0";
						port?: number;
						domain?: string;
						readOnly?: boolean;
				  }
				| {
						backend: "webdav";
						path: string;
						server: string;
						port?: number;
						password?: string;
						readOnly?: boolean;
						ssl?: boolean;
						username?: string;
				  };
			createdAt: number;
			id: number;
			lastError: string | null;
			lastHealthCheck: number;
			name: string;
			status: "error" | "mounted" | "unmounted";
			type: "directory" | "nfs" | "smb" | "webdav";
			updatedAt: number;
		};
	};
};

export type GetVolumeResponse = GetVolumeResponses[keyof GetVolumeResponses];

export type UpdateVolumeData = {
	body?: {
		autoRemount?: boolean;
		config?:
			| {
					backend: "directory";
					path: string;
					readOnly?: false;
			  }
			| {
					backend: "nfs";
					exportPath: string;
					server: string;
					version: "3" | "4" | "4.1";
					port?: number;
					readOnly?: boolean;
			  }
			| {
					backend: "smb";
					password: string;
					server: string;
					share: string;
					username: string;
					vers?: "1.0" | "2.0" | "2.1" | "3.0";
					port?: number;
					domain?: string;
					readOnly?: boolean;
			  }
			| {
					backend: "webdav";
					path: string;
					server: string;
					port?: number;
					password?: string;
					readOnly?: boolean;
					ssl?: boolean;
					username?: string;
			  };
	};
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/volumes/{name}";
};

export type UpdateVolumeErrors = {
	/**
	 * Volume not found
	 */
	404: unknown;
};

export type UpdateVolumeResponses = {
	/**
	 * Volume updated successfully
	 */
	200: {
		autoRemount: boolean;
		config:
			| {
					backend: "directory";
					path: string;
					readOnly?: false;
			  }
			| {
					backend: "nfs";
					exportPath: string;
					server: string;
					version: "3" | "4" | "4.1";
					port?: number;
					readOnly?: boolean;
			  }
			| {
					backend: "smb";
					password: string;
					server: string;
					share: string;
					username: string;
					vers?: "1.0" | "2.0" | "2.1" | "3.0";
					port?: number;
					domain?: string;
					readOnly?: boolean;
			  }
			| {
					backend: "webdav";
					path: string;
					server: string;
					port?: number;
					password?: string;
					readOnly?: boolean;
					ssl?: boolean;
					username?: string;
			  };
		createdAt: number;
		id: number;
		lastError: string | null;
		lastHealthCheck: number;
		name: string;
		status: "error" | "mounted" | "unmounted";
		type: "directory" | "nfs" | "smb" | "webdav";
		updatedAt: number;
	};
};

export type UpdateVolumeResponse = UpdateVolumeResponses[keyof UpdateVolumeResponses];

export type GetContainersUsingVolumeData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/volumes/{name}/containers";
};

export type GetContainersUsingVolumeErrors = {
	/**
	 * Volume not found
	 */
	404: unknown;
};

export type GetContainersUsingVolumeResponses = {
	/**
	 * List of containers using the volume
	 */
	200: Array<{
		id: string;
		image: string;
		name: string;
		state: string;
	}>;
};

export type GetContainersUsingVolumeResponse =
	GetContainersUsingVolumeResponses[keyof GetContainersUsingVolumeResponses];

export type MountVolumeData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/volumes/{name}/mount";
};

export type MountVolumeResponses = {
	/**
	 * Volume mounted successfully
	 */
	200: {
		status: "error" | "mounted" | "unmounted";
		error?: string;
	};
};

export type MountVolumeResponse = MountVolumeResponses[keyof MountVolumeResponses];

export type UnmountVolumeData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/volumes/{name}/unmount";
};

export type UnmountVolumeResponses = {
	/**
	 * Volume unmounted successfully
	 */
	200: {
		status: "error" | "mounted" | "unmounted";
		error?: string;
	};
};

export type UnmountVolumeResponse = UnmountVolumeResponses[keyof UnmountVolumeResponses];

export type HealthCheckVolumeData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/volumes/{name}/health-check";
};

export type HealthCheckVolumeErrors = {
	/**
	 * Volume not found
	 */
	404: unknown;
};

export type HealthCheckVolumeResponses = {
	/**
	 * Volume health check result
	 */
	200: {
		status: "error" | "mounted" | "unmounted";
		error?: string;
	};
};

export type HealthCheckVolumeResponse = HealthCheckVolumeResponses[keyof HealthCheckVolumeResponses];

export type ListFilesData = {
	body?: never;
	path: {
		name: string;
	};
	query?: {
		/**
		 * Subdirectory path to list (relative to volume root)
		 */
		path?: string;
	};
	url: "/api/v1/volumes/{name}/files";
};

export type ListFilesResponses = {
	/**
	 * List of files in the volume
	 */
	200: {
		files: Array<{
			name: string;
			path: string;
			type: "directory" | "file";
			modifiedAt?: number;
			size?: number;
		}>;
		path: string;
	};
};

export type ListFilesResponse = ListFilesResponses[keyof ListFilesResponses];

export type BrowseFilesystemData = {
	body?: never;
	path?: never;
	query?: {
		/**
		 * Directory path to browse (absolute path, defaults to /)
		 */
		path?: string;
	};
	url: "/api/v1/volumes/filesystem/browse";
};

export type BrowseFilesystemResponses = {
	/**
	 * List of directories in the specified path
	 */
	200: {
		directories: Array<{
			name: string;
			path: string;
			type: "directory" | "file";
			modifiedAt?: number;
			size?: number;
		}>;
		path: string;
	};
};

export type BrowseFilesystemResponse = BrowseFilesystemResponses[keyof BrowseFilesystemResponses];

export type ListRepositoriesData = {
	body?: never;
	path?: never;
	query?: never;
	url: "/api/v1/repositories";
};

export type ListRepositoriesResponses = {
	/**
	 * List of repositories
	 */
	200: Array<{
		compressionMode: "auto" | "better" | "fastest" | "max" | "off" | null;
		config:
			| {
					accessKeyId: string;
					backend: "s3";
					bucket: string;
					endpoint: string;
					secretAccessKey: string;
			  }
			| {
					accountKey: string;
					accountName: string;
					backend: "azure";
					container: string;
					endpointSuffix?: string;
			  }
			| {
					backend: "gcs";
					bucket: string;
					credentialsJson: string;
					projectId: string;
			  }
			| {
					backend: "local";
					name: string;
			  }
			| {
					backend: "rclone";
					path: string;
					remote: string;
			  };
		createdAt: number;
		id: string;
		lastChecked: number | null;
		lastError: string | null;
		name: string;
		status: "error" | "healthy" | "unknown" | null;
		type: "azure" | "gcs" | "local" | "rclone" | "s3";
		updatedAt: number;
	}>;
};

export type ListRepositoriesResponse = ListRepositoriesResponses[keyof ListRepositoriesResponses];

export type CreateRepositoryData = {
	body?: {
		config:
			| {
					accessKeyId: string;
					backend: "s3";
					bucket: string;
					endpoint: string;
					secretAccessKey: string;
			  }
			| {
					accountKey: string;
					accountName: string;
					backend: "azure";
					container: string;
					endpointSuffix?: string;
			  }
			| {
					backend: "gcs";
					bucket: string;
					credentialsJson: string;
					projectId: string;
			  }
			| {
					backend: "local";
					name: string;
			  }
			| {
					backend: "rclone";
					path: string;
					remote: string;
			  };
		name: string;
		compressionMode?: "auto" | "better" | "fastest" | "max" | "off";
	};
	path?: never;
	query?: never;
	url: "/api/v1/repositories";
};

export type CreateRepositoryResponses = {
	/**
	 * Repository created successfully
	 */
	201: {
		message: string;
		repository: {
			id: string;
			name: string;
		};
	};
};

export type CreateRepositoryResponse = CreateRepositoryResponses[keyof CreateRepositoryResponses];

export type ListRcloneRemotesData = {
	body?: never;
	path?: never;
	query?: never;
	url: "/api/v1/repositories/rclone-remotes";
};

export type ListRcloneRemotesResponses = {
	/**
	 * List of rclone remotes
	 */
	200: Array<{
		name: string;
		type: string;
	}>;
};

export type ListRcloneRemotesResponse = ListRcloneRemotesResponses[keyof ListRcloneRemotesResponses];

export type DeleteRepositoryData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/repositories/{name}";
};

export type DeleteRepositoryResponses = {
	/**
	 * Repository deleted successfully
	 */
	200: {
		message: string;
	};
};

export type DeleteRepositoryResponse = DeleteRepositoryResponses[keyof DeleteRepositoryResponses];

export type GetRepositoryData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/repositories/{name}";
};

export type GetRepositoryResponses = {
	/**
	 * Repository details
	 */
	200: {
		compressionMode: "auto" | "better" | "fastest" | "max" | "off" | null;
		config:
			| {
					accessKeyId: string;
					backend: "s3";
					bucket: string;
					endpoint: string;
					secretAccessKey: string;
			  }
			| {
					accountKey: string;
					accountName: string;
					backend: "azure";
					container: string;
					endpointSuffix?: string;
			  }
			| {
					backend: "gcs";
					bucket: string;
					credentialsJson: string;
					projectId: string;
			  }
			| {
					backend: "local";
					name: string;
			  }
			| {
					backend: "rclone";
					path: string;
					remote: string;
			  };
		createdAt: number;
		id: string;
		lastChecked: number | null;
		lastError: string | null;
		name: string;
		status: "error" | "healthy" | "unknown" | null;
		type: "azure" | "gcs" | "local" | "rclone" | "s3";
		updatedAt: number;
	};
};

export type GetRepositoryResponse = GetRepositoryResponses[keyof GetRepositoryResponses];

export type ListSnapshotsData = {
	body?: never;
	path: {
		name: string;
	};
	query?: {
		backupId?: string;
	};
	url: "/api/v1/repositories/{name}/snapshots";
};

export type ListSnapshotsResponses = {
	/**
	 * List of snapshots
	 */
	200: Array<{
		duration: number;
		paths: Array<string>;
		short_id: string;
		size: number;
		time: number;
	}>;
};

export type ListSnapshotsResponse = ListSnapshotsResponses[keyof ListSnapshotsResponses];

export type GetSnapshotDetailsData = {
	body?: never;
	path: {
		name: string;
		snapshotId: string;
	};
	query?: never;
	url: "/api/v1/repositories/{name}/snapshots/{snapshotId}";
};

export type GetSnapshotDetailsResponses = {
	/**
	 * Snapshot details
	 */
	200: {
		duration: number;
		paths: Array<string>;
		short_id: string;
		size: number;
		time: number;
	};
};

export type GetSnapshotDetailsResponse = GetSnapshotDetailsResponses[keyof GetSnapshotDetailsResponses];

export type ListSnapshotFilesData = {
	body?: never;
	path: {
		name: string;
		snapshotId: string;
	};
	query?: {
		path?: string;
	};
	url: "/api/v1/repositories/{name}/snapshots/{snapshotId}/files";
};

export type ListSnapshotFilesResponses = {
	/**
	 * List of files and directories in the snapshot
	 */
	200: {
		files: Array<{
			name: string;
			path: string;
			type: string;
			atime?: string;
			ctime?: string;
			gid?: number;
			mode?: number;
			mtime?: string;
			size?: number;
			uid?: number;
		}>;
		snapshot: {
			hostname: string;
			id: string;
			paths: Array<string>;
			short_id: string;
			time: string;
		};
	};
};

export type ListSnapshotFilesResponse = ListSnapshotFilesResponses[keyof ListSnapshotFilesResponses];

export type RestoreSnapshotData = {
	body?: {
		snapshotId: string;
		delete?: boolean;
		exclude?: Array<string>;
		include?: Array<string>;
	};
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/repositories/{name}/restore";
};

export type RestoreSnapshotResponses = {
	/**
	 * Snapshot restored successfully
	 */
	200: {
		filesRestored: number;
		filesSkipped: number;
		message: string;
		success: boolean;
	};
};

export type RestoreSnapshotResponse = RestoreSnapshotResponses[keyof RestoreSnapshotResponses];

export type DoctorRepositoryData = {
	body?: never;
	path: {
		name: string;
	};
	query?: never;
	url: "/api/v1/repositories/{name}/doctor";
};

export type DoctorRepositoryResponses = {
	/**
	 * Doctor operation completed
	 */
	200: {
		steps: Array<{
			error: string | null;
			output: string | null;
			step: string;
			success: boolean;
		}>;
		success: boolean;
	};
};

export type DoctorRepositoryResponse = DoctorRepositoryResponses[keyof DoctorRepositoryResponses];

export type ListBackupSchedulesData = {
	body?: never;
	path?: never;
	query?: never;
	url: "/api/v1/backups";
};

export type ListBackupSchedulesResponses = {
	/**
	 * List of backup schedules
	 */
	200: Array<{
		createdAt: number;
		cronExpression: string;
		enabled: boolean;
		excludePatterns: Array<string> | null;
		id: number;
		includePatterns: Array<string> | null;
		lastBackupAt: number | null;
		lastBackupError: string | null;
		lastBackupStatus: "error" | "in_progress" | "success" | null;
		nextBackupAt: number | null;
		repository: {
			compressionMode: "auto" | "better" | "fastest" | "max" | "off" | null;
			config:
				| {
						accessKeyId: string;
						backend: "s3";
						bucket: string;
						endpoint: string;
						secretAccessKey: string;
				  }
				| {
						accountKey: string;
						accountName: string;
						backend: "azure";
						container: string;
						endpointSuffix?: string;
				  }
				| {
						backend: "gcs";
						bucket: string;
						credentialsJson: string;
						projectId: string;
				  }
				| {
						backend: "local";
						name: string;
				  }
				| {
						backend: "rclone";
						path: string;
						remote: string;
				  };
			createdAt: number;
			id: string;
			lastChecked: number | null;
			lastError: string | null;
			name: string;
			status: "error" | "healthy" | "unknown" | null;
			type: "azure" | "gcs" | "local" | "rclone" | "s3";
			updatedAt: number;
		};
		repositoryId: string;
		retentionPolicy: {
			keepDaily?: number;
			keepHourly?: number;
			keepLast?: number;
			keepMonthly?: number;
			keepWeekly?: number;
			keepWithinDuration?: string;
			keepYearly?: number;
		} | null;
		updatedAt: number;
		volume: {
			autoRemount: boolean;
			config:
				| {
						backend: "directory";
						path: string;
						readOnly?: false;
				  }
				| {
						backend: "nfs";
						exportPath: string;
						server: string;
						version: "3" | "4" | "4.1";
						port?: number;
						readOnly?: boolean;
				  }
				| {
						backend: "smb";
						password: string;
						server: string;
						share: string;
						username: string;
						vers?: "1.0" | "2.0" | "2.1" | "3.0";
						port?: number;
						domain?: string;
						readOnly?: boolean;
				  }
				| {
						backend: "webdav";
						path: string;
						server: string;
						port?: number;
						password?: string;
						readOnly?: boolean;
						ssl?: boolean;
						username?: string;
				  };
			createdAt: number;
			id: number;
			lastError: string | null;
			lastHealthCheck: number;
			name: string;
			status: "error" | "mounted" | "unmounted";
			type: "directory" | "nfs" | "smb" | "webdav";
			updatedAt: number;
		};
		volumeId: number;
	}>;
};

export type ListBackupSchedulesResponse = ListBackupSchedulesResponses[keyof ListBackupSchedulesResponses];

export type CreateBackupScheduleData = {
	body?: {
		cronExpression: string;
		enabled: boolean;
		repositoryId: string;
		volumeId: number;
		excludePatterns?: Array<string>;
		includePatterns?: Array<string>;
		retentionPolicy?: {
			keepDaily?: number;
			keepHourly?: number;
			keepLast?: number;
			keepMonthly?: number;
			keepWeekly?: number;
			keepWithinDuration?: string;
			keepYearly?: number;
		};
		tags?: Array<string>;
	};
	path?: never;
	query?: never;
	url: "/api/v1/backups";
};

export type CreateBackupScheduleResponses = {
	/**
	 * Backup schedule created successfully
	 */
	201: {
		createdAt: number;
		cronExpression: string;
		enabled: boolean;
		excludePatterns: Array<string> | null;
		id: number;
		includePatterns: Array<string> | null;
		lastBackupAt: number | null;
		lastBackupError: string | null;
		lastBackupStatus: "error" | "in_progress" | "success" | null;
		nextBackupAt: number | null;
		repositoryId: string;
		retentionPolicy: {
			keepDaily?: number;
			keepHourly?: number;
			keepLast?: number;
			keepMonthly?: number;
			keepWeekly?: number;
			keepWithinDuration?: string;
			keepYearly?: number;
		} | null;
		updatedAt: number;
		volumeId: number;
	};
};

export type CreateBackupScheduleResponse = CreateBackupScheduleResponses[keyof CreateBackupScheduleResponses];

export type DeleteBackupScheduleData = {
	body?: never;
	path: {
		scheduleId: string;
	};
	query?: never;
	url: "/api/v1/backups/{scheduleId}";
};

export type DeleteBackupScheduleResponses = {
	/**
	 * Backup schedule deleted successfully
	 */
	200: {
		success: boolean;
	};
};

export type DeleteBackupScheduleResponse = DeleteBackupScheduleResponses[keyof DeleteBackupScheduleResponses];

export type GetBackupScheduleData = {
	body?: never;
	path: {
		scheduleId: string;
	};
	query?: never;
	url: "/api/v1/backups/{scheduleId}";
};

export type GetBackupScheduleResponses = {
	/**
	 * Backup schedule details
	 */
	200: {
		createdAt: number;
		cronExpression: string;
		enabled: boolean;
		excludePatterns: Array<string> | null;
		id: number;
		includePatterns: Array<string> | null;
		lastBackupAt: number | null;
		lastBackupError: string | null;
		lastBackupStatus: "error" | "in_progress" | "success" | null;
		nextBackupAt: number | null;
		repository: {
			compressionMode: "auto" | "better" | "fastest" | "max" | "off" | null;
			config:
				| {
						accessKeyId: string;
						backend: "s3";
						bucket: string;
						endpoint: string;
						secretAccessKey: string;
				  }
				| {
						accountKey: string;
						accountName: string;
						backend: "azure";
						container: string;
						endpointSuffix?: string;
				  }
				| {
						backend: "gcs";
						bucket: string;
						credentialsJson: string;
						projectId: string;
				  }
				| {
						backend: "local";
						name: string;
				  }
				| {
						backend: "rclone";
						path: string;
						remote: string;
				  };
			createdAt: number;
			id: string;
			lastChecked: number | null;
			lastError: string | null;
			name: string;
			status: "error" | "healthy" | "unknown" | null;
			type: "azure" | "gcs" | "local" | "rclone" | "s3";
			updatedAt: number;
		};
		repositoryId: string;
		retentionPolicy: {
			keepDaily?: number;
			keepHourly?: number;
			keepLast?: number;
			keepMonthly?: number;
			keepWeekly?: number;
			keepWithinDuration?: string;
			keepYearly?: number;
		} | null;
		updatedAt: number;
		volume: {
			autoRemount: boolean;
			config:
				| {
						backend: "directory";
						path: string;
						readOnly?: false;
				  }
				| {
						backend: "nfs";
						exportPath: string;
						server: string;
						version: "3" | "4" | "4.1";
						port?: number;
						readOnly?: boolean;
				  }
				| {
						backend: "smb";
						password: string;
						server: string;
						share: string;
						username: string;
						vers?: "1.0" | "2.0" | "2.1" | "3.0";
						port?: number;
						domain?: string;
						readOnly?: boolean;
				  }
				| {
						backend: "webdav";
						path: string;
						server: string;
						port?: number;
						password?: string;
						readOnly?: boolean;
						ssl?: boolean;
						username?: string;
				  };
			createdAt: number;
			id: number;
			lastError: string | null;
			lastHealthCheck: number;
			name: string;
			status: "error" | "mounted" | "unmounted";
			type: "directory" | "nfs" | "smb" | "webdav";
			updatedAt: number;
		};
		volumeId: number;
	};
};

export type GetBackupScheduleResponse = GetBackupScheduleResponses[keyof GetBackupScheduleResponses];

export type UpdateBackupScheduleData = {
	body?: {
		cronExpression: string;
		repositoryId: string;
		enabled?: boolean;
		excludePatterns?: Array<string>;
		includePatterns?: Array<string>;
		retentionPolicy?: {
			keepDaily?: number;
			keepHourly?: number;
			keepLast?: number;
			keepMonthly?: number;
			keepWeekly?: number;
			keepWithinDuration?: string;
			keepYearly?: number;
		};
		tags?: Array<string>;
	};
	path: {
		scheduleId: string;
	};
	query?: never;
	url: "/api/v1/backups/{scheduleId}";
};

export type UpdateBackupScheduleResponses = {
	/**
	 * Backup schedule updated successfully
	 */
	200: {
		createdAt: number;
		cronExpression: string;
		enabled: boolean;
		excludePatterns: Array<string> | null;
		id: number;
		includePatterns: Array<string> | null;
		lastBackupAt: number | null;
		lastBackupError: string | null;
		lastBackupStatus: "error" | "in_progress" | "success" | null;
		nextBackupAt: number | null;
		repositoryId: string;
		retentionPolicy: {
			keepDaily?: number;
			keepHourly?: number;
			keepLast?: number;
			keepMonthly?: number;
			keepWeekly?: number;
			keepWithinDuration?: string;
			keepYearly?: number;
		} | null;
		updatedAt: number;
		volumeId: number;
	};
};

export type UpdateBackupScheduleResponse = UpdateBackupScheduleResponses[keyof UpdateBackupScheduleResponses];

export type GetBackupScheduleForVolumeData = {
	body?: never;
	path: {
		volumeId: string;
	};
	query?: never;
	url: "/api/v1/backups/volume/{volumeId}";
};

export type GetBackupScheduleForVolumeResponses = {
	/**
	 * Backup schedule details for the volume
	 */
	200: {
		createdAt: number;
		cronExpression: string;
		enabled: boolean;
		excludePatterns: Array<string> | null;
		id: number;
		includePatterns: Array<string> | null;
		lastBackupAt: number | null;
		lastBackupError: string | null;
		lastBackupStatus: "error" | "in_progress" | "success" | null;
		nextBackupAt: number | null;
		repository: {
			compressionMode: "auto" | "better" | "fastest" | "max" | "off" | null;
			config:
				| {
						accessKeyId: string;
						backend: "s3";
						bucket: string;
						endpoint: string;
						secretAccessKey: string;
				  }
				| {
						accountKey: string;
						accountName: string;
						backend: "azure";
						container: string;
						endpointSuffix?: string;
				  }
				| {
						backend: "gcs";
						bucket: string;
						credentialsJson: string;
						projectId: string;
				  }
				| {
						backend: "local";
						name: string;
				  }
				| {
						backend: "rclone";
						path: string;
						remote: string;
				  };
			createdAt: number;
			id: string;
			lastChecked: number | null;
			lastError: string | null;
			name: string;
			status: "error" | "healthy" | "unknown" | null;
			type: "azure" | "gcs" | "local" | "rclone" | "s3";
			updatedAt: number;
		};
		repositoryId: string;
		retentionPolicy: {
			keepDaily?: number;
			keepHourly?: number;
			keepLast?: number;
			keepMonthly?: number;
			keepWeekly?: number;
			keepWithinDuration?: string;
			keepYearly?: number;
		} | null;
		updatedAt: number;
		volume: {
			autoRemount: boolean;
			config:
				| {
						backend: "directory";
						path: string;
						readOnly?: false;
				  }
				| {
						backend: "nfs";
						exportPath: string;
						server: string;
						version: "3" | "4" | "4.1";
						port?: number;
						readOnly?: boolean;
				  }
				| {
						backend: "smb";
						password: string;
						server: string;
						share: string;
						username: string;
						vers?: "1.0" | "2.0" | "2.1" | "3.0";
						port?: number;
						domain?: string;
						readOnly?: boolean;
				  }
				| {
						backend: "webdav";
						path: string;
						server: string;
						port?: number;
						password?: string;
						readOnly?: boolean;
						ssl?: boolean;
						username?: string;
				  };
			createdAt: number;
			id: number;
			lastError: string | null;
			lastHealthCheck: number;
			name: string;
			status: "error" | "mounted" | "unmounted";
			type: "directory" | "nfs" | "smb" | "webdav";
			updatedAt: number;
		};
		volumeId: number;
	} | null;
};

export type GetBackupScheduleForVolumeResponse =
	GetBackupScheduleForVolumeResponses[keyof GetBackupScheduleForVolumeResponses];

export type RunBackupNowData = {
	body?: never;
	path: {
		scheduleId: string;
	};
	query?: never;
	url: "/api/v1/backups/{scheduleId}/run";
};

export type RunBackupNowResponses = {
	/**
	 * Backup started successfully
	 */
	200: {
		success: boolean;
	};
};

export type RunBackupNowResponse = RunBackupNowResponses[keyof RunBackupNowResponses];

export type StopBackupData = {
	body?: never;
	path: {
		scheduleId: string;
	};
	query?: never;
	url: "/api/v1/backups/{scheduleId}/stop";
};

export type StopBackupErrors = {
	/**
	 * No backup is currently running for this schedule
	 */
	409: unknown;
};

export type StopBackupResponses = {
	/**
	 * Backup stopped successfully
	 */
	200: {
		success: boolean;
	};
};

export type StopBackupResponse = StopBackupResponses[keyof StopBackupResponses];

export type GetSystemInfoData = {
	body?: never;
	path?: never;
	query?: never;
	url: "/api/v1/system/info";
};

export type GetSystemInfoResponses = {
	/**
	 * System information with enabled capabilities
	 */
	200: {
		capabilities: {
			docker: boolean;
			rclone: boolean;
		};
	};
};

export type GetSystemInfoResponse = GetSystemInfoResponses[keyof GetSystemInfoResponses];

export type DownloadResticPasswordData = {
	body?: {
		password: string;
	};
	path?: never;
	query?: never;
	url: "/api/v1/system/restic-password";
};

export type DownloadResticPasswordResponses = {
	/**
	 * Restic password file content
	 */
	200: string;
};

export type DownloadResticPasswordResponse = DownloadResticPasswordResponses[keyof DownloadResticPasswordResponses];

export type ClientOptions = {
	baseUrl: "http://192.168.2.42:4096" | (string & {});
};
