/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LlmCheckRequest = { /** * Type of LLM resource */ resourceType: components.LlmResourceType; resourceId: string; /** * Permission role for the resource (owner > writer > reader) */ role: components.ResourceRole; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const LlmCheckRequest$inboundSchema: z.ZodType< LlmCheckRequest, z.ZodTypeDef, unknown > = z.object({ resourceType: components.LlmResourceType$inboundSchema, resourceId: z.string(), role: components.ResourceRole$inboundSchema, "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type LlmCheckRequest$Outbound = { resourceType: string; resourceId: string; role: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const LlmCheckRequest$outboundSchema: z.ZodType< LlmCheckRequest$Outbound, z.ZodTypeDef, LlmCheckRequest > = z.object({ resourceType: components.LlmResourceType$outboundSchema, resourceId: z.string(), role: components.ResourceRole$outboundSchema, xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function llmCheckRequestToJSON( llmCheckRequest: LlmCheckRequest, ): string { return JSON.stringify(LlmCheckRequest$outboundSchema.parse(llmCheckRequest)); } export function llmCheckRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LlmCheckRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LlmCheckRequest' from JSON`, ); }