/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; /** * Workspace object with all metadata */ export type Workspace = { /** * Workspace unique identifier */ id: string; /** * Parent organization ID */ organizationId: string; /** * Workspace display name */ name: string; /** * URL-friendly identifier */ slug: string; /** * Workspace description */ description: string | null; /** * Whether this is the default workspace for the organization */ isDefault: boolean; /** * Whether the workspace is active */ isActive: boolean; /** * Workspace settings */ settings: { [k: string]: any } | null; /** * Arbitrary metadata */ metadata: { [k: string]: any } | null; /** * User ID of the creator */ createdBy: string | null; /** * Creation timestamp (ISO 8601) */ createdAt: Date; /** * Last update timestamp (ISO 8601) */ updatedAt: Date; }; /** @internal */ export const Workspace$inboundSchema: z.ZodMiniType = z .object({ id: types.string(), organizationId: types.string(), name: types.string(), slug: types.string(), description: types.nullable(types.string()), isDefault: types.boolean(), isActive: types.boolean(), settings: types.nullable(z.record(z.string(), z.any())), metadata: types.nullable(z.record(z.string(), z.any())), createdBy: types.nullable(types.string()), createdAt: types.date(), updatedAt: types.date(), }); export function workspaceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Workspace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Workspace' from JSON`, ); }