/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { lazySchema as lazySchema$ } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { SortDirection, SortDirection$outboundSchema, } from "./sortdirection.js"; /** * The field to sort by */ export const ProjectsSortSortBy = { Name: "name", Status: "status", StartDate: "start_date", EndDate: "end_date", BudgetAmount: "budget_amount", ActualAmount: "actual_amount", CreatedAt: "created_at", UpdatedAt: "updated_at", } as const; /** * The field to sort by */ export type ProjectsSortSortBy = OpenEnum; export type ProjectsSort = { /** * The field to sort by */ by?: ProjectsSortSortBy | undefined; /** * The direction in which to sort the results */ direction?: SortDirection | undefined; }; /** @internal */ export const ProjectsSortSortBy$outboundSchema: z.ZodType< string, z.ZodTypeDef, ProjectsSortSortBy > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(ProjectsSortSortBy) ); /** @internal */ export type ProjectsSort$Outbound = { by?: string | undefined; direction: string; }; /** @internal */ export const ProjectsSort$outboundSchema: z.ZodType< ProjectsSort$Outbound, z.ZodTypeDef, ProjectsSort > = /* @__PURE__ */ lazySchema$(() => z.object({ by: ProjectsSortSortBy$outboundSchema.optional(), direction: SortDirection$outboundSchema.default("asc"), }) ); export function projectsSortToJSON(projectsSort: ProjectsSort): string { return JSON.stringify(ProjectsSort$outboundSchema.parse(projectsSort)); }