/* * 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 GetMediaExtendedAudioDescriptionsIdRequest = { /** * The hashed id of the Media Extended Audio Description */ id: string; }; export type GetMediaExtendedAudioDescriptionsIdMedia = { /** * A unique alphanumeric identifier for the record. */ id: string; /** * A URL for fetching all the records of the given record type. You can pass hashed_ids as a param with multiple values * * @remarks * to do a batch fetch for this records type. */ indexUrl: string; /** * A URL that can be used to fetch this record. */ url: string; }; export type GetMediaExtendedAudioDescriptionsIdProvidedMediaFile = { /** * A unique alphanumeric identifier for the record. */ id: string; /** * A URL for fetching all the records of the given record type. You can pass hashed_ids as a param with multiple values * * @remarks * to do a batch fetch for this records type. */ indexUrl: string; /** * A URL that can be used to fetch this record. */ url: string; }; export type GetMediaExtendedAudioDescriptionsIdContact = { /** * A unique alphanumeric identifier for the record. */ id: string; /** * A URL for fetching all the records of the given record type. You can pass hashed_ids as a param with multiple values * * @remarks * to do a batch fetch for this records type. */ indexUrl: string; /** * A URL that can be used to fetch this record. */ url: string; }; /** * Download links for the audio description files. */ export type Assets = { /** * URL to download the MP3 audio file. */ mp3Url: string | null; /** * The WebVTT file contents with cue timings relative to the original video. Start and * * @remarks * end times show when the text is relative to the scene */ webvtt: string | null; /** * The extended WebVTT file contents with timings that include pause durations. Start and * * @remarks * end times correspond to when an audio description starts and ends. During this time * the video will be paused. */ webvttExtended: string | null; }; /** * Media Extended Audio Description fetched successful */ export type GetMediaExtendedAudioDescriptionsIdResponse = { id?: string | undefined; ietfLanguageTag?: string | undefined; createdAt?: Date | undefined; updatedAt?: Date | undefined; media?: GetMediaExtendedAudioDescriptionsIdMedia | undefined; providedMediaFile?: | GetMediaExtendedAudioDescriptionsIdProvidedMediaFile | undefined; contact?: GetMediaExtendedAudioDescriptionsIdContact | undefined; /** * Download links for the audio description files. */ assets?: Assets | undefined; }; /** @internal */ export type GetMediaExtendedAudioDescriptionsIdRequest$Outbound = { id: string; }; /** @internal */ export const GetMediaExtendedAudioDescriptionsIdRequest$outboundSchema: z.ZodType< GetMediaExtendedAudioDescriptionsIdRequest$Outbound, z.ZodTypeDef, GetMediaExtendedAudioDescriptionsIdRequest > = z.object({ id: z.string(), }); export function getMediaExtendedAudioDescriptionsIdRequestToJSON( getMediaExtendedAudioDescriptionsIdRequest: GetMediaExtendedAudioDescriptionsIdRequest, ): string { return JSON.stringify( GetMediaExtendedAudioDescriptionsIdRequest$outboundSchema.parse( getMediaExtendedAudioDescriptionsIdRequest, ), ); } /** @internal */ export const GetMediaExtendedAudioDescriptionsIdMedia$inboundSchema: z.ZodType< GetMediaExtendedAudioDescriptionsIdMedia, z.ZodTypeDef, unknown > = z.object({ id: z.string(), index_url: z.string(), url: z.string(), }).transform((v) => { return remap$(v, { "index_url": "indexUrl", }); }); export function getMediaExtendedAudioDescriptionsIdMediaFromJSON( jsonString: string, ): SafeParseResult< GetMediaExtendedAudioDescriptionsIdMedia, SDKValidationError > { return safeParse( jsonString, (x) => GetMediaExtendedAudioDescriptionsIdMedia$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetMediaExtendedAudioDescriptionsIdMedia' from JSON`, ); } /** @internal */ export const GetMediaExtendedAudioDescriptionsIdProvidedMediaFile$inboundSchema: z.ZodType< GetMediaExtendedAudioDescriptionsIdProvidedMediaFile, z.ZodTypeDef, unknown > = z.object({ id: z.string(), index_url: z.string(), url: z.string(), }).transform((v) => { return remap$(v, { "index_url": "indexUrl", }); }); export function getMediaExtendedAudioDescriptionsIdProvidedMediaFileFromJSON( jsonString: string, ): SafeParseResult< GetMediaExtendedAudioDescriptionsIdProvidedMediaFile, SDKValidationError > { return safeParse( jsonString, (x) => GetMediaExtendedAudioDescriptionsIdProvidedMediaFile$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetMediaExtendedAudioDescriptionsIdProvidedMediaFile' from JSON`, ); } /** @internal */ export const GetMediaExtendedAudioDescriptionsIdContact$inboundSchema: z.ZodType = z.object({ id: z.string(), index_url: z.string(), url: z.string(), }).transform((v) => { return remap$(v, { "index_url": "indexUrl", }); }); export function getMediaExtendedAudioDescriptionsIdContactFromJSON( jsonString: string, ): SafeParseResult< GetMediaExtendedAudioDescriptionsIdContact, SDKValidationError > { return safeParse( jsonString, (x) => GetMediaExtendedAudioDescriptionsIdContact$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetMediaExtendedAudioDescriptionsIdContact' from JSON`, ); } /** @internal */ export const Assets$inboundSchema: z.ZodType = z .object({ mp3_url: z.nullable(z.string()), webvtt: z.nullable(z.string()), webvtt_extended: z.nullable(z.string()), }).transform((v) => { return remap$(v, { "mp3_url": "mp3Url", "webvtt_extended": "webvttExtended", }); }); export function assetsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Assets$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Assets' from JSON`, ); } /** @internal */ export const GetMediaExtendedAudioDescriptionsIdResponse$inboundSchema: z.ZodType< GetMediaExtendedAudioDescriptionsIdResponse, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), ietf_language_tag: z.string().optional(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), media: z.lazy(() => GetMediaExtendedAudioDescriptionsIdMedia$inboundSchema) .optional(), provided_media_file: z.lazy(() => GetMediaExtendedAudioDescriptionsIdProvidedMediaFile$inboundSchema ).optional(), contact: z.lazy(() => GetMediaExtendedAudioDescriptionsIdContact$inboundSchema ).optional(), assets: z.lazy(() => Assets$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "ietf_language_tag": "ietfLanguageTag", "created_at": "createdAt", "updated_at": "updatedAt", "provided_media_file": "providedMediaFile", }); }); export function getMediaExtendedAudioDescriptionsIdResponseFromJSON( jsonString: string, ): SafeParseResult< GetMediaExtendedAudioDescriptionsIdResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetMediaExtendedAudioDescriptionsIdResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetMediaExtendedAudioDescriptionsIdResponse' from JSON`, ); }