import z from 'zod';
import { ResponseArgs } from '../models';

const ResponseArgsSchema = z.object({
  error: z.boolean(),
  message: z.string().optional(),
  invalidProperties: z.record(z.string()).optional(),
  result: z.any().optional(),
});

export function isResponseArgs<T>(args: any): args is ResponseArgs<T> {
  return ResponseArgsSchema.safeParse(args).success;
}
