/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type IntercomData = { articlesHelpCenter?: boolean | undefined; admins?: boolean | undefined; contacts?: boolean | undefined; conversations?: boolean | undefined; conversationAttachments?: boolean | undefined; conversationNotes?: boolean | undefined; tickets?: boolean | undefined; ticketAttachments?: boolean | undefined; ticketComments?: boolean | undefined; ticketNotes?: boolean | undefined; filterUserId?: string | null | undefined; }; /** @internal */ export const IntercomData$inboundSchema: z.ZodType< IntercomData, z.ZodTypeDef, unknown > = z.object({ articles_help_center: z.boolean().default(false), admins: z.boolean().default(false), contacts: z.boolean().default(false), conversations: z.boolean().default(false), conversation_attachments: z.boolean().default(false), conversation_notes: z.boolean().default(false), tickets: z.boolean().default(false), ticket_attachments: z.boolean().default(false), ticket_comments: z.boolean().default(false), ticket_notes: z.boolean().default(false), filter_user_id: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "articles_help_center": "articlesHelpCenter", "conversation_attachments": "conversationAttachments", "conversation_notes": "conversationNotes", "ticket_attachments": "ticketAttachments", "ticket_comments": "ticketComments", "ticket_notes": "ticketNotes", "filter_user_id": "filterUserId", }); }); /** @internal */ export type IntercomData$Outbound = { articles_help_center: boolean; admins: boolean; contacts: boolean; conversations: boolean; conversation_attachments: boolean; conversation_notes: boolean; tickets: boolean; ticket_attachments: boolean; ticket_comments: boolean; ticket_notes: boolean; filter_user_id?: string | null | undefined; }; /** @internal */ export const IntercomData$outboundSchema: z.ZodType< IntercomData$Outbound, z.ZodTypeDef, IntercomData > = z.object({ articlesHelpCenter: z.boolean().default(false), admins: z.boolean().default(false), contacts: z.boolean().default(false), conversations: z.boolean().default(false), conversationAttachments: z.boolean().default(false), conversationNotes: z.boolean().default(false), tickets: z.boolean().default(false), ticketAttachments: z.boolean().default(false), ticketComments: z.boolean().default(false), ticketNotes: z.boolean().default(false), filterUserId: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { articlesHelpCenter: "articles_help_center", conversationAttachments: "conversation_attachments", conversationNotes: "conversation_notes", ticketAttachments: "ticket_attachments", ticketComments: "ticket_comments", ticketNotes: "ticket_notes", filterUserId: "filter_user_id", }); }); export function intercomDataToJSON(intercomData: IntercomData): string { return JSON.stringify(IntercomData$outboundSchema.parse(intercomData)); } export function intercomDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IntercomData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IntercomData' from JSON`, ); }