/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 9a45caf93b40
 */

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

export type ArchiveModelResponse = {
  id: string;
  object: "model";
  archived: boolean;
};

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

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