/* * 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 { Skill, Skill$inboundSchema, Skill$Outbound, Skill$outboundSchema, } from "./skill.js"; export type SkillList = { object?: "list" | undefined; data: Array; firstId: string | null; hasMore: boolean; lastId: string | null; }; /** @internal */ export const SkillList$inboundSchema: z.ZodType< SkillList, z.ZodTypeDef, unknown > = z.object({ object: z.literal("list").default("list"), data: z.array(Skill$inboundSchema), first_id: z.nullable(z.string()), has_more: z.boolean(), last_id: z.nullable(z.string()), }).transform((v) => { return remap$(v, { "first_id": "firstId", "has_more": "hasMore", "last_id": "lastId", }); }); /** @internal */ export type SkillList$Outbound = { object: "list"; data: Array; first_id: string | null; has_more: boolean; last_id: string | null; }; /** @internal */ export const SkillList$outboundSchema: z.ZodType< SkillList$Outbound, z.ZodTypeDef, SkillList > = z.object({ object: z.literal("list").default("list" as const), data: z.array(Skill$outboundSchema), firstId: z.nullable(z.string()), hasMore: z.boolean(), lastId: z.nullable(z.string()), }).transform((v) => { return remap$(v, { firstId: "first_id", hasMore: "has_more", lastId: "last_id", }); }); export function skillListToJSON(skillList: SkillList): string { return JSON.stringify(SkillList$outboundSchema.parse(skillList)); } export function skillListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SkillList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SkillList' from JSON`, ); }