/* * 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 { KeyAlgorithm, KeyAlgorithm$inboundSchema } from "./keyalgorithm.js"; export type Signature = { /** * Whether the certificate was signed by its own key. */ selfSigned?: boolean | undefined; signatureAlgorithm?: KeyAlgorithm | undefined; /** * Whether the signature is valid. */ valid?: boolean | undefined; /** * Contents of the signature. */ value?: string | undefined; }; /** @internal */ export const Signature$inboundSchema: z.ZodType< Signature, z.ZodTypeDef, unknown > = z.object({ self_signed: z.boolean().optional(), signature_algorithm: KeyAlgorithm$inboundSchema.optional(), valid: z.boolean().optional(), value: z.string().optional(), }).transform((v) => { return remap$(v, { "self_signed": "selfSigned", "signature_algorithm": "signatureAlgorithm", }); }); export function signatureFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Signature$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Signature' from JSON`, ); }