/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ComputerScreenshot = { type: "computer_screenshot"; fileId?: string | undefined; imageUrl?: string | undefined; }; /** @internal */ export const ComputerScreenshot$inboundSchema: z.ZodType< ComputerScreenshot, z.ZodTypeDef, unknown > = z.object({ type: z.literal("computer_screenshot"), file_id: z.string().optional(), image_url: z.string().optional(), }).transform((v) => { return remap$(v, { "file_id": "fileId", "image_url": "imageUrl", }); }); /** @internal */ export type ComputerScreenshot$Outbound = { type: "computer_screenshot"; file_id?: string | undefined; image_url?: string | undefined; }; /** @internal */ export const ComputerScreenshot$outboundSchema: z.ZodType< ComputerScreenshot$Outbound, z.ZodTypeDef, ComputerScreenshot > = z.object({ type: z.literal("computer_screenshot"), fileId: z.string().optional(), imageUrl: z.string().optional(), }).transform((v) => { return remap$(v, { fileId: "file_id", imageUrl: "image_url", }); }); export function computerScreenshotToJSON( computerScreenshot: ComputerScreenshot, ): string { return JSON.stringify( ComputerScreenshot$outboundSchema.parse(computerScreenshot), ); } export function computerScreenshotFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputerScreenshot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputerScreenshot' from JSON`, ); }