/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type DeleteFileOut = {
  /**
   * The ID of the deleted file.
   */
  id: string;
  /**
   * The object type that was deleted
   */
  object: string;
  /**
   * The deletion status.
   */
  deleted: boolean;
};

/** @internal */
export const DeleteFileOut$inboundSchema: z.ZodType<
  DeleteFileOut,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: z.string(),
  object: z.string(),
  deleted: z.boolean(),
});

export function deleteFileOutFromJSON(
  jsonString: string,
): SafeParseResult<DeleteFileOut, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => DeleteFileOut$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'DeleteFileOut' from JSON`,
  );
}
