/*
 * 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";

/**
 * Schema for creating a metrics dashboard.
 */
export type MetricDashboardCreate = {
  /**
   * Display name for the dashboard.
   */
  name: string;
  /**
   * List of metric slugs to display in this dashboard.
   */
  metrics?: Array<string> | undefined;
  /**
   * The ID of the organization owning this dashboard. **Required unless you use an organization token.**
   */
  organizationId?: string | null | undefined;
};

/** @internal */
export type MetricDashboardCreate$Outbound = {
  name: string;
  metrics?: Array<string> | undefined;
  organization_id?: string | null | undefined;
};

/** @internal */
export const MetricDashboardCreate$outboundSchema: z.ZodMiniType<
  MetricDashboardCreate$Outbound,
  MetricDashboardCreate
> = z.pipe(
  z.object({
    name: z.string(),
    metrics: z.optional(z.array(z.string())),
    organizationId: z.optional(z.nullable(z.string())),
  }),
  z.transform((v) => {
    return remap$(v, {
      organizationId: "organization_id",
    });
  }),
);

export function metricDashboardCreateToJSON(
  metricDashboardCreate: MetricDashboardCreate,
): string {
  return JSON.stringify(
    MetricDashboardCreate$outboundSchema.parse(metricDashboardCreate),
  );
}
