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.405.6
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
*/
|
||||
|
||||
import { PlexAPICore } from "../core.js";
|
||||
import { encodeSimple as encodeSimple$ } from "../lib/encodings.js";
|
||||
import * as m$ from "../lib/matchers.js";
|
||||
import * as schemas$ from "../lib/schemas.js";
|
||||
import { encodeSimple } from "../lib/encodings.js";
|
||||
import * as M from "../lib/matchers.js";
|
||||
import { safeParse } from "../lib/schemas.js";
|
||||
import { RequestOptions } from "../lib/sdks.js";
|
||||
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
||||
import { pathToFunc } from "../lib/url.js";
|
||||
@@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js";
|
||||
* Delete a library using a specific section id
|
||||
*/
|
||||
export async function libraryDeleteLibrary(
|
||||
client$: PlexAPICore,
|
||||
client: PlexAPICore,
|
||||
sectionKey: number,
|
||||
options?: RequestOptions,
|
||||
): Promise<
|
||||
@@ -46,61 +46,61 @@ export async function libraryDeleteLibrary(
|
||||
| ConnectionError
|
||||
>
|
||||
> {
|
||||
const input$: operations.DeleteLibraryRequest = {
|
||||
const input: operations.DeleteLibraryRequest = {
|
||||
sectionKey: sectionKey,
|
||||
};
|
||||
|
||||
const parsed$ = schemas$.safeParse(
|
||||
input$,
|
||||
(value$) => operations.DeleteLibraryRequest$outboundSchema.parse(value$),
|
||||
const parsed = safeParse(
|
||||
input,
|
||||
(value) => operations.DeleteLibraryRequest$outboundSchema.parse(value),
|
||||
"Input validation failed",
|
||||
);
|
||||
if (!parsed$.ok) {
|
||||
return parsed$;
|
||||
if (!parsed.ok) {
|
||||
return parsed;
|
||||
}
|
||||
const payload$ = parsed$.value;
|
||||
const body$ = null;
|
||||
const payload = parsed.value;
|
||||
const body = null;
|
||||
|
||||
const pathParams$ = {
|
||||
sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, {
|
||||
const pathParams = {
|
||||
sectionKey: encodeSimple("sectionKey", payload.sectionKey, {
|
||||
explode: false,
|
||||
charEncoding: "percent",
|
||||
}),
|
||||
};
|
||||
|
||||
const path$ = pathToFunc("/library/sections/{sectionKey}")(pathParams$);
|
||||
const path = pathToFunc("/library/sections/{sectionKey}")(pathParams);
|
||||
|
||||
const headers$ = new Headers({
|
||||
const headers = new Headers({
|
||||
Accept: "application/json",
|
||||
});
|
||||
|
||||
const accessToken$ = await extractSecurity(client$.options$.accessToken);
|
||||
const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ };
|
||||
const secConfig = await extractSecurity(client._options.accessToken);
|
||||
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
|
||||
const context = {
|
||||
operationID: "deleteLibrary",
|
||||
oAuth2Scopes: [],
|
||||
securitySource: client$.options$.accessToken,
|
||||
securitySource: client._options.accessToken,
|
||||
};
|
||||
const securitySettings$ = resolveGlobalSecurity(security$);
|
||||
const requestSecurity = resolveGlobalSecurity(securityInput);
|
||||
|
||||
const requestRes = client$.createRequest$(context, {
|
||||
security: securitySettings$,
|
||||
const requestRes = client._createRequest(context, {
|
||||
security: requestSecurity,
|
||||
method: "DELETE",
|
||||
path: path$,
|
||||
headers: headers$,
|
||||
body: body$,
|
||||
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
|
||||
path: path,
|
||||
headers: headers,
|
||||
body: body,
|
||||
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
||||
}, options);
|
||||
if (!requestRes.ok) {
|
||||
return requestRes;
|
||||
}
|
||||
const request$ = requestRes.value;
|
||||
const req = requestRes.value;
|
||||
|
||||
const doResult = await client$.do$(request$, {
|
||||
const doResult = await client._do(req, {
|
||||
context,
|
||||
errorCodes: ["400", "401", "4XX", "5XX"],
|
||||
retryConfig: options?.retries
|
||||
|| client$.options$.retryConfig,
|
||||
|| client._options.retryConfig,
|
||||
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
||||
});
|
||||
if (!doResult.ok) {
|
||||
@@ -108,7 +108,7 @@ export async function libraryDeleteLibrary(
|
||||
}
|
||||
const response = doResult.value;
|
||||
|
||||
const responseFields$ = {
|
||||
const responseFields = {
|
||||
ContentType: response.headers.get("content-type")
|
||||
?? "application/octet-stream",
|
||||
StatusCode: response.status,
|
||||
@@ -116,7 +116,7 @@ export async function libraryDeleteLibrary(
|
||||
Headers: {},
|
||||
};
|
||||
|
||||
const [result$] = await m$.match<
|
||||
const [result] = await M.match<
|
||||
operations.DeleteLibraryResponse,
|
||||
| errors.DeleteLibraryBadRequest
|
||||
| errors.DeleteLibraryUnauthorized
|
||||
@@ -128,14 +128,14 @@ export async function libraryDeleteLibrary(
|
||||
| RequestTimeoutError
|
||||
| ConnectionError
|
||||
>(
|
||||
m$.nil(200, operations.DeleteLibraryResponse$inboundSchema),
|
||||
m$.jsonErr(400, errors.DeleteLibraryBadRequest$inboundSchema),
|
||||
m$.jsonErr(401, errors.DeleteLibraryUnauthorized$inboundSchema),
|
||||
m$.fail(["4XX", "5XX"]),
|
||||
)(response, { extraFields: responseFields$ });
|
||||
if (!result$.ok) {
|
||||
return result$;
|
||||
M.nil(200, operations.DeleteLibraryResponse$inboundSchema),
|
||||
M.jsonErr(400, errors.DeleteLibraryBadRequest$inboundSchema),
|
||||
M.jsonErr(401, errors.DeleteLibraryUnauthorized$inboundSchema),
|
||||
M.fail(["4XX", "5XX"]),
|
||||
)(response, { extraFields: responseFields });
|
||||
if (!result.ok) {
|
||||
return result;
|
||||
}
|
||||
|
||||
return result$;
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user