/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type UpdateChanges = { new?: Array | null | undefined; fixed?: Array | null | undefined; }; /** @internal */ export const UpdateChanges$inboundSchema: z.ZodType< UpdateChanges, z.ZodTypeDef, unknown > = z.object({ new: z.nullable(z.array(z.string())).optional(), fixed: z.nullable(z.array(z.string())).optional(), }); /** @internal */ export type UpdateChanges$Outbound = { new?: Array | null | undefined; fixed?: Array | null | undefined; }; /** @internal */ export const UpdateChanges$outboundSchema: z.ZodType< UpdateChanges$Outbound, z.ZodTypeDef, UpdateChanges > = z.object({ new: z.nullable(z.array(z.string())).optional(), fixed: z.nullable(z.array(z.string())).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UpdateChanges$ { /** @deprecated use `UpdateChanges$inboundSchema` instead. */ export const inboundSchema = UpdateChanges$inboundSchema; /** @deprecated use `UpdateChanges$outboundSchema` instead. */ export const outboundSchema = UpdateChanges$outboundSchema; /** @deprecated use `UpdateChanges$Outbound` instead. */ export type Outbound = UpdateChanges$Outbound; } export function updateChangesToJSON(updateChanges: UpdateChanges): string { return JSON.stringify(UpdateChanges$outboundSchema.parse(updateChanges)); } export function updateChangesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateChanges$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateChanges' from JSON`, ); }