/* * 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 FeatureFileEntity = { /** * Unique identifier for the file. */ id: string; /** * The name of the file. */ fileName: string; /** * The URL to download the file. */ url: string; /** * The MIME type of the file. */ type: string; /** * The size of the file in bytes. */ size: number; }; /** @internal */ export const FeatureFileEntity$inboundSchema: z.ZodType< FeatureFileEntity, z.ZodTypeDef, unknown > = z.object({ id: z.string(), file_name: z.string(), url: z.string(), type: z.string(), size: z.number(), }).transform((v) => { return remap$(v, { "file_name": "fileName", }); }); /** @internal */ export type FeatureFileEntity$Outbound = { id: string; file_name: string; url: string; type: string; size: number; }; /** @internal */ export const FeatureFileEntity$outboundSchema: z.ZodType< FeatureFileEntity$Outbound, z.ZodTypeDef, FeatureFileEntity > = z.object({ id: z.string(), fileName: z.string(), url: z.string(), type: z.string(), size: z.number(), }).transform((v) => { return remap$(v, { fileName: "file_name", }); }); export function featureFileEntityToJSON( featureFileEntity: FeatureFileEntity, ): string { return JSON.stringify( FeatureFileEntity$outboundSchema.parse(featureFileEntity), ); } export function featureFileEntityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeatureFileEntity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeatureFileEntity' from JSON`, ); }