mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 12:37:46 +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,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
|
||||
* @remarks
|
||||
* Delete a library using a specific section id
|
||||
*/
|
||||
export async function libraryDeleteLibrary(
|
||||
export function libraryDeleteLibrary(
|
||||
client: PlexAPICore,
|
||||
sectionKey: number,
|
||||
options?: RequestOptions,
|
||||
): Promise<
|
||||
): APIPromise<
|
||||
Result<
|
||||
operations.DeleteLibraryResponse,
|
||||
| errors.DeleteLibraryBadRequest
|
||||
@@ -46,6 +47,34 @@ export async function libraryDeleteLibrary(
|
||||
| RequestTimeoutError
|
||||
| ConnectionError
|
||||
>
|
||||
> {
|
||||
return new APIPromise($do(
|
||||
client,
|
||||
sectionKey,
|
||||
options,
|
||||
));
|
||||
}
|
||||
|
||||
async function $do(
|
||||
client: PlexAPICore,
|
||||
sectionKey: number,
|
||||
options?: RequestOptions,
|
||||
): Promise<
|
||||
[
|
||||
Result<
|
||||
operations.DeleteLibraryResponse,
|
||||
| errors.DeleteLibraryBadRequest
|
||||
| errors.DeleteLibraryUnauthorized
|
||||
| SDKError
|
||||
| SDKValidationError
|
||||
| UnexpectedClientError
|
||||
| InvalidRequestError
|
||||
| RequestAbortedError
|
||||
| RequestTimeoutError
|
||||
| ConnectionError
|
||||
>,
|
||||
APICall,
|
||||
]
|
||||
> {
|
||||
const input: operations.DeleteLibraryRequest = {
|
||||
sectionKey: sectionKey,
|
||||
@@ -57,7 +86,7 @@ export async function libraryDeleteLibrary(
|
||||
"Input validation failed",
|
||||
);
|
||||
if (!parsed.ok) {
|
||||
return parsed;
|
||||
return [parsed, { status: "invalid" }];
|
||||
}
|
||||
const payload = parsed.value;
|
||||
const body = null;
|
||||
@@ -80,6 +109,7 @@ export async function libraryDeleteLibrary(
|
||||
const requestSecurity = resolveGlobalSecurity(securityInput);
|
||||
|
||||
const context = {
|
||||
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
||||
operationID: "deleteLibrary",
|
||||
oAuth2Scopes: [],
|
||||
|
||||
@@ -102,7 +132,7 @@ export async function libraryDeleteLibrary(
|
||||
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
||||
}, options);
|
||||
if (!requestRes.ok) {
|
||||
return requestRes;
|
||||
return [requestRes, { status: "invalid" }];
|
||||
}
|
||||
const req = requestRes.value;
|
||||
|
||||
@@ -113,7 +143,7 @@ export async function libraryDeleteLibrary(
|
||||
retryCodes: context.retryCodes,
|
||||
});
|
||||
if (!doResult.ok) {
|
||||
return doResult;
|
||||
return [doResult, { status: "request-error", request: req }];
|
||||
}
|
||||
const response = doResult.value;
|
||||
|
||||
@@ -144,8 +174,8 @@ export async function libraryDeleteLibrary(
|
||||
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