/* * 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 GetFileContentRequest = { fileId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; export type GetFileContentResponse = | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream; /** @internal */ export const GetFileContentRequest$inboundSchema: z.ZodType< GetFileContentRequest, z.ZodTypeDef, unknown > = z.object({ file_id: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "file_id": "fileId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type GetFileContentRequest$Outbound = { file_id: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const GetFileContentRequest$outboundSchema: z.ZodType< GetFileContentRequest$Outbound, z.ZodTypeDef, GetFileContentRequest > = z.object({ fileId: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { fileId: "file_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function getFileContentRequestToJSON( getFileContentRequest: GetFileContentRequest, ): string { return JSON.stringify( GetFileContentRequest$outboundSchema.parse(getFileContentRequest), ); } export function getFileContentRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetFileContentRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFileContentRequest' from JSON`, ); } /** @internal */ export const GetFileContentResponse$inboundSchema: z.ZodType< GetFileContentResponse, z.ZodTypeDef, unknown > = z.union([ z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), ]); /** @internal */ export type GetFileContentResponse$Outbound = | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream | ReadableStream; /** @internal */ export const GetFileContentResponse$outboundSchema: z.ZodType< GetFileContentResponse$Outbound, z.ZodTypeDef, GetFileContentResponse > = z.union([ z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), z.instanceof(ReadableStream), ]); export function getFileContentResponseToJSON( getFileContentResponse: GetFileContentResponse, ): string { return JSON.stringify( GetFileContentResponse$outboundSchema.parse(getFileContentResponse), ); } export function getFileContentResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetFileContentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetFileContentResponse' from JSON`, ); }