/* * 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 { OtherName, OtherName$inboundSchema } from "./othername.js"; export type GeneralNames = { /** * The parsed directoryName entries in the GeneralName. */ directoryNames?: Array | null | undefined; /** * The parsed dNSName entries in the GeneralName. */ dnsNames?: Array | null | undefined; /** * The parsed eDIPartyName entries in the GeneralName. */ ediPartyNames?: Array | null | undefined; /** * The parsed rfc822Name entries in the GeneralName. */ emailAddresses?: Array | null | undefined; /** * The parsed ipAddress entries in the GeneralName. */ ipAddresses?: Array | null | undefined; /** * The parsed otherName entries in the GeneralName. An arbitrary binary value identified by an OID. */ otherNames?: Array | null | undefined; /** * The parsed registeredID entries in the GeneralName. Stored in dotted-decimal format. */ registeredIds?: Array | null | undefined; /** * The parsed uniformResourceIdentifier entries in the GeneralName. */ uniformResourceIdentifiers?: Array | null | undefined; }; /** @internal */ export const GeneralNames$inboundSchema: z.ZodType< GeneralNames, z.ZodTypeDef, unknown > = z.object({ directory_names: z.nullable(z.array(DistinguishedName$inboundSchema)) .optional(), dns_names: z.nullable(z.array(z.string())).optional(), edi_party_names: z.nullable(z.array(EdiPartyName$inboundSchema)).optional(), email_addresses: z.nullable(z.array(z.string())).optional(), ip_addresses: z.nullable(z.array(z.string())).optional(), other_names: z.nullable(z.array(OtherName$inboundSchema)).optional(), registered_ids: z.nullable(z.array(z.string())).optional(), uniform_resource_identifiers: z.nullable(z.array(z.string())).optional(), }).transform((v) => { return remap$(v, { "directory_names": "directoryNames", "dns_names": "dnsNames", "edi_party_names": "ediPartyNames", "email_addresses": "emailAddresses", "ip_addresses": "ipAddresses", "other_names": "otherNames", "registered_ids": "registeredIds", "uniform_resource_identifiers": "uniformResourceIdentifiers", }); }); export function generalNamesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GeneralNames$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GeneralNames' from JSON`, ); }