/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: eadc5ec6107e */ 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"; /** * Information about a team's email */ export type TeamEmail = { /** * An email address */ email: string; /** * An enum of `PRIMARY`, `SECONDARY`, `ONCALL`, `OTHER` */ type?: string | undefined; }; /** @internal */ export const TeamEmail$inboundSchema: z.ZodType< TeamEmail, z.ZodTypeDef, unknown > = z.object({ email: z.string(), type: z.string().default("OTHER"), }); /** @internal */ export type TeamEmail$Outbound = { email: string; type: string; }; /** @internal */ export const TeamEmail$outboundSchema: z.ZodType< TeamEmail$Outbound, z.ZodTypeDef, TeamEmail > = z.object({ email: z.string(), type: z.string().default("OTHER"), }); export function teamEmailToJSON(teamEmail: TeamEmail): string { return JSON.stringify(TeamEmail$outboundSchema.parse(teamEmail)); } export function teamEmailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TeamEmail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TeamEmail' from JSON`, ); }