/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LinkedDepartment = { /** * A unique identifier for an object. */ id?: string | undefined; /** * Id to be displayed. */ displayId?: string | null | undefined; /** * The name of the resource. */ name?: string | null | undefined; /** * The third-party API ID of original entity */ downstreamId?: string | null | undefined; }; /** @internal */ export const LinkedDepartment$inboundSchema: z.ZodType< LinkedDepartment, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), display_id: z.nullable(types.string()).optional(), name: z.nullable(types.string()).optional(), downstream_id: z.nullable(types.string()).optional(), }).transform((v) => { return remap$(v, { "display_id": "displayId", "downstream_id": "downstreamId", }); }) ); export function linkedDepartmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedDepartment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedDepartment' from JSON`, ); }