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

import {ZodObjectId} from "./object-id";
import {ZodGenericTiming, ZodGenericTimingWrite } from "./generic-timing";

export const ZodOIDGenericData = ZodGenericTiming.extend({
	/**
	 * Unique ObjectID of the object
	 */
	oid: ZodObjectId.readonly(),

});

export type OIDGenericData = zod.infer<typeof ZodOIDGenericData>;

export function isOIDGenericData(data: any): data is OIDGenericData {
	try {
		ZodOIDGenericData.parse(data);
		return true;
	} catch (e: any) {
		console.log(`Fail to parse data type='ZodOIDGenericData' error=${e}`);
		return false;
	}
}
export const ZodOIDGenericDataWrite = ZodGenericTimingWrite;

export type OIDGenericDataWrite = zod.infer<typeof ZodOIDGenericDataWrite>;

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