/* * 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 ValidityPeriod = { /** * The duration of the certificate's validity period, in seconds. */ lengthSeconds?: number | undefined; /** * An RFC-3339-formatted timestamp after which the certificate is no longer valid. */ notAfter?: string | undefined; /** * An RFC-3339-formatted timestamp before which the certificate is not valid. */ notBefore?: string | undefined; }; /** @internal */ export const ValidityPeriod$inboundSchema: z.ZodType< ValidityPeriod, z.ZodTypeDef, unknown > = z.object({ length_seconds: z.number().int().optional(), not_after: z.string().optional(), not_before: z.string().optional(), }).transform((v) => { return remap$(v, { "length_seconds": "lengthSeconds", "not_after": "notAfter", "not_before": "notBefore", }); }); export function validityPeriodFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ValidityPeriod$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ValidityPeriod' from JSON`, ); }