/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; import { safeParse } from "../../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). */ export enum QueryParamOnlyTransient { Zero = 0, One = 1, } export type GetLibraryHubsRequest = { /** * the Id of the library to query */ sectionId: number; /** * The number of items to return with each hub. */ count?: number | undefined; /** * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). */ onlyTransient?: QueryParamOnlyTransient | undefined; }; export type GetLibraryHubsPart = { id?: number | undefined; key?: string | undefined; duration?: number | undefined; file?: string | undefined; size?: number | undefined; audioProfile?: string | undefined; container?: string | undefined; has64bitOffsets?: boolean | undefined; optimizedForStreaming?: boolean | undefined; videoProfile?: string | undefined; }; export type GetLibraryHubsMedia = { id?: number | undefined; duration?: number | undefined; bitrate?: number | undefined; width?: number | undefined; height?: number | undefined; aspectRatio?: number | undefined; audioChannels?: number | undefined; audioCodec?: string | undefined; videoCodec?: string | undefined; videoResolution?: string | undefined; container?: string | undefined; videoFrameRate?: string | undefined; optimizedForStreaming?: number | undefined; audioProfile?: string | undefined; has64bitOffsets?: boolean | undefined; videoProfile?: string | undefined; part?: Array | undefined; }; export type GetLibraryHubsGenre = { tag?: string | undefined; }; export type GetLibraryHubsCountry = { tag?: string | undefined; }; export type GetLibraryHubsDirector = { tag?: string | undefined; }; export type GetLibraryHubsRole = { tag?: string | undefined; }; export type GetLibraryHubsWriter = { tag?: string | undefined; }; export type GetLibraryHubsMetadata = { ratingKey?: string | undefined; key?: string | undefined; guid?: string | undefined; studio?: string | undefined; type?: string | undefined; title?: string | undefined; librarySectionTitle?: string | undefined; librarySectionID?: number | undefined; librarySectionKey?: string | undefined; contentRating?: string | undefined; summary?: string | undefined; rating?: number | undefined; audienceRating?: number | undefined; viewCount?: number | undefined; lastViewedAt?: number | undefined; year?: number | undefined; tagline?: string | undefined; thumb?: string | undefined; art?: string | undefined; duration?: number | undefined; originallyAvailableAt?: RFCDate | undefined; addedAt?: number | undefined; updatedAt?: number | undefined; audienceRatingImage?: string | undefined; primaryExtraKey?: string | undefined; ratingImage?: string | undefined; media?: Array | undefined; genre?: Array | undefined; country?: Array | undefined; director?: Array | undefined; role?: Array | undefined; writer?: Array | undefined; skipCount?: number | undefined; chapterSource?: string | undefined; }; export type GetLibraryHubsHub = { key?: string | undefined; title?: string | undefined; type?: string | undefined; hubIdentifier?: string | undefined; context?: string | undefined; size?: number | undefined; more?: boolean | undefined; style?: string | undefined; hubKey?: string | undefined; metadata?: Array | undefined; promoted?: boolean | undefined; random?: boolean | undefined; }; export type GetLibraryHubsMediaContainer = { size?: number | undefined; allowSync?: boolean | undefined; identifier?: string | undefined; librarySectionID?: number | undefined; librarySectionTitle?: string | undefined; librarySectionUUID?: string | undefined; hub?: Array | undefined; }; /** * The hubs specific to the library */ export type GetLibraryHubsResponseBody = { mediaContainer?: GetLibraryHubsMediaContainer | undefined; }; export type GetLibraryHubsResponse = { /** * HTTP response content type for this operation */ contentType: string; /** * HTTP response status code for this operation */ statusCode: number; /** * Raw HTTP response; suitable for custom response parsing */ rawResponse: Response; /** * The hubs specific to the library */ object?: GetLibraryHubsResponseBody | undefined; }; /** @internal */ export const QueryParamOnlyTransient$inboundSchema: z.ZodNativeEnum< typeof QueryParamOnlyTransient > = z.nativeEnum(QueryParamOnlyTransient); /** @internal */ export const QueryParamOnlyTransient$outboundSchema: z.ZodNativeEnum< typeof QueryParamOnlyTransient > = QueryParamOnlyTransient$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace QueryParamOnlyTransient$ { /** @deprecated use `QueryParamOnlyTransient$inboundSchema` instead. */ export const inboundSchema = QueryParamOnlyTransient$inboundSchema; /** @deprecated use `QueryParamOnlyTransient$outboundSchema` instead. */ export const outboundSchema = QueryParamOnlyTransient$outboundSchema; } /** @internal */ export const GetLibraryHubsRequest$inboundSchema: z.ZodType< GetLibraryHubsRequest, z.ZodTypeDef, unknown > = z.object({ sectionId: z.number(), count: z.number().optional(), onlyTransient: QueryParamOnlyTransient$inboundSchema.optional(), }); /** @internal */ export type GetLibraryHubsRequest$Outbound = { sectionId: number; count?: number | undefined; onlyTransient?: number | undefined; }; /** @internal */ export const GetLibraryHubsRequest$outboundSchema: z.ZodType< GetLibraryHubsRequest$Outbound, z.ZodTypeDef, GetLibraryHubsRequest > = z.object({ sectionId: z.number(), count: z.number().optional(), onlyTransient: QueryParamOnlyTransient$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsRequest$ { /** @deprecated use `GetLibraryHubsRequest$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsRequest$inboundSchema; /** @deprecated use `GetLibraryHubsRequest$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsRequest$outboundSchema; /** @deprecated use `GetLibraryHubsRequest$Outbound` instead. */ export type Outbound = GetLibraryHubsRequest$Outbound; } export function getLibraryHubsRequestToJSON( getLibraryHubsRequest: GetLibraryHubsRequest, ): string { return JSON.stringify( GetLibraryHubsRequest$outboundSchema.parse(getLibraryHubsRequest), ); } export function getLibraryHubsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsRequest' from JSON`, ); } /** @internal */ export const GetLibraryHubsPart$inboundSchema: z.ZodType< GetLibraryHubsPart, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), key: z.string().optional(), duration: z.number().int().optional(), file: z.string().optional(), size: z.number().int().optional(), audioProfile: z.string().optional(), container: z.string().optional(), has64bitOffsets: z.boolean().optional(), optimizedForStreaming: z.boolean().optional(), videoProfile: z.string().optional(), }); /** @internal */ export type GetLibraryHubsPart$Outbound = { id?: number | undefined; key?: string | undefined; duration?: number | undefined; file?: string | undefined; size?: number | undefined; audioProfile?: string | undefined; container?: string | undefined; has64bitOffsets?: boolean | undefined; optimizedForStreaming?: boolean | undefined; videoProfile?: string | undefined; }; /** @internal */ export const GetLibraryHubsPart$outboundSchema: z.ZodType< GetLibraryHubsPart$Outbound, z.ZodTypeDef, GetLibraryHubsPart > = z.object({ id: z.number().int().optional(), key: z.string().optional(), duration: z.number().int().optional(), file: z.string().optional(), size: z.number().int().optional(), audioProfile: z.string().optional(), container: z.string().optional(), has64bitOffsets: z.boolean().optional(), optimizedForStreaming: z.boolean().optional(), videoProfile: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsPart$ { /** @deprecated use `GetLibraryHubsPart$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsPart$inboundSchema; /** @deprecated use `GetLibraryHubsPart$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsPart$outboundSchema; /** @deprecated use `GetLibraryHubsPart$Outbound` instead. */ export type Outbound = GetLibraryHubsPart$Outbound; } export function getLibraryHubsPartToJSON( getLibraryHubsPart: GetLibraryHubsPart, ): string { return JSON.stringify( GetLibraryHubsPart$outboundSchema.parse(getLibraryHubsPart), ); } export function getLibraryHubsPartFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsPart$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsPart' from JSON`, ); } /** @internal */ export const GetLibraryHubsMedia$inboundSchema: z.ZodType< GetLibraryHubsMedia, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), duration: z.number().int().optional(), bitrate: z.number().int().optional(), width: z.number().int().optional(), height: z.number().int().optional(), aspectRatio: z.number().optional(), audioChannels: z.number().int().optional(), audioCodec: z.string().optional(), videoCodec: z.string().optional(), videoResolution: z.string().optional(), container: z.string().optional(), videoFrameRate: z.string().optional(), optimizedForStreaming: z.number().int().optional(), audioProfile: z.string().optional(), has64bitOffsets: z.boolean().optional(), videoProfile: z.string().optional(), Part: z.array(z.lazy(() => GetLibraryHubsPart$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "Part": "part", }); }); /** @internal */ export type GetLibraryHubsMedia$Outbound = { id?: number | undefined; duration?: number | undefined; bitrate?: number | undefined; width?: number | undefined; height?: number | undefined; aspectRatio?: number | undefined; audioChannels?: number | undefined; audioCodec?: string | undefined; videoCodec?: string | undefined; videoResolution?: string | undefined; container?: string | undefined; videoFrameRate?: string | undefined; optimizedForStreaming?: number | undefined; audioProfile?: string | undefined; has64bitOffsets?: boolean | undefined; videoProfile?: string | undefined; Part?: Array | undefined; }; /** @internal */ export const GetLibraryHubsMedia$outboundSchema: z.ZodType< GetLibraryHubsMedia$Outbound, z.ZodTypeDef, GetLibraryHubsMedia > = z.object({ id: z.number().int().optional(), duration: z.number().int().optional(), bitrate: z.number().int().optional(), width: z.number().int().optional(), height: z.number().int().optional(), aspectRatio: z.number().optional(), audioChannels: z.number().int().optional(), audioCodec: z.string().optional(), videoCodec: z.string().optional(), videoResolution: z.string().optional(), container: z.string().optional(), videoFrameRate: z.string().optional(), optimizedForStreaming: z.number().int().optional(), audioProfile: z.string().optional(), has64bitOffsets: z.boolean().optional(), videoProfile: z.string().optional(), part: z.array(z.lazy(() => GetLibraryHubsPart$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { part: "Part", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsMedia$ { /** @deprecated use `GetLibraryHubsMedia$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsMedia$inboundSchema; /** @deprecated use `GetLibraryHubsMedia$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsMedia$outboundSchema; /** @deprecated use `GetLibraryHubsMedia$Outbound` instead. */ export type Outbound = GetLibraryHubsMedia$Outbound; } export function getLibraryHubsMediaToJSON( getLibraryHubsMedia: GetLibraryHubsMedia, ): string { return JSON.stringify( GetLibraryHubsMedia$outboundSchema.parse(getLibraryHubsMedia), ); } export function getLibraryHubsMediaFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsMedia$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsMedia' from JSON`, ); } /** @internal */ export const GetLibraryHubsGenre$inboundSchema: z.ZodType< GetLibraryHubsGenre, z.ZodTypeDef, unknown > = z.object({ tag: z.string().optional(), }); /** @internal */ export type GetLibraryHubsGenre$Outbound = { tag?: string | undefined; }; /** @internal */ export const GetLibraryHubsGenre$outboundSchema: z.ZodType< GetLibraryHubsGenre$Outbound, z.ZodTypeDef, GetLibraryHubsGenre > = z.object({ tag: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsGenre$ { /** @deprecated use `GetLibraryHubsGenre$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsGenre$inboundSchema; /** @deprecated use `GetLibraryHubsGenre$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsGenre$outboundSchema; /** @deprecated use `GetLibraryHubsGenre$Outbound` instead. */ export type Outbound = GetLibraryHubsGenre$Outbound; } export function getLibraryHubsGenreToJSON( getLibraryHubsGenre: GetLibraryHubsGenre, ): string { return JSON.stringify( GetLibraryHubsGenre$outboundSchema.parse(getLibraryHubsGenre), ); } export function getLibraryHubsGenreFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsGenre$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsGenre' from JSON`, ); } /** @internal */ export const GetLibraryHubsCountry$inboundSchema: z.ZodType< GetLibraryHubsCountry, z.ZodTypeDef, unknown > = z.object({ tag: z.string().optional(), }); /** @internal */ export type GetLibraryHubsCountry$Outbound = { tag?: string | undefined; }; /** @internal */ export const GetLibraryHubsCountry$outboundSchema: z.ZodType< GetLibraryHubsCountry$Outbound, z.ZodTypeDef, GetLibraryHubsCountry > = z.object({ tag: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsCountry$ { /** @deprecated use `GetLibraryHubsCountry$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsCountry$inboundSchema; /** @deprecated use `GetLibraryHubsCountry$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsCountry$outboundSchema; /** @deprecated use `GetLibraryHubsCountry$Outbound` instead. */ export type Outbound = GetLibraryHubsCountry$Outbound; } export function getLibraryHubsCountryToJSON( getLibraryHubsCountry: GetLibraryHubsCountry, ): string { return JSON.stringify( GetLibraryHubsCountry$outboundSchema.parse(getLibraryHubsCountry), ); } export function getLibraryHubsCountryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsCountry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsCountry' from JSON`, ); } /** @internal */ export const GetLibraryHubsDirector$inboundSchema: z.ZodType< GetLibraryHubsDirector, z.ZodTypeDef, unknown > = z.object({ tag: z.string().optional(), }); /** @internal */ export type GetLibraryHubsDirector$Outbound = { tag?: string | undefined; }; /** @internal */ export const GetLibraryHubsDirector$outboundSchema: z.ZodType< GetLibraryHubsDirector$Outbound, z.ZodTypeDef, GetLibraryHubsDirector > = z.object({ tag: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsDirector$ { /** @deprecated use `GetLibraryHubsDirector$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsDirector$inboundSchema; /** @deprecated use `GetLibraryHubsDirector$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsDirector$outboundSchema; /** @deprecated use `GetLibraryHubsDirector$Outbound` instead. */ export type Outbound = GetLibraryHubsDirector$Outbound; } export function getLibraryHubsDirectorToJSON( getLibraryHubsDirector: GetLibraryHubsDirector, ): string { return JSON.stringify( GetLibraryHubsDirector$outboundSchema.parse(getLibraryHubsDirector), ); } export function getLibraryHubsDirectorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsDirector$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsDirector' from JSON`, ); } /** @internal */ export const GetLibraryHubsRole$inboundSchema: z.ZodType< GetLibraryHubsRole, z.ZodTypeDef, unknown > = z.object({ tag: z.string().optional(), }); /** @internal */ export type GetLibraryHubsRole$Outbound = { tag?: string | undefined; }; /** @internal */ export const GetLibraryHubsRole$outboundSchema: z.ZodType< GetLibraryHubsRole$Outbound, z.ZodTypeDef, GetLibraryHubsRole > = z.object({ tag: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsRole$ { /** @deprecated use `GetLibraryHubsRole$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsRole$inboundSchema; /** @deprecated use `GetLibraryHubsRole$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsRole$outboundSchema; /** @deprecated use `GetLibraryHubsRole$Outbound` instead. */ export type Outbound = GetLibraryHubsRole$Outbound; } export function getLibraryHubsRoleToJSON( getLibraryHubsRole: GetLibraryHubsRole, ): string { return JSON.stringify( GetLibraryHubsRole$outboundSchema.parse(getLibraryHubsRole), ); } export function getLibraryHubsRoleFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsRole' from JSON`, ); } /** @internal */ export const GetLibraryHubsWriter$inboundSchema: z.ZodType< GetLibraryHubsWriter, z.ZodTypeDef, unknown > = z.object({ tag: z.string().optional(), }); /** @internal */ export type GetLibraryHubsWriter$Outbound = { tag?: string | undefined; }; /** @internal */ export const GetLibraryHubsWriter$outboundSchema: z.ZodType< GetLibraryHubsWriter$Outbound, z.ZodTypeDef, GetLibraryHubsWriter > = z.object({ tag: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsWriter$ { /** @deprecated use `GetLibraryHubsWriter$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsWriter$inboundSchema; /** @deprecated use `GetLibraryHubsWriter$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsWriter$outboundSchema; /** @deprecated use `GetLibraryHubsWriter$Outbound` instead. */ export type Outbound = GetLibraryHubsWriter$Outbound; } export function getLibraryHubsWriterToJSON( getLibraryHubsWriter: GetLibraryHubsWriter, ): string { return JSON.stringify( GetLibraryHubsWriter$outboundSchema.parse(getLibraryHubsWriter), ); } export function getLibraryHubsWriterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsWriter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsWriter' from JSON`, ); } /** @internal */ export const GetLibraryHubsMetadata$inboundSchema: z.ZodType< GetLibraryHubsMetadata, z.ZodTypeDef, unknown > = z.object({ ratingKey: z.string().optional(), key: z.string().optional(), guid: z.string().optional(), studio: z.string().optional(), type: z.string().optional(), title: z.string().optional(), librarySectionTitle: z.string().optional(), librarySectionID: z.number().int().optional(), librarySectionKey: z.string().optional(), contentRating: z.string().optional(), summary: z.string().optional(), rating: z.number().optional(), audienceRating: z.number().optional(), viewCount: z.number().int().optional(), lastViewedAt: z.number().int().optional(), year: z.number().int().optional(), tagline: z.string().optional(), thumb: z.string().optional(), art: z.string().optional(), duration: z.number().int().optional(), originallyAvailableAt: z.string().transform(v => new RFCDate(v)).optional(), addedAt: z.number().int().optional(), updatedAt: z.number().int().optional(), audienceRatingImage: z.string().optional(), primaryExtraKey: z.string().optional(), ratingImage: z.string().optional(), Media: z.array(z.lazy(() => GetLibraryHubsMedia$inboundSchema)).optional(), Genre: z.array(z.lazy(() => GetLibraryHubsGenre$inboundSchema)).optional(), Country: z.array(z.lazy(() => GetLibraryHubsCountry$inboundSchema)) .optional(), Director: z.array(z.lazy(() => GetLibraryHubsDirector$inboundSchema)) .optional(), Role: z.array(z.lazy(() => GetLibraryHubsRole$inboundSchema)).optional(), Writer: z.array(z.lazy(() => GetLibraryHubsWriter$inboundSchema)).optional(), skipCount: z.number().int().optional(), chapterSource: z.string().optional(), }).transform((v) => { return remap$(v, { "Media": "media", "Genre": "genre", "Country": "country", "Director": "director", "Role": "role", "Writer": "writer", }); }); /** @internal */ export type GetLibraryHubsMetadata$Outbound = { ratingKey?: string | undefined; key?: string | undefined; guid?: string | undefined; studio?: string | undefined; type?: string | undefined; title?: string | undefined; librarySectionTitle?: string | undefined; librarySectionID?: number | undefined; librarySectionKey?: string | undefined; contentRating?: string | undefined; summary?: string | undefined; rating?: number | undefined; audienceRating?: number | undefined; viewCount?: number | undefined; lastViewedAt?: number | undefined; year?: number | undefined; tagline?: string | undefined; thumb?: string | undefined; art?: string | undefined; duration?: number | undefined; originallyAvailableAt?: string | undefined; addedAt?: number | undefined; updatedAt?: number | undefined; audienceRatingImage?: string | undefined; primaryExtraKey?: string | undefined; ratingImage?: string | undefined; Media?: Array | undefined; Genre?: Array | undefined; Country?: Array | undefined; Director?: Array | undefined; Role?: Array | undefined; Writer?: Array | undefined; skipCount?: number | undefined; chapterSource?: string | undefined; }; /** @internal */ export const GetLibraryHubsMetadata$outboundSchema: z.ZodType< GetLibraryHubsMetadata$Outbound, z.ZodTypeDef, GetLibraryHubsMetadata > = z.object({ ratingKey: z.string().optional(), key: z.string().optional(), guid: z.string().optional(), studio: z.string().optional(), type: z.string().optional(), title: z.string().optional(), librarySectionTitle: z.string().optional(), librarySectionID: z.number().int().optional(), librarySectionKey: z.string().optional(), contentRating: z.string().optional(), summary: z.string().optional(), rating: z.number().optional(), audienceRating: z.number().optional(), viewCount: z.number().int().optional(), lastViewedAt: z.number().int().optional(), year: z.number().int().optional(), tagline: z.string().optional(), thumb: z.string().optional(), art: z.string().optional(), duration: z.number().int().optional(), originallyAvailableAt: z.instanceof(RFCDate).transform(v => v.toString()) .optional(), addedAt: z.number().int().optional(), updatedAt: z.number().int().optional(), audienceRatingImage: z.string().optional(), primaryExtraKey: z.string().optional(), ratingImage: z.string().optional(), media: z.array(z.lazy(() => GetLibraryHubsMedia$outboundSchema)).optional(), genre: z.array(z.lazy(() => GetLibraryHubsGenre$outboundSchema)).optional(), country: z.array(z.lazy(() => GetLibraryHubsCountry$outboundSchema)) .optional(), director: z.array(z.lazy(() => GetLibraryHubsDirector$outboundSchema)) .optional(), role: z.array(z.lazy(() => GetLibraryHubsRole$outboundSchema)).optional(), writer: z.array(z.lazy(() => GetLibraryHubsWriter$outboundSchema)).optional(), skipCount: z.number().int().optional(), chapterSource: z.string().optional(), }).transform((v) => { return remap$(v, { media: "Media", genre: "Genre", country: "Country", director: "Director", role: "Role", writer: "Writer", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsMetadata$ { /** @deprecated use `GetLibraryHubsMetadata$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsMetadata$inboundSchema; /** @deprecated use `GetLibraryHubsMetadata$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsMetadata$outboundSchema; /** @deprecated use `GetLibraryHubsMetadata$Outbound` instead. */ export type Outbound = GetLibraryHubsMetadata$Outbound; } export function getLibraryHubsMetadataToJSON( getLibraryHubsMetadata: GetLibraryHubsMetadata, ): string { return JSON.stringify( GetLibraryHubsMetadata$outboundSchema.parse(getLibraryHubsMetadata), ); } export function getLibraryHubsMetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsMetadata' from JSON`, ); } /** @internal */ export const GetLibraryHubsHub$inboundSchema: z.ZodType< GetLibraryHubsHub, z.ZodTypeDef, unknown > = z.object({ key: z.string().optional(), title: z.string().optional(), type: z.string().optional(), hubIdentifier: z.string().optional(), context: z.string().optional(), size: z.number().int().optional(), more: z.boolean().optional(), style: z.string().optional(), hubKey: z.string().optional(), Metadata: z.array(z.lazy(() => GetLibraryHubsMetadata$inboundSchema)) .optional(), promoted: z.boolean().optional(), random: z.boolean().optional(), }).transform((v) => { return remap$(v, { "Metadata": "metadata", }); }); /** @internal */ export type GetLibraryHubsHub$Outbound = { key?: string | undefined; title?: string | undefined; type?: string | undefined; hubIdentifier?: string | undefined; context?: string | undefined; size?: number | undefined; more?: boolean | undefined; style?: string | undefined; hubKey?: string | undefined; Metadata?: Array | undefined; promoted?: boolean | undefined; random?: boolean | undefined; }; /** @internal */ export const GetLibraryHubsHub$outboundSchema: z.ZodType< GetLibraryHubsHub$Outbound, z.ZodTypeDef, GetLibraryHubsHub > = z.object({ key: z.string().optional(), title: z.string().optional(), type: z.string().optional(), hubIdentifier: z.string().optional(), context: z.string().optional(), size: z.number().int().optional(), more: z.boolean().optional(), style: z.string().optional(), hubKey: z.string().optional(), metadata: z.array(z.lazy(() => GetLibraryHubsMetadata$outboundSchema)) .optional(), promoted: z.boolean().optional(), random: z.boolean().optional(), }).transform((v) => { return remap$(v, { metadata: "Metadata", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsHub$ { /** @deprecated use `GetLibraryHubsHub$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsHub$inboundSchema; /** @deprecated use `GetLibraryHubsHub$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsHub$outboundSchema; /** @deprecated use `GetLibraryHubsHub$Outbound` instead. */ export type Outbound = GetLibraryHubsHub$Outbound; } export function getLibraryHubsHubToJSON( getLibraryHubsHub: GetLibraryHubsHub, ): string { return JSON.stringify( GetLibraryHubsHub$outboundSchema.parse(getLibraryHubsHub), ); } export function getLibraryHubsHubFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsHub$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsHub' from JSON`, ); } /** @internal */ export const GetLibraryHubsMediaContainer$inboundSchema: z.ZodType< GetLibraryHubsMediaContainer, z.ZodTypeDef, unknown > = z.object({ size: z.number().int().optional(), allowSync: z.boolean().optional(), identifier: z.string().optional(), librarySectionID: z.number().int().optional(), librarySectionTitle: z.string().optional(), librarySectionUUID: z.string().optional(), Hub: z.array(z.lazy(() => GetLibraryHubsHub$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "Hub": "hub", }); }); /** @internal */ export type GetLibraryHubsMediaContainer$Outbound = { size?: number | undefined; allowSync?: boolean | undefined; identifier?: string | undefined; librarySectionID?: number | undefined; librarySectionTitle?: string | undefined; librarySectionUUID?: string | undefined; Hub?: Array | undefined; }; /** @internal */ export const GetLibraryHubsMediaContainer$outboundSchema: z.ZodType< GetLibraryHubsMediaContainer$Outbound, z.ZodTypeDef, GetLibraryHubsMediaContainer > = z.object({ size: z.number().int().optional(), allowSync: z.boolean().optional(), identifier: z.string().optional(), librarySectionID: z.number().int().optional(), librarySectionTitle: z.string().optional(), librarySectionUUID: z.string().optional(), hub: z.array(z.lazy(() => GetLibraryHubsHub$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { hub: "Hub", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsMediaContainer$ { /** @deprecated use `GetLibraryHubsMediaContainer$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsMediaContainer$inboundSchema; /** @deprecated use `GetLibraryHubsMediaContainer$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsMediaContainer$outboundSchema; /** @deprecated use `GetLibraryHubsMediaContainer$Outbound` instead. */ export type Outbound = GetLibraryHubsMediaContainer$Outbound; } export function getLibraryHubsMediaContainerToJSON( getLibraryHubsMediaContainer: GetLibraryHubsMediaContainer, ): string { return JSON.stringify( GetLibraryHubsMediaContainer$outboundSchema.parse( getLibraryHubsMediaContainer, ), ); } export function getLibraryHubsMediaContainerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsMediaContainer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsMediaContainer' from JSON`, ); } /** @internal */ export const GetLibraryHubsResponseBody$inboundSchema: z.ZodType< GetLibraryHubsResponseBody, z.ZodTypeDef, unknown > = z.object({ MediaContainer: z.lazy(() => GetLibraryHubsMediaContainer$inboundSchema) .optional(), }).transform((v) => { return remap$(v, { "MediaContainer": "mediaContainer", }); }); /** @internal */ export type GetLibraryHubsResponseBody$Outbound = { MediaContainer?: GetLibraryHubsMediaContainer$Outbound | undefined; }; /** @internal */ export const GetLibraryHubsResponseBody$outboundSchema: z.ZodType< GetLibraryHubsResponseBody$Outbound, z.ZodTypeDef, GetLibraryHubsResponseBody > = z.object({ mediaContainer: z.lazy(() => GetLibraryHubsMediaContainer$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { mediaContainer: "MediaContainer", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsResponseBody$ { /** @deprecated use `GetLibraryHubsResponseBody$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsResponseBody$inboundSchema; /** @deprecated use `GetLibraryHubsResponseBody$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsResponseBody$outboundSchema; /** @deprecated use `GetLibraryHubsResponseBody$Outbound` instead. */ export type Outbound = GetLibraryHubsResponseBody$Outbound; } export function getLibraryHubsResponseBodyToJSON( getLibraryHubsResponseBody: GetLibraryHubsResponseBody, ): string { return JSON.stringify( GetLibraryHubsResponseBody$outboundSchema.parse(getLibraryHubsResponseBody), ); } export function getLibraryHubsResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsResponseBody' from JSON`, ); } /** @internal */ export const GetLibraryHubsResponse$inboundSchema: z.ZodType< GetLibraryHubsResponse, z.ZodTypeDef, unknown > = z.object({ ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), object: z.lazy(() => GetLibraryHubsResponseBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "ContentType": "contentType", "StatusCode": "statusCode", "RawResponse": "rawResponse", }); }); /** @internal */ export type GetLibraryHubsResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; object?: GetLibraryHubsResponseBody$Outbound | undefined; }; /** @internal */ export const GetLibraryHubsResponse$outboundSchema: z.ZodType< GetLibraryHubsResponse$Outbound, z.ZodTypeDef, GetLibraryHubsResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), object: z.lazy(() => GetLibraryHubsResponseBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { contentType: "ContentType", statusCode: "StatusCode", rawResponse: "RawResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetLibraryHubsResponse$ { /** @deprecated use `GetLibraryHubsResponse$inboundSchema` instead. */ export const inboundSchema = GetLibraryHubsResponse$inboundSchema; /** @deprecated use `GetLibraryHubsResponse$outboundSchema` instead. */ export const outboundSchema = GetLibraryHubsResponse$outboundSchema; /** @deprecated use `GetLibraryHubsResponse$Outbound` instead. */ export type Outbound = GetLibraryHubsResponse$Outbound; } export function getLibraryHubsResponseToJSON( getLibraryHubsResponse: GetLibraryHubsResponse, ): string { return JSON.stringify( GetLibraryHubsResponse$outboundSchema.parse(getLibraryHubsResponse), ); } export function getLibraryHubsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetLibraryHubsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetLibraryHubsResponse' from JSON`, ); }