/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$ } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; /** * Status of projects to filter by */ export const ProjectStatus = { Active: "active", Completed: "completed", OnHold: "on_hold", Cancelled: "cancelled", Draft: "draft", InProgress: "in_progress", Approved: "approved", Other: "other", } as const; /** * Status of projects to filter by */ export type ProjectStatus = OpenEnum; export type ProjectsFilter = { /** * Name of project to search for */ name?: string | undefined; /** * Status of projects to filter by */ status?: ProjectStatus | undefined; /** * Filter projects by customer ID */ customerId?: string | undefined; /** * Return projects modified after this date */ updatedSince?: Date | undefined; /** * Filter by the subsidiary (legal entity) the record belongs to. Only honored on connectors that support multi-entity scoping (e.g. NetSuite OneWorld); ignored elsewhere. */ subsidiaryId?: string | undefined; }; /** @internal */ export const ProjectStatus$outboundSchema: z.ZodType< string, z.ZodTypeDef, ProjectStatus > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(ProjectStatus)); /** @internal */ export type ProjectsFilter$Outbound = { name?: string | undefined; status?: string | undefined; customer_id?: string | undefined; updated_since?: string | undefined; subsidiary_id?: string | undefined; }; /** @internal */ export const ProjectsFilter$outboundSchema: z.ZodType< ProjectsFilter$Outbound, z.ZodTypeDef, ProjectsFilter > = /* @__PURE__ */ lazySchema$(() => z.object({ name: z.string().optional(), status: ProjectStatus$outboundSchema.optional(), customerId: z.string().optional(), updatedSince: z.date().transform(v => v.toISOString()).optional(), subsidiaryId: z.string().optional(), }).transform((v) => { return remap$(v, { customerId: "customer_id", updatedSince: "updated_since", subsidiaryId: "subsidiary_id", }); }) ); export function projectsFilterToJSON(projectsFilter: ProjectsFilter): string { return JSON.stringify(ProjectsFilter$outboundSchema.parse(projectsFilter)); }