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

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

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

export type ListVolumesResponse = ListVolumesResponses[keyof ListVolumesResponses];

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

export type CreateVolumeResponses = {
	/**
	 * Volume created successfully
	 */
	201: {
		message: string;
		volume: {
			name: string;
			path: string;
		};
	};
};

export type CreateVolumeResponse = CreateVolumeResponses[keyof CreateVolumeResponses];

export type TestConnectionData = {
	body?: {
		config:
			| {
					backend: "directory";
			  }
			| {
					backend: "nfs";
					exportPath: string;
					server: string;
					version: "3" | "4" | "4.1";
					port?: number;
			  }
			| {
					backend: "smb";
					password: string;
					server: string;
					share: string;
					username: string;
					vers?: "1.0" | "2.0" | "2.1" | "3.0";
					port?: number;
					domain?: string;
			  }
			| {
					backend: "webdav";
					path: string;
					server: string;
					port?: number;
					password?: string;
					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";
				  }
				| {
						backend: "nfs";
						exportPath: string;
						server: string;
						version: "3" | "4" | "4.1";
						port?: number;
				  }
				| {
						backend: "smb";
						password: string;
						server: string;
						share: string;
						username: string;
						vers?: "1.0" | "2.0" | "2.1" | "3.0";
						port?: number;
						domain?: string;
				  }
				| {
						backend: "webdav";
						path: string;
						server: string;
						port?: number;
						password?: string;
						ssl?: boolean;
						username?: string;
				  };
			createdAt: number;
			lastError: string | null;
			lastHealthCheck: number;
			name: string;
			path: string;
			status: "error" | "mounted" | "unknown" | "unmounted";
			type: "directory" | "nfs" | "smb" | "webdav";
			updatedAt: number;
		};
	};
};

export type GetVolumeResponse = GetVolumeResponses[keyof GetVolumeResponses];

export type UpdateVolumeData = {
	body?: {
		autoRemount?: boolean;
		config?:
			| {
					backend: "directory";
			  }
			| {
					backend: "nfs";
					exportPath: string;
					server: string;
					version: "3" | "4" | "4.1";
					port?: number;
			  }
			| {
					backend: "smb";
					password: string;
					server: string;
					share: string;
					username: string;
					vers?: "1.0" | "2.0" | "2.1" | "3.0";
					port?: number;
					domain?: string;
			  }
			| {
					backend: "webdav";
					path: string;
					server: string;
					port?: number;
					password?: string;
					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: {
		message: string;
		volume: {
			autoRemount: boolean;
			config:
				| {
						backend: "directory";
				  }
				| {
						backend: "nfs";
						exportPath: string;
						server: string;
						version: "3" | "4" | "4.1";
						port?: number;
				  }
				| {
						backend: "smb";
						password: string;
						server: string;
						share: string;
						username: string;
						vers?: "1.0" | "2.0" | "2.1" | "3.0";
						port?: number;
						domain?: string;
				  }
				| {
						backend: "webdav";
						path: string;
						server: string;
						port?: number;
						password?: string;
						ssl?: boolean;
						username?: string;
				  };
			createdAt: number;
			lastError: string | null;
			lastHealthCheck: number;
			name: string;
			path: string;
			status: "error" | "mounted" | "unknown" | "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: {
		containers: 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 MountVolumeErrors = {
	/**
	 * Volume not found
	 */
	404: unknown;
};

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 UnmountVolumeErrors = {
	/**
	 * Volume not found
	 */
	404: unknown;
};

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 ClientOptions = {
	baseUrl: "http://localhost:4096" | (string & {});
};
