/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const ListSkillsQueryParamOrder = { Asc: "asc", Desc: "desc", } as const; export type ListSkillsQueryParamOrder = ClosedEnum< typeof ListSkillsQueryParamOrder >; export type ListSkillsRequest = { after?: string | undefined; limit?: number | undefined; order?: ListSkillsQueryParamOrder | undefined; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const ListSkillsQueryParamOrder$inboundSchema: z.ZodNativeEnum< typeof ListSkillsQueryParamOrder > = z.nativeEnum(ListSkillsQueryParamOrder); /** @internal */ export const ListSkillsQueryParamOrder$outboundSchema: z.ZodNativeEnum< typeof ListSkillsQueryParamOrder > = ListSkillsQueryParamOrder$inboundSchema; /** @internal */ export const ListSkillsRequest$inboundSchema: z.ZodType< ListSkillsRequest, z.ZodTypeDef, unknown > = z.object({ after: z.string().optional(), limit: z.number().int().default(20), order: ListSkillsQueryParamOrder$inboundSchema.default("desc"), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type ListSkillsRequest$Outbound = { after?: string | undefined; limit: number; order: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const ListSkillsRequest$outboundSchema: z.ZodType< ListSkillsRequest$Outbound, z.ZodTypeDef, ListSkillsRequest > = z.object({ after: z.string().optional(), limit: z.number().int().default(20), order: ListSkillsQueryParamOrder$outboundSchema.default("desc"), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function listSkillsRequestToJSON( listSkillsRequest: ListSkillsRequest, ): string { return JSON.stringify( ListSkillsRequest$outboundSchema.parse(listSkillsRequest), ); } export function listSkillsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListSkillsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListSkillsRequest' from JSON`, ); }