/* * 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 { BrandColor, BrandColor$inboundSchema, BrandColor$Outbound, BrandColor$outboundSchema, } from "./brandcolor.js"; /** * Brand colors for light and dark modes. */ export type BrandColors = { dark: BrandColor; light: BrandColor; }; /** @internal */ export const BrandColors$inboundSchema: z.ZodType< BrandColors, z.ZodTypeDef, unknown > = z.object({ dark: BrandColor$inboundSchema, light: BrandColor$inboundSchema, }); /** @internal */ export type BrandColors$Outbound = { dark: BrandColor$Outbound; light: BrandColor$Outbound; }; /** @internal */ export const BrandColors$outboundSchema: z.ZodType< BrandColors$Outbound, z.ZodTypeDef, BrandColors > = z.object({ dark: BrandColor$outboundSchema, light: BrandColor$outboundSchema, }); export function brandColorsToJSON(brandColors: BrandColors): string { return JSON.stringify(BrandColors$outboundSchema.parse(brandColors)); } export function brandColorsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BrandColors$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BrandColors' from JSON`, ); }