/* * 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 { DistinguishedName, DistinguishedName$inboundSchema, } from "./distinguishedname.js"; import { EdiPartyName, EdiPartyName$inboundSchema } from "./edipartyname.js"; import { GeneralSubtreeIp, GeneralSubtreeIp$inboundSchema, } from "./generalsubtreeip.js"; export type NameConstraints = { critical?: boolean | undefined; /** * A record providing excluded names of the type directoryName in leaf certificates whose trust path includes this certificate. */ excludedDirectoryNames?: Array | null | undefined; /** * A record providing excluded names of the type ediPartyName in leaf certificates whose trust path includes this certificate. */ excludedEdiPartyNames?: Array | null | undefined; /** * A record providing a range of excluded names of the type rfc822Name in leaf certificates whose trust path includes this certificate. */ excludedEmailAddresses?: Array | null | undefined; /** * A record providing a range of excluded names of the type iPAddress in leaf certificates whose trust path includes this certificate. */ excludedIpAddresses?: Array | null | undefined; /** * A record providing a range of excluded names of the type dNSName in leaf certificates whose trust path includes this certificate. */ excludedNames?: Array | null | undefined; /** * A record providing excluded names of the type registeredID in leaf certificates whose trust path includes this certificate. */ excludedRegisteredIds?: Array | null | undefined; /** * A record providing a range of excluded uniform resource identifiers in leaf certificates whose trust path includes this certificate. */ excludedUris?: Array | null | undefined; /** * A record providing permitted names of the type directoryName in leaf certificates whose trust path includes this certificate. */ permittedDirectoryNames?: Array | null | undefined; /** * A record providing permitted names of the type ediPartyName in leaf certificates whose trust path includes this certificate. */ permittedEdiPartyNames?: Array | null | undefined; /** * A record providing a range of permitted names of the type rfc822Name in leaf certificates whose trust path includes this certificate. */ permittedEmailAddresses?: Array | null | undefined; /** * A record providing a range of permitted names of the type iPAddress in leaf certificates whose trust path includes this certificate. */ permittedIpAddresses?: Array | null | undefined; /** * A record providing a range of permitted names of the type dNSName in leaf certificates whose trust path includes this certificate. */ permittedNames?: Array | null | undefined; /** * A record providing permitted names of the type registeredID in leaf certificates whose trust path includes this certificate. */ permittedRegisteredIds?: Array | null | undefined; /** * A record providing a range of permitted uniform resource identifiers in leaf certificates whose trust path includes this certificate. */ permittedUris?: Array | null | undefined; }; /** @internal */ export const NameConstraints$inboundSchema: z.ZodType< NameConstraints, z.ZodTypeDef, unknown > = z.object({ critical: z.boolean().optional(), excluded_directory_names: z.nullable(z.array(DistinguishedName$inboundSchema)) .optional(), excluded_edi_party_names: z.nullable(z.array(EdiPartyName$inboundSchema)) .optional(), excluded_email_addresses: z.nullable(z.array(z.string())).optional(), excluded_ip_addresses: z.nullable(z.array(GeneralSubtreeIp$inboundSchema)) .optional(), excluded_names: z.nullable(z.array(z.string())).optional(), excluded_registered_ids: z.nullable(z.array(z.string())).optional(), excluded_uris: z.nullable(z.array(z.string())).optional(), permitted_directory_names: z.nullable( z.array(DistinguishedName$inboundSchema), ).optional(), permitted_edi_party_names: z.nullable(z.array(EdiPartyName$inboundSchema)) .optional(), permitted_email_addresses: z.nullable(z.array(z.string())).optional(), permitted_ip_addresses: z.nullable(z.array(GeneralSubtreeIp$inboundSchema)) .optional(), permitted_names: z.nullable(z.array(z.string())).optional(), permitted_registered_ids: z.nullable(z.array(z.string())).optional(), permitted_uris: z.nullable(z.array(z.string())).optional(), }).transform((v) => { return remap$(v, { "excluded_directory_names": "excludedDirectoryNames", "excluded_edi_party_names": "excludedEdiPartyNames", "excluded_email_addresses": "excludedEmailAddresses", "excluded_ip_addresses": "excludedIpAddresses", "excluded_names": "excludedNames", "excluded_registered_ids": "excludedRegisteredIds", "excluded_uris": "excludedUris", "permitted_directory_names": "permittedDirectoryNames", "permitted_edi_party_names": "permittedEdiPartyNames", "permitted_email_addresses": "permittedEmailAddresses", "permitted_ip_addresses": "permittedIpAddresses", "permitted_names": "permittedNames", "permitted_registered_ids": "permittedRegisteredIds", "permitted_uris": "permittedUris", }); }); export function nameConstraintsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NameConstraints$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NameConstraints' from JSON`, ); }