/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PostMediasMediaHashedIdCopyRequestBody = { /** * The ID of the folder where you want the new copy placed. Defaults to the source media’s current folder if omitted or invalid. */ folderId?: number | undefined; /** * An email address specifying the owner of the new media. Defaults to the source media’s current owner if omitted or invalid. */ owner?: string | undefined; }; export type PostMediasMediaHashedIdCopyRequest = { /** * The hashed ID of the media. */ mediaHashedId: string; requestBody?: PostMediasMediaHashedIdCopyRequestBody | undefined; }; /** * A string representing what type of media this is. */ export const PostMediasMediaHashedIdCopyType = { Video: "Video", Audio: "Audio", Image: "Image", PdfDocument: "PdfDocument", MicrosoftOfficeDocument: "MicrosoftOfficeDocument", Swf: "Swf", UnknownType: "UnknownType", } as const; /** * A string representing what type of media this is. */ export type PostMediasMediaHashedIdCopyType = ClosedEnum< typeof PostMediasMediaHashedIdCopyType >; /** * Post upload processing status. - `queued`: the file is waiting in the queue to be processed. - `processing`: the file is actively being processed. - `ready`: the file has been fully processed and is ready for embedding and viewing. - `failed`: the file was unable to be processed (usually a format or size error). * * @remarks */ export const PostMediasMediaHashedIdCopyStatus = { Queued: "queued", Processing: "processing", Ready: "ready", Failed: "failed", } as const; /** * Post upload processing status. - `queued`: the file is waiting in the queue to be processed. - `processing`: the file is actively being processed. - `ready`: the file has been fully processed and is ready for embedding and viewing. - `failed`: the file was unable to be processed (usually a format or size error). * * @remarks */ export type PostMediasMediaHashedIdCopyStatus = ClosedEnum< typeof PostMediasMediaHashedIdCopyStatus >; export type PostMediasMediaHashedIdCopyThumbnail = { url?: string | undefined; width?: number | undefined; height?: number | undefined; }; export type PostMediasMediaHashedIdCopyFolder = { /** * A unique numeric identifier for the folder within the system. */ id?: number | undefined; /** * The folder’s display name. */ name?: string | undefined; /** * A private hashed id, uniquely identifying the folder within the system. */ hashedId?: string | undefined; }; /** * A media generally represents a video or an audio which can be embedded into your website. * * @remarks * * CDN-backed medias are accessible using this url structure: https://fast.wistia.com/embed/medias/{hashed_id}.m3u8. * For more information, see https://docs.wistia.com/docs/asset-urls#getting-hls-assets. */ export type PostMediasMediaHashedIdCopyResponseBody = { /** * A unique numeric identifier for the media within the system. */ id?: number | undefined; /** * The display name of the media. */ name?: string | undefined; /** * A string representing what type of media this is. */ type?: PostMediasMediaHashedIdCopyType | undefined; /** * Whether or not the media is archived, either true or false. */ archived?: boolean | undefined; /** * The date when the media was originally uploaded. */ created?: Date | undefined; /** * The date when the media was last changed. */ updated?: Date | undefined; /** * Specifies the length (in seconds) for audio and video files. Specifies number of pages in the document. Omitted for other types of media. */ duration?: number | null | undefined; /** * DEPRECATED: If you want to programmatically embed videos, follow the construct an embed code guide. * * @remarks * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ embedCode?: string | undefined; /** * A unique alphanumeric identifier for this media. */ hashedId?: string | undefined; /** * A description for the media which usually appears near the top of the sidebar on the media's page. */ description?: string | undefined; /** * A floating point value between 0 and 1 that indicates the progress of the processing for this file. */ progress?: number | undefined; /** * Post upload processing status. - `queued`: the file is waiting in the queue to be processed. - `processing`: the file is actively being processed. - `ready`: the file has been fully processed and is ready for embedding and viewing. - `failed`: the file was unable to be processed (usually a format or size error). * * @remarks */ status?: PostMediasMediaHashedIdCopyStatus | undefined; /** * The title of the section in which the media appears. This attribute is omitted if the media is not in a section (default). */ section?: string | null | undefined; thumbnail?: PostMediasMediaHashedIdCopyThumbnail | undefined; folder: PostMediasMediaHashedIdCopyFolder | null; }; export type PostMediasMediaHashedIdCopyResponse = { headers: { [k: string]: Array }; result: PostMediasMediaHashedIdCopyResponseBody; }; /** @internal */ export type PostMediasMediaHashedIdCopyRequestBody$Outbound = { folder_id?: number | undefined; owner?: string | undefined; }; /** @internal */ export const PostMediasMediaHashedIdCopyRequestBody$outboundSchema: z.ZodType< PostMediasMediaHashedIdCopyRequestBody$Outbound, z.ZodTypeDef, PostMediasMediaHashedIdCopyRequestBody > = z.object({ folderId: z.number().int().optional(), owner: z.string().optional(), }).transform((v) => { return remap$(v, { folderId: "folder_id", }); }); export function postMediasMediaHashedIdCopyRequestBodyToJSON( postMediasMediaHashedIdCopyRequestBody: PostMediasMediaHashedIdCopyRequestBody, ): string { return JSON.stringify( PostMediasMediaHashedIdCopyRequestBody$outboundSchema.parse( postMediasMediaHashedIdCopyRequestBody, ), ); } /** @internal */ export type PostMediasMediaHashedIdCopyRequest$Outbound = { mediaHashedId: string; RequestBody?: PostMediasMediaHashedIdCopyRequestBody$Outbound | undefined; }; /** @internal */ export const PostMediasMediaHashedIdCopyRequest$outboundSchema: z.ZodType< PostMediasMediaHashedIdCopyRequest$Outbound, z.ZodTypeDef, PostMediasMediaHashedIdCopyRequest > = z.object({ mediaHashedId: z.string(), requestBody: z.lazy(() => PostMediasMediaHashedIdCopyRequestBody$outboundSchema ).optional(), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function postMediasMediaHashedIdCopyRequestToJSON( postMediasMediaHashedIdCopyRequest: PostMediasMediaHashedIdCopyRequest, ): string { return JSON.stringify( PostMediasMediaHashedIdCopyRequest$outboundSchema.parse( postMediasMediaHashedIdCopyRequest, ), ); } /** @internal */ export const PostMediasMediaHashedIdCopyType$inboundSchema: z.ZodNativeEnum< typeof PostMediasMediaHashedIdCopyType > = z.nativeEnum(PostMediasMediaHashedIdCopyType); /** @internal */ export const PostMediasMediaHashedIdCopyStatus$inboundSchema: z.ZodNativeEnum< typeof PostMediasMediaHashedIdCopyStatus > = z.nativeEnum(PostMediasMediaHashedIdCopyStatus); /** @internal */ export const PostMediasMediaHashedIdCopyThumbnail$inboundSchema: z.ZodType< PostMediasMediaHashedIdCopyThumbnail, z.ZodTypeDef, unknown > = z.object({ url: z.string().optional(), width: z.number().int().optional(), height: z.number().int().optional(), }); export function postMediasMediaHashedIdCopyThumbnailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostMediasMediaHashedIdCopyThumbnail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostMediasMediaHashedIdCopyThumbnail' from JSON`, ); } /** @internal */ export const PostMediasMediaHashedIdCopyFolder$inboundSchema: z.ZodType< PostMediasMediaHashedIdCopyFolder, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), name: z.string().optional(), hashedId: z.string().optional(), }); export function postMediasMediaHashedIdCopyFolderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostMediasMediaHashedIdCopyFolder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostMediasMediaHashedIdCopyFolder' from JSON`, ); } /** @internal */ export const PostMediasMediaHashedIdCopyResponseBody$inboundSchema: z.ZodType< PostMediasMediaHashedIdCopyResponseBody, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), name: z.string().optional(), type: PostMediasMediaHashedIdCopyType$inboundSchema.optional(), archived: z.boolean().optional(), created: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), updated: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), duration: z.nullable(z.number()).optional(), embedCode: z.string().optional(), hashed_id: z.string().optional(), description: z.string().optional(), progress: z.number().optional(), status: PostMediasMediaHashedIdCopyStatus$inboundSchema.optional(), section: z.nullable(z.string()).optional(), thumbnail: z.lazy(() => PostMediasMediaHashedIdCopyThumbnail$inboundSchema) .optional(), folder: z.nullable( z.lazy(() => PostMediasMediaHashedIdCopyFolder$inboundSchema), ), }).transform((v) => { return remap$(v, { "hashed_id": "hashedId", }); }); export function postMediasMediaHashedIdCopyResponseBodyFromJSON( jsonString: string, ): SafeParseResult< PostMediasMediaHashedIdCopyResponseBody, SDKValidationError > { return safeParse( jsonString, (x) => PostMediasMediaHashedIdCopyResponseBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostMediasMediaHashedIdCopyResponseBody' from JSON`, ); } /** @internal */ export const PostMediasMediaHashedIdCopyResponse$inboundSchema: z.ZodType< PostMediasMediaHashedIdCopyResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: z.lazy(() => PostMediasMediaHashedIdCopyResponseBody$inboundSchema), }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function postMediasMediaHashedIdCopyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostMediasMediaHashedIdCopyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostMediasMediaHashedIdCopyResponse' from JSON`, ); }