/* * 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 IntercomCredentials = { accessToken: string; appName: string; /** * The email of the Intercom account this is for */ userEmail: string; }; /** @internal */ export const IntercomCredentials$inboundSchema: z.ZodType< IntercomCredentials, z.ZodTypeDef, unknown > = z.object({ access_token: z.string(), app_name: z.string(), user_email: z.string(), }).transform((v) => { return remap$(v, { "access_token": "accessToken", "app_name": "appName", "user_email": "userEmail", }); }); /** @internal */ export type IntercomCredentials$Outbound = { access_token: string; app_name: string; user_email: string; }; /** @internal */ export const IntercomCredentials$outboundSchema: z.ZodType< IntercomCredentials$Outbound, z.ZodTypeDef, IntercomCredentials > = z.object({ accessToken: z.string(), appName: z.string(), userEmail: z.string(), }).transform((v) => { return remap$(v, { accessToken: "access_token", appName: "app_name", userEmail: "user_email", }); }); export function intercomCredentialsToJSON( intercomCredentials: IntercomCredentials, ): string { return JSON.stringify( IntercomCredentials$outboundSchema.parse(intercomCredentials), ); } export function intercomCredentialsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IntercomCredentials$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IntercomCredentials' from JSON`, ); }