/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ActivitiesFilter = { /** * Company ID to filter on */ companyId?: string | undefined; /** * Owner ID to filter on */ ownerId?: string | undefined; /** * Primary contact ID to filter on */ contactId?: string | undefined; updatedSince?: Date | undefined; /** * Type to filter on */ type?: string | undefined; }; /** @internal */ export const ActivitiesFilter$inboundSchema: z.ZodType< ActivitiesFilter, z.ZodTypeDef, unknown > = z.object({ company_id: z.string().optional(), owner_id: z.string().optional(), contact_id: z.string().optional(), updated_since: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), type: z.string().optional(), }).transform((v) => { return remap$(v, { "company_id": "companyId", "owner_id": "ownerId", "contact_id": "contactId", "updated_since": "updatedSince", }); }); /** @internal */ export type ActivitiesFilter$Outbound = { company_id?: string | undefined; owner_id?: string | undefined; contact_id?: string | undefined; updated_since?: string | undefined; type?: string | undefined; }; /** @internal */ export const ActivitiesFilter$outboundSchema: z.ZodType< ActivitiesFilter$Outbound, z.ZodTypeDef, ActivitiesFilter > = z.object({ companyId: z.string().optional(), ownerId: z.string().optional(), contactId: z.string().optional(), updatedSince: z.date().transform(v => v.toISOString()).optional(), type: z.string().optional(), }).transform((v) => { return remap$(v, { companyId: "company_id", ownerId: "owner_id", contactId: "contact_id", updatedSince: "updated_since", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ActivitiesFilter$ { /** @deprecated use `ActivitiesFilter$inboundSchema` instead. */ export const inboundSchema = ActivitiesFilter$inboundSchema; /** @deprecated use `ActivitiesFilter$outboundSchema` instead. */ export const outboundSchema = ActivitiesFilter$outboundSchema; /** @deprecated use `ActivitiesFilter$Outbound` instead. */ export type Outbound = ActivitiesFilter$Outbound; } export function activitiesFilterToJSON( activitiesFilter: ActivitiesFilter, ): string { return JSON.stringify( ActivitiesFilter$outboundSchema.parse(activitiesFilter), ); } export function activitiesFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ActivitiesFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActivitiesFilter' from JSON`, ); }