/* * 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 on which to sort the Companies */ export const CompaniesSortBy = { CreatedAt: "created_at", UpdatedAt: "updated_at", Name: "name", } as const; /** * The field on which to sort the Companies */ export type CompaniesSortBy = OpenEnum; export type CompaniesSort = { /** * The field on which to sort the Companies */ by?: CompaniesSortBy | undefined; /** * The direction in which to sort the results */ direction?: SortDirection | undefined; }; /** @internal */ export const CompaniesSortBy$outboundSchema: z.ZodType< string, z.ZodTypeDef, CompaniesSortBy > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(CompaniesSortBy) ); /** @internal */ export type CompaniesSort$Outbound = { by?: string | undefined; direction: string; }; /** @internal */ export const CompaniesSort$outboundSchema: z.ZodType< CompaniesSort$Outbound, z.ZodTypeDef, CompaniesSort > = /* @__PURE__ */ lazySchema$(() => z.object({ by: CompaniesSortBy$outboundSchema.optional(), direction: SortDirection$outboundSchema.default("asc"), }) ); export function companiesSortToJSON(companiesSort: CompaniesSort): string { return JSON.stringify(CompaniesSort$outboundSchema.parse(companiesSort)); }