/* * 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 DistinguishedName = { /** * The commonName (CN) elements of the Distinguished Name (OID: 2.5.4.3). */ commonName?: Array | null | undefined; /** * The countryName (C) elements of the Distinguished Name (OID: 2.5.4.6). */ country?: Array | null | undefined; /** * The domainComponent (DC) elements of the Distinguished Name (OID: 0.9.2342.19200300.100.1.25). */ domainComponent?: Array | null | undefined; /** * The emailAddress (E) elements of the Distinguished Name (OID: 1.2.840.113549.1.9.1). */ emailAddress?: Array | null | undefined; /** * The givenName (G) elements of the Distinguished Name (OID: 2.5.4.42). */ givenName?: Array | null | undefined; /** * The jurisdictionCountry elements of the Distinguished Name (OID: 1.3.6.1.4.1.311.60.2.1.3). */ jurisdictionCountry?: Array | null | undefined; /** * The jurisdictionLocality elements of the Distinguished Name (OID: 1.3.6.1.4.1.311.60.2.1.1). */ jurisdictionLocality?: Array | null | undefined; /** * The jurisdictionStateOrProvince elements of the Distinguished Name (OID: 1.3.6.1.4.1.311.60.2.1.2). */ jurisdictionProvince?: Array | null | undefined; /** * The localityName (L) elements of the Distinguished Name (OID: 2.5.4.7). */ locality?: Array | null | undefined; /** * The organizationName (O) elements of the Distinguished Name (OID: 2.5.4.10). */ organization?: Array | null | undefined; organizationId?: Array | null | undefined; /** * The organizationalUnit (OU) elements of the Distinguished Name (OID: 2.5.4.11). */ organizationalUnit?: Array | null | undefined; /** * The postalCode elements of the Distinguished Name (OID: 2.5.4.17). */ postalCode?: Array | null | undefined; /** * The stateOrProvinceName (ST) elements of the Distinguished Name (OID: 2.5.4.8). */ province?: Array | null | undefined; /** * The serialNumber elements of the Distinguished Name (OID: 2.5.4.5). */ serialNumber?: Array | null | undefined; /** * The streetAddress (STREET) elements of the Distinguished Name (OID: 2.5.4.9). */ streetAddress?: Array | null | undefined; /** * The surname (SN) elements of the Distinguished Name (OID: 2.5.4.4). */ surname?: Array | null | undefined; }; /** @internal */ export const DistinguishedName$inboundSchema: z.ZodType< DistinguishedName, z.ZodTypeDef, unknown > = z.object({ common_name: z.nullable(z.array(z.string())).optional(), country: z.nullable(z.array(z.string())).optional(), domain_component: z.nullable(z.array(z.string())).optional(), email_address: z.nullable(z.array(z.string())).optional(), given_name: z.nullable(z.array(z.string())).optional(), jurisdiction_country: z.nullable(z.array(z.string())).optional(), jurisdiction_locality: z.nullable(z.array(z.string())).optional(), jurisdiction_province: z.nullable(z.array(z.string())).optional(), locality: z.nullable(z.array(z.string())).optional(), organization: z.nullable(z.array(z.string())).optional(), organization_id: z.nullable(z.array(z.string())).optional(), organizational_unit: z.nullable(z.array(z.string())).optional(), postal_code: z.nullable(z.array(z.string())).optional(), province: z.nullable(z.array(z.string())).optional(), serial_number: z.nullable(z.array(z.string())).optional(), street_address: z.nullable(z.array(z.string())).optional(), surname: z.nullable(z.array(z.string())).optional(), }).transform((v) => { return remap$(v, { "common_name": "commonName", "domain_component": "domainComponent", "email_address": "emailAddress", "given_name": "givenName", "jurisdiction_country": "jurisdictionCountry", "jurisdiction_locality": "jurisdictionLocality", "jurisdiction_province": "jurisdictionProvince", "organization_id": "organizationId", "organizational_unit": "organizationalUnit", "postal_code": "postalCode", "serial_number": "serialNumber", "street_address": "streetAddress", }); }); export function distinguishedNameFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DistinguishedName$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DistinguishedName' from JSON`, ); }