/* * 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 * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * An enumerated value indicating the issuer-supplied reason for the revocation. */ export const Reason = { Unknown: "", Unspecified: "unspecified", KeyCompromise: "key_compromise", CaCompromise: "ca_compromise", AffiliationChanged: "affiliation_changed", Superseded: "superseded", CessationOfOperation: "cessation_of_operation", CertificateHold: "certificate_hold", RemoveFromCrl: "remove_from_crl", PrivilegeWithdrawn: "privilege_withdrawn", AaCompromise: "aa_compromise", } as const; /** * An enumerated value indicating the issuer-supplied reason for the revocation. */ export type Reason = OpenEnum; export type CertificateRevocationRevocationInfo = { nextUpdate?: string | undefined; /** * An enumerated value indicating the issuer-supplied reason for the revocation. */ reason?: Reason | undefined; /** * The issuer-supplied timestamp indicating when the certificate was revoked. */ revocationTime?: string | undefined; /** * Whether the certificate has been revoked before its expiry date by the issuer. */ revoked?: boolean | undefined; }; /** @internal */ export const Reason$inboundSchema: z.ZodType = openEnums.inboundSchema(Reason); /** @internal */ export const CertificateRevocationRevocationInfo$inboundSchema: z.ZodType< CertificateRevocationRevocationInfo, z.ZodTypeDef, unknown > = z.object({ next_update: z.string().optional(), reason: Reason$inboundSchema.optional(), revocation_time: z.string().optional(), revoked: z.boolean().optional(), }).transform((v) => { return remap$(v, { "next_update": "nextUpdate", "revocation_time": "revocationTime", }); }); export function certificateRevocationRevocationInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CertificateRevocationRevocationInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CertificateRevocationRevocationInfo' from JSON`, ); }