mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-09 04:20:52 +00:00
217 lines
5.5 KiB
TypeScript
217 lines
5.5 KiB
TypeScript
/*
|
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
*/
|
|
|
|
import * as z from "zod/v3";
|
|
import { remap as remap$ } from "../../../lib/primitives.js";
|
|
import { safeParse } from "../../../lib/schemas.js";
|
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
import * as shared from "../shared/index.js";
|
|
|
|
export type DeleteHistoryGlobals = {
|
|
/**
|
|
* Indicates the client accepts the indicated media types
|
|
*/
|
|
accepts?: shared.Accepts | undefined;
|
|
/**
|
|
* An opaque identifier unique to the client
|
|
*/
|
|
clientIdentifier?: string | undefined;
|
|
/**
|
|
* The name of the client product
|
|
*/
|
|
product?: string | undefined;
|
|
/**
|
|
* The version of the client application
|
|
*/
|
|
version?: string | undefined;
|
|
/**
|
|
* The platform of the client
|
|
*/
|
|
platform?: string | undefined;
|
|
/**
|
|
* The version of the platform
|
|
*/
|
|
platformVersion?: string | undefined;
|
|
/**
|
|
* A relatively friendly name for the client device
|
|
*/
|
|
device?: string | undefined;
|
|
/**
|
|
* A potentially less friendly identifier for the device model
|
|
*/
|
|
model?: string | undefined;
|
|
/**
|
|
* The device vendor
|
|
*/
|
|
deviceVendor?: string | undefined;
|
|
/**
|
|
* A friendly name for the client
|
|
*/
|
|
deviceName?: string | undefined;
|
|
/**
|
|
* The marketplace on which the client application is distributed
|
|
*/
|
|
marketplace?: string | undefined;
|
|
};
|
|
|
|
export type DeleteHistoryRequest = {
|
|
/**
|
|
* Indicates the client accepts the indicated media types
|
|
*/
|
|
accepts?: shared.Accepts | undefined;
|
|
/**
|
|
* An opaque identifier unique to the client
|
|
*/
|
|
clientIdentifier?: string | undefined;
|
|
/**
|
|
* The name of the client product
|
|
*/
|
|
product?: string | undefined;
|
|
/**
|
|
* The version of the client application
|
|
*/
|
|
version?: string | undefined;
|
|
/**
|
|
* The platform of the client
|
|
*/
|
|
platform?: string | undefined;
|
|
/**
|
|
* The version of the platform
|
|
*/
|
|
platformVersion?: string | undefined;
|
|
/**
|
|
* A relatively friendly name for the client device
|
|
*/
|
|
device?: string | undefined;
|
|
/**
|
|
* A potentially less friendly identifier for the device model
|
|
*/
|
|
model?: string | undefined;
|
|
/**
|
|
* The device vendor
|
|
*/
|
|
deviceVendor?: string | undefined;
|
|
/**
|
|
* A friendly name for the client
|
|
*/
|
|
deviceName?: string | undefined;
|
|
/**
|
|
* The marketplace on which the client application is distributed
|
|
*/
|
|
marketplace?: string | undefined;
|
|
/**
|
|
* The id of the history item (the `historyKey` from above)
|
|
*/
|
|
historyId: number;
|
|
};
|
|
|
|
export type DeleteHistoryResponse = {
|
|
/**
|
|
* HTTP response content type for this operation
|
|
*/
|
|
contentType: string;
|
|
/**
|
|
* HTTP response status code for this operation
|
|
*/
|
|
statusCode: number;
|
|
/**
|
|
* Raw HTTP response; suitable for custom response parsing
|
|
*/
|
|
rawResponse: Response;
|
|
/**
|
|
* OK
|
|
*/
|
|
mediaContainer?: shared.MediaContainer | undefined;
|
|
headers: { [k: string]: Array<string> };
|
|
};
|
|
|
|
/** @internal */
|
|
export type DeleteHistoryRequest$Outbound = {
|
|
accepts: string;
|
|
"Client-Identifier"?: string | undefined;
|
|
Product?: string | undefined;
|
|
Version?: string | undefined;
|
|
Platform?: string | undefined;
|
|
"Platform-Version"?: string | undefined;
|
|
Device?: string | undefined;
|
|
Model?: string | undefined;
|
|
"Device-Vendor"?: string | undefined;
|
|
"Device-Name"?: string | undefined;
|
|
Marketplace?: string | undefined;
|
|
historyId: number;
|
|
};
|
|
|
|
/** @internal */
|
|
export const DeleteHistoryRequest$outboundSchema: z.ZodType<
|
|
DeleteHistoryRequest$Outbound,
|
|
z.ZodTypeDef,
|
|
DeleteHistoryRequest
|
|
> = z.object({
|
|
accepts: shared.Accepts$outboundSchema.default(shared.Accepts.ApplicationXml),
|
|
clientIdentifier: z.string().optional(),
|
|
product: z.string().optional(),
|
|
version: z.string().optional(),
|
|
platform: z.string().optional(),
|
|
platformVersion: z.string().optional(),
|
|
device: z.string().optional(),
|
|
model: z.string().optional(),
|
|
deviceVendor: z.string().optional(),
|
|
deviceName: z.string().optional(),
|
|
marketplace: z.string().optional(),
|
|
historyId: z.number().int(),
|
|
}).transform((v) => {
|
|
return remap$(v, {
|
|
clientIdentifier: "Client-Identifier",
|
|
product: "Product",
|
|
version: "Version",
|
|
platform: "Platform",
|
|
platformVersion: "Platform-Version",
|
|
device: "Device",
|
|
model: "Model",
|
|
deviceVendor: "Device-Vendor",
|
|
deviceName: "Device-Name",
|
|
marketplace: "Marketplace",
|
|
});
|
|
});
|
|
|
|
export function deleteHistoryRequestToJSON(
|
|
deleteHistoryRequest: DeleteHistoryRequest,
|
|
): string {
|
|
return JSON.stringify(
|
|
DeleteHistoryRequest$outboundSchema.parse(deleteHistoryRequest),
|
|
);
|
|
}
|
|
|
|
/** @internal */
|
|
export const DeleteHistoryResponse$inboundSchema: z.ZodType<
|
|
DeleteHistoryResponse,
|
|
z.ZodTypeDef,
|
|
unknown
|
|
> = z.object({
|
|
ContentType: z.string(),
|
|
StatusCode: z.number().int(),
|
|
RawResponse: z.instanceof(Response),
|
|
MediaContainer: shared.MediaContainer$inboundSchema.optional(),
|
|
Headers: z.record(z.array(z.string())).default({}),
|
|
}).transform((v) => {
|
|
return remap$(v, {
|
|
"ContentType": "contentType",
|
|
"StatusCode": "statusCode",
|
|
"RawResponse": "rawResponse",
|
|
"MediaContainer": "mediaContainer",
|
|
"Headers": "headers",
|
|
});
|
|
});
|
|
|
|
export function deleteHistoryResponseFromJSON(
|
|
jsonString: string,
|
|
): SafeParseResult<DeleteHistoryResponse, SDKValidationError> {
|
|
return safeParse(
|
|
jsonString,
|
|
(x) => DeleteHistoryResponse$inboundSchema.parse(JSON.parse(x)),
|
|
`Failed to parse 'DeleteHistoryResponse' from JSON`,
|
|
);
|
|
}
|