/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LinkedAttachment = { /** * The name of the file */ name?: string | null | undefined; /** * The MIME type of the file. */ mimeType?: string | null | undefined; /** * Whether the file is compressed. */ isCompressed?: boolean | null | undefined; /** * The encoding of the file. */ encoding?: string | null | undefined; /** * The content of the file. */ content?: string | null | undefined; /** * The notes of the file. */ notes?: string | null | undefined; }; /** @internal */ export const LinkedAttachment$inboundSchema: z.ZodType< LinkedAttachment, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ name: z.nullable(types.string()).optional(), mime_type: z.nullable(types.string()).optional(), is_compressed: z.nullable(types.boolean()).optional(), encoding: z.nullable(types.string()).optional(), content: z.nullable(types.string()).optional(), notes: z.nullable(types.string()).optional(), }).transform((v) => { return remap$(v, { "mime_type": "mimeType", "is_compressed": "isCompressed", }); }) ); /** @internal */ export type LinkedAttachment$Outbound = { name?: string | null | undefined; mime_type?: string | null | undefined; is_compressed?: boolean | null | undefined; encoding?: string | null | undefined; content?: string | null | undefined; notes?: string | null | undefined; }; /** @internal */ export const LinkedAttachment$outboundSchema: z.ZodType< LinkedAttachment$Outbound, z.ZodTypeDef, LinkedAttachment > = /* @__PURE__ */ lazySchema$(() => z.object({ name: z.nullable(z.string()).optional(), mimeType: z.nullable(z.string()).optional(), isCompressed: z.nullable(z.boolean()).optional(), encoding: z.nullable(z.string()).optional(), content: z.nullable(z.string()).optional(), notes: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { mimeType: "mime_type", isCompressed: "is_compressed", }); }) ); export function linkedAttachmentToJSON( linkedAttachment: LinkedAttachment, ): string { return JSON.stringify( LinkedAttachment$outboundSchema.parse(linkedAttachment), ); } export function linkedAttachmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedAttachment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedAttachment' from JSON`, ); }