/* * 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 { blobLikeSchema } from "../../types/blobs.js"; export type RunBuildDeprecatedGlobals = { appId?: string | undefined; }; export type FileT = { fileName: string; content: ReadableStream | Blob | ArrayBuffer | Uint8Array; }; export type RunBuildDeprecatedRequestBody = { file: FileT | Blob; }; export type RunBuildDeprecatedRequest = { appId?: string | undefined; buildId: number; requestBody: RunBuildDeprecatedRequestBody; }; /** @internal */ export type FileT$Outbound = { fileName: string; content: ReadableStream | Blob | ArrayBuffer | Uint8Array; }; /** @internal */ export const FileT$outboundSchema: z.ZodType< FileT$Outbound, z.ZodTypeDef, FileT > = z.object({ fileName: z.string(), content: z.union([ z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), z.instanceof(Uint8Array), ]), }); export function fileToJSON(fileT: FileT): string { return JSON.stringify(FileT$outboundSchema.parse(fileT)); } /** @internal */ export type RunBuildDeprecatedRequestBody$Outbound = { file: FileT$Outbound | Blob; }; /** @internal */ export const RunBuildDeprecatedRequestBody$outboundSchema: z.ZodType< RunBuildDeprecatedRequestBody$Outbound, z.ZodTypeDef, RunBuildDeprecatedRequestBody > = z.object({ file: z.lazy(() => FileT$outboundSchema).or(blobLikeSchema), }); export function runBuildDeprecatedRequestBodyToJSON( runBuildDeprecatedRequestBody: RunBuildDeprecatedRequestBody, ): string { return JSON.stringify( RunBuildDeprecatedRequestBody$outboundSchema.parse( runBuildDeprecatedRequestBody, ), ); } /** @internal */ export type RunBuildDeprecatedRequest$Outbound = { appId?: string | undefined; buildId: number; RequestBody: RunBuildDeprecatedRequestBody$Outbound; }; /** @internal */ export const RunBuildDeprecatedRequest$outboundSchema: z.ZodType< RunBuildDeprecatedRequest$Outbound, z.ZodTypeDef, RunBuildDeprecatedRequest > = z.object({ appId: z.string().optional(), buildId: z.number().int(), requestBody: z.lazy(() => RunBuildDeprecatedRequestBody$outboundSchema), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function runBuildDeprecatedRequestToJSON( runBuildDeprecatedRequest: RunBuildDeprecatedRequest, ): string { return JSON.stringify( RunBuildDeprecatedRequest$outboundSchema.parse(runBuildDeprecatedRequest), ); }