/* * 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 Opportunities */ export const OpportunitiesSortBy = { CreatedAt: "created_at", UpdatedAt: "updated_at", Title: "title", WinProbability: "win_probability", MonetaryAmount: "monetary_amount", Status: "status", } as const; /** * The field on which to sort the Opportunities */ export type OpportunitiesSortBy = OpenEnum; export type OpportunitiesSort = { /** * The field on which to sort the Opportunities */ by?: OpportunitiesSortBy | undefined; /** * The direction in which to sort the results */ direction?: SortDirection | undefined; }; /** @internal */ export const OpportunitiesSortBy$outboundSchema: z.ZodType< string, z.ZodTypeDef, OpportunitiesSortBy > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(OpportunitiesSortBy) ); /** @internal */ export type OpportunitiesSort$Outbound = { by?: string | undefined; direction: string; }; /** @internal */ export const OpportunitiesSort$outboundSchema: z.ZodType< OpportunitiesSort$Outbound, z.ZodTypeDef, OpportunitiesSort > = /* @__PURE__ */ lazySchema$(() => z.object({ by: OpportunitiesSortBy$outboundSchema.optional(), direction: SortDirection$outboundSchema.default("asc"), }) ); export function opportunitiesSortToJSON( opportunitiesSort: OpportunitiesSort, ): string { return JSON.stringify( OpportunitiesSort$outboundSchema.parse(opportunitiesSort), ); }