mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-11 04:20:58 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1
This commit is contained in:
336
src/sdk/models/errors/getcountrieslibrary.ts
Normal file
336
src/sdk/models/errors/getcountrieslibrary.ts
Normal file
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
* 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 { SDKValidationError } from "./sdkvalidationerror.js";
|
||||
|
||||
export type GetCountriesLibraryLibraryErrors = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
export type GetCountriesLibraryUnauthorizedData = {
|
||||
errors?: Array<GetCountriesLibraryLibraryErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
export class GetCountriesLibraryUnauthorized extends Error {
|
||||
errors?: Array<GetCountriesLibraryLibraryErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
|
||||
/** The original data that was passed to this error instance. */
|
||||
data$: GetCountriesLibraryUnauthorizedData;
|
||||
|
||||
constructor(err: GetCountriesLibraryUnauthorizedData) {
|
||||
const message = "message" in err && typeof err.message === "string"
|
||||
? err.message
|
||||
: `API error occurred: ${JSON.stringify(err)}`;
|
||||
super(message);
|
||||
this.data$ = err;
|
||||
|
||||
if (err.errors != null) this.errors = err.errors;
|
||||
if (err.rawResponse != null) this.rawResponse = err.rawResponse;
|
||||
|
||||
this.name = "GetCountriesLibraryUnauthorized";
|
||||
}
|
||||
}
|
||||
|
||||
export type GetCountriesLibraryErrors = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
*/
|
||||
export type GetCountriesLibraryBadRequestData = {
|
||||
errors?: Array<GetCountriesLibraryErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
*/
|
||||
export class GetCountriesLibraryBadRequest extends Error {
|
||||
errors?: Array<GetCountriesLibraryErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
|
||||
/** The original data that was passed to this error instance. */
|
||||
data$: GetCountriesLibraryBadRequestData;
|
||||
|
||||
constructor(err: GetCountriesLibraryBadRequestData) {
|
||||
const message = "message" in err && typeof err.message === "string"
|
||||
? err.message
|
||||
: `API error occurred: ${JSON.stringify(err)}`;
|
||||
super(message);
|
||||
this.data$ = err;
|
||||
|
||||
if (err.errors != null) this.errors = err.errors;
|
||||
if (err.rawResponse != null) this.rawResponse = err.rawResponse;
|
||||
|
||||
this.name = "GetCountriesLibraryBadRequest";
|
||||
}
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryLibraryErrors$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryLibraryErrors,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
code: z.number().int().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().int().optional(),
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryLibraryErrors$Outbound = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryLibraryErrors$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryLibraryErrors$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryLibraryErrors
|
||||
> = z.object({
|
||||
code: z.number().int().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().int().optional(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetCountriesLibraryLibraryErrors$ {
|
||||
/** @deprecated use `GetCountriesLibraryLibraryErrors$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryLibraryErrors$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryLibraryErrors$outboundSchema` instead. */
|
||||
export const outboundSchema = GetCountriesLibraryLibraryErrors$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryLibraryErrors$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryLibraryErrors$Outbound;
|
||||
}
|
||||
|
||||
export function getCountriesLibraryLibraryErrorsToJSON(
|
||||
getCountriesLibraryLibraryErrors: GetCountriesLibraryLibraryErrors,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetCountriesLibraryLibraryErrors$outboundSchema.parse(
|
||||
getCountriesLibraryLibraryErrors,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getCountriesLibraryLibraryErrorsFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetCountriesLibraryLibraryErrors, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetCountriesLibraryLibraryErrors$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetCountriesLibraryLibraryErrors' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryUnauthorized$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryUnauthorized,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
errors: z.array(z.lazy(() => GetCountriesLibraryLibraryErrors$inboundSchema))
|
||||
.optional(),
|
||||
RawResponse: z.instanceof(Response).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
const remapped = remap$(v, {
|
||||
"RawResponse": "rawResponse",
|
||||
});
|
||||
|
||||
return new GetCountriesLibraryUnauthorized(remapped);
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryUnauthorized$Outbound = {
|
||||
errors?: Array<GetCountriesLibraryLibraryErrors$Outbound> | undefined;
|
||||
RawResponse?: never | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryUnauthorized$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryUnauthorized$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryUnauthorized
|
||||
> = z.instanceof(GetCountriesLibraryUnauthorized)
|
||||
.transform(v => v.data$)
|
||||
.pipe(
|
||||
z.object({
|
||||
errors: z.array(
|
||||
z.lazy(() => GetCountriesLibraryLibraryErrors$outboundSchema),
|
||||
).optional(),
|
||||
rawResponse: z.instanceof(Response).transform(() => {
|
||||
throw new Error("Response cannot be serialized");
|
||||
}).optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
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 GetCountriesLibraryUnauthorized$ {
|
||||
/** @deprecated use `GetCountriesLibraryUnauthorized$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryUnauthorized$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryUnauthorized$outboundSchema` instead. */
|
||||
export const outboundSchema = GetCountriesLibraryUnauthorized$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryUnauthorized$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryUnauthorized$Outbound;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryErrors$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryErrors,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
code: z.number().int().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().int().optional(),
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryErrors$Outbound = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryErrors$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryErrors$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryErrors
|
||||
> = z.object({
|
||||
code: z.number().int().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().int().optional(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetCountriesLibraryErrors$ {
|
||||
/** @deprecated use `GetCountriesLibraryErrors$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryErrors$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryErrors$outboundSchema` instead. */
|
||||
export const outboundSchema = GetCountriesLibraryErrors$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryErrors$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryErrors$Outbound;
|
||||
}
|
||||
|
||||
export function getCountriesLibraryErrorsToJSON(
|
||||
getCountriesLibraryErrors: GetCountriesLibraryErrors,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetCountriesLibraryErrors$outboundSchema.parse(getCountriesLibraryErrors),
|
||||
);
|
||||
}
|
||||
|
||||
export function getCountriesLibraryErrorsFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetCountriesLibraryErrors, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetCountriesLibraryErrors$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetCountriesLibraryErrors' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryBadRequest$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryBadRequest,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
errors: z.array(z.lazy(() => GetCountriesLibraryErrors$inboundSchema))
|
||||
.optional(),
|
||||
RawResponse: z.instanceof(Response).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
const remapped = remap$(v, {
|
||||
"RawResponse": "rawResponse",
|
||||
});
|
||||
|
||||
return new GetCountriesLibraryBadRequest(remapped);
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryBadRequest$Outbound = {
|
||||
errors?: Array<GetCountriesLibraryErrors$Outbound> | undefined;
|
||||
RawResponse?: never | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryBadRequest$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryBadRequest$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryBadRequest
|
||||
> = z.instanceof(GetCountriesLibraryBadRequest)
|
||||
.transform(v => v.data$)
|
||||
.pipe(
|
||||
z.object({
|
||||
errors: z.array(z.lazy(() => GetCountriesLibraryErrors$outboundSchema))
|
||||
.optional(),
|
||||
rawResponse: z.instanceof(Response).transform(() => {
|
||||
throw new Error("Response cannot be serialized");
|
||||
}).optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
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 GetCountriesLibraryBadRequest$ {
|
||||
/** @deprecated use `GetCountriesLibraryBadRequest$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryBadRequest$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryBadRequest$outboundSchema` instead. */
|
||||
export const outboundSchema = GetCountriesLibraryBadRequest$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryBadRequest$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryBadRequest$Outbound;
|
||||
}
|
||||
336
src/sdk/models/errors/getgenreslibrary.ts
Normal file
336
src/sdk/models/errors/getgenreslibrary.ts
Normal file
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
* 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 { SDKValidationError } from "./sdkvalidationerror.js";
|
||||
|
||||
export type GetGenresLibraryLibraryErrors = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
export type GetGenresLibraryUnauthorizedData = {
|
||||
errors?: Array<GetGenresLibraryLibraryErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
*/
|
||||
export class GetGenresLibraryUnauthorized extends Error {
|
||||
errors?: Array<GetGenresLibraryLibraryErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
|
||||
/** The original data that was passed to this error instance. */
|
||||
data$: GetGenresLibraryUnauthorizedData;
|
||||
|
||||
constructor(err: GetGenresLibraryUnauthorizedData) {
|
||||
const message = "message" in err && typeof err.message === "string"
|
||||
? err.message
|
||||
: `API error occurred: ${JSON.stringify(err)}`;
|
||||
super(message);
|
||||
this.data$ = err;
|
||||
|
||||
if (err.errors != null) this.errors = err.errors;
|
||||
if (err.rawResponse != null) this.rawResponse = err.rawResponse;
|
||||
|
||||
this.name = "GetGenresLibraryUnauthorized";
|
||||
}
|
||||
}
|
||||
|
||||
export type GetGenresLibraryErrors = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
*/
|
||||
export type GetGenresLibraryBadRequestData = {
|
||||
errors?: Array<GetGenresLibraryErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
*/
|
||||
export class GetGenresLibraryBadRequest extends Error {
|
||||
errors?: Array<GetGenresLibraryErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
|
||||
/** The original data that was passed to this error instance. */
|
||||
data$: GetGenresLibraryBadRequestData;
|
||||
|
||||
constructor(err: GetGenresLibraryBadRequestData) {
|
||||
const message = "message" in err && typeof err.message === "string"
|
||||
? err.message
|
||||
: `API error occurred: ${JSON.stringify(err)}`;
|
||||
super(message);
|
||||
this.data$ = err;
|
||||
|
||||
if (err.errors != null) this.errors = err.errors;
|
||||
if (err.rawResponse != null) this.rawResponse = err.rawResponse;
|
||||
|
||||
this.name = "GetGenresLibraryBadRequest";
|
||||
}
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryLibraryErrors$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryLibraryErrors,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
code: z.number().int().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().int().optional(),
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryLibraryErrors$Outbound = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryLibraryErrors$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryLibraryErrors$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryLibraryErrors
|
||||
> = z.object({
|
||||
code: z.number().int().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().int().optional(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetGenresLibraryLibraryErrors$ {
|
||||
/** @deprecated use `GetGenresLibraryLibraryErrors$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryLibraryErrors$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryLibraryErrors$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryLibraryErrors$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryLibraryErrors$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryLibraryErrors$Outbound;
|
||||
}
|
||||
|
||||
export function getGenresLibraryLibraryErrorsToJSON(
|
||||
getGenresLibraryLibraryErrors: GetGenresLibraryLibraryErrors,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetGenresLibraryLibraryErrors$outboundSchema.parse(
|
||||
getGenresLibraryLibraryErrors,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getGenresLibraryLibraryErrorsFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetGenresLibraryLibraryErrors, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetGenresLibraryLibraryErrors$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetGenresLibraryLibraryErrors' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryUnauthorized$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryUnauthorized,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
errors: z.array(z.lazy(() => GetGenresLibraryLibraryErrors$inboundSchema))
|
||||
.optional(),
|
||||
RawResponse: z.instanceof(Response).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
const remapped = remap$(v, {
|
||||
"RawResponse": "rawResponse",
|
||||
});
|
||||
|
||||
return new GetGenresLibraryUnauthorized(remapped);
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryUnauthorized$Outbound = {
|
||||
errors?: Array<GetGenresLibraryLibraryErrors$Outbound> | undefined;
|
||||
RawResponse?: never | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryUnauthorized$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryUnauthorized$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryUnauthorized
|
||||
> = z.instanceof(GetGenresLibraryUnauthorized)
|
||||
.transform(v => v.data$)
|
||||
.pipe(
|
||||
z.object({
|
||||
errors: z.array(
|
||||
z.lazy(() => GetGenresLibraryLibraryErrors$outboundSchema),
|
||||
).optional(),
|
||||
rawResponse: z.instanceof(Response).transform(() => {
|
||||
throw new Error("Response cannot be serialized");
|
||||
}).optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
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 GetGenresLibraryUnauthorized$ {
|
||||
/** @deprecated use `GetGenresLibraryUnauthorized$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryUnauthorized$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryUnauthorized$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryUnauthorized$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryUnauthorized$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryUnauthorized$Outbound;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryErrors$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryErrors,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
code: z.number().int().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().int().optional(),
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryErrors$Outbound = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryErrors$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryErrors$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryErrors
|
||||
> = z.object({
|
||||
code: z.number().int().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().int().optional(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetGenresLibraryErrors$ {
|
||||
/** @deprecated use `GetGenresLibraryErrors$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryErrors$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryErrors$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryErrors$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryErrors$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryErrors$Outbound;
|
||||
}
|
||||
|
||||
export function getGenresLibraryErrorsToJSON(
|
||||
getGenresLibraryErrors: GetGenresLibraryErrors,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetGenresLibraryErrors$outboundSchema.parse(getGenresLibraryErrors),
|
||||
);
|
||||
}
|
||||
|
||||
export function getGenresLibraryErrorsFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetGenresLibraryErrors, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetGenresLibraryErrors$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetGenresLibraryErrors' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryBadRequest$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryBadRequest,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
errors: z.array(z.lazy(() => GetGenresLibraryErrors$inboundSchema))
|
||||
.optional(),
|
||||
RawResponse: z.instanceof(Response).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
const remapped = remap$(v, {
|
||||
"RawResponse": "rawResponse",
|
||||
});
|
||||
|
||||
return new GetGenresLibraryBadRequest(remapped);
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryBadRequest$Outbound = {
|
||||
errors?: Array<GetGenresLibraryErrors$Outbound> | undefined;
|
||||
RawResponse?: never | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryBadRequest$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryBadRequest$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryBadRequest
|
||||
> = z.instanceof(GetGenresLibraryBadRequest)
|
||||
.transform(v => v.data$)
|
||||
.pipe(
|
||||
z.object({
|
||||
errors: z.array(z.lazy(() => GetGenresLibraryErrors$outboundSchema))
|
||||
.optional(),
|
||||
rawResponse: z.instanceof(Response).transform(() => {
|
||||
throw new Error("Response cannot be serialized");
|
||||
}).optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
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 GetGenresLibraryBadRequest$ {
|
||||
/** @deprecated use `GetGenresLibraryBadRequest$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryBadRequest$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryBadRequest$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryBadRequest$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryBadRequest$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryBadRequest$Outbound;
|
||||
}
|
||||
@@ -17,8 +17,10 @@ export * from "./getbandwidthstatistics.js";
|
||||
export * from "./getbannerimage.js";
|
||||
export * from "./getbutlertasks.js";
|
||||
export * from "./getcompanionsdata.js";
|
||||
export * from "./getcountrieslibrary.js";
|
||||
export * from "./getdevices.js";
|
||||
export * from "./getfilehash.js";
|
||||
export * from "./getgenreslibrary.js";
|
||||
export * from "./getgeodata.js";
|
||||
export * from "./getglobalhubs.js";
|
||||
export * from "./gethomedata.js";
|
||||
|
||||
441
src/sdk/models/operations/getcountrieslibrary.ts
Normal file
441
src/sdk/models/operations/getcountrieslibrary.ts
Normal file
@@ -0,0 +1,441 @@
|
||||
/*
|
||||
* 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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
||||
|
||||
export type GetCountriesLibraryRequest = {
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
*
|
||||
* @remarks
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*/
|
||||
sectionKey: number;
|
||||
};
|
||||
|
||||
export type GetCountriesLibraryDirectory = {
|
||||
fastKey: string;
|
||||
key: string;
|
||||
title: string;
|
||||
};
|
||||
|
||||
export type GetCountriesLibraryMediaContainer = {
|
||||
size: number;
|
||||
offset?: number | undefined;
|
||||
totalSize?: number | undefined;
|
||||
identifier: string;
|
||||
allowSync: boolean;
|
||||
art: string;
|
||||
content: string;
|
||||
mediaTagPrefix: string;
|
||||
mediaTagVersion: number;
|
||||
nocache: boolean;
|
||||
thumb: string;
|
||||
title1: string;
|
||||
title2: string;
|
||||
viewGroup: string;
|
||||
directory?: Array<GetCountriesLibraryDirectory> | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Successful response containing media container data.
|
||||
*/
|
||||
export type GetCountriesLibraryResponseBody = {
|
||||
mediaContainer?: GetCountriesLibraryMediaContainer | undefined;
|
||||
};
|
||||
|
||||
export type GetCountriesLibraryResponse = {
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Successful response containing media container data.
|
||||
*/
|
||||
object?: GetCountriesLibraryResponseBody | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryRequest$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryRequest,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
sectionKey: z.number().int(),
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryRequest$Outbound = {
|
||||
sectionKey: number;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryRequest$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryRequest$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryRequest
|
||||
> = z.object({
|
||||
sectionKey: z.number().int(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetCountriesLibraryRequest$ {
|
||||
/** @deprecated use `GetCountriesLibraryRequest$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryRequest$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryRequest$outboundSchema` instead. */
|
||||
export const outboundSchema = GetCountriesLibraryRequest$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryRequest$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryRequest$Outbound;
|
||||
}
|
||||
|
||||
export function getCountriesLibraryRequestToJSON(
|
||||
getCountriesLibraryRequest: GetCountriesLibraryRequest,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetCountriesLibraryRequest$outboundSchema.parse(getCountriesLibraryRequest),
|
||||
);
|
||||
}
|
||||
|
||||
export function getCountriesLibraryRequestFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetCountriesLibraryRequest, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetCountriesLibraryRequest$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetCountriesLibraryRequest' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryDirectory$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryDirectory,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
fastKey: z.string(),
|
||||
key: z.string(),
|
||||
title: z.string(),
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryDirectory$Outbound = {
|
||||
fastKey: string;
|
||||
key: string;
|
||||
title: string;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryDirectory$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryDirectory$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryDirectory
|
||||
> = z.object({
|
||||
fastKey: z.string(),
|
||||
key: z.string(),
|
||||
title: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetCountriesLibraryDirectory$ {
|
||||
/** @deprecated use `GetCountriesLibraryDirectory$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryDirectory$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryDirectory$outboundSchema` instead. */
|
||||
export const outboundSchema = GetCountriesLibraryDirectory$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryDirectory$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryDirectory$Outbound;
|
||||
}
|
||||
|
||||
export function getCountriesLibraryDirectoryToJSON(
|
||||
getCountriesLibraryDirectory: GetCountriesLibraryDirectory,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetCountriesLibraryDirectory$outboundSchema.parse(
|
||||
getCountriesLibraryDirectory,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getCountriesLibraryDirectoryFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetCountriesLibraryDirectory, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetCountriesLibraryDirectory$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetCountriesLibraryDirectory' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryMediaContainer$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryMediaContainer,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
size: z.number(),
|
||||
offset: z.number().int().optional(),
|
||||
totalSize: z.number().int().optional(),
|
||||
identifier: z.string(),
|
||||
allowSync: z.boolean(),
|
||||
art: z.string(),
|
||||
content: z.string(),
|
||||
mediaTagPrefix: z.string(),
|
||||
mediaTagVersion: z.number().int(),
|
||||
nocache: z.boolean(),
|
||||
thumb: z.string(),
|
||||
title1: z.string(),
|
||||
title2: z.string(),
|
||||
viewGroup: z.string(),
|
||||
Directory: z.array(z.lazy(() => GetCountriesLibraryDirectory$inboundSchema))
|
||||
.optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
"Directory": "directory",
|
||||
});
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryMediaContainer$Outbound = {
|
||||
size: number;
|
||||
offset?: number | undefined;
|
||||
totalSize?: number | undefined;
|
||||
identifier: string;
|
||||
allowSync: boolean;
|
||||
art: string;
|
||||
content: string;
|
||||
mediaTagPrefix: string;
|
||||
mediaTagVersion: number;
|
||||
nocache: boolean;
|
||||
thumb: string;
|
||||
title1: string;
|
||||
title2: string;
|
||||
viewGroup: string;
|
||||
Directory?: Array<GetCountriesLibraryDirectory$Outbound> | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryMediaContainer$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryMediaContainer$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryMediaContainer
|
||||
> = z.object({
|
||||
size: z.number(),
|
||||
offset: z.number().int().optional(),
|
||||
totalSize: z.number().int().optional(),
|
||||
identifier: z.string(),
|
||||
allowSync: z.boolean(),
|
||||
art: z.string(),
|
||||
content: z.string(),
|
||||
mediaTagPrefix: z.string(),
|
||||
mediaTagVersion: z.number().int(),
|
||||
nocache: z.boolean(),
|
||||
thumb: z.string(),
|
||||
title1: z.string(),
|
||||
title2: z.string(),
|
||||
viewGroup: z.string(),
|
||||
directory: z.array(z.lazy(() => GetCountriesLibraryDirectory$outboundSchema))
|
||||
.optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
directory: "Directory",
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetCountriesLibraryMediaContainer$ {
|
||||
/** @deprecated use `GetCountriesLibraryMediaContainer$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryMediaContainer$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryMediaContainer$outboundSchema` instead. */
|
||||
export const outboundSchema =
|
||||
GetCountriesLibraryMediaContainer$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryMediaContainer$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryMediaContainer$Outbound;
|
||||
}
|
||||
|
||||
export function getCountriesLibraryMediaContainerToJSON(
|
||||
getCountriesLibraryMediaContainer: GetCountriesLibraryMediaContainer,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetCountriesLibraryMediaContainer$outboundSchema.parse(
|
||||
getCountriesLibraryMediaContainer,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getCountriesLibraryMediaContainerFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetCountriesLibraryMediaContainer, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetCountriesLibraryMediaContainer$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetCountriesLibraryMediaContainer' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryResponseBody$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryResponseBody,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
MediaContainer: z.lazy(() => GetCountriesLibraryMediaContainer$inboundSchema)
|
||||
.optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
"MediaContainer": "mediaContainer",
|
||||
});
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryResponseBody$Outbound = {
|
||||
MediaContainer?: GetCountriesLibraryMediaContainer$Outbound | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryResponseBody$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryResponseBody$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryResponseBody
|
||||
> = z.object({
|
||||
mediaContainer: z.lazy(() => GetCountriesLibraryMediaContainer$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 GetCountriesLibraryResponseBody$ {
|
||||
/** @deprecated use `GetCountriesLibraryResponseBody$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryResponseBody$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryResponseBody$outboundSchema` instead. */
|
||||
export const outboundSchema = GetCountriesLibraryResponseBody$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryResponseBody$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryResponseBody$Outbound;
|
||||
}
|
||||
|
||||
export function getCountriesLibraryResponseBodyToJSON(
|
||||
getCountriesLibraryResponseBody: GetCountriesLibraryResponseBody,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetCountriesLibraryResponseBody$outboundSchema.parse(
|
||||
getCountriesLibraryResponseBody,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getCountriesLibraryResponseBodyFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetCountriesLibraryResponseBody, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetCountriesLibraryResponseBody$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetCountriesLibraryResponseBody' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryResponse$inboundSchema: z.ZodType<
|
||||
GetCountriesLibraryResponse,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
ContentType: z.string(),
|
||||
StatusCode: z.number().int(),
|
||||
RawResponse: z.instanceof(Response),
|
||||
object: z.lazy(() => GetCountriesLibraryResponseBody$inboundSchema)
|
||||
.optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
"ContentType": "contentType",
|
||||
"StatusCode": "statusCode",
|
||||
"RawResponse": "rawResponse",
|
||||
});
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetCountriesLibraryResponse$Outbound = {
|
||||
ContentType: string;
|
||||
StatusCode: number;
|
||||
RawResponse: never;
|
||||
object?: GetCountriesLibraryResponseBody$Outbound | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetCountriesLibraryResponse$outboundSchema: z.ZodType<
|
||||
GetCountriesLibraryResponse$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetCountriesLibraryResponse
|
||||
> = z.object({
|
||||
contentType: z.string(),
|
||||
statusCode: z.number().int(),
|
||||
rawResponse: z.instanceof(Response).transform(() => {
|
||||
throw new Error("Response cannot be serialized");
|
||||
}),
|
||||
object: z.lazy(() => GetCountriesLibraryResponseBody$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 GetCountriesLibraryResponse$ {
|
||||
/** @deprecated use `GetCountriesLibraryResponse$inboundSchema` instead. */
|
||||
export const inboundSchema = GetCountriesLibraryResponse$inboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryResponse$outboundSchema` instead. */
|
||||
export const outboundSchema = GetCountriesLibraryResponse$outboundSchema;
|
||||
/** @deprecated use `GetCountriesLibraryResponse$Outbound` instead. */
|
||||
export type Outbound = GetCountriesLibraryResponse$Outbound;
|
||||
}
|
||||
|
||||
export function getCountriesLibraryResponseToJSON(
|
||||
getCountriesLibraryResponse: GetCountriesLibraryResponse,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetCountriesLibraryResponse$outboundSchema.parse(
|
||||
getCountriesLibraryResponse,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getCountriesLibraryResponseFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetCountriesLibraryResponse, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetCountriesLibraryResponse$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetCountriesLibraryResponse' from JSON`,
|
||||
);
|
||||
}
|
||||
438
src/sdk/models/operations/getgenreslibrary.ts
Normal file
438
src/sdk/models/operations/getgenreslibrary.ts
Normal file
@@ -0,0 +1,438 @@
|
||||
/*
|
||||
* 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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
||||
|
||||
export type GetGenresLibraryRequest = {
|
||||
/**
|
||||
* The unique key of the Plex library.
|
||||
*
|
||||
* @remarks
|
||||
* Note: This is unique in the context of the Plex server.
|
||||
*/
|
||||
sectionKey: number;
|
||||
};
|
||||
|
||||
export type GetGenresLibraryDirectory = {
|
||||
fastKey: string;
|
||||
key: string;
|
||||
title: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type GetGenresLibraryMediaContainer = {
|
||||
size: number;
|
||||
offset?: number | undefined;
|
||||
totalSize?: number | undefined;
|
||||
identifier: string;
|
||||
allowSync: boolean;
|
||||
art: string;
|
||||
content: string;
|
||||
mediaTagPrefix: string;
|
||||
mediaTagVersion: number;
|
||||
nocache: boolean;
|
||||
thumb: string;
|
||||
title1: string;
|
||||
title2: string;
|
||||
viewGroup: string;
|
||||
directory?: Array<GetGenresLibraryDirectory> | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Successful response containing media container data.
|
||||
*/
|
||||
export type GetGenresLibraryResponseBody = {
|
||||
mediaContainer?: GetGenresLibraryMediaContainer | undefined;
|
||||
};
|
||||
|
||||
export type GetGenresLibraryResponse = {
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Successful response containing media container data.
|
||||
*/
|
||||
object?: GetGenresLibraryResponseBody | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryRequest$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryRequest,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
sectionKey: z.number().int(),
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryRequest$Outbound = {
|
||||
sectionKey: number;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryRequest$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryRequest$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryRequest
|
||||
> = z.object({
|
||||
sectionKey: z.number().int(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetGenresLibraryRequest$ {
|
||||
/** @deprecated use `GetGenresLibraryRequest$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryRequest$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryRequest$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryRequest$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryRequest$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryRequest$Outbound;
|
||||
}
|
||||
|
||||
export function getGenresLibraryRequestToJSON(
|
||||
getGenresLibraryRequest: GetGenresLibraryRequest,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetGenresLibraryRequest$outboundSchema.parse(getGenresLibraryRequest),
|
||||
);
|
||||
}
|
||||
|
||||
export function getGenresLibraryRequestFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetGenresLibraryRequest, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetGenresLibraryRequest$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetGenresLibraryRequest' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryDirectory$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryDirectory,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
fastKey: z.string(),
|
||||
key: z.string(),
|
||||
title: z.string(),
|
||||
type: z.string(),
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryDirectory$Outbound = {
|
||||
fastKey: string;
|
||||
key: string;
|
||||
title: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryDirectory$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryDirectory$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryDirectory
|
||||
> = z.object({
|
||||
fastKey: z.string(),
|
||||
key: z.string(),
|
||||
title: z.string(),
|
||||
type: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetGenresLibraryDirectory$ {
|
||||
/** @deprecated use `GetGenresLibraryDirectory$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryDirectory$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryDirectory$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryDirectory$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryDirectory$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryDirectory$Outbound;
|
||||
}
|
||||
|
||||
export function getGenresLibraryDirectoryToJSON(
|
||||
getGenresLibraryDirectory: GetGenresLibraryDirectory,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetGenresLibraryDirectory$outboundSchema.parse(getGenresLibraryDirectory),
|
||||
);
|
||||
}
|
||||
|
||||
export function getGenresLibraryDirectoryFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetGenresLibraryDirectory, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetGenresLibraryDirectory$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetGenresLibraryDirectory' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryMediaContainer$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryMediaContainer,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
size: z.number(),
|
||||
offset: z.number().int().optional(),
|
||||
totalSize: z.number().int().optional(),
|
||||
identifier: z.string(),
|
||||
allowSync: z.boolean(),
|
||||
art: z.string(),
|
||||
content: z.string(),
|
||||
mediaTagPrefix: z.string(),
|
||||
mediaTagVersion: z.number().int(),
|
||||
nocache: z.boolean(),
|
||||
thumb: z.string(),
|
||||
title1: z.string(),
|
||||
title2: z.string(),
|
||||
viewGroup: z.string(),
|
||||
Directory: z.array(z.lazy(() => GetGenresLibraryDirectory$inboundSchema))
|
||||
.optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
"Directory": "directory",
|
||||
});
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryMediaContainer$Outbound = {
|
||||
size: number;
|
||||
offset?: number | undefined;
|
||||
totalSize?: number | undefined;
|
||||
identifier: string;
|
||||
allowSync: boolean;
|
||||
art: string;
|
||||
content: string;
|
||||
mediaTagPrefix: string;
|
||||
mediaTagVersion: number;
|
||||
nocache: boolean;
|
||||
thumb: string;
|
||||
title1: string;
|
||||
title2: string;
|
||||
viewGroup: string;
|
||||
Directory?: Array<GetGenresLibraryDirectory$Outbound> | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryMediaContainer$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryMediaContainer$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryMediaContainer
|
||||
> = z.object({
|
||||
size: z.number(),
|
||||
offset: z.number().int().optional(),
|
||||
totalSize: z.number().int().optional(),
|
||||
identifier: z.string(),
|
||||
allowSync: z.boolean(),
|
||||
art: z.string(),
|
||||
content: z.string(),
|
||||
mediaTagPrefix: z.string(),
|
||||
mediaTagVersion: z.number().int(),
|
||||
nocache: z.boolean(),
|
||||
thumb: z.string(),
|
||||
title1: z.string(),
|
||||
title2: z.string(),
|
||||
viewGroup: z.string(),
|
||||
directory: z.array(z.lazy(() => GetGenresLibraryDirectory$outboundSchema))
|
||||
.optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
directory: "Directory",
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
||||
*/
|
||||
export namespace GetGenresLibraryMediaContainer$ {
|
||||
/** @deprecated use `GetGenresLibraryMediaContainer$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryMediaContainer$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryMediaContainer$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryMediaContainer$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryMediaContainer$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryMediaContainer$Outbound;
|
||||
}
|
||||
|
||||
export function getGenresLibraryMediaContainerToJSON(
|
||||
getGenresLibraryMediaContainer: GetGenresLibraryMediaContainer,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetGenresLibraryMediaContainer$outboundSchema.parse(
|
||||
getGenresLibraryMediaContainer,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getGenresLibraryMediaContainerFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetGenresLibraryMediaContainer, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetGenresLibraryMediaContainer$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetGenresLibraryMediaContainer' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryResponseBody$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryResponseBody,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
MediaContainer: z.lazy(() => GetGenresLibraryMediaContainer$inboundSchema)
|
||||
.optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
"MediaContainer": "mediaContainer",
|
||||
});
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryResponseBody$Outbound = {
|
||||
MediaContainer?: GetGenresLibraryMediaContainer$Outbound | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryResponseBody$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryResponseBody$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryResponseBody
|
||||
> = z.object({
|
||||
mediaContainer: z.lazy(() => GetGenresLibraryMediaContainer$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 GetGenresLibraryResponseBody$ {
|
||||
/** @deprecated use `GetGenresLibraryResponseBody$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryResponseBody$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryResponseBody$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryResponseBody$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryResponseBody$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryResponseBody$Outbound;
|
||||
}
|
||||
|
||||
export function getGenresLibraryResponseBodyToJSON(
|
||||
getGenresLibraryResponseBody: GetGenresLibraryResponseBody,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetGenresLibraryResponseBody$outboundSchema.parse(
|
||||
getGenresLibraryResponseBody,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getGenresLibraryResponseBodyFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetGenresLibraryResponseBody, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetGenresLibraryResponseBody$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetGenresLibraryResponseBody' from JSON`,
|
||||
);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryResponse$inboundSchema: z.ZodType<
|
||||
GetGenresLibraryResponse,
|
||||
z.ZodTypeDef,
|
||||
unknown
|
||||
> = z.object({
|
||||
ContentType: z.string(),
|
||||
StatusCode: z.number().int(),
|
||||
RawResponse: z.instanceof(Response),
|
||||
object: z.lazy(() => GetGenresLibraryResponseBody$inboundSchema).optional(),
|
||||
}).transform((v) => {
|
||||
return remap$(v, {
|
||||
"ContentType": "contentType",
|
||||
"StatusCode": "statusCode",
|
||||
"RawResponse": "rawResponse",
|
||||
});
|
||||
});
|
||||
|
||||
/** @internal */
|
||||
export type GetGenresLibraryResponse$Outbound = {
|
||||
ContentType: string;
|
||||
StatusCode: number;
|
||||
RawResponse: never;
|
||||
object?: GetGenresLibraryResponseBody$Outbound | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const GetGenresLibraryResponse$outboundSchema: z.ZodType<
|
||||
GetGenresLibraryResponse$Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetGenresLibraryResponse
|
||||
> = z.object({
|
||||
contentType: z.string(),
|
||||
statusCode: z.number().int(),
|
||||
rawResponse: z.instanceof(Response).transform(() => {
|
||||
throw new Error("Response cannot be serialized");
|
||||
}),
|
||||
object: z.lazy(() => GetGenresLibraryResponseBody$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 GetGenresLibraryResponse$ {
|
||||
/** @deprecated use `GetGenresLibraryResponse$inboundSchema` instead. */
|
||||
export const inboundSchema = GetGenresLibraryResponse$inboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryResponse$outboundSchema` instead. */
|
||||
export const outboundSchema = GetGenresLibraryResponse$outboundSchema;
|
||||
/** @deprecated use `GetGenresLibraryResponse$Outbound` instead. */
|
||||
export type Outbound = GetGenresLibraryResponse$Outbound;
|
||||
}
|
||||
|
||||
export function getGenresLibraryResponseToJSON(
|
||||
getGenresLibraryResponse: GetGenresLibraryResponse,
|
||||
): string {
|
||||
return JSON.stringify(
|
||||
GetGenresLibraryResponse$outboundSchema.parse(getGenresLibraryResponse),
|
||||
);
|
||||
}
|
||||
|
||||
export function getGenresLibraryResponseFromJSON(
|
||||
jsonString: string,
|
||||
): SafeParseResult<GetGenresLibraryResponse, SDKValidationError> {
|
||||
return safeParse(
|
||||
jsonString,
|
||||
(x) => GetGenresLibraryResponse$inboundSchema.parse(JSON.parse(x)),
|
||||
`Failed to parse 'GetGenresLibraryResponse' from JSON`,
|
||||
);
|
||||
}
|
||||
@@ -17,8 +17,10 @@ export * from "./getbandwidthstatistics.js";
|
||||
export * from "./getbannerimage.js";
|
||||
export * from "./getbutlertasks.js";
|
||||
export * from "./getcompanionsdata.js";
|
||||
export * from "./getcountrieslibrary.js";
|
||||
export * from "./getdevices.js";
|
||||
export * from "./getfilehash.js";
|
||||
export * from "./getgenreslibrary.js";
|
||||
export * from "./getgeodata.js";
|
||||
export * from "./getglobalhubs.js";
|
||||
export * from "./gethomedata.js";
|
||||
|
||||
Reference in New Issue
Block a user