/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type WebhookDataTicketCreated = { accountID: string; ticketID: string; foreignID?: string | undefined; }; /** @internal */ export const WebhookDataTicketCreated$inboundSchema: z.ZodType< WebhookDataTicketCreated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), ticketID: z.string(), foreignID: z.string().optional(), }); /** @internal */ export type WebhookDataTicketCreated$Outbound = { accountID: string; ticketID: string; foreignID?: string | undefined; }; /** @internal */ export const WebhookDataTicketCreated$outboundSchema: z.ZodType< WebhookDataTicketCreated$Outbound, z.ZodTypeDef, WebhookDataTicketCreated > = z.object({ accountID: z.string(), ticketID: z.string(), foreignID: z.string().optional(), }); export function webhookDataTicketCreatedToJSON( webhookDataTicketCreated: WebhookDataTicketCreated, ): string { return JSON.stringify( WebhookDataTicketCreated$outboundSchema.parse(webhookDataTicketCreated), ); } export function webhookDataTicketCreatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataTicketCreated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataTicketCreated' from JSON`, ); }