/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CrmNotesUpdateGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type CrmNotesUpdateRequest = { /** * ID of the record you are acting upon. */ id: string; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ serviceId?: string | undefined; /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; note: components.NoteInput; }; export type CrmNotesUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Note updated */ updateNoteResponse?: components.UpdateNoteResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const CrmNotesUpdateGlobals$inboundSchema: z.ZodType< CrmNotesUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type CrmNotesUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const CrmNotesUpdateGlobals$outboundSchema: z.ZodType< CrmNotesUpdateGlobals$Outbound, z.ZodTypeDef, CrmNotesUpdateGlobals > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CrmNotesUpdateGlobals$ { /** @deprecated use `CrmNotesUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = CrmNotesUpdateGlobals$inboundSchema; /** @deprecated use `CrmNotesUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = CrmNotesUpdateGlobals$outboundSchema; /** @deprecated use `CrmNotesUpdateGlobals$Outbound` instead. */ export type Outbound = CrmNotesUpdateGlobals$Outbound; } export function crmNotesUpdateGlobalsToJSON( crmNotesUpdateGlobals: CrmNotesUpdateGlobals, ): string { return JSON.stringify( CrmNotesUpdateGlobals$outboundSchema.parse(crmNotesUpdateGlobals), ); } export function crmNotesUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmNotesUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmNotesUpdateGlobals' from JSON`, ); } /** @internal */ export const CrmNotesUpdateRequest$inboundSchema: z.ZodType< CrmNotesUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), Note: components.NoteInput$inboundSchema, }).transform((v) => { return remap$(v, { "Note": "note", }); }); /** @internal */ export type CrmNotesUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; Note: components.NoteInput$Outbound; }; /** @internal */ export const CrmNotesUpdateRequest$outboundSchema: z.ZodType< CrmNotesUpdateRequest$Outbound, z.ZodTypeDef, CrmNotesUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), note: components.NoteInput$outboundSchema, }).transform((v) => { return remap$(v, { note: "Note", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CrmNotesUpdateRequest$ { /** @deprecated use `CrmNotesUpdateRequest$inboundSchema` instead. */ export const inboundSchema = CrmNotesUpdateRequest$inboundSchema; /** @deprecated use `CrmNotesUpdateRequest$outboundSchema` instead. */ export const outboundSchema = CrmNotesUpdateRequest$outboundSchema; /** @deprecated use `CrmNotesUpdateRequest$Outbound` instead. */ export type Outbound = CrmNotesUpdateRequest$Outbound; } export function crmNotesUpdateRequestToJSON( crmNotesUpdateRequest: CrmNotesUpdateRequest, ): string { return JSON.stringify( CrmNotesUpdateRequest$outboundSchema.parse(crmNotesUpdateRequest), ); } export function crmNotesUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmNotesUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmNotesUpdateRequest' from JSON`, ); } /** @internal */ export const CrmNotesUpdateResponse$inboundSchema: z.ZodType< CrmNotesUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateNoteResponse: components.UpdateNoteResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateNoteResponse": "updateNoteResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type CrmNotesUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateNoteResponse?: components.UpdateNoteResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const CrmNotesUpdateResponse$outboundSchema: z.ZodType< CrmNotesUpdateResponse$Outbound, z.ZodTypeDef, CrmNotesUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateNoteResponse: components.UpdateNoteResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateNoteResponse: "UpdateNoteResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CrmNotesUpdateResponse$ { /** @deprecated use `CrmNotesUpdateResponse$inboundSchema` instead. */ export const inboundSchema = CrmNotesUpdateResponse$inboundSchema; /** @deprecated use `CrmNotesUpdateResponse$outboundSchema` instead. */ export const outboundSchema = CrmNotesUpdateResponse$outboundSchema; /** @deprecated use `CrmNotesUpdateResponse$Outbound` instead. */ export type Outbound = CrmNotesUpdateResponse$Outbound; } export function crmNotesUpdateResponseToJSON( crmNotesUpdateResponse: CrmNotesUpdateResponse, ): string { return JSON.stringify( CrmNotesUpdateResponse$outboundSchema.parse(crmNotesUpdateResponse), ); } export function crmNotesUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmNotesUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmNotesUpdateResponse' from JSON`, ); }