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