ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.394.0

This commit is contained in:
speakeasybot
2024-09-10 00:11:07 +00:00
parent 8dc802ca50
commit 39d3a40524
910 changed files with 51963 additions and 53271 deletions

View File

@@ -10,11 +10,11 @@ import { RequestOptions } from "../lib/sdks.js";
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
} from "../sdk/models/errors/httpclienterrors.js";
import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
@@ -27,119 +27,119 @@ 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(
client$: PlexAPICore,
type: operations.GetTopWatchedContentQueryParamType,
includeGuids?: number | undefined,
options?: RequestOptions
client$: PlexAPICore,
type: operations.GetTopWatchedContentQueryParamType,
includeGuids?: number | undefined,
options?: RequestOptions,
): Promise<
Result<
operations.GetTopWatchedContentResponse,
| errors.GetTopWatchedContentResponseBody
| errors.GetTopWatchedContentLibraryResponseBody
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>
Result<
operations.GetTopWatchedContentResponse,
| errors.GetTopWatchedContentBadRequest
| errors.GetTopWatchedContentUnauthorized
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>
> {
const input$: operations.GetTopWatchedContentRequest = {
type: type,
includeGuids: includeGuids,
};
const input$: operations.GetTopWatchedContentRequest = {
type: type,
includeGuids: includeGuids,
};
const parsed$ = schemas$.safeParse(
input$,
(value$) => operations.GetTopWatchedContentRequest$outboundSchema.parse(value$),
"Input validation failed"
);
if (!parsed$.ok) {
return parsed$;
}
const payload$ = parsed$.value;
const body$ = null;
const parsed$ = schemas$.safeParse(
input$,
(value$) =>
operations.GetTopWatchedContentRequest$outboundSchema.parse(value$),
"Input validation failed",
);
if (!parsed$.ok) {
return parsed$;
}
const payload$ = parsed$.value;
const body$ = null;
const path$ = pathToFunc("/library/all/top")();
const path$ = pathToFunc("/library/all/top")();
const query$ = encodeFormQuery$({
includeGuids: payload$.includeGuids,
type: payload$.type,
});
const query$ = encodeFormQuery$({
"includeGuids": payload$.includeGuids,
"type": payload$.type,
});
const headers$ = new Headers({
Accept: "application/json",
});
const headers$ = new Headers({
Accept: "application/json",
});
const accessToken$ = await extractSecurity(client$.options$.accessToken);
const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ };
const context = {
operationID: "getTopWatchedContent",
oAuth2Scopes: [],
securitySource: client$.options$.accessToken,
};
const securitySettings$ = resolveGlobalSecurity(security$);
const accessToken$ = await extractSecurity(client$.options$.accessToken);
const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ };
const context = {
operationID: "getTopWatchedContent",
oAuth2Scopes: [],
securitySource: client$.options$.accessToken,
};
const securitySettings$ = resolveGlobalSecurity(security$);
const requestRes = client$.createRequest$(
context,
{
security: securitySettings$,
method: "GET",
path: path$,
headers: headers$,
query: query$,
body: body$,
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
},
options
);
if (!requestRes.ok) {
return requestRes;
}
const request$ = requestRes.value;
const requestRes = client$.createRequest$(context, {
security: securitySettings$,
method: "GET",
path: path$,
headers: headers$,
query: query$,
body: body$,
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
return requestRes;
}
const request$ = requestRes.value;
const doResult = await client$.do$(request$, {
context,
errorCodes: ["400", "401", "4XX", "5XX"],
retryConfig: options?.retries || client$.options$.retryConfig,
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
});
if (!doResult.ok) {
return doResult;
}
const response = doResult.value;
const doResult = await client$.do$(request$, {
context,
errorCodes: ["400", "401", "4XX", "5XX"],
retryConfig: options?.retries
|| client$.options$.retryConfig,
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
});
if (!doResult.ok) {
return doResult;
}
const response = doResult.value;
const responseFields$ = {
ContentType: response.headers.get("content-type") ?? "application/octet-stream",
StatusCode: response.status,
RawResponse: response,
Headers: {},
};
const [result$] = await m$.match<
operations.GetTopWatchedContentResponse,
| errors.GetTopWatchedContentResponseBody
| errors.GetTopWatchedContentLibraryResponseBody
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>(
m$.json(200, operations.GetTopWatchedContentResponse$inboundSchema, { key: "object" }),
m$.jsonErr(400, errors.GetTopWatchedContentResponseBody$inboundSchema),
m$.jsonErr(401, errors.GetTopWatchedContentLibraryResponseBody$inboundSchema),
m$.fail(["4XX", "5XX"])
)(response, { extraFields: responseFields$ });
if (!result$.ok) {
return result$;
}
const responseFields$ = {
ContentType: response.headers.get("content-type")
?? "application/octet-stream",
StatusCode: response.status,
RawResponse: response,
Headers: {},
};
const [result$] = await m$.match<
operations.GetTopWatchedContentResponse,
| errors.GetTopWatchedContentBadRequest
| errors.GetTopWatchedContentUnauthorized
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>(
m$.json(200, operations.GetTopWatchedContentResponse$inboundSchema, {
key: "object",
}),
m$.jsonErr(400, errors.GetTopWatchedContentBadRequest$inboundSchema),
m$.jsonErr(401, errors.GetTopWatchedContentUnauthorized$inboundSchema),
m$.fail(["4XX", "5XX"]),
)(response, { extraFields: responseFields$ });
if (!result$.ok) {
return result$;
}
return result$;
}