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