/* * 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 GetMediasMediaHashedIdCaptionsRequest = { /** * The hashed ID of the media for which captions are to be retrieved. */ mediaHashedId: string; }; export type GetMediasMediaHashedIdCaptionsResponse = { /** * English name of the language. */ englishName?: string | undefined; /** * Native name of the language. */ nativeName?: string | undefined; /** * A 3 character language code as specified by ISO-639–2. */ language: string; /** * The text of the captions for the specified language in SRT format. */ text?: string | null | undefined; isDraft: boolean; /** * The unique hashed identifier of the time-coded transcript. */ id: string; /** * A cursor for stable pagination based on current `sort_by` order. You can pass this to `cursor[before]` or `cursor[after]` as a parameter to fetch the records before or after this record in the same sort order. This is only populated if records were fetched with `cursor[enabled]`, or `cursor[before]` or `cursor[after]`. */ cursor?: string | null | undefined; }; /** @internal */ export type GetMediasMediaHashedIdCaptionsRequest$Outbound = { mediaHashedId: string; }; /** @internal */ export const GetMediasMediaHashedIdCaptionsRequest$outboundSchema: z.ZodType< GetMediasMediaHashedIdCaptionsRequest$Outbound, z.ZodTypeDef, GetMediasMediaHashedIdCaptionsRequest > = z.object({ mediaHashedId: z.string(), }); export function getMediasMediaHashedIdCaptionsRequestToJSON( getMediasMediaHashedIdCaptionsRequest: GetMediasMediaHashedIdCaptionsRequest, ): string { return JSON.stringify( GetMediasMediaHashedIdCaptionsRequest$outboundSchema.parse( getMediasMediaHashedIdCaptionsRequest, ), ); } /** @internal */ export const GetMediasMediaHashedIdCaptionsResponse$inboundSchema: z.ZodType< GetMediasMediaHashedIdCaptionsResponse, z.ZodTypeDef, unknown > = z.object({ english_name: z.string().optional(), native_name: z.string().optional(), language: z.string(), text: z.nullable(z.string()).optional(), is_draft: z.boolean(), id: z.string(), cursor: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "english_name": "englishName", "native_name": "nativeName", "is_draft": "isDraft", }); }); export function getMediasMediaHashedIdCaptionsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetMediasMediaHashedIdCaptionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetMediasMediaHashedIdCaptionsResponse' from JSON`, ); }