/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type GetWebhookSecretRequest = { /** * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. */ projectId?: string | undefined; }; /** * Signing secret retrieved successfully */ export type GetWebhookSecretResponse = { /** * The signing secret for this project. Every webhook delivery is signed with HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` header. */ secret: string; }; /** @internal */ export type GetWebhookSecretRequest$Outbound = { projectId?: string | undefined; }; /** @internal */ export const GetWebhookSecretRequest$outboundSchema: z.ZodMiniType< GetWebhookSecretRequest$Outbound, GetWebhookSecretRequest > = z.object({ projectId: z.optional(z.string()), }); export function getWebhookSecretRequestToJSON( getWebhookSecretRequest: GetWebhookSecretRequest, ): string { return JSON.stringify( GetWebhookSecretRequest$outboundSchema.parse(getWebhookSecretRequest), ); } /** @internal */ export const GetWebhookSecretResponse$inboundSchema: z.ZodMiniType< GetWebhookSecretResponse, unknown > = z.object({ secret: types.string(), }); export function getWebhookSecretResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetWebhookSecretResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWebhookSecretResponse' from JSON`, ); }