/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; 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"; /** * A user-defined metrics dashboard. */ export type MetricDashboardSchema = { /** * Creation timestamp of the object. */ createdAt: Date; /** * Last modification timestamp of the object. */ modifiedAt: Date | null; /** * The ID of the object. */ id: string; /** * Display name for the dashboard. */ name: string; /** * List of metric slugs displayed in this dashboard. */ metrics: Array; /** * The ID of the organization owning this dashboard. */ organizationId: string; }; /** @internal */ export const MetricDashboardSchema$inboundSchema: z.ZodMiniType< MetricDashboardSchema, unknown > = z.pipe( z.object({ created_at: z.pipe( z.iso.datetime({ offset: true }), z.transform(v => new Date(v)), ), modified_at: z.nullable( z.pipe(z.iso.datetime({ offset: true }), z.transform(v => new Date(v))), ), id: z.string(), name: z.string(), metrics: z.array(z.string()), organization_id: z.string(), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "modified_at": "modifiedAt", "organization_id": "organizationId", }); }), ); export function metricDashboardSchemaFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MetricDashboardSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetricDashboardSchema' from JSON`, ); }