/**
 * Interface of the server (auto-generated code)
 */
import { z as zod } from "zod";

import {ZodObjectId} from "./object-id";
import {ZodOIDGenericData, ZodOIDGenericDataWrite } from "./oid-generic-data";

export const ZodOIDGenericDataSoftDelete = ZodOIDGenericData.extend({
	/**
	 * Deleted state
	 */
	deleted: zod.boolean().readonly().optional(),
	/**
	 * Unique ObjectID of the object
	 */
	oid: ZodObjectId.readonly(),

});

export type OIDGenericDataSoftDelete = zod.infer<typeof ZodOIDGenericDataSoftDelete>;

export function isOIDGenericDataSoftDelete(data: any): data is OIDGenericDataSoftDelete {
	try {
		ZodOIDGenericDataSoftDelete.parse(data);
		return true;
	} catch (e: any) {
		console.log(`Fail to parse data type='ZodOIDGenericDataSoftDelete' error=${e}`);
		return false;
	}
}
export const ZodOIDGenericDataSoftDeleteWrite = ZodOIDGenericDataWrite;

export type OIDGenericDataSoftDeleteWrite = zod.infer<typeof ZodOIDGenericDataSoftDeleteWrite>;

export function isOIDGenericDataSoftDeleteWrite(data: any): data is OIDGenericDataSoftDeleteWrite {
	try {
		ZodOIDGenericDataSoftDeleteWrite.parse(data);
		return true;
	} catch (e: any) {
		console.log(`Fail to parse data type='ZodOIDGenericDataSoftDeleteWrite' error=${e}`);
		return false;
	}
}
