/* * 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"; export type WebhookDtoSubscriptionPhase = { endDate?: Date | undefined; id?: string | undefined; startDate?: Date | undefined; subscriptionId?: string | undefined; }; /** @internal */ export const WebhookDtoSubscriptionPhase$inboundSchema: z.ZodMiniType< WebhookDtoSubscriptionPhase, unknown > = z.pipe( z.object({ end_date: types.optional(types.date()), id: types.optional(types.string()), start_date: types.optional(types.date()), subscription_id: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "end_date": "endDate", "start_date": "startDate", "subscription_id": "subscriptionId", }); }), ); export function webhookDtoSubscriptionPhaseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDtoSubscriptionPhase$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDtoSubscriptionPhase' from JSON`, ); }