Files
plexjs/src/sdk/models/operations/getplaylistcontents.ts

1164 lines
36 KiB
TypeScript

/*
* 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 {
catchUnrecognizedEnum,
OpenEnum,
Unrecognized,
} from "../../types/enums.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { RFCDate } from "../../types/rfcdate.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
/**
* The type of media to retrieve or filter by.
*
* @remarks
* 1 = movie
* 2 = show
* 3 = season
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
export enum GetPlaylistContentsQueryParamType {
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
Audio = 8,
Album = 9,
Track = 10,
}
/**
* The type of media to retrieve or filter by.
*
* @remarks
* 1 = movie
* 2 = show
* 3 = season
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
export type GetPlaylistContentsQueryParamTypeOpen = OpenEnum<
typeof GetPlaylistContentsQueryParamType
>;
export type GetPlaylistContentsRequest = {
/**
* the ID of the playlist
*/
playlistID: number;
/**
* The type of media to retrieve or filter by.
*
* @remarks
* 1 = movie
* 2 = show
* 3 = season
* 4 = episode
* E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
*/
type: GetPlaylistContentsQueryParamTypeOpen;
};
export type GetPlaylistContentsPart = {
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 GetPlaylistContentsMedia = {
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<GetPlaylistContentsPart> | undefined;
};
export type GetPlaylistContentsGenre = {
tag?: string | undefined;
};
export type GetPlaylistContentsCountry = {
tag?: string | undefined;
};
export type GetPlaylistContentsDirector = {
tag?: string | undefined;
};
export type GetPlaylistContentsWriter = {
tag?: string | undefined;
};
export type GetPlaylistContentsRole = {
tag?: string | undefined;
};
export type GetPlaylistContentsMetadata = {
ratingKey?: string | undefined;
key?: string | undefined;
guid?: string | undefined;
studio?: string | undefined;
type?: string | undefined;
title?: string | undefined;
titleSort?: string | undefined;
librarySectionTitle?: string | undefined;
librarySectionID?: number | undefined;
librarySectionKey?: string | undefined;
contentRating?: string | undefined;
summary?: string | undefined;
rating?: number | undefined;
audienceRating?: 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;
hasPremiumExtras?: string | undefined;
hasPremiumPrimaryExtra?: string | undefined;
ratingImage?: string | undefined;
media?: Array<GetPlaylistContentsMedia> | undefined;
genre?: Array<GetPlaylistContentsGenre> | undefined;
country?: Array<GetPlaylistContentsCountry> | undefined;
director?: Array<GetPlaylistContentsDirector> | undefined;
writer?: Array<GetPlaylistContentsWriter> | undefined;
role?: Array<GetPlaylistContentsRole> | undefined;
};
export type GetPlaylistContentsMediaContainer = {
size?: number | undefined;
composite?: string | undefined;
duration?: number | undefined;
leafCount?: number | undefined;
playlistType?: string | undefined;
ratingKey?: string | undefined;
smart?: boolean | undefined;
title?: string | undefined;
metadata?: Array<GetPlaylistContentsMetadata> | undefined;
};
/**
* The playlist contents
*/
export type GetPlaylistContentsResponseBody = {
mediaContainer?: GetPlaylistContentsMediaContainer | undefined;
};
export type GetPlaylistContentsResponse = {
/**
* 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 playlist contents
*/
object?: GetPlaylistContentsResponseBody | undefined;
};
/** @internal */
export const GetPlaylistContentsQueryParamType$inboundSchema: z.ZodType<
GetPlaylistContentsQueryParamTypeOpen,
z.ZodTypeDef,
unknown
> = z
.union([
z.nativeEnum(GetPlaylistContentsQueryParamType),
z.number().transform(catchUnrecognizedEnum),
]);
/** @internal */
export const GetPlaylistContentsQueryParamType$outboundSchema: z.ZodType<
GetPlaylistContentsQueryParamTypeOpen,
z.ZodTypeDef,
GetPlaylistContentsQueryParamTypeOpen
> = z.union([
z.nativeEnum(GetPlaylistContentsQueryParamType),
z.number().and(z.custom<Unrecognized<number>>()),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetPlaylistContentsQueryParamType$ {
/** @deprecated use `GetPlaylistContentsQueryParamType$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsQueryParamType$inboundSchema;
/** @deprecated use `GetPlaylistContentsQueryParamType$outboundSchema` instead. */
export const outboundSchema =
GetPlaylistContentsQueryParamType$outboundSchema;
}
/** @internal */
export const GetPlaylistContentsRequest$inboundSchema: z.ZodType<
GetPlaylistContentsRequest,
z.ZodTypeDef,
unknown
> = z.object({
playlistID: z.number(),
type: GetPlaylistContentsQueryParamType$inboundSchema,
});
/** @internal */
export type GetPlaylistContentsRequest$Outbound = {
playlistID: number;
type: number;
};
/** @internal */
export const GetPlaylistContentsRequest$outboundSchema: z.ZodType<
GetPlaylistContentsRequest$Outbound,
z.ZodTypeDef,
GetPlaylistContentsRequest
> = z.object({
playlistID: z.number(),
type: GetPlaylistContentsQueryParamType$outboundSchema,
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetPlaylistContentsRequest$ {
/** @deprecated use `GetPlaylistContentsRequest$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsRequest$inboundSchema;
/** @deprecated use `GetPlaylistContentsRequest$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsRequest$outboundSchema;
/** @deprecated use `GetPlaylistContentsRequest$Outbound` instead. */
export type Outbound = GetPlaylistContentsRequest$Outbound;
}
export function getPlaylistContentsRequestToJSON(
getPlaylistContentsRequest: GetPlaylistContentsRequest,
): string {
return JSON.stringify(
GetPlaylistContentsRequest$outboundSchema.parse(getPlaylistContentsRequest),
);
}
export function getPlaylistContentsRequestFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsRequest' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsPart$inboundSchema: z.ZodType<
GetPlaylistContentsPart,
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 GetPlaylistContentsPart$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 GetPlaylistContentsPart$outboundSchema: z.ZodType<
GetPlaylistContentsPart$Outbound,
z.ZodTypeDef,
GetPlaylistContentsPart
> = 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 GetPlaylistContentsPart$ {
/** @deprecated use `GetPlaylistContentsPart$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsPart$inboundSchema;
/** @deprecated use `GetPlaylistContentsPart$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsPart$outboundSchema;
/** @deprecated use `GetPlaylistContentsPart$Outbound` instead. */
export type Outbound = GetPlaylistContentsPart$Outbound;
}
export function getPlaylistContentsPartToJSON(
getPlaylistContentsPart: GetPlaylistContentsPart,
): string {
return JSON.stringify(
GetPlaylistContentsPart$outboundSchema.parse(getPlaylistContentsPart),
);
}
export function getPlaylistContentsPartFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsPart, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsPart$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsPart' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsMedia$inboundSchema: z.ZodType<
GetPlaylistContentsMedia,
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(() => GetPlaylistContentsPart$inboundSchema)).optional(),
}).transform((v) => {
return remap$(v, {
"Part": "part",
});
});
/** @internal */
export type GetPlaylistContentsMedia$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<GetPlaylistContentsPart$Outbound> | undefined;
};
/** @internal */
export const GetPlaylistContentsMedia$outboundSchema: z.ZodType<
GetPlaylistContentsMedia$Outbound,
z.ZodTypeDef,
GetPlaylistContentsMedia
> = 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(() => GetPlaylistContentsPart$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 GetPlaylistContentsMedia$ {
/** @deprecated use `GetPlaylistContentsMedia$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsMedia$inboundSchema;
/** @deprecated use `GetPlaylistContentsMedia$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsMedia$outboundSchema;
/** @deprecated use `GetPlaylistContentsMedia$Outbound` instead. */
export type Outbound = GetPlaylistContentsMedia$Outbound;
}
export function getPlaylistContentsMediaToJSON(
getPlaylistContentsMedia: GetPlaylistContentsMedia,
): string {
return JSON.stringify(
GetPlaylistContentsMedia$outboundSchema.parse(getPlaylistContentsMedia),
);
}
export function getPlaylistContentsMediaFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsMedia, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsMedia$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsMedia' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsGenre$inboundSchema: z.ZodType<
GetPlaylistContentsGenre,
z.ZodTypeDef,
unknown
> = z.object({
tag: z.string().optional(),
});
/** @internal */
export type GetPlaylistContentsGenre$Outbound = {
tag?: string | undefined;
};
/** @internal */
export const GetPlaylistContentsGenre$outboundSchema: z.ZodType<
GetPlaylistContentsGenre$Outbound,
z.ZodTypeDef,
GetPlaylistContentsGenre
> = 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 GetPlaylistContentsGenre$ {
/** @deprecated use `GetPlaylistContentsGenre$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsGenre$inboundSchema;
/** @deprecated use `GetPlaylistContentsGenre$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsGenre$outboundSchema;
/** @deprecated use `GetPlaylistContentsGenre$Outbound` instead. */
export type Outbound = GetPlaylistContentsGenre$Outbound;
}
export function getPlaylistContentsGenreToJSON(
getPlaylistContentsGenre: GetPlaylistContentsGenre,
): string {
return JSON.stringify(
GetPlaylistContentsGenre$outboundSchema.parse(getPlaylistContentsGenre),
);
}
export function getPlaylistContentsGenreFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsGenre, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsGenre$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsGenre' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsCountry$inboundSchema: z.ZodType<
GetPlaylistContentsCountry,
z.ZodTypeDef,
unknown
> = z.object({
tag: z.string().optional(),
});
/** @internal */
export type GetPlaylistContentsCountry$Outbound = {
tag?: string | undefined;
};
/** @internal */
export const GetPlaylistContentsCountry$outboundSchema: z.ZodType<
GetPlaylistContentsCountry$Outbound,
z.ZodTypeDef,
GetPlaylistContentsCountry
> = 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 GetPlaylistContentsCountry$ {
/** @deprecated use `GetPlaylistContentsCountry$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsCountry$inboundSchema;
/** @deprecated use `GetPlaylistContentsCountry$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsCountry$outboundSchema;
/** @deprecated use `GetPlaylistContentsCountry$Outbound` instead. */
export type Outbound = GetPlaylistContentsCountry$Outbound;
}
export function getPlaylistContentsCountryToJSON(
getPlaylistContentsCountry: GetPlaylistContentsCountry,
): string {
return JSON.stringify(
GetPlaylistContentsCountry$outboundSchema.parse(getPlaylistContentsCountry),
);
}
export function getPlaylistContentsCountryFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsCountry, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsCountry$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsCountry' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsDirector$inboundSchema: z.ZodType<
GetPlaylistContentsDirector,
z.ZodTypeDef,
unknown
> = z.object({
tag: z.string().optional(),
});
/** @internal */
export type GetPlaylistContentsDirector$Outbound = {
tag?: string | undefined;
};
/** @internal */
export const GetPlaylistContentsDirector$outboundSchema: z.ZodType<
GetPlaylistContentsDirector$Outbound,
z.ZodTypeDef,
GetPlaylistContentsDirector
> = 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 GetPlaylistContentsDirector$ {
/** @deprecated use `GetPlaylistContentsDirector$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsDirector$inboundSchema;
/** @deprecated use `GetPlaylistContentsDirector$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsDirector$outboundSchema;
/** @deprecated use `GetPlaylistContentsDirector$Outbound` instead. */
export type Outbound = GetPlaylistContentsDirector$Outbound;
}
export function getPlaylistContentsDirectorToJSON(
getPlaylistContentsDirector: GetPlaylistContentsDirector,
): string {
return JSON.stringify(
GetPlaylistContentsDirector$outboundSchema.parse(
getPlaylistContentsDirector,
),
);
}
export function getPlaylistContentsDirectorFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsDirector, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsDirector$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsDirector' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsWriter$inboundSchema: z.ZodType<
GetPlaylistContentsWriter,
z.ZodTypeDef,
unknown
> = z.object({
tag: z.string().optional(),
});
/** @internal */
export type GetPlaylistContentsWriter$Outbound = {
tag?: string | undefined;
};
/** @internal */
export const GetPlaylistContentsWriter$outboundSchema: z.ZodType<
GetPlaylistContentsWriter$Outbound,
z.ZodTypeDef,
GetPlaylistContentsWriter
> = 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 GetPlaylistContentsWriter$ {
/** @deprecated use `GetPlaylistContentsWriter$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsWriter$inboundSchema;
/** @deprecated use `GetPlaylistContentsWriter$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsWriter$outboundSchema;
/** @deprecated use `GetPlaylistContentsWriter$Outbound` instead. */
export type Outbound = GetPlaylistContentsWriter$Outbound;
}
export function getPlaylistContentsWriterToJSON(
getPlaylistContentsWriter: GetPlaylistContentsWriter,
): string {
return JSON.stringify(
GetPlaylistContentsWriter$outboundSchema.parse(getPlaylistContentsWriter),
);
}
export function getPlaylistContentsWriterFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsWriter, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsWriter$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsWriter' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsRole$inboundSchema: z.ZodType<
GetPlaylistContentsRole,
z.ZodTypeDef,
unknown
> = z.object({
tag: z.string().optional(),
});
/** @internal */
export type GetPlaylistContentsRole$Outbound = {
tag?: string | undefined;
};
/** @internal */
export const GetPlaylistContentsRole$outboundSchema: z.ZodType<
GetPlaylistContentsRole$Outbound,
z.ZodTypeDef,
GetPlaylistContentsRole
> = 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 GetPlaylistContentsRole$ {
/** @deprecated use `GetPlaylistContentsRole$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsRole$inboundSchema;
/** @deprecated use `GetPlaylistContentsRole$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsRole$outboundSchema;
/** @deprecated use `GetPlaylistContentsRole$Outbound` instead. */
export type Outbound = GetPlaylistContentsRole$Outbound;
}
export function getPlaylistContentsRoleToJSON(
getPlaylistContentsRole: GetPlaylistContentsRole,
): string {
return JSON.stringify(
GetPlaylistContentsRole$outboundSchema.parse(getPlaylistContentsRole),
);
}
export function getPlaylistContentsRoleFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsRole, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsRole$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsRole' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsMetadata$inboundSchema: z.ZodType<
GetPlaylistContentsMetadata,
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(),
titleSort: 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(),
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(),
hasPremiumExtras: z.string().optional(),
hasPremiumPrimaryExtra: z.string().optional(),
ratingImage: z.string().optional(),
Media: z.array(z.lazy(() => GetPlaylistContentsMedia$inboundSchema))
.optional(),
Genre: z.array(z.lazy(() => GetPlaylistContentsGenre$inboundSchema))
.optional(),
Country: z.array(z.lazy(() => GetPlaylistContentsCountry$inboundSchema))
.optional(),
Director: z.array(z.lazy(() => GetPlaylistContentsDirector$inboundSchema))
.optional(),
Writer: z.array(z.lazy(() => GetPlaylistContentsWriter$inboundSchema))
.optional(),
Role: z.array(z.lazy(() => GetPlaylistContentsRole$inboundSchema)).optional(),
}).transform((v) => {
return remap$(v, {
"Media": "media",
"Genre": "genre",
"Country": "country",
"Director": "director",
"Writer": "writer",
"Role": "role",
});
});
/** @internal */
export type GetPlaylistContentsMetadata$Outbound = {
ratingKey?: string | undefined;
key?: string | undefined;
guid?: string | undefined;
studio?: string | undefined;
type?: string | undefined;
title?: string | undefined;
titleSort?: string | undefined;
librarySectionTitle?: string | undefined;
librarySectionID?: number | undefined;
librarySectionKey?: string | undefined;
contentRating?: string | undefined;
summary?: string | undefined;
rating?: number | undefined;
audienceRating?: 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;
hasPremiumExtras?: string | undefined;
hasPremiumPrimaryExtra?: string | undefined;
ratingImage?: string | undefined;
Media?: Array<GetPlaylistContentsMedia$Outbound> | undefined;
Genre?: Array<GetPlaylistContentsGenre$Outbound> | undefined;
Country?: Array<GetPlaylistContentsCountry$Outbound> | undefined;
Director?: Array<GetPlaylistContentsDirector$Outbound> | undefined;
Writer?: Array<GetPlaylistContentsWriter$Outbound> | undefined;
Role?: Array<GetPlaylistContentsRole$Outbound> | undefined;
};
/** @internal */
export const GetPlaylistContentsMetadata$outboundSchema: z.ZodType<
GetPlaylistContentsMetadata$Outbound,
z.ZodTypeDef,
GetPlaylistContentsMetadata
> = 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(),
titleSort: 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(),
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(),
hasPremiumExtras: z.string().optional(),
hasPremiumPrimaryExtra: z.string().optional(),
ratingImage: z.string().optional(),
media: z.array(z.lazy(() => GetPlaylistContentsMedia$outboundSchema))
.optional(),
genre: z.array(z.lazy(() => GetPlaylistContentsGenre$outboundSchema))
.optional(),
country: z.array(z.lazy(() => GetPlaylistContentsCountry$outboundSchema))
.optional(),
director: z.array(z.lazy(() => GetPlaylistContentsDirector$outboundSchema))
.optional(),
writer: z.array(z.lazy(() => GetPlaylistContentsWriter$outboundSchema))
.optional(),
role: z.array(z.lazy(() => GetPlaylistContentsRole$outboundSchema))
.optional(),
}).transform((v) => {
return remap$(v, {
media: "Media",
genre: "Genre",
country: "Country",
director: "Director",
writer: "Writer",
role: "Role",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetPlaylistContentsMetadata$ {
/** @deprecated use `GetPlaylistContentsMetadata$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsMetadata$inboundSchema;
/** @deprecated use `GetPlaylistContentsMetadata$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsMetadata$outboundSchema;
/** @deprecated use `GetPlaylistContentsMetadata$Outbound` instead. */
export type Outbound = GetPlaylistContentsMetadata$Outbound;
}
export function getPlaylistContentsMetadataToJSON(
getPlaylistContentsMetadata: GetPlaylistContentsMetadata,
): string {
return JSON.stringify(
GetPlaylistContentsMetadata$outboundSchema.parse(
getPlaylistContentsMetadata,
),
);
}
export function getPlaylistContentsMetadataFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsMetadata, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsMetadata$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsMetadata' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsMediaContainer$inboundSchema: z.ZodType<
GetPlaylistContentsMediaContainer,
z.ZodTypeDef,
unknown
> = z.object({
size: z.number().int().optional(),
composite: z.string().optional(),
duration: z.number().int().optional(),
leafCount: z.number().int().optional(),
playlistType: z.string().optional(),
ratingKey: z.string().optional(),
smart: z.boolean().optional(),
title: z.string().optional(),
Metadata: z.array(z.lazy(() => GetPlaylistContentsMetadata$inboundSchema))
.optional(),
}).transform((v) => {
return remap$(v, {
"Metadata": "metadata",
});
});
/** @internal */
export type GetPlaylistContentsMediaContainer$Outbound = {
size?: number | undefined;
composite?: string | undefined;
duration?: number | undefined;
leafCount?: number | undefined;
playlistType?: string | undefined;
ratingKey?: string | undefined;
smart?: boolean | undefined;
title?: string | undefined;
Metadata?: Array<GetPlaylistContentsMetadata$Outbound> | undefined;
};
/** @internal */
export const GetPlaylistContentsMediaContainer$outboundSchema: z.ZodType<
GetPlaylistContentsMediaContainer$Outbound,
z.ZodTypeDef,
GetPlaylistContentsMediaContainer
> = z.object({
size: z.number().int().optional(),
composite: z.string().optional(),
duration: z.number().int().optional(),
leafCount: z.number().int().optional(),
playlistType: z.string().optional(),
ratingKey: z.string().optional(),
smart: z.boolean().optional(),
title: z.string().optional(),
metadata: z.array(z.lazy(() => GetPlaylistContentsMetadata$outboundSchema))
.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 GetPlaylistContentsMediaContainer$ {
/** @deprecated use `GetPlaylistContentsMediaContainer$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsMediaContainer$inboundSchema;
/** @deprecated use `GetPlaylistContentsMediaContainer$outboundSchema` instead. */
export const outboundSchema =
GetPlaylistContentsMediaContainer$outboundSchema;
/** @deprecated use `GetPlaylistContentsMediaContainer$Outbound` instead. */
export type Outbound = GetPlaylistContentsMediaContainer$Outbound;
}
export function getPlaylistContentsMediaContainerToJSON(
getPlaylistContentsMediaContainer: GetPlaylistContentsMediaContainer,
): string {
return JSON.stringify(
GetPlaylistContentsMediaContainer$outboundSchema.parse(
getPlaylistContentsMediaContainer,
),
);
}
export function getPlaylistContentsMediaContainerFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsMediaContainer, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsMediaContainer$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsMediaContainer' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsResponseBody$inboundSchema: z.ZodType<
GetPlaylistContentsResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
MediaContainer: z.lazy(() => GetPlaylistContentsMediaContainer$inboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
"MediaContainer": "mediaContainer",
});
});
/** @internal */
export type GetPlaylistContentsResponseBody$Outbound = {
MediaContainer?: GetPlaylistContentsMediaContainer$Outbound | undefined;
};
/** @internal */
export const GetPlaylistContentsResponseBody$outboundSchema: z.ZodType<
GetPlaylistContentsResponseBody$Outbound,
z.ZodTypeDef,
GetPlaylistContentsResponseBody
> = z.object({
mediaContainer: z.lazy(() => GetPlaylistContentsMediaContainer$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 GetPlaylistContentsResponseBody$ {
/** @deprecated use `GetPlaylistContentsResponseBody$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsResponseBody$inboundSchema;
/** @deprecated use `GetPlaylistContentsResponseBody$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsResponseBody$outboundSchema;
/** @deprecated use `GetPlaylistContentsResponseBody$Outbound` instead. */
export type Outbound = GetPlaylistContentsResponseBody$Outbound;
}
export function getPlaylistContentsResponseBodyToJSON(
getPlaylistContentsResponseBody: GetPlaylistContentsResponseBody,
): string {
return JSON.stringify(
GetPlaylistContentsResponseBody$outboundSchema.parse(
getPlaylistContentsResponseBody,
),
);
}
export function getPlaylistContentsResponseBodyFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsResponseBody, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsResponseBody$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsResponseBody' from JSON`,
);
}
/** @internal */
export const GetPlaylistContentsResponse$inboundSchema: z.ZodType<
GetPlaylistContentsResponse,
z.ZodTypeDef,
unknown
> = z.object({
ContentType: z.string(),
StatusCode: z.number().int(),
RawResponse: z.instanceof(Response),
object: z.lazy(() => GetPlaylistContentsResponseBody$inboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
"ContentType": "contentType",
"StatusCode": "statusCode",
"RawResponse": "rawResponse",
});
});
/** @internal */
export type GetPlaylistContentsResponse$Outbound = {
ContentType: string;
StatusCode: number;
RawResponse: never;
object?: GetPlaylistContentsResponseBody$Outbound | undefined;
};
/** @internal */
export const GetPlaylistContentsResponse$outboundSchema: z.ZodType<
GetPlaylistContentsResponse$Outbound,
z.ZodTypeDef,
GetPlaylistContentsResponse
> = z.object({
contentType: z.string(),
statusCode: z.number().int(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}),
object: z.lazy(() => GetPlaylistContentsResponseBody$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 GetPlaylistContentsResponse$ {
/** @deprecated use `GetPlaylistContentsResponse$inboundSchema` instead. */
export const inboundSchema = GetPlaylistContentsResponse$inboundSchema;
/** @deprecated use `GetPlaylistContentsResponse$outboundSchema` instead. */
export const outboundSchema = GetPlaylistContentsResponse$outboundSchema;
/** @deprecated use `GetPlaylistContentsResponse$Outbound` instead. */
export type Outbound = GetPlaylistContentsResponse$Outbound;
}
export function getPlaylistContentsResponseToJSON(
getPlaylistContentsResponse: GetPlaylistContentsResponse,
): string {
return JSON.stringify(
GetPlaylistContentsResponse$outboundSchema.parse(
getPlaylistContentsResponse,
),
);
}
export function getPlaylistContentsResponseFromJSON(
jsonString: string,
): SafeParseResult<GetPlaylistContentsResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetPlaylistContentsResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetPlaylistContentsResponse' from JSON`,
);
}