/* * 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$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PassThroughBody, PassThroughBody$inboundSchema, } from "./passthroughbody.js"; export type Note = { /** * The unique identifier of the note */ id?: string | undefined; /** * 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 activity that is related to the note. */ activityId?: 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; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: { [k: string]: any } | null | undefined; /** * The user that last updated the note. */ updatedBy?: string | null | undefined; /** * The user that created the note. */ createdBy?: string | null | undefined; /** * The timestamp when the note was last updated */ updatedAt?: string | null | undefined; /** * The timestamp when the note was created */ createdAt?: string | 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 Note$inboundSchema: z.ZodType = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), title: z.nullable(types.string()).optional(), content: z.nullable(types.string()).optional(), owner_id: z.nullable(types.string()).optional(), contact_id: z.nullable(types.string()).optional(), company_id: z.nullable(types.string()).optional(), opportunity_id: z.nullable(types.string()).optional(), activity_id: z.nullable(types.string()).optional(), lead_id: z.nullable(types.string()).optional(), active: z.nullable(types.boolean()).optional(), custom_mappings: z.nullable(z.record(z.any())).optional(), updated_by: z.nullable(types.string()).optional(), created_by: z.nullable(types.string()).optional(), updated_at: z.nullable(types.string()).optional(), created_at: z.nullable(types.string()).optional(), pass_through: types.optional(z.array(PassThroughBody$inboundSchema)), }).transform((v) => { return remap$(v, { "owner_id": "ownerId", "contact_id": "contactId", "company_id": "companyId", "opportunity_id": "opportunityId", "activity_id": "activityId", "lead_id": "leadId", "custom_mappings": "customMappings", "updated_by": "updatedBy", "created_by": "createdBy", "updated_at": "updatedAt", "created_at": "createdAt", "pass_through": "passThrough", }); }) ); export function noteFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Note$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Note' from JSON`, ); }