/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type UiConfigResource = { id?: number | undefined; firstDayOfWeek?: number | undefined; calendarWeekColumnHeader?: string | null | undefined; shortDateFormat?: string | null | undefined; longDateFormat?: string | null | undefined; timeFormat?: string | null | undefined; showRelativeDates?: boolean | undefined; enableColorImpairedMode?: boolean | undefined; uiLanguage?: string | null | undefined; theme?: string | null | undefined; }; /** @internal */ export const UiConfigResource$inboundSchema: z.ZodType< UiConfigResource, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), firstDayOfWeek: z.number().int().optional(), calendarWeekColumnHeader: z.nullable(z.string()).optional(), shortDateFormat: z.nullable(z.string()).optional(), longDateFormat: z.nullable(z.string()).optional(), timeFormat: z.nullable(z.string()).optional(), showRelativeDates: z.boolean().optional(), enableColorImpairedMode: z.boolean().optional(), uiLanguage: z.nullable(z.string()).optional(), theme: z.nullable(z.string()).optional(), }); /** @internal */ export type UiConfigResource$Outbound = { id?: number | undefined; firstDayOfWeek?: number | undefined; calendarWeekColumnHeader?: string | null | undefined; shortDateFormat?: string | null | undefined; longDateFormat?: string | null | undefined; timeFormat?: string | null | undefined; showRelativeDates?: boolean | undefined; enableColorImpairedMode?: boolean | undefined; uiLanguage?: string | null | undefined; theme?: string | null | undefined; }; /** @internal */ export const UiConfigResource$outboundSchema: z.ZodType< UiConfigResource$Outbound, z.ZodTypeDef, UiConfigResource > = z.object({ id: z.number().int().optional(), firstDayOfWeek: z.number().int().optional(), calendarWeekColumnHeader: z.nullable(z.string()).optional(), shortDateFormat: z.nullable(z.string()).optional(), longDateFormat: z.nullable(z.string()).optional(), timeFormat: z.nullable(z.string()).optional(), showRelativeDates: z.boolean().optional(), enableColorImpairedMode: z.boolean().optional(), uiLanguage: z.nullable(z.string()).optional(), theme: z.nullable(z.string()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UiConfigResource$ { /** @deprecated use `UiConfigResource$inboundSchema` instead. */ export const inboundSchema = UiConfigResource$inboundSchema; /** @deprecated use `UiConfigResource$outboundSchema` instead. */ export const outboundSchema = UiConfigResource$outboundSchema; /** @deprecated use `UiConfigResource$Outbound` instead. */ export type Outbound = UiConfigResource$Outbound; } export function uiConfigResourceToJSON( uiConfigResource: UiConfigResource, ): string { return JSON.stringify( UiConfigResource$outboundSchema.parse(uiConfigResource), ); } export function uiConfigResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UiConfigResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UiConfigResource' from JSON`, ); }