mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-10 04:20:58 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.148.0
This commit is contained in:
@@ -8,6 +8,7 @@ import { HTTPClient } from "../lib/http";
|
||||
import { ClientSDK, RequestOptions } from "../lib/sdks";
|
||||
import * as errors from "../models/errors";
|
||||
import * as operations from "../models/operations";
|
||||
import { z } from "zod";
|
||||
|
||||
export class Log extends ClientSDK {
|
||||
private readonly options$: SDKOptions;
|
||||
@@ -108,14 +109,41 @@ export class Log extends ClientSDK {
|
||||
* Logging a multi-line message
|
||||
*
|
||||
* @remarks
|
||||
* This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above GET endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above.
|
||||
* This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
|
||||
* It accepts a text/plain request body, where each line represents a distinct log entry.
|
||||
* Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
|
||||
*
|
||||
* Log entries are separated by a newline character (`\n`).
|
||||
* Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
|
||||
* This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
|
||||
*
|
||||
* The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
|
||||
* - `0`: Error - Critical issues that require immediate attention.
|
||||
* - `1`: Warning - Important events that are not critical but may indicate potential issues.
|
||||
* - `2`: Info - General informational messages about system operation.
|
||||
* - `3`: Debug - Detailed information useful for debugging purposes.
|
||||
* - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
|
||||
*
|
||||
* The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
|
||||
*
|
||||
* Example of a single log entry format:
|
||||
* `level=4&message=Sample%20log%20entry&source=applicationName`
|
||||
*
|
||||
* Ensure each parameter is properly URL-encoded to avoid interpretation issues.
|
||||
*
|
||||
*/
|
||||
async logMultiLine(options?: RequestOptions): Promise<operations.LogMultiLineResponse> {
|
||||
async logMultiLine(
|
||||
input: string,
|
||||
options?: RequestOptions
|
||||
): Promise<operations.LogMultiLineResponse> {
|
||||
const headers$ = new Headers();
|
||||
headers$.set("user-agent", SDK_METADATA.userAgent);
|
||||
headers$.set("Content-Type", "text/plain");
|
||||
headers$.set("Accept", "application/json");
|
||||
|
||||
const payload$ = z.string().parse(input);
|
||||
const body$ = payload$;
|
||||
|
||||
const path$ = this.templateURLComponent("/log")();
|
||||
|
||||
let security$;
|
||||
@@ -129,7 +157,13 @@ export class Log extends ClientSDK {
|
||||
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
||||
|
||||
const response = await this.fetch$(
|
||||
{ security: securitySettings$, method: "POST", path: path$, headers: headers$ },
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "POST",
|
||||
path: path$,
|
||||
headers: headers$,
|
||||
body: body$,
|
||||
},
|
||||
options
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user