/* * 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 { LdapAttribute, LdapAttribute$inboundSchema } from "./ldapattribute.js"; export type Ldap = { /** * Ability to connect with anonymous bind (empty username and password) */ allowsAnonymousBind?: boolean | undefined; /** * All root DN attributes available via anonymous bind */ attributes?: Array | null | undefined; /** * Result or error code returned by LDAP instance upon bind */ resultCode?: number | undefined; }; /** @internal */ export const Ldap$inboundSchema: z.ZodType = z .object({ allows_anonymous_bind: z.boolean().optional(), attributes: z.nullable(z.array(LdapAttribute$inboundSchema)).optional(), result_code: z.number().int().optional(), }).transform((v) => { return remap$(v, { "allows_anonymous_bind": "allowsAnonymousBind", "result_code": "resultCode", }); }); export function ldapFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Ldap$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Ldap' from JSON`, ); }