/* * 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 GetTextToSpeechHistoryContentRequest = { ttsId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; export type GetTextToSpeechHistoryContentResponse = | ReadableStream | ReadableStream; /** @internal */ export const GetTextToSpeechHistoryContentRequest$inboundSchema: z.ZodType< GetTextToSpeechHistoryContentRequest, z.ZodTypeDef, unknown > = z.object({ tts_id: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "tts_id": "ttsId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type GetTextToSpeechHistoryContentRequest$Outbound = { tts_id: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const GetTextToSpeechHistoryContentRequest$outboundSchema: z.ZodType< GetTextToSpeechHistoryContentRequest$Outbound, z.ZodTypeDef, GetTextToSpeechHistoryContentRequest > = z.object({ ttsId: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { ttsId: "tts_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function getTextToSpeechHistoryContentRequestToJSON( getTextToSpeechHistoryContentRequest: GetTextToSpeechHistoryContentRequest, ): string { return JSON.stringify( GetTextToSpeechHistoryContentRequest$outboundSchema.parse( getTextToSpeechHistoryContentRequest, ), ); } export function getTextToSpeechHistoryContentRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetTextToSpeechHistoryContentRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetTextToSpeechHistoryContentRequest' from JSON`, ); } /** @internal */ export const GetTextToSpeechHistoryContentResponse$inboundSchema: z.ZodType< GetTextToSpeechHistoryContentResponse, z.ZodTypeDef, unknown > = z.union([ z.instanceof(ReadableStream), z.instanceof(ReadableStream), ]); /** @internal */ export type GetTextToSpeechHistoryContentResponse$Outbound = | ReadableStream | ReadableStream; /** @internal */ export const GetTextToSpeechHistoryContentResponse$outboundSchema: z.ZodType< GetTextToSpeechHistoryContentResponse$Outbound, z.ZodTypeDef, GetTextToSpeechHistoryContentResponse > = z.union([ z.instanceof(ReadableStream), z.instanceof(ReadableStream), ]); export function getTextToSpeechHistoryContentResponseToJSON( getTextToSpeechHistoryContentResponse: GetTextToSpeechHistoryContentResponse, ): string { return JSON.stringify( GetTextToSpeechHistoryContentResponse$outboundSchema.parse( getTextToSpeechHistoryContentResponse, ), ); } export function getTextToSpeechHistoryContentResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetTextToSpeechHistoryContentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetTextToSpeechHistoryContentResponse' from JSON`, ); }