/* * 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 { Currency, Currency$outboundSchema } from "./currency.js"; import { PassThroughBody, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; export type PipelineStages = { /** * The name of the Pipeline Stage. */ name?: string | null | undefined; /** * The value of the Pipeline Stage. */ value?: string | null | undefined; /** * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. */ winProbability?: number | null | undefined; /** * The order in which the Pipeline Stage is displayed in the UI. */ displayOrder?: number | null | undefined; /** * Whether the Pipeline Stage is archived or not. */ archived?: boolean | null | undefined; }; export type PipelineInput = { /** * The unique identifier of the Pipeline. */ id?: string | undefined; /** * The name of the Pipeline. */ name: string; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * Whether the Pipeline is archived or not. */ archived?: boolean | undefined; /** * Whether the Pipeline is active or not. */ active?: boolean | undefined; /** * The order in which the Pipeline is displayed in the UI. */ displayOrder?: number | null | undefined; /** * Whether the Pipeline has win probability enabled or not. */ winProbabilityEnabled?: boolean | undefined; /** * The Pipeline Stages. */ stages?: Array | 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 type PipelineStages$Outbound = { name?: string | null | undefined; value?: string | null | undefined; win_probability?: number | null | undefined; display_order?: number | null | undefined; archived?: boolean | null | undefined; }; /** @internal */ export const PipelineStages$outboundSchema: z.ZodType< PipelineStages$Outbound, z.ZodTypeDef, PipelineStages > = /* @__PURE__ */ lazySchema$(() => z.object({ name: z.nullable(z.string()).optional(), value: z.nullable(z.string()).optional(), winProbability: z.nullable(z.number().int()).optional(), displayOrder: z.nullable(z.number().int()).optional(), archived: z.nullable(z.boolean()).optional(), }).transform((v) => { return remap$(v, { winProbability: "win_probability", displayOrder: "display_order", }); }) ); export function pipelineStagesToJSON(pipelineStages: PipelineStages): string { return JSON.stringify(PipelineStages$outboundSchema.parse(pipelineStages)); } /** @internal */ export type PipelineInput$Outbound = { id?: string | undefined; name: string; currency?: string | null | undefined; archived?: boolean | undefined; active?: boolean | undefined; display_order?: number | null | undefined; win_probability_enabled?: boolean | undefined; stages?: Array | undefined; pass_through?: Array | undefined; }; /** @internal */ export const PipelineInput$outboundSchema: z.ZodType< PipelineInput$Outbound, z.ZodTypeDef, PipelineInput > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.string().optional(), name: z.string(), currency: z.nullable(Currency$outboundSchema).optional(), archived: z.boolean().optional(), active: z.boolean().optional(), displayOrder: z.nullable(z.number().int()).optional(), winProbabilityEnabled: z.boolean().optional(), stages: z.array(z.lazy(() => PipelineStages$outboundSchema)).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { displayOrder: "display_order", winProbabilityEnabled: "win_probability_enabled", passThrough: "pass_through", }); }) ); export function pipelineInputToJSON(pipelineInput: PipelineInput): string { return JSON.stringify(PipelineInput$outboundSchema.parse(pipelineInput)); }