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