/*
 * 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 DeleteModelOut = {
  /**
   * The ID of the deleted model.
   */
  id: string;
  /**
   * The object type that was deleted
   */
  object: string | undefined;
  /**
   * The deletion status
   */
  deleted: boolean | undefined;
};

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

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