/* * 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 GetFoldersFolderIdSubfoldersSubfolderIdRequest = { /** * The hashed ID of the folder */ folderId: string; /** * The hashed ID of the subfolder */ subfolderId: string; /** * Format for media descriptions */ descriptionFormat?: "markdown" | undefined; }; /** * A string representing what type of media this is. */ export const GetFoldersFolderIdSubfoldersSubfolderIdType = { 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 GetFoldersFolderIdSubfoldersSubfolderIdType = ClosedEnum< typeof GetFoldersFolderIdSubfoldersSubfolderIdType >; /** * 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 GetFoldersFolderIdSubfoldersSubfolderIdStatus = { 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 GetFoldersFolderIdSubfoldersSubfolderIdStatus = ClosedEnum< typeof GetFoldersFolderIdSubfoldersSubfolderIdStatus >; export type GetFoldersFolderIdSubfoldersSubfolderIdThumbnail = { url?: string | undefined; width?: number | undefined; height?: number | 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 GetFoldersFolderIdSubfoldersSubfolderIdMedia = { /** * 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?: GetFoldersFolderIdSubfoldersSubfolderIdType | 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?: GetFoldersFolderIdSubfoldersSubfolderIdStatus | 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?: GetFoldersFolderIdSubfoldersSubfolderIdThumbnail | undefined; }; /** * A subfolder with its contained media files. */ export type GetFoldersFolderIdSubfoldersSubfolderIdResponse = { /** * A unique alphanumeric identifier for this subfolder. */ hashedId: string; /** * The display name of the subfolder. */ name?: string | null | undefined; /** * A description for the subfolder. */ description?: string | null | undefined; /** * The position of this subfolder within its folder, used for ordering. */ position: number | null; /** * The date when the subfolder was created. */ created: Date | null; /** * The date when the subfolder was last modified. */ updated: Date | null; /** * 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; /** * Array of media files contained in this subfolder. */ medias?: Array | undefined; }; /** @internal */ export type GetFoldersFolderIdSubfoldersSubfolderIdRequest$Outbound = { folderId: string; subfolderId: string; description_format?: "markdown" | undefined; }; /** @internal */ export const GetFoldersFolderIdSubfoldersSubfolderIdRequest$outboundSchema: z.ZodType< GetFoldersFolderIdSubfoldersSubfolderIdRequest$Outbound, z.ZodTypeDef, GetFoldersFolderIdSubfoldersSubfolderIdRequest > = z.object({ folderId: z.string(), subfolderId: z.string(), descriptionFormat: z.literal("markdown").optional(), }).transform((v) => { return remap$(v, { descriptionFormat: "description_format", }); }); export function getFoldersFolderIdSubfoldersSubfolderIdRequestToJSON( getFoldersFolderIdSubfoldersSubfolderIdRequest: GetFoldersFolderIdSubfoldersSubfolderIdRequest, ): string { return JSON.stringify( GetFoldersFolderIdSubfoldersSubfolderIdRequest$outboundSchema.parse( getFoldersFolderIdSubfoldersSubfolderIdRequest, ), ); } /** @internal */ export const GetFoldersFolderIdSubfoldersSubfolderIdType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetFoldersFolderIdSubfoldersSubfolderIdType); /** @internal */ export const GetFoldersFolderIdSubfoldersSubfolderIdStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetFoldersFolderIdSubfoldersSubfolderIdStatus); /** @internal */ export const GetFoldersFolderIdSubfoldersSubfolderIdThumbnail$inboundSchema: z.ZodType< GetFoldersFolderIdSubfoldersSubfolderIdThumbnail, z.ZodTypeDef, unknown > = z.object({ url: z.string().optional(), width: z.number().int().optional(), height: z.number().int().optional(), }); export function getFoldersFolderIdSubfoldersSubfolderIdThumbnailFromJSON( jsonString: string, ): SafeParseResult< GetFoldersFolderIdSubfoldersSubfolderIdThumbnail, SDKValidationError > { return safeParse( jsonString, (x) => GetFoldersFolderIdSubfoldersSubfolderIdThumbnail$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetFoldersFolderIdSubfoldersSubfolderIdThumbnail' from JSON`, ); } /** @internal */ export const GetFoldersFolderIdSubfoldersSubfolderIdMedia$inboundSchema: z.ZodType< GetFoldersFolderIdSubfoldersSubfolderIdMedia, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), name: z.string().optional(), type: GetFoldersFolderIdSubfoldersSubfolderIdType$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: GetFoldersFolderIdSubfoldersSubfolderIdStatus$inboundSchema .optional(), section: z.nullable(z.string()).optional(), thumbnail: z.lazy(() => GetFoldersFolderIdSubfoldersSubfolderIdThumbnail$inboundSchema ).optional(), }).transform((v) => { return remap$(v, { "hashed_id": "hashedId", }); }); export function getFoldersFolderIdSubfoldersSubfolderIdMediaFromJSON( jsonString: string, ): SafeParseResult< GetFoldersFolderIdSubfoldersSubfolderIdMedia, SDKValidationError > { return safeParse( jsonString, (x) => GetFoldersFolderIdSubfoldersSubfolderIdMedia$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetFoldersFolderIdSubfoldersSubfolderIdMedia' from JSON`, ); } /** @internal */ export const GetFoldersFolderIdSubfoldersSubfolderIdResponse$inboundSchema: z.ZodType< GetFoldersFolderIdSubfoldersSubfolderIdResponse, z.ZodTypeDef, unknown > = z.object({ hashed_id: z.string(), name: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), position: z.nullable(z.number().int()), created: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), updated: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), cursor: z.nullable(z.string()).optional(), medias: z.array( z.lazy(() => GetFoldersFolderIdSubfoldersSubfolderIdMedia$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "hashed_id": "hashedId", }); }); export function getFoldersFolderIdSubfoldersSubfolderIdResponseFromJSON( jsonString: string, ): SafeParseResult< GetFoldersFolderIdSubfoldersSubfolderIdResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetFoldersFolderIdSubfoldersSubfolderIdResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetFoldersFolderIdSubfoldersSubfolderIdResponse' from JSON`, ); }