/* * 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"; export type GetSkillVersionRequest = { skillId: string; version: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const GetSkillVersionRequest$inboundSchema: z.ZodType< GetSkillVersionRequest, z.ZodTypeDef, unknown > = z.object({ skill_id: z.string(), version: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "skill_id": "skillId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type GetSkillVersionRequest$Outbound = { skill_id: string; version: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const GetSkillVersionRequest$outboundSchema: z.ZodType< GetSkillVersionRequest$Outbound, z.ZodTypeDef, GetSkillVersionRequest > = z.object({ skillId: z.string(), version: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { skillId: "skill_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function getSkillVersionRequestToJSON( getSkillVersionRequest: GetSkillVersionRequest, ): string { return JSON.stringify( GetSkillVersionRequest$outboundSchema.parse(getSkillVersionRequest), ); } export function getSkillVersionRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetSkillVersionRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSkillVersionRequest' from JSON`, ); }