/* * 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 DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest = { /** * The hashed ID of the localization's media. */ mediaHashedId: string; /** * The hashed ID of the localization to delete. */ localizationHashedId: string; }; /** * The media that the localization is associated with. */ export type DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMedia = { /** * A unique alphanumeric identifier for this media. */ hashedId: string; /** * The name of the media. */ name: string; /** * The duration of the media in seconds. */ duration: number; /** * The date when the media was created. */ createdAt: Date; /** * The date when the media was last updated. */ updatedAt: Date; }; /** * The transcript for the localization. Selectively serialized in some endpoints. See properties for endpoint. */ export type DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscript = { /** * A unique alphanumeric identifier for this transcript. */ hashedId: string; /** * The name of the language in English. */ languageName: string; /** * The name of the language in the language of the localization. */ nativeLanguageName: string; /** * The text of the transcript. */ text: string; /** * The date when the transcript was created. */ createdAt: Date; /** * The date when the transcript was last updated. */ updatedAt: Date; }; /** * A localization is a translation of a media into another language. * * @remarks */ export type DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdResponse = { /** * A unique alphanumeric identifier for this localization. */ hashedId: string; /** * A 3-character language code as specified by IETF. */ languageCode: string; /** * A 2-character language code as specified by ISO-639–2. */ iso6392LanguageCode: string; /** * The name of the language in English. */ languageName: string; /** * The name of the language in the language of the localization. */ nativeLanguageName: string; /** * The date when the localization was created. */ createdAt: Date; /** * The date when the localization was last updated. */ updatedAt: Date; /** * The date when the localization was ordered. */ orderedAt: Date | null; /** * The date when the localization was enabled. */ enabledAt: Date | null; /** * Whether or not the localization is enabled. */ enabled: boolean; /** * The media that the localization is associated with. */ sourceMedia: DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMedia; /** * The transcript for the localization. Selectively serialized in some endpoints. See properties for endpoint. */ transcript?: | DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscript | null | undefined; }; /** @internal */ export type DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest$Outbound = { mediaHashedId: string; localizationHashedId: string; }; /** @internal */ export const DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest$outboundSchema: z.ZodType< DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest$Outbound, z.ZodTypeDef, DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest > = z.object({ mediaHashedId: z.string(), localizationHashedId: z.string(), }); export function deleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequestToJSON( deleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest: DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest, ): string { return JSON.stringify( DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest$outboundSchema .parse(deleteMediasMediaHashedIdLocalizationsLocalizationHashedIdRequest), ); } /** @internal */ export const DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMedia$inboundSchema: z.ZodType< DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMedia, z.ZodTypeDef, unknown > = z.object({ hashed_id: z.string(), name: z.string(), duration: z.number(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ), }).transform((v) => { return remap$(v, { "hashed_id": "hashedId", "created_at": "createdAt", "updated_at": "updatedAt", }); }); export function deleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMediaFromJSON( jsonString: string, ): SafeParseResult< DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMedia, SDKValidationError > { return safeParse( jsonString, (x) => DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMedia$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMedia' from JSON`, ); } /** @internal */ export const DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscript$inboundSchema: z.ZodType< DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscript, z.ZodTypeDef, unknown > = z.object({ hashed_id: z.string(), language_name: z.string(), native_language_name: z.string(), text: z.string(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ), }).transform((v) => { return remap$(v, { "hashed_id": "hashedId", "language_name": "languageName", "native_language_name": "nativeLanguageName", "created_at": "createdAt", "updated_at": "updatedAt", }); }); export function deleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscriptFromJSON( jsonString: string, ): SafeParseResult< DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscript, SDKValidationError > { return safeParse( jsonString, (x) => DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscript$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscript' from JSON`, ); } /** @internal */ export const DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdResponse$inboundSchema: z.ZodType< DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdResponse, z.ZodTypeDef, unknown > = z.object({ hashed_id: z.string(), language_code: z.string(), iso639_2_language_code: z.string(), language_name: z.string(), native_language_name: z.string(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ), ordered_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), enabled_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), enabled: z.boolean(), source_media: z.lazy(() => DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdSourceMedia$inboundSchema ), transcript: z.nullable( z.lazy(() => DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdTranscript$inboundSchema ), ).optional(), }).transform((v) => { return remap$(v, { "hashed_id": "hashedId", "language_code": "languageCode", "iso639_2_language_code": "iso6392LanguageCode", "language_name": "languageName", "native_language_name": "nativeLanguageName", "created_at": "createdAt", "updated_at": "updatedAt", "ordered_at": "orderedAt", "enabled_at": "enabledAt", "source_media": "sourceMedia", }); }); export function deleteMediasMediaHashedIdLocalizationsLocalizationHashedIdResponseFromJSON( jsonString: string, ): SafeParseResult< DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdResponse, SDKValidationError > { return safeParse( jsonString, (x) => DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'DeleteMediasMediaHashedIdLocalizationsLocalizationHashedIdResponse' from JSON`, ); }