/* * 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 PostMediasMediaHashedIdCaptionsPurchaseRequestBody = { /** * Order computer-generated captions or paid human-generated captions. */ automated?: boolean | undefined; /** * Enable rush order for one business day turnaround or standard four business day turnaround for human-generated captions. Rush can only be used for human-generated captions. */ rush?: boolean | undefined; /** * Automatically enable captions for the video once the order is ready or hold the captions for review before manually enabling. */ automaticallyEnable?: boolean | undefined; }; export type PostMediasMediaHashedIdCaptionsPurchaseRequest = { /** * Unique identifier for the video. */ mediaHashedId: string; requestBody: PostMediasMediaHashedIdCaptionsPurchaseRequestBody; }; /** * Successful operation. Captions purchased. */ export type PostMediasMediaHashedIdCaptionsPurchaseResponse = { /** * Success message indicating the captions have been purchased */ message: string; /** * The unique hashed identifier of the time-coded transcript that was created */ id: string; }; /** @internal */ export type PostMediasMediaHashedIdCaptionsPurchaseRequestBody$Outbound = { automated: boolean; rush: boolean; automatically_enable: boolean; }; /** @internal */ export const PostMediasMediaHashedIdCaptionsPurchaseRequestBody$outboundSchema: z.ZodType< PostMediasMediaHashedIdCaptionsPurchaseRequestBody$Outbound, z.ZodTypeDef, PostMediasMediaHashedIdCaptionsPurchaseRequestBody > = z.object({ automated: z.boolean().default(false), rush: z.boolean().default(false), automaticallyEnable: z.boolean().default(true), }).transform((v) => { return remap$(v, { automaticallyEnable: "automatically_enable", }); }); export function postMediasMediaHashedIdCaptionsPurchaseRequestBodyToJSON( postMediasMediaHashedIdCaptionsPurchaseRequestBody: PostMediasMediaHashedIdCaptionsPurchaseRequestBody, ): string { return JSON.stringify( PostMediasMediaHashedIdCaptionsPurchaseRequestBody$outboundSchema.parse( postMediasMediaHashedIdCaptionsPurchaseRequestBody, ), ); } /** @internal */ export type PostMediasMediaHashedIdCaptionsPurchaseRequest$Outbound = { mediaHashedId: string; RequestBody: PostMediasMediaHashedIdCaptionsPurchaseRequestBody$Outbound; }; /** @internal */ export const PostMediasMediaHashedIdCaptionsPurchaseRequest$outboundSchema: z.ZodType< PostMediasMediaHashedIdCaptionsPurchaseRequest$Outbound, z.ZodTypeDef, PostMediasMediaHashedIdCaptionsPurchaseRequest > = z.object({ mediaHashedId: z.string(), requestBody: z.lazy(() => PostMediasMediaHashedIdCaptionsPurchaseRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function postMediasMediaHashedIdCaptionsPurchaseRequestToJSON( postMediasMediaHashedIdCaptionsPurchaseRequest: PostMediasMediaHashedIdCaptionsPurchaseRequest, ): string { return JSON.stringify( PostMediasMediaHashedIdCaptionsPurchaseRequest$outboundSchema.parse( postMediasMediaHashedIdCaptionsPurchaseRequest, ), ); } /** @internal */ export const PostMediasMediaHashedIdCaptionsPurchaseResponse$inboundSchema: z.ZodType< PostMediasMediaHashedIdCaptionsPurchaseResponse, z.ZodTypeDef, unknown > = z.object({ message: z.string(), id: z.string(), }); export function postMediasMediaHashedIdCaptionsPurchaseResponseFromJSON( jsonString: string, ): SafeParseResult< PostMediasMediaHashedIdCaptionsPurchaseResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostMediasMediaHashedIdCaptionsPurchaseResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostMediasMediaHashedIdCaptionsPurchaseResponse' from JSON`, ); }