mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-09 20:47:47 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.513.2
This commit is contained in:
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
|
||||
import { SDKError } from "../sdk/models/errors/sdkerror.js";
|
||||
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
||||
import * as operations from "../sdk/models/operations/index.js";
|
||||
import { APICall, APIPromise } from "../sdk/types/async.js";
|
||||
import { Result } from "../sdk/types/fp.js";
|
||||
|
||||
/**
|
||||
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
|
||||
* @remarks
|
||||
* This endpoint will return the top watched content from libraries of a certain type
|
||||
*/
|
||||
export async function libraryGetTopWatchedContent(
|
||||
export function libraryGetTopWatchedContent(
|
||||
client: PlexAPICore,
|
||||
type: operations.GetTopWatchedContentQueryParamType,
|
||||
includeGuids?: number | undefined,
|
||||
options?: RequestOptions,
|
||||
): Promise<
|
||||
): APIPromise<
|
||||
Result<
|
||||
operations.GetTopWatchedContentResponse,
|
||||
| errors.GetTopWatchedContentBadRequest
|
||||
@@ -47,6 +48,36 @@ export async function libraryGetTopWatchedContent(
|
||||
| RequestTimeoutError
|
||||
| ConnectionError
|
||||
>
|
||||
> {
|
||||
return new APIPromise($do(
|
||||
client,
|
||||
type,
|
||||
includeGuids,
|
||||
options,
|
||||
));
|
||||
}
|
||||
|
||||
async function $do(
|
||||
client: PlexAPICore,
|
||||
type: operations.GetTopWatchedContentQueryParamType,
|
||||
includeGuids?: number | undefined,
|
||||
options?: RequestOptions,
|
||||
): Promise<
|
||||
[
|
||||
Result<
|
||||
operations.GetTopWatchedContentResponse,
|
||||
| errors.GetTopWatchedContentBadRequest
|
||||
| errors.GetTopWatchedContentUnauthorized
|
||||
| SDKError
|
||||
| SDKValidationError
|
||||
| UnexpectedClientError
|
||||
| InvalidRequestError
|
||||
| RequestAbortedError
|
||||
| RequestTimeoutError
|
||||
| ConnectionError
|
||||
>,
|
||||
APICall,
|
||||
]
|
||||
> {
|
||||
const input: operations.GetTopWatchedContentRequest = {
|
||||
type: type,
|
||||
@@ -60,7 +91,7 @@ export async function libraryGetTopWatchedContent(
|
||||
"Input validation failed",
|
||||
);
|
||||
if (!parsed.ok) {
|
||||
return parsed;
|
||||
return [parsed, { status: "invalid" }];
|
||||
}
|
||||
const payload = parsed.value;
|
||||
const body = null;
|
||||
@@ -81,6 +112,7 @@ export async function libraryGetTopWatchedContent(
|
||||
const requestSecurity = resolveGlobalSecurity(securityInput);
|
||||
|
||||
const context = {
|
||||
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
||||
operationID: "getTopWatchedContent",
|
||||
oAuth2Scopes: [],
|
||||
|
||||
@@ -104,7 +136,7 @@ export async function libraryGetTopWatchedContent(
|
||||
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
||||
}, options);
|
||||
if (!requestRes.ok) {
|
||||
return requestRes;
|
||||
return [requestRes, { status: "invalid" }];
|
||||
}
|
||||
const req = requestRes.value;
|
||||
|
||||
@@ -115,7 +147,7 @@ export async function libraryGetTopWatchedContent(
|
||||
retryCodes: context.retryCodes,
|
||||
});
|
||||
if (!doResult.ok) {
|
||||
return doResult;
|
||||
return [doResult, { status: "request-error", request: req }];
|
||||
}
|
||||
const response = doResult.value;
|
||||
|
||||
@@ -148,8 +180,8 @@ export async function libraryGetTopWatchedContent(
|
||||
M.fail("5XX"),
|
||||
)(response, { extraFields: responseFields });
|
||||
if (!result.ok) {
|
||||
return result;
|
||||
return [result, { status: "complete", request: req, response }];
|
||||
}
|
||||
|
||||
return result;
|
||||
return [result, { status: "complete", request: req, response }];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user