mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-09 20:47:47 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.129.1
This commit is contained in:
151
src/models/errors/getavailableclients.ts
Normal file
151
src/models/errors/getavailableclients.ts
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
export type GetAvailableClientsErrors = {
|
||||
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 GetAvailableClientsResponseBodyData = {
|
||||
errors?: Array<GetAvailableClientsErrors> | 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 GetAvailableClientsResponseBody extends Error {
|
||||
errors?: Array<GetAvailableClientsErrors> | undefined;
|
||||
/**
|
||||
* Raw HTTP response; suitable for custom response parsing
|
||||
*/
|
||||
rawResponse?: Response | undefined;
|
||||
|
||||
/** The original data that was passed to this error instance. */
|
||||
data$: GetAvailableClientsResponseBodyData;
|
||||
|
||||
constructor(err: GetAvailableClientsResponseBodyData, options?: ErrorOptions) {
|
||||
super("", options);
|
||||
this.data$ = err;
|
||||
|
||||
if (err.errors != null) {
|
||||
this.errors = err.errors;
|
||||
}
|
||||
if (err.rawResponse != null) {
|
||||
this.rawResponse = err.rawResponse;
|
||||
}
|
||||
|
||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
||||
const { rawResponse, ...data } = err;
|
||||
const content = JSON.stringify(data);
|
||||
this.message = [msg, content].filter(Boolean).join("\n");
|
||||
|
||||
this.name = "GetAvailableClientsResponseBody";
|
||||
}
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export namespace GetAvailableClientsErrors$ {
|
||||
export type Inbound = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
export const inboundSchema: z.ZodType<GetAvailableClientsErrors, z.ZodTypeDef, Inbound> = z
|
||||
.object({
|
||||
code: z.number().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
...(v.code === undefined ? null : { code: v.code }),
|
||||
...(v.message === undefined ? null : { message: v.message }),
|
||||
...(v.status === undefined ? null : { status: v.status }),
|
||||
};
|
||||
});
|
||||
|
||||
export type Outbound = {
|
||||
code?: number | undefined;
|
||||
message?: string | undefined;
|
||||
status?: number | undefined;
|
||||
};
|
||||
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetAvailableClientsErrors> = z
|
||||
.object({
|
||||
code: z.number().optional(),
|
||||
message: z.string().optional(),
|
||||
status: z.number().optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
...(v.code === undefined ? null : { code: v.code }),
|
||||
...(v.message === undefined ? null : { message: v.message }),
|
||||
...(v.status === undefined ? null : { status: v.status }),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export namespace GetAvailableClientsResponseBody$ {
|
||||
export type Inbound = {
|
||||
errors?: Array<GetAvailableClientsErrors$.Inbound> | undefined;
|
||||
RawResponse?: Response | undefined;
|
||||
};
|
||||
|
||||
export const inboundSchema: z.ZodType<GetAvailableClientsResponseBody, z.ZodTypeDef, Inbound> =
|
||||
z
|
||||
.object({
|
||||
errors: z.array(z.lazy(() => GetAvailableClientsErrors$.inboundSchema)).optional(),
|
||||
RawResponse: z.instanceof(Response).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return new GetAvailableClientsResponseBody({
|
||||
...(v.errors === undefined ? null : { errors: v.errors }),
|
||||
...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
|
||||
});
|
||||
});
|
||||
export type Outbound = {
|
||||
errors?: Array<GetAvailableClientsErrors$.Outbound> | undefined;
|
||||
RawResponse?: never | undefined;
|
||||
};
|
||||
|
||||
export const outboundSchema: z.ZodType<
|
||||
Outbound,
|
||||
z.ZodTypeDef,
|
||||
GetAvailableClientsResponseBody
|
||||
> = z
|
||||
.instanceof(GetAvailableClientsResponseBody)
|
||||
.transform((v) => v.data$)
|
||||
.pipe(
|
||||
z
|
||||
.object({
|
||||
errors: z
|
||||
.array(z.lazy(() => GetAvailableClientsErrors$.outboundSchema))
|
||||
.optional(),
|
||||
rawResponse: z
|
||||
.instanceof(Response)
|
||||
.transform(() => {
|
||||
throw new Error("Response cannot be serialized");
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
...(v.errors === undefined ? null : { errors: v.errors }),
|
||||
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user