/* * 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"; export type BasicConstraints = { /** * Whether the certificate is permitted to sign other certificates. */ isCa?: boolean | undefined; /** * When present, provides the maximum number of intermediate certificates that may follow this certificate in a trusted certification path. */ maxPathLen?: number | undefined; }; /** @internal */ export const BasicConstraints$inboundSchema: z.ZodType< BasicConstraints, z.ZodTypeDef, unknown > = z.object({ is_ca: z.boolean().optional(), max_path_len: z.number().int().optional(), }).transform((v) => { return remap$(v, { "is_ca": "isCa", "max_path_len": "maxPathLen", }); }); export function basicConstraintsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BasicConstraints$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BasicConstraints' from JSON`, ); }