/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { WebhookDtoSubscriptionPhase, WebhookDtoSubscriptionPhase$inboundSchema, } from "./webhook-dto-subscription-phase.js"; import { WebhookEventName, WebhookEventName$inboundSchema, } from "./webhook-event-name.js"; export type WebhookDtoSubscriptionPhaseWebhookPayload = { eventType?: WebhookEventName | undefined; phase?: WebhookDtoSubscriptionPhase | undefined; }; /** @internal */ export const WebhookDtoSubscriptionPhaseWebhookPayload$inboundSchema: z.ZodMiniType = z.pipe( z.object({ event_type: types.optional(WebhookEventName$inboundSchema), phase: types.optional(WebhookDtoSubscriptionPhase$inboundSchema), }), z.transform((v) => { return remap$(v, { "event_type": "eventType", }); }), ); export function webhookDtoSubscriptionPhaseWebhookPayloadFromJSON( jsonString: string, ): SafeParseResult< WebhookDtoSubscriptionPhaseWebhookPayload, SDKValidationError > { return safeParse( jsonString, (x) => WebhookDtoSubscriptionPhaseWebhookPayload$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WebhookDtoSubscriptionPhaseWebhookPayload' from JSON`, ); }