/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const Type = { Default: "default", Mega: "mega", } as const; export type Type = ClosedEnum; /** * The access level of the folder within the workspace. */ export const AccessLevel = { Write: "write", Read: "read", } as const; /** * The access level of the folder within the workspace. */ export type AccessLevel = ClosedEnum; export type FolderSchema = { /** * The unique ID of the folder. */ id: string; /** * The name of the folder. */ name: string; /** * The description of the folder. */ description: string | null; type: Type; /** * The access level of the folder within the workspace. */ accessLevel: AccessLevel | null; /** * The date the folder was created. */ createdAt: string; /** * The date the folder was updated. */ updatedAt: string; }; /** @internal */ export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum( Type, ); /** @internal */ export const AccessLevel$inboundSchema: z.ZodNativeEnum = z .nativeEnum(AccessLevel); /** @internal */ export const FolderSchema$inboundSchema: z.ZodType< FolderSchema, z.ZodTypeDef, unknown > = z.object({ id: z.string(), name: z.string(), description: z.nullable(z.string()), type: Type$inboundSchema, accessLevel: z.nullable(AccessLevel$inboundSchema).default(null), createdAt: z.string(), updatedAt: z.string(), }); export function folderSchemaFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FolderSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FolderSchema' from JSON`, ); }