/* * 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"; import { TicketStatus, TicketStatus$inboundSchema, TicketStatus$outboundSchema, } from "./ticketstatus.js"; export type WebhookDataTicketUpdated = { accountID: string; ticketID: string; foreignID?: string | undefined; status: TicketStatus; }; /** @internal */ export const WebhookDataTicketUpdated$inboundSchema: z.ZodType< WebhookDataTicketUpdated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), ticketID: z.string(), foreignID: z.string().optional(), status: TicketStatus$inboundSchema, }); /** @internal */ export type WebhookDataTicketUpdated$Outbound = { accountID: string; ticketID: string; foreignID?: string | undefined; status: string; }; /** @internal */ export const WebhookDataTicketUpdated$outboundSchema: z.ZodType< WebhookDataTicketUpdated$Outbound, z.ZodTypeDef, WebhookDataTicketUpdated > = z.object({ accountID: z.string(), ticketID: z.string(), foreignID: z.string().optional(), status: TicketStatus$outboundSchema, }); export function webhookDataTicketUpdatedToJSON( webhookDataTicketUpdated: WebhookDataTicketUpdated, ): string { return JSON.stringify( WebhookDataTicketUpdated$outboundSchema.parse(webhookDataTicketUpdated), ); } export function webhookDataTicketUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataTicketUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataTicketUpdated' from JSON`, ); }