/* * 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"; import { PassThroughBody, PassThroughBody$inboundSchema, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; export type NoteInput = { /** * The title of the note */ title?: string | null | undefined; /** * The content of the note. */ content?: string | null | undefined; /** * The user that owns the note. */ ownerId?: string | null | undefined; /** * The contact that is related to the note. */ contactId?: string | null | undefined; /** * The company that is related to the note. */ companyId?: string | null | undefined; /** * The opportunity that is related to the note. */ opportunityId?: string | null | undefined; /** * The lead that is related to the note. */ leadId?: string | null | undefined; /** * Whether the Note is active or not. */ active?: boolean | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export const NoteInput$inboundSchema: z.ZodType< NoteInput, z.ZodTypeDef, unknown > = z.object({ title: z.nullable(z.string()).optional(), content: z.nullable(z.string()).optional(), owner_id: z.nullable(z.string()).optional(), contact_id: z.nullable(z.string()).optional(), company_id: z.nullable(z.string()).optional(), opportunity_id: z.nullable(z.string()).optional(), lead_id: z.nullable(z.string()).optional(), active: z.nullable(z.boolean()).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "owner_id": "ownerId", "contact_id": "contactId", "company_id": "companyId", "opportunity_id": "opportunityId", "lead_id": "leadId", "pass_through": "passThrough", }); }); /** @internal */ export type NoteInput$Outbound = { title?: string | null | undefined; content?: string | null | undefined; owner_id?: string | null | undefined; contact_id?: string | null | undefined; company_id?: string | null | undefined; opportunity_id?: string | null | undefined; lead_id?: string | null | undefined; active?: boolean | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export const NoteInput$outboundSchema: z.ZodType< NoteInput$Outbound, z.ZodTypeDef, NoteInput > = z.object({ title: z.nullable(z.string()).optional(), content: z.nullable(z.string()).optional(), ownerId: z.nullable(z.string()).optional(), contactId: z.nullable(z.string()).optional(), companyId: z.nullable(z.string()).optional(), opportunityId: z.nullable(z.string()).optional(), leadId: z.nullable(z.string()).optional(), active: z.nullable(z.boolean()).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { ownerId: "owner_id", contactId: "contact_id", companyId: "company_id", opportunityId: "opportunity_id", leadId: "lead_id", passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace NoteInput$ { /** @deprecated use `NoteInput$inboundSchema` instead. */ export const inboundSchema = NoteInput$inboundSchema; /** @deprecated use `NoteInput$outboundSchema` instead. */ export const outboundSchema = NoteInput$outboundSchema; /** @deprecated use `NoteInput$Outbound` instead. */ export type Outbound = NoteInput$Outbound; } export function noteInputToJSON(noteInput: NoteInput): string { return JSON.stringify(NoteInput$outboundSchema.parse(noteInput)); } export function noteInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NoteInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NoteInput' from JSON`, ); }