From 3282e5cba52a50fb9d202c1ae16a34190b3d0917 Mon Sep 17 00:00:00 2001 From: pipedrive-bot Date: Tue, 18 Mar 2025 12:14:33 +0000 Subject: [PATCH] Build 173 - version-minor --- CHANGELOG.md | 11 + docs/v2.md | 35 - src/versions/v1/api/subscriptions-api.ts | 72 +- src/versions/v1/api/webhooks-api.ts | 8 +- src/versions/v1/models/add-webhook-request.ts | 11 +- src/versions/v2/api/beta-api.ts | 5094 +---------------- 6 files changed, 284 insertions(+), 4947 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74e4c2ed..dd2b3249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ The file format of it is based on [Keep a Changelog](http://keepachangelog.com/e For public Changelog covering all changes done to Pipedrive’s API, webhooks and app extensions platforms, see [public Changelog](https://pipedrive.readme.io/docs/changelog) with discussion area in [Developers Community](https://devcommunity.pipedrive.com/c/documentation/changelog/19). ## [Unreleased] +### Added +- Notice informing the users of the upcoming Subscriptions API deprecation: + - `GET /v1/subscriptions/{id}` + - `GET /v1/subscriptions/find/{dealId}` + - `GET /v1/subscriptions/{id}/payments` + - `POST /v1/subscriptions/recurring` + - `POST /v1/subscriptions/installment` + - `PUT /v1/subscriptions/recurring/{id}` + - `PUT /v1/subscriptions/installment/{id}` + - `PUT /v1/subscriptions/recurring/{id}/cancel` + - `DELETE /v1/subscriptions/{id}` ## [24.2.0] - 2025-03-12 ### Added diff --git a/docs/v2.md b/docs/v2.md index c50383d6..b20562a5 100644 --- a/docs/v2.md +++ b/docs/v2.md @@ -9,45 +9,10 @@ ActivitiesApi | deleteActivity | **DELETE** /activities/{id} | Delete an activit ActivitiesApi | getActivities | **GET** /activities | Get all activities ActivitiesApi | getActivity | **GET** /activities/{id} | Get details of an activity ActivitiesApi | updateActivity | **PATCH** /activities/{id} | Update an activity -BetaApi | addActivity | **POST** /activities | Add a new activity -BetaApi | addDeal | **POST** /deals | Add a new deal -BetaApi | addDealProduct | **POST** /deals/{id}/products | Add a product to a deal -BetaApi | addOrganization | **POST** /organizations | Add a new organization -BetaApi | addPerson | **POST** /persons | Add a new person -BetaApi | deleteActivity | **DELETE** /activities/{id} | Delete an activity -BetaApi | deleteAdditionalDiscount | **DELETE** /deals/{id}/discounts/{discount_id} | Delete a discount from a deal -BetaApi | deleteDeal | **DELETE** /deals/{id} | Delete a deal -BetaApi | deleteDealProduct | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal BetaApi | deleteInstallment | **DELETE** /deals/{id}/installments/{installment_id} | Delete an installment from a deal -BetaApi | deleteOrganization | **DELETE** /organizations/{id} | Delete a organization -BetaApi | deletePerson | **DELETE** /persons/{id} | Delete a person -BetaApi | getActivities | **GET** /activities | Get all activities -BetaApi | getActivity | **GET** /activities/{id} | Get details of an activity -BetaApi | getAdditionalDiscounts | **GET** /deals/{id}/discounts | List discounts added to a deal -BetaApi | getDeal | **GET** /deals/{id} | Get details of a deal -BetaApi | getDealProducts | **GET** /deals/{id}/products | List products attached to a deal -BetaApi | getDeals | **GET** /deals | Get all deals -BetaApi | getDealsProducts | **GET** /deals/products | Get deal products of several deals BetaApi | getInstallments | **GET** /deals/installments | List installments added to a list of deals -BetaApi | getOrganization | **GET** /organizations/{id} | Get details of a organization -BetaApi | getOrganizations | **GET** /organizations | Get all organizations -BetaApi | getPerson | **GET** /persons/{id} | Get details of a person -BetaApi | getPersons | **GET** /persons | Get all persons -BetaApi | postAdditionalDiscount | **POST** /deals/{id}/discounts | Add a discount to a deal BetaApi | postInstallment | **POST** /deals/{id}/installments | Add an installment to a deal -BetaApi | searchDeals | **GET** /deals/search | Search deals -BetaApi | searchItem | **GET** /itemSearch | Perform a search from multiple item types -BetaApi | searchItemByField | **GET** /itemSearch/field | Perform a search using a specific field from an item type -BetaApi | searchLeads | **GET** /leads/search | Search leads -BetaApi | searchOrganization | **GET** /organizations/search | Search organizations -BetaApi | searchPersons | **GET** /persons/search | Search persons -BetaApi | updateActivity | **PATCH** /activities/{id} | Update an activity -BetaApi | updateAdditionalDiscount | **PATCH** /deals/{id}/discounts/{discount_id} | Update a discount added to a deal -BetaApi | updateDeal | **PATCH** /deals/{id} | Update a deal -BetaApi | updateDealProduct | **PATCH** /deals/{id}/products/{product_attachment_id} | Update the product attached to a deal BetaApi | updateInstallment | **PATCH** /deals/{id}/installments/{installment_id} | Update an installment added to a deal -BetaApi | updateOrganization | **PATCH** /organizations/{id} | Update a organization -BetaApi | updatePerson | **PATCH** /persons/{id} | Update a person DealsApi | addDeal | **POST** /deals | Add a new deal DealsApi | addDealProduct | **POST** /deals/{id}/products | Add a product to a deal DealsApi | deleteAdditionalDiscount | **DELETE** /deals/{id}/discounts/{discount_id} | Delete a discount from a deal diff --git a/src/versions/v1/api/subscriptions-api.ts b/src/versions/v1/api/subscriptions-api.ts index 8d5ec4fb..b11375e7 100644 --- a/src/versions/v1/api/subscriptions-api.ts +++ b/src/versions/v1/api/subscriptions-api.ts @@ -45,7 +45,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * Adds a new recurring subscription. * @summary Add a recurring subscription * @param {AddRecurringSubscriptionRequest} [AddRecurringSubscriptionRequest] - + * @deprecated * @throws {RequiredError} */ addRecurringSubscription: async (AddRecurringSubscriptionRequest?: AddRecurringSubscriptionRequest, ): Promise => { @@ -86,7 +86,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * Adds a new installment subscription. * @summary Add an installment subscription * @param {AddSubscriptionInstallmentRequest} [AddSubscriptionInstallmentRequest] - + * @deprecated * @throws {RequiredError} */ addSubscriptionInstallment: async (AddSubscriptionInstallmentRequest?: AddSubscriptionInstallmentRequest, ): Promise => { @@ -128,7 +128,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * @summary Cancel a recurring subscription * @param {number} id The ID of the subscription * @param {CancelRecurringSubscriptionRequest} [CancelRecurringSubscriptionRequest] - + * @deprecated * @throws {RequiredError} */ cancelRecurringSubscription: async (id: number, CancelRecurringSubscriptionRequest?: CancelRecurringSubscriptionRequest, ): Promise => { @@ -172,7 +172,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * Marks an installment or a recurring subscription as deleted. * @summary Delete a subscription * @param {number} id The ID of the subscription - + * @deprecated * @throws {RequiredError} */ deleteSubscription: async (id: number, ): Promise => { @@ -213,7 +213,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * Returns details of an installment or a recurring subscription by the deal ID. * @summary Find subscription by deal * @param {number} dealId The ID of the deal - + * @deprecated * @throws {RequiredError} */ findSubscriptionByDeal: async (dealId: number, ): Promise => { @@ -254,7 +254,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * Returns details of an installment or a recurring subscription. * @summary Get details of a subscription * @param {number} id The ID of the subscription - + * @deprecated * @throws {RequiredError} */ getSubscription: async (id: number, ): Promise => { @@ -295,7 +295,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * Returns all payments of an installment or recurring subscription. * @summary Get all payments of a subscription * @param {number} id The ID of the subscription - + * @deprecated * @throws {RequiredError} */ getSubscriptionPayments: async (id: number, ): Promise => { @@ -337,7 +337,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * @summary Update a recurring subscription * @param {number} id The ID of the subscription * @param {UpdateRecurringSubscriptionRequest} [UpdateRecurringSubscriptionRequest] - + * @deprecated * @throws {RequiredError} */ updateRecurringSubscription: async (id: number, UpdateRecurringSubscriptionRequest?: UpdateRecurringSubscriptionRequest, ): Promise => { @@ -382,7 +382,7 @@ export const SubscriptionsApiAxiosParamCreator = function (configuration?: Confi * @summary Update an installment subscription * @param {number} id The ID of the subscription * @param {UpdateSubscriptionInstallmentRequest} [UpdateSubscriptionInstallmentRequest] - + * @deprecated * @throws {RequiredError} */ updateSubscriptionInstallment: async (id: number, UpdateSubscriptionInstallmentRequest?: UpdateSubscriptionInstallmentRequest, ): Promise => { @@ -437,7 +437,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * Adds a new recurring subscription. * @summary Add a recurring subscription * @param {AddRecurringSubscriptionRequest} [AddRecurringSubscriptionRequest] - + * @deprecated * @throws {RequiredError} */ async addRecurringSubscription(AddRecurringSubscriptionRequest?: AddRecurringSubscriptionRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -448,7 +448,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * Adds a new installment subscription. * @summary Add an installment subscription * @param {AddSubscriptionInstallmentRequest} [AddSubscriptionInstallmentRequest] - + * @deprecated * @throws {RequiredError} */ async addSubscriptionInstallment(AddSubscriptionInstallmentRequest?: AddSubscriptionInstallmentRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -460,7 +460,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * @summary Cancel a recurring subscription * @param {number} id The ID of the subscription * @param {CancelRecurringSubscriptionRequest} [CancelRecurringSubscriptionRequest] - + * @deprecated * @throws {RequiredError} */ async cancelRecurringSubscription(id: number, CancelRecurringSubscriptionRequest?: CancelRecurringSubscriptionRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -471,7 +471,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * Marks an installment or a recurring subscription as deleted. * @summary Delete a subscription * @param {number} id The ID of the subscription - + * @deprecated * @throws {RequiredError} */ async deleteSubscription(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -482,7 +482,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * Returns details of an installment or a recurring subscription by the deal ID. * @summary Find subscription by deal * @param {number} dealId The ID of the deal - + * @deprecated * @throws {RequiredError} */ async findSubscriptionByDeal(dealId: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -493,7 +493,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * Returns details of an installment or a recurring subscription. * @summary Get details of a subscription * @param {number} id The ID of the subscription - + * @deprecated * @throws {RequiredError} */ async getSubscription(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -504,7 +504,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * Returns all payments of an installment or recurring subscription. * @summary Get all payments of a subscription * @param {number} id The ID of the subscription - + * @deprecated * @throws {RequiredError} */ async getSubscriptionPayments(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -516,7 +516,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * @summary Update a recurring subscription * @param {number} id The ID of the subscription * @param {UpdateRecurringSubscriptionRequest} [UpdateRecurringSubscriptionRequest] - + * @deprecated * @throws {RequiredError} */ async updateRecurringSubscription(id: number, UpdateRecurringSubscriptionRequest?: UpdateRecurringSubscriptionRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -528,7 +528,7 @@ export const SubscriptionsApiFp = function(configuration?: Configuration) { * @summary Update an installment subscription * @param {number} id The ID of the subscription * @param {UpdateSubscriptionInstallmentRequest} [UpdateSubscriptionInstallmentRequest] - + * @deprecated * @throws {RequiredError} */ async updateSubscriptionInstallment(id: number, UpdateSubscriptionInstallmentRequest?: UpdateSubscriptionInstallmentRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { @@ -549,7 +549,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Adds a new recurring subscription. * @summary Add a recurring subscription * @param {SubscriptionsApiAddRecurringSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ addRecurringSubscription(requestParameters: SubscriptionsApiAddRecurringSubscriptionRequest = {}, ): Promise { @@ -559,7 +559,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Adds a new installment subscription. * @summary Add an installment subscription * @param {SubscriptionsApiAddSubscriptionInstallmentRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ addSubscriptionInstallment(requestParameters: SubscriptionsApiAddSubscriptionInstallmentRequest = {}, ): Promise { @@ -569,7 +569,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Cancels a recurring subscription. * @summary Cancel a recurring subscription * @param {SubscriptionsApiCancelRecurringSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ cancelRecurringSubscription(requestParameters: SubscriptionsApiCancelRecurringSubscriptionRequest, ): Promise { @@ -579,7 +579,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Marks an installment or a recurring subscription as deleted. * @summary Delete a subscription * @param {SubscriptionsApiDeleteSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ deleteSubscription(requestParameters: SubscriptionsApiDeleteSubscriptionRequest, ): Promise { @@ -589,7 +589,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Returns details of an installment or a recurring subscription by the deal ID. * @summary Find subscription by deal * @param {SubscriptionsApiFindSubscriptionByDealRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ findSubscriptionByDeal(requestParameters: SubscriptionsApiFindSubscriptionByDealRequest, ): Promise { @@ -599,7 +599,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Returns details of an installment or a recurring subscription. * @summary Get details of a subscription * @param {SubscriptionsApiGetSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ getSubscription(requestParameters: SubscriptionsApiGetSubscriptionRequest, ): Promise { @@ -609,7 +609,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Returns all payments of an installment or recurring subscription. * @summary Get all payments of a subscription * @param {SubscriptionsApiGetSubscriptionPaymentsRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ getSubscriptionPayments(requestParameters: SubscriptionsApiGetSubscriptionPaymentsRequest, ): Promise { @@ -619,7 +619,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Updates a recurring subscription. * @summary Update a recurring subscription * @param {SubscriptionsApiUpdateRecurringSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ updateRecurringSubscription(requestParameters: SubscriptionsApiUpdateRecurringSubscriptionRequest, ): Promise { @@ -629,7 +629,7 @@ export const SubscriptionsApiFactory = function (configuration?: Configuration, * Updates an installment subscription. * @summary Update an installment subscription * @param {SubscriptionsApiUpdateSubscriptionInstallmentRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} */ updateSubscriptionInstallment(requestParameters: SubscriptionsApiUpdateSubscriptionInstallmentRequest, ): Promise { @@ -796,7 +796,7 @@ export class SubscriptionsApi extends BaseAPI { * Adds a new recurring subscription. * @summary Add a recurring subscription * @param {SubscriptionsApiAddRecurringSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ @@ -808,7 +808,7 @@ export class SubscriptionsApi extends BaseAPI { * Adds a new installment subscription. * @summary Add an installment subscription * @param {SubscriptionsApiAddSubscriptionInstallmentRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ @@ -820,7 +820,7 @@ export class SubscriptionsApi extends BaseAPI { * Cancels a recurring subscription. * @summary Cancel a recurring subscription * @param {SubscriptionsApiCancelRecurringSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ @@ -832,7 +832,7 @@ export class SubscriptionsApi extends BaseAPI { * Marks an installment or a recurring subscription as deleted. * @summary Delete a subscription * @param {SubscriptionsApiDeleteSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ @@ -844,7 +844,7 @@ export class SubscriptionsApi extends BaseAPI { * Returns details of an installment or a recurring subscription by the deal ID. * @summary Find subscription by deal * @param {SubscriptionsApiFindSubscriptionByDealRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ @@ -856,7 +856,7 @@ export class SubscriptionsApi extends BaseAPI { * Returns details of an installment or a recurring subscription. * @summary Get details of a subscription * @param {SubscriptionsApiGetSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ @@ -868,7 +868,7 @@ export class SubscriptionsApi extends BaseAPI { * Returns all payments of an installment or recurring subscription. * @summary Get all payments of a subscription * @param {SubscriptionsApiGetSubscriptionPaymentsRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ @@ -880,7 +880,7 @@ export class SubscriptionsApi extends BaseAPI { * Updates a recurring subscription. * @summary Update a recurring subscription * @param {SubscriptionsApiUpdateRecurringSubscriptionRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ @@ -892,7 +892,7 @@ export class SubscriptionsApi extends BaseAPI { * Updates an installment subscription. * @summary Update an installment subscription * @param {SubscriptionsApiUpdateSubscriptionInstallmentRequest} requestParameters Request parameters. - + * @deprecated * @throws {RequiredError} * @memberof SubscriptionsApi */ diff --git a/src/versions/v1/api/webhooks-api.ts b/src/versions/v1/api/webhooks-api.ts index d8a98c65..edea8e28 100644 --- a/src/versions/v1/api/webhooks-api.ts +++ b/src/versions/v1/api/webhooks-api.ts @@ -42,7 +42,7 @@ import { WebhooksBadRequestResponse } from '../models'; export const WebhooksApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `added.deal` for any newly added deals, `deleted.persons` for any deleted persons, etc. See the guide for Webhooks for more details. + * Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `create.deal` for any newly added deals, `delete.persons` for any deleted persons, etc. See the guide for Webhooks for more details. * @summary Create a new Webhook * @param {AddWebhookRequest} [AddWebhookRequest] @@ -172,7 +172,7 @@ export const WebhooksApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = WebhooksApiAxiosParamCreator(configuration) return { /** - * Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `added.deal` for any newly added deals, `deleted.persons` for any deleted persons, etc. See the guide for Webhooks for more details. + * Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `create.deal` for any newly added deals, `delete.persons` for any deleted persons, etc. See the guide for Webhooks for more details. * @summary Create a new Webhook * @param {AddWebhookRequest} [AddWebhookRequest] @@ -214,7 +214,7 @@ export const WebhooksApiFactory = function (configuration?: Configuration, baseP const localVarFp = WebhooksApiFp(configuration) return { /** - * Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `added.deal` for any newly added deals, `deleted.persons` for any deleted persons, etc. See the guide for Webhooks for more details. + * Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `create.deal` for any newly added deals, `delete.persons` for any deleted persons, etc. See the guide for Webhooks for more details. * @summary Create a new Webhook * @param {WebhooksApiAddWebhookRequest} requestParameters Request parameters. @@ -281,7 +281,7 @@ export interface WebhooksApiDeleteWebhookRequest { */ export class WebhooksApi extends BaseAPI { /** - * Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `added.deal` for any newly added deals, `deleted.persons` for any deleted persons, etc. See the guide for Webhooks for more details. + * Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `create.deal` for any newly added deals, `delete.persons` for any deleted persons, etc. See the guide for Webhooks for more details. * @summary Create a new Webhook * @param {WebhooksApiAddWebhookRequest} requestParameters Request parameters. diff --git a/src/versions/v1/models/add-webhook-request.ts b/src/versions/v1/models/add-webhook-request.ts index 05629e05..9b270aed 100644 --- a/src/versions/v1/models/add-webhook-request.ts +++ b/src/versions/v1/models/add-webhook-request.ts @@ -51,25 +51,24 @@ export interface AddWebhookRequest { */ 'http_auth_password'?: string; /** - * The webhook\'s version. NB! Webhooks v2 will become the default from March 17th, 2025. See this Changelog post for more details. + * The webhook\'s version. NB! Webhooks v2 is the default from March 17th, 2025. See this Changelog post for more details. * @type {string} */ 'version'?: AddWebhookRequestVersionConst; } export const AddWebhookRequestEventActionConst = { - added: 'added', - updated: 'updated', - merged: 'merged', - deleted: 'deleted', + create: 'create', + change: 'change', + delete: 'delete', Star: '*' } as const; export type AddWebhookRequestEventActionConst = typeof AddWebhookRequestEventActionConst[keyof typeof AddWebhookRequestEventActionConst]; export const AddWebhookRequestEventObjectConst = { activity: 'activity', - activityType: 'activityType', deal: 'deal', + lead: 'lead', note: 'note', organization: 'organization', person: 'person', diff --git a/src/versions/v2/api/beta-api.ts b/src/versions/v2/api/beta-api.ts index fcacc30a..8f00b98e 100644 --- a/src/versions/v2/api/beta-api.ts +++ b/src/versions/v2/api/beta-api.ts @@ -24,87 +24,15 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr // @ts-ignore import { AddAInstallmentResponse } from '../models'; // @ts-ignore -import { AddActivityRequest } from '../models'; -// @ts-ignore -import { AddAdditionalDiscountRequestBody } from '../models'; -// @ts-ignore -import { AddAdditionalDiscountResponse } from '../models'; -// @ts-ignore -import { AddDealProductRequest } from '../models'; -// @ts-ignore -import { AddDealProductResponse } from '../models'; -// @ts-ignore -import { AddDealRequest } from '../models'; -// @ts-ignore import { AddInstallmentRequestBody } from '../models'; // @ts-ignore -import { AddOrganizationRequest } from '../models'; -// @ts-ignore -import { AddPersonRequest } from '../models'; -// @ts-ignore -import { DeleteActivityResponse } from '../models'; -// @ts-ignore -import { DeleteAdditionalDiscountResponse } from '../models'; -// @ts-ignore -import { DeleteDealProductResponse } from '../models'; -// @ts-ignore -import { DeleteDealResponse } from '../models'; -// @ts-ignore import { DeleteInstallmentResponse } from '../models'; // @ts-ignore -import { DeleteOrganizationResponse } from '../models'; -// @ts-ignore -import { DeletePersonResponse } from '../models'; -// @ts-ignore -import { GetActivitiesResponse } from '../models'; -// @ts-ignore -import { GetAdditionalDiscountsResponse } from '../models'; -// @ts-ignore -import { GetDealSearchResponse } from '../models'; -// @ts-ignore -import { GetDealsProductsResponse } from '../models'; -// @ts-ignore -import { GetDealsResponse } from '../models'; -// @ts-ignore import { GetInstallmentsResponse } from '../models'; // @ts-ignore -import { GetItemSearchFieldResponse } from '../models'; -// @ts-ignore -import { GetItemSearchResponse } from '../models'; -// @ts-ignore -import { GetLeadSearchResponse } from '../models'; -// @ts-ignore -import { GetOrganizationSearchResponse } from '../models'; -// @ts-ignore -import { GetOrganizationsResponse } from '../models'; -// @ts-ignore -import { GetPersonSearchResponse } from '../models'; -// @ts-ignore -import { GetPersonsResponse } from '../models'; -// @ts-ignore -import { UpdateAdditionalDiscountRequestBody } from '../models'; -// @ts-ignore -import { UpdateAdditionalDiscountResponse } from '../models'; -// @ts-ignore -import { UpdateDealProductRequest } from '../models'; -// @ts-ignore -import { UpdateDealRequest } from '../models'; -// @ts-ignore import { UpdateInstallmentRequestBody } from '../models'; // @ts-ignore import { UpdateInstallmentResponse } from '../models'; -// @ts-ignore -import { UpdateOrganizationRequest } from '../models'; -// @ts-ignore -import { UpdatePersonRequest } from '../models'; -// @ts-ignore -import { UpsertActivityResponse } from '../models'; -// @ts-ignore -import { UpsertDealResponse } from '../models'; -// @ts-ignore -import { UpsertOrganizationResponse } from '../models'; -// @ts-ignore -import { UpsertPersonResponse } from '../models'; /** * BetaApi - axios parameter creator * @export @@ -112,14 +40,21 @@ import { UpsertPersonResponse } from '../models'; export const BetaApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Adds a new activity. - * @summary Add a new activity - * @param {AddActivityRequest} [AddActivityRequest] + * Removes an installment from a deal. Only available in Advanced and above plans. + * @summary Delete an installment from a deal + * @param {number} id The ID of the deal + * @param {number} installment_id The ID of the installment * @throws {RequiredError} */ - addActivity: async (AddActivityRequest?: AddActivityRequest, ): Promise => { - const localVarPath = `/activities`; + deleteInstallment: async (id: number, installment_id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteInstallment', 'id', id) + // verify required parameter 'installment_id' is not null or undefined + assertParamExists('deleteInstallment', 'installment_id', installment_id) + const localVarPath = `/deals/{id}/installments/{installment_id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -127,7 +62,7 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions }; + const localVarRequestOptions = { method: 'DELETE', ...baseOptions }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -136,16 +71,13 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) // authentication oauth2 required // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["activities:full"], configuration) + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(AddActivityRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -153,14 +85,20 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Adds a new deal. - * @summary Add a new deal - * @param {AddDealRequest} [AddDealRequest] + * Lists installments attached to a list of deals. Only available in Advanced and above plans. + * @summary List installments added to a list of deals + * @param {Array} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. + * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. * @throws {RequiredError} */ - addDeal: async (AddDealRequest?: AddDealRequest, ): Promise => { - const localVarPath = `/deals`; + getInstallments: async (deal_ids: Array, cursor?: string, limit?: number, sort_by?: 'id' | 'billing_date' | 'deal_id', sort_direction?: 'asc' | 'desc', ): Promise => { + // verify required parameter 'deal_ids' is not null or undefined + assertParamExists('getInstallments', 'deal_ids', deal_ids) + const localVarPath = `/deals/installments`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -168,7 +106,7 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions }; + const localVarRequestOptions = { method: 'GET', ...baseOptions }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -177,16 +115,33 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) // authentication oauth2 required // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:full"], configuration) + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) + if (deal_ids) { + localVarQueryParameter['deal_ids'] = deal_ids; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (sort_by !== undefined) { + localVarQueryParameter['sort_by'] = sort_by; + } + + if (sort_direction !== undefined) { + localVarQueryParameter['sort_direction'] = sort_direction; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(AddDealRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -194,17 +149,17 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Adds a product to a deal, creating a new item called a deal-product. - * @summary Add a product to a deal + * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans. + * @summary Add an installment to a deal * @param {number} id The ID of the deal - * @param {AddDealProductRequest} [AddDealProductRequest] + * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody] * @throws {RequiredError} */ - addDealProduct: async (id: number, AddDealProductRequest?: AddDealProductRequest, ): Promise => { + postInstallment: async (id: number, AddInstallmentRequestBody?: AddInstallmentRequestBody, ): Promise => { // verify required parameter 'id' is not null or undefined - assertParamExists('addDealProduct', 'id', id) - const localVarPath = `/deals/{id}/products` + assertParamExists('postInstallment', 'id', id) + const localVarPath = `/deals/{id}/installments` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -222,7 +177,7 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) // authentication oauth2 required // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration) + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) @@ -231,7 +186,7 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(AddDealProductRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(AddInstallmentRequestBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -239,14 +194,22 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Adds a new organization. - * @summary Add a new organization - * @param {AddOrganizationRequest} [AddOrganizationRequest] + * Edits an installment added to a deal. Only available in Advanced and above plans. + * @summary Update an installment added to a deal + * @param {number} id The ID of the deal + * @param {number} installment_id The ID of the installment + * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody] * @throws {RequiredError} */ - addOrganization: async (AddOrganizationRequest?: AddOrganizationRequest, ): Promise => { - const localVarPath = `/organizations`; + updateInstallment: async (id: number, installment_id: number, UpdateInstallmentRequestBody?: UpdateInstallmentRequestBody, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateInstallment', 'id', id) + // verify required parameter 'installment_id' is not null or undefined + assertParamExists('updateInstallment', 'installment_id', installment_id) + const localVarPath = `/deals/{id}/installments/{installment_id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -254,7 +217,7 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions }; + const localVarRequestOptions = { method: 'PATCH', ...baseOptions }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -263,7 +226,7 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) // authentication oauth2 required // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration) + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) @@ -272,4655 +235,258 @@ export const BetaApiAxiosParamCreator = function (configuration?: Configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(AddOrganizationRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(UpdateInstallmentRequestBody, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, + } +}; + + +/** + * BetaApi - functional programming interface + * @export + */ +export const BetaApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = BetaApiAxiosParamCreator(configuration) + return { /** - * Adds a new person. - * @summary Add a new person - * @param {AddPersonRequest} [AddPersonRequest] + * Removes an installment from a deal. Only available in Advanced and above plans. + * @summary Delete an installment from a deal + * @param {number} id The ID of the deal + * @param {number} installment_id The ID of the installment * @throws {RequiredError} */ - addPerson: async (AddPersonRequest?: AddPersonRequest, ): Promise => { - const localVarPath = `/persons`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(AddPersonRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + async deleteInstallment(id: number, installment_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInstallment(id, installment_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** - * Marks an activity as deleted. After 30 days, the activity will be permanently deleted. - * @summary Delete an activity - * @param {number} id The ID of the activity + * Lists installments attached to a list of deals. Only available in Advanced and above plans. + * @summary List installments added to a list of deals + * @param {Array} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. + * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. * @throws {RequiredError} */ - deleteActivity: async (id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('deleteActivity', 'id', id) - const localVarPath = `/activities/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["activities:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + async getInstallments(deal_ids: Array, cursor?: string, limit?: number, sort_by?: 'id' | 'billing_date' | 'deal_id', sort_direction?: 'asc' | 'desc', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstallments(deal_ids, cursor, limit, sort_by, sort_direction, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** - * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. - * @summary Delete a discount from a deal + * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans. + * @summary Add an installment to a deal * @param {number} id The ID of the deal - * @param {number} discount_id The ID of the discount + * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody] * @throws {RequiredError} */ - deleteAdditionalDiscount: async (id: number, discount_id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('deleteAdditionalDiscount', 'id', id) - // verify required parameter 'discount_id' is not null or undefined - assertParamExists('deleteAdditionalDiscount', 'discount_id', discount_id) - const localVarPath = `/deals/{id}/discounts/{discount_id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))) - .replace(`{${"discount_id"}}`, encodeURIComponent(String(discount_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + async postInstallment(id: number, AddInstallmentRequestBody?: AddInstallmentRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postInstallment(id, AddInstallmentRequestBody, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** - * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. - * @summary Delete a deal + * Edits an installment added to a deal. Only available in Advanced and above plans. + * @summary Update an installment added to a deal * @param {number} id The ID of the deal + * @param {number} installment_id The ID of the installment + * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody] * @throws {RequiredError} */ - deleteDeal: async (id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('deleteDeal', 'id', id) - const localVarPath = `/deals/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } + async updateInstallment(id: number, installment_id: number, UpdateInstallmentRequestBody?: UpdateInstallmentRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateInstallment(id, installment_id, UpdateInstallmentRequestBody, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; - const localVarRequestOptions = { method: 'DELETE', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Deletes a product attachment from a deal, using the `product_attachment_id`. - * @summary Delete an attached product from a deal - * @param {number} id The ID of the deal - * @param {number} product_attachment_id The product attachment ID - - * @throws {RequiredError} - */ - deleteDealProduct: async (id: number, product_attachment_id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('deleteDealProduct', 'id', id) - // verify required parameter 'product_attachment_id' is not null or undefined - assertParamExists('deleteDealProduct', 'product_attachment_id', product_attachment_id) - const localVarPath = `/deals/{id}/products/{product_attachment_id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))) - .replace(`{${"product_attachment_id"}}`, encodeURIComponent(String(product_attachment_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:full", "products:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, +/** + * BetaApi - factory interface + * @export + */ +export const BetaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = BetaApiFp(configuration) + return { /** * Removes an installment from a deal. Only available in Advanced and above plans. * @summary Delete an installment from a deal - * @param {number} id The ID of the deal - * @param {number} installment_id The ID of the installment + * @param {BetaApiDeleteInstallmentRequest} requestParameters Request parameters. * @throws {RequiredError} */ - deleteInstallment: async (id: number, installment_id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('deleteInstallment', 'id', id) - // verify required parameter 'installment_id' is not null or undefined - assertParamExists('deleteInstallment', 'installment_id', installment_id) - const localVarPath = `/deals/{id}/installments/{installment_id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))) - .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + deleteInstallment(requestParameters: BetaApiDeleteInstallmentRequest, ): Promise { + return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(axios, basePath)); }, /** - * Marks a organization as deleted. After 30 days, the organization will be permanently deleted. - * @summary Delete a organization - * @param {number} id The ID of the organization + * Lists installments attached to a list of deals. Only available in Advanced and above plans. + * @summary List installments added to a list of deals + * @param {BetaApiGetInstallmentsRequest} requestParameters Request parameters. * @throws {RequiredError} */ - deleteOrganization: async (id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('deleteOrganization', 'id', id) - const localVarPath = `/organizations/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + getInstallments(requestParameters: BetaApiGetInstallmentsRequest, ): Promise { + return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(axios, basePath)); }, /** - * Marks a person as deleted. After 30 days, the person will be permanently deleted. - * @summary Delete a person - * @param {number} id The ID of the person + * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans. + * @summary Add an installment to a deal + * @param {BetaApiPostInstallmentRequest} requestParameters Request parameters. * @throws {RequiredError} */ - deletePerson: async (id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('deletePerson', 'id', id) - const localVarPath = `/persons/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + postInstallment(requestParameters: BetaApiPostInstallmentRequest, ): Promise { + return localVarFp.postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody, ).then((request) => request(axios, basePath)); }, /** - * Returns data about all activities. - * @summary Get all activities - * @param {number} [filter_id] If supplied, only activities matching the specified filter are returned - * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @param {number} [owner_id] If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored. - * @param {number} [deal_id] If supplied, only activities linked to the specified deal are returned. If filter_id is provided, this is ignored. - * @param {string} [lead_id] If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. - * @param {number} [person_id] If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. - * @param {number} [org_id] If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @param {string} [updated_since] If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {string} [updated_until] If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + * Edits an installment added to a deal. Only available in Advanced and above plans. + * @summary Update an installment added to a deal + * @param {BetaApiUpdateInstallmentRequest} requestParameters Request parameters. * @throws {RequiredError} */ - getActivities: async (filter_id?: number, ids?: string, owner_id?: number, deal_id?: number, lead_id?: string, person_id?: number, org_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'attendees', limit?: number, cursor?: string, ): Promise => { - const localVarPath = `/activities`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["activities:read", "activities:full"], configuration) - - if (filter_id !== undefined) { - localVarQueryParameter['filter_id'] = filter_id; - } - - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; - } - - if (owner_id !== undefined) { - localVarQueryParameter['owner_id'] = owner_id; - } - - if (deal_id !== undefined) { - localVarQueryParameter['deal_id'] = deal_id; - } - - if (lead_id !== undefined) { - localVarQueryParameter['lead_id'] = lead_id; - } - - if (person_id !== undefined) { - localVarQueryParameter['person_id'] = person_id; - } - - if (org_id !== undefined) { - localVarQueryParameter['org_id'] = org_id; - } - - if (updated_since !== undefined) { - localVarQueryParameter['updated_since'] = updated_since; - } - - if (updated_until !== undefined) { - localVarQueryParameter['updated_until'] = updated_until; - } - - if (sort_by !== undefined) { - localVarQueryParameter['sort_by'] = sort_by; - } - - if (sort_direction !== undefined) { - localVarQueryParameter['sort_direction'] = sort_direction; - } - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + updateInstallment(requestParameters: BetaApiUpdateInstallmentRequest, ): Promise { + return localVarFp.updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(axios, basePath)); }, - /** - * Returns the details of a specific activity. - * @summary Get details of an activity - * @param {number} id The ID of the activity - * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include - - * @throws {RequiredError} - */ - getActivity: async (id: number, include_fields?: 'attendees', ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getActivity', 'id', id) - const localVarPath = `/activities/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["activities:read", "activities:full"], configuration) - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Lists discounts attached to a deal. - * @summary List discounts added to a deal - * @param {number} id The ID of the deal - - * @throws {RequiredError} - */ - getAdditionalDiscounts: async (id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getAdditionalDiscounts', 'id', id) - const localVarPath = `/deals/{id}/discounts` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns the details of a specific deal. - * @summary Get details of a deal - * @param {number} id The ID of the deal - * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - - * @throws {RequiredError} - */ - getDeal: async (id: number, include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time', custom_fields?: string, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getDeal', 'id', id) - const localVarPath = `/deals/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (custom_fields !== undefined) { - localVarQueryParameter['custom_fields'] = custom_fields; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Lists products attached to a deal. - * @summary List products attached to a deal - * @param {number} id The ID of the deal - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {'id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: `id`, `add_time`, `update_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - - * @throws {RequiredError} - */ - getDealProducts: async (id: number, cursor?: string, limit?: number, sort_by?: 'id' | 'add_time' | 'update_time', sort_direction?: 'asc' | 'desc', ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getDealProducts', 'id', id) - const localVarPath = `/deals/{id}/products` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["products:read", "products:full", "deals:read", "deals:full"], configuration) - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (sort_by !== undefined) { - localVarQueryParameter['sort_by'] = sort_by; - } - - if (sort_direction !== undefined) { - localVarQueryParameter['sort_direction'] = sort_direction; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns data about all deals. - * @summary Get all deals - * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned - * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. - * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. - * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. - * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. - * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. - * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - getDeals: async (filter_id?: number, ids?: string, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time', custom_fields?: string, limit?: number, cursor?: string, ): Promise => { - const localVarPath = `/deals`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - if (filter_id !== undefined) { - localVarQueryParameter['filter_id'] = filter_id; - } - - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; - } - - if (owner_id !== undefined) { - localVarQueryParameter['owner_id'] = owner_id; - } - - if (person_id !== undefined) { - localVarQueryParameter['person_id'] = person_id; - } - - if (org_id !== undefined) { - localVarQueryParameter['org_id'] = org_id; - } - - if (pipeline_id !== undefined) { - localVarQueryParameter['pipeline_id'] = pipeline_id; - } - - if (stage_id !== undefined) { - localVarQueryParameter['stage_id'] = stage_id; - } - - if (status !== undefined) { - localVarQueryParameter['status'] = status; - } - - if (updated_since !== undefined) { - localVarQueryParameter['updated_since'] = updated_since; - } - - if (updated_until !== undefined) { - localVarQueryParameter['updated_until'] = updated_until; - } - - if (sort_by !== undefined) { - localVarQueryParameter['sort_by'] = sort_by; - } - - if (sort_direction !== undefined) { - localVarQueryParameter['sort_direction'] = sort_direction; - } - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (custom_fields !== undefined) { - localVarQueryParameter['custom_fields'] = custom_fields; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns data about products attached to deals - * @summary Get deal products of several deals - * @param {Array} deal_ids An array of integers with the IDs of the deals for which the attached products will be returned. A maximum of 100 deal IDs can be provided. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {'id' | 'deal_id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: `id`, `deal_id`, `add_time`, `update_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - - * @throws {RequiredError} - */ - getDealsProducts: async (deal_ids: Array, cursor?: string, limit?: number, sort_by?: 'id' | 'deal_id' | 'add_time' | 'update_time', sort_direction?: 'asc' | 'desc', ): Promise => { - // verify required parameter 'deal_ids' is not null or undefined - assertParamExists('getDealsProducts', 'deal_ids', deal_ids) - const localVarPath = `/deals/products`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["products:read", "products:full", "deals:read", "deals:full"], configuration) - - if (deal_ids) { - localVarQueryParameter['deal_ids'] = deal_ids; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (sort_by !== undefined) { - localVarQueryParameter['sort_by'] = sort_by; - } - - if (sort_direction !== undefined) { - localVarQueryParameter['sort_direction'] = sort_direction; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Lists installments attached to a list of deals. Only available in Advanced and above plans. - * @summary List installments added to a list of deals - * @param {Array} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - - * @throws {RequiredError} - */ - getInstallments: async (deal_ids: Array, cursor?: string, limit?: number, sort_by?: 'id' | 'billing_date' | 'deal_id', sort_direction?: 'asc' | 'desc', ): Promise => { - // verify required parameter 'deal_ids' is not null or undefined - assertParamExists('getInstallments', 'deal_ids', deal_ids) - const localVarPath = `/deals/installments`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - if (deal_ids) { - localVarQueryParameter['deal_ids'] = deal_ids; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (sort_by !== undefined) { - localVarQueryParameter['sort_by'] = sort_by; - } - - if (sort_direction !== undefined) { - localVarQueryParameter['sort_direction'] = sort_direction; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns the details of a specific organization. - * @summary Get details of a organization - * @param {number} id The ID of the organization - * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - - * @throws {RequiredError} - */ - getOrganization: async (id: number, include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count', custom_fields?: string, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getOrganization', 'id', id) - const localVarPath = `/organizations/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration) - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (custom_fields !== undefined) { - localVarQueryParameter['custom_fields'] = custom_fields; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns data about all organizations. - * @summary Get all organizations - * @param {number} [filter_id] If supplied, only organizations matching the specified filter are returned - * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @param {number} [owner_id] If supplied, only organization owned by the specified user are returned. If filter_id is provided, this is ignored. - * @param {string} [updated_since] If set, only organizations with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {string} [updated_until] If set, only organizations with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - getOrganizations: async (filter_id?: number, ids?: string, owner_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count', custom_fields?: string, limit?: number, cursor?: string, ): Promise => { - const localVarPath = `/organizations`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration) - - if (filter_id !== undefined) { - localVarQueryParameter['filter_id'] = filter_id; - } - - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; - } - - if (owner_id !== undefined) { - localVarQueryParameter['owner_id'] = owner_id; - } - - if (updated_since !== undefined) { - localVarQueryParameter['updated_since'] = updated_since; - } - - if (updated_until !== undefined) { - localVarQueryParameter['updated_until'] = updated_until; - } - - if (sort_by !== undefined) { - localVarQueryParameter['sort_by'] = sort_by; - } - - if (sort_direction !== undefined) { - localVarQueryParameter['sort_direction'] = sort_direction; - } - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (custom_fields !== undefined) { - localVarQueryParameter['custom_fields'] = custom_fields; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. - * @summary Get details of a person - * @param {number} id The ID of the person - * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. `marketing_status` and `doi_status` can only be included if the company has marketing app enabled. - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - - * @throws {RequiredError} - */ - getPerson: async (id: number, include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getPerson', 'id', id) - const localVarPath = `/persons/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration) - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (custom_fields !== undefined) { - localVarQueryParameter['custom_fields'] = custom_fields; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. - * @summary Get all persons - * @param {number} [filter_id] If supplied, only persons matching the specified filter are returned - * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored. - * @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @param {string} [updated_since] If set, only persons with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {string} [updated_until] If set, only persons with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. `marketing_status` and `doi_status` can only be included if the company has marketing app enabled. - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - getPersons: async (filter_id?: number, ids?: string, owner_id?: number, org_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise => { - const localVarPath = `/persons`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration) - - if (filter_id !== undefined) { - localVarQueryParameter['filter_id'] = filter_id; - } - - if (ids !== undefined) { - localVarQueryParameter['ids'] = ids; - } - - if (owner_id !== undefined) { - localVarQueryParameter['owner_id'] = owner_id; - } - - if (org_id !== undefined) { - localVarQueryParameter['org_id'] = org_id; - } - - if (updated_since !== undefined) { - localVarQueryParameter['updated_since'] = updated_since; - } - - if (updated_until !== undefined) { - localVarQueryParameter['updated_until'] = updated_until; - } - - if (sort_by !== undefined) { - localVarQueryParameter['sort_by'] = sort_by; - } - - if (sort_direction !== undefined) { - localVarQueryParameter['sort_direction'] = sort_direction; - } - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (custom_fields !== undefined) { - localVarQueryParameter['custom_fields'] = custom_fields; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Adds a discount to a deal changing, the deal value if the deal has one-time products attached. - * @summary Add a discount to a deal - * @param {number} id The ID of the deal - * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody] - - * @throws {RequiredError} - */ - postAdditionalDiscount: async (id: number, AddAdditionalDiscountRequestBody?: AddAdditionalDiscountRequestBody, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('postAdditionalDiscount', 'id', id) - const localVarPath = `/deals/{id}/discounts` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(AddAdditionalDiscountRequestBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans. - * @summary Add an installment to a deal - * @param {number} id The ID of the deal - * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody] - - * @throws {RequiredError} - */ - postInstallment: async (id: number, AddInstallmentRequestBody?: AddInstallmentRequestBody, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('postInstallment', 'id', id) - const localVarPath = `/deals/{id}/installments` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(AddInstallmentRequestBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. - * @summary Search deals - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. - * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. - * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. - * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - searchDeals: async (term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, status?: 'open' | 'won' | 'lost', include_fields?: 'deal.cc_email', limit?: number, cursor?: string, ): Promise => { - // verify required parameter 'term' is not null or undefined - assertParamExists('searchDeals', 'term', term) - const localVarPath = `/deals/search`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full", "search:read"], configuration) - - if (term !== undefined) { - localVarQueryParameter['term'] = term; - } - - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; - } - - if (exact_match !== undefined) { - localVarQueryParameter['exact_match'] = exact_match; - } - - if (person_id !== undefined) { - localVarQueryParameter['person_id'] = person_id; - } - - if (organization_id !== undefined) { - localVarQueryParameter['organization_id'] = organization_id; - } - - if (status !== undefined) { - localVarQueryParameter['status'] = status; - } - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Performs a search from your choice of item types and fields. - * @summary Perform a search from multiple item types - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all. - * @param {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<br/> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. - * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {'deal.cc_email' | 'person.picture' | 'product.price'} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - searchItem: async (term: string, item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project', fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description', search_for_related_items?: boolean, exact_match?: boolean, include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price', limit?: number, cursor?: string, ): Promise => { - // verify required parameter 'term' is not null or undefined - assertParamExists('searchItem', 'term', term) - const localVarPath = `/itemSearch`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["search:read"], configuration) - - if (term !== undefined) { - localVarQueryParameter['term'] = term; - } - - if (item_types !== undefined) { - localVarQueryParameter['item_types'] = item_types; - } - - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; - } - - if (search_for_related_items !== undefined) { - localVarQueryParameter['search_for_related_items'] = search_for_related_items; - } - - if (exact_match !== undefined) { - localVarQueryParameter['exact_match'] = exact_match; - } - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). - * @summary Perform a search using a specific field from an item type - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if `match` is `exact`). Please note that the search term has to be URL encoded. - * @param {'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project'} entity_type The type of the field to perform the search from - * @param {string} field The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields\' API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @param {'exact' | 'beginning' | 'middle'} [match] The type of match used against the term. The search <b>is</b> case sensitive.<br/><br/> E.g. in case of searching for a value `monkey`, <ul> <li>with `exact` match, you will only find it if term is `monkey`</li> <li>with `beginning` match, you will only find it if the term matches the beginning or the whole string, e.g. `monk` and `monkey`</li> <li>with `middle` match, you will find the it if the term matches any substring of the value, e.g. `onk` and `ke`</li> </ul>. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - searchItemByField: async (term: string, entity_type: 'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project', field: string, match?: 'exact' | 'beginning' | 'middle', limit?: number, cursor?: string, ): Promise => { - // verify required parameter 'term' is not null or undefined - assertParamExists('searchItemByField', 'term', term) - // verify required parameter 'entity_type' is not null or undefined - assertParamExists('searchItemByField', 'entity_type', entity_type) - // verify required parameter 'field' is not null or undefined - assertParamExists('searchItemByField', 'field', field) - const localVarPath = `/itemSearch/field`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["search:read"], configuration) - - if (term !== undefined) { - localVarQueryParameter['term'] = term; - } - - if (entity_type !== undefined) { - localVarQueryParameter['entity_type'] = entity_type; - } - - if (match !== undefined) { - localVarQueryParameter['match'] = match; - } - - if (field !== undefined) { - localVarQueryParameter['field'] = field; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. - * @summary Search leads - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. - * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - searchLeads: async (term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: 'lead.was_seen', limit?: number, cursor?: string, ): Promise => { - // verify required parameter 'term' is not null or undefined - assertParamExists('searchLeads', 'term', term) - const localVarPath = `/leads/search`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["leads:read", "leads:full", "search:read"], configuration) - - if (term !== undefined) { - localVarQueryParameter['term'] = term; - } - - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; - } - - if (exact_match !== undefined) { - localVarQueryParameter['exact_match'] = exact_match; - } - - if (person_id !== undefined) { - localVarQueryParameter['person_id'] = person_id; - } - - if (organization_id !== undefined) { - localVarQueryParameter['organization_id'] = organization_id; - } - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. - * @summary Search organizations - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'address' | 'custom_fields' | 'notes' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - searchOrganization: async (term: string, fields?: 'address' | 'custom_fields' | 'notes' | 'name', exact_match?: boolean, limit?: number, cursor?: string, ): Promise => { - // verify required parameter 'term' is not null or undefined - assertParamExists('searchOrganization', 'term', term) - const localVarPath = `/organizations/search`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full", "search:read"], configuration) - - if (term !== undefined) { - localVarQueryParameter['term'] = term; - } - - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; - } - - if (exact_match !== undefined) { - localVarQueryParameter['exact_match'] = exact_match; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. - * @summary Search persons - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. - * @param {'person.picture'} [include_fields] Supports including optional fields in the results which are not provided by default - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - searchPersons: async (term: string, fields?: 'custom_fields' | 'email' | 'notes' | 'phone' | 'name', exact_match?: boolean, organization_id?: number, include_fields?: 'person.picture', limit?: number, cursor?: string, ): Promise => { - // verify required parameter 'term' is not null or undefined - assertParamExists('searchPersons', 'term', term) - const localVarPath = `/persons/search`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full", "search:read"], configuration) - - if (term !== undefined) { - localVarQueryParameter['term'] = term; - } - - if (fields !== undefined) { - localVarQueryParameter['fields'] = fields; - } - - if (exact_match !== undefined) { - localVarQueryParameter['exact_match'] = exact_match; - } - - if (organization_id !== undefined) { - localVarQueryParameter['organization_id'] = organization_id; - } - - if (include_fields !== undefined) { - localVarQueryParameter['include_fields'] = include_fields; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (cursor !== undefined) { - localVarQueryParameter['cursor'] = cursor; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Updates the properties of an activity. - * @summary Update an activity - * @param {number} id The ID of the activity - * @param {AddActivityRequest} [AddActivityRequest] - - * @throws {RequiredError} - */ - updateActivity: async (id: number, AddActivityRequest?: AddActivityRequest, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('updateActivity', 'id', id) - const localVarPath = `/activities/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["activities:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(AddActivityRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. - * @summary Update a discount added to a deal - * @param {number} id The ID of the deal - * @param {number} discount_id The ID of the discount - * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody] - - * @throws {RequiredError} - */ - updateAdditionalDiscount: async (id: number, discount_id: number, UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('updateAdditionalDiscount', 'id', id) - // verify required parameter 'discount_id' is not null or undefined - assertParamExists('updateAdditionalDiscount', 'discount_id', discount_id) - const localVarPath = `/deals/{id}/discounts/{discount_id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))) - .replace(`{${"discount_id"}}`, encodeURIComponent(String(discount_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(UpdateAdditionalDiscountRequestBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Updates the properties of a deal. - * @summary Update a deal - * @param {number} id The ID of the deal - * @param {UpdateDealRequest} [UpdateDealRequest] - - * @throws {RequiredError} - */ - updateDeal: async (id: number, UpdateDealRequest?: UpdateDealRequest, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('updateDeal', 'id', id) - const localVarPath = `/deals/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(UpdateDealRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Updates the details of the product that has been attached to a deal. - * @summary Update the product attached to a deal - * @param {number} id The ID of the deal - * @param {number} product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) - * @param {UpdateDealProductRequest} [UpdateDealProductRequest] - - * @throws {RequiredError} - */ - updateDealProduct: async (id: number, product_attachment_id: number, UpdateDealProductRequest?: UpdateDealProductRequest, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('updateDealProduct', 'id', id) - // verify required parameter 'product_attachment_id' is not null or undefined - assertParamExists('updateDealProduct', 'product_attachment_id', product_attachment_id) - const localVarPath = `/deals/{id}/products/{product_attachment_id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))) - .replace(`{${"product_attachment_id"}}`, encodeURIComponent(String(product_attachment_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(UpdateDealProductRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Edits an installment added to a deal. Only available in Advanced and above plans. - * @summary Update an installment added to a deal - * @param {number} id The ID of the deal - * @param {number} installment_id The ID of the installment - * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody] - - * @throws {RequiredError} - */ - updateInstallment: async (id: number, installment_id: number, UpdateInstallmentRequestBody?: UpdateInstallmentRequestBody, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('updateInstallment', 'id', id) - // verify required parameter 'installment_id' is not null or undefined - assertParamExists('updateInstallment', 'installment_id', installment_id) - const localVarPath = `/deals/{id}/installments/{installment_id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))) - .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(UpdateInstallmentRequestBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Updates the properties of a organization. - * @summary Update a organization - * @param {number} id The ID of the organization - * @param {UpdateOrganizationRequest} [UpdateOrganizationRequest] - - * @throws {RequiredError} - */ - updateOrganization: async (id: number, UpdateOrganizationRequest?: UpdateOrganizationRequest, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('updateOrganization', 'id', id) - const localVarPath = `/organizations/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(UpdateOrganizationRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Updates the properties of a person. - * @summary Update a person - * @param {number} id The ID of the person - * @param {UpdatePersonRequest} [UpdatePersonRequest] - - * @throws {RequiredError} - */ - updatePerson: async (id: number, UpdatePersonRequest?: UpdatePersonRequest, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('updatePerson', 'id', id) - const localVarPath = `/persons/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - await setApiKeyToObject(localVarQueryParameter, "api_token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - localVarRequestOptions.data = serializeDataIfNeeded(UpdatePersonRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - - -/** - * BetaApi - functional programming interface - * @export - */ -export const BetaApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = BetaApiAxiosParamCreator(configuration) - return { - /** - * Adds a new activity. - * @summary Add a new activity - * @param {AddActivityRequest} [AddActivityRequest] - - * @throws {RequiredError} - */ - async addActivity(AddActivityRequest?: AddActivityRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addActivity(AddActivityRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Adds a new deal. - * @summary Add a new deal - * @param {AddDealRequest} [AddDealRequest] - - * @throws {RequiredError} - */ - async addDeal(AddDealRequest?: AddDealRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addDeal(AddDealRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Adds a product to a deal, creating a new item called a deal-product. - * @summary Add a product to a deal - * @param {number} id The ID of the deal - * @param {AddDealProductRequest} [AddDealProductRequest] - - * @throws {RequiredError} - */ - async addDealProduct(id: number, AddDealProductRequest?: AddDealProductRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addDealProduct(id, AddDealProductRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Adds a new organization. - * @summary Add a new organization - * @param {AddOrganizationRequest} [AddOrganizationRequest] - - * @throws {RequiredError} - */ - async addOrganization(AddOrganizationRequest?: AddOrganizationRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganization(AddOrganizationRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Adds a new person. - * @summary Add a new person - * @param {AddPersonRequest} [AddPersonRequest] - - * @throws {RequiredError} - */ - async addPerson(AddPersonRequest?: AddPersonRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.addPerson(AddPersonRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Marks an activity as deleted. After 30 days, the activity will be permanently deleted. - * @summary Delete an activity - * @param {number} id The ID of the activity - - * @throws {RequiredError} - */ - async deleteActivity(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteActivity(id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. - * @summary Delete a discount from a deal - * @param {number} id The ID of the deal - * @param {number} discount_id The ID of the discount - - * @throws {RequiredError} - */ - async deleteAdditionalDiscount(id: number, discount_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAdditionalDiscount(id, discount_id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. - * @summary Delete a deal - * @param {number} id The ID of the deal - - * @throws {RequiredError} - */ - async deleteDeal(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDeal(id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Deletes a product attachment from a deal, using the `product_attachment_id`. - * @summary Delete an attached product from a deal - * @param {number} id The ID of the deal - * @param {number} product_attachment_id The product attachment ID - - * @throws {RequiredError} - */ - async deleteDealProduct(id: number, product_attachment_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealProduct(id, product_attachment_id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Removes an installment from a deal. Only available in Advanced and above plans. - * @summary Delete an installment from a deal - * @param {number} id The ID of the deal - * @param {number} installment_id The ID of the installment - - * @throws {RequiredError} - */ - async deleteInstallment(id: number, installment_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInstallment(id, installment_id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Marks a organization as deleted. After 30 days, the organization will be permanently deleted. - * @summary Delete a organization - * @param {number} id The ID of the organization - - * @throws {RequiredError} - */ - async deleteOrganization(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganization(id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Marks a person as deleted. After 30 days, the person will be permanently deleted. - * @summary Delete a person - * @param {number} id The ID of the person - - * @throws {RequiredError} - */ - async deletePerson(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deletePerson(id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns data about all activities. - * @summary Get all activities - * @param {number} [filter_id] If supplied, only activities matching the specified filter are returned - * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @param {number} [owner_id] If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored. - * @param {number} [deal_id] If supplied, only activities linked to the specified deal are returned. If filter_id is provided, this is ignored. - * @param {string} [lead_id] If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. - * @param {number} [person_id] If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. - * @param {number} [org_id] If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @param {string} [updated_since] If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {string} [updated_until] If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async getActivities(filter_id?: number, ids?: string, owner_id?: number, deal_id?: number, lead_id?: string, person_id?: number, org_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'attendees', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getActivities(filter_id, ids, owner_id, deal_id, lead_id, person_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns the details of a specific activity. - * @summary Get details of an activity - * @param {number} id The ID of the activity - * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include - - * @throws {RequiredError} - */ - async getActivity(id: number, include_fields?: 'attendees', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getActivity(id, include_fields, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Lists discounts attached to a deal. - * @summary List discounts added to a deal - * @param {number} id The ID of the deal - - * @throws {RequiredError} - */ - async getAdditionalDiscounts(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAdditionalDiscounts(id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns the details of a specific deal. - * @summary Get details of a deal - * @param {number} id The ID of the deal - * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - - * @throws {RequiredError} - */ - async getDeal(id: number, include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time', custom_fields?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDeal(id, include_fields, custom_fields, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Lists products attached to a deal. - * @summary List products attached to a deal - * @param {number} id The ID of the deal - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {'id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: `id`, `add_time`, `update_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - - * @throws {RequiredError} - */ - async getDealProducts(id: number, cursor?: string, limit?: number, sort_by?: 'id' | 'add_time' | 'update_time', sort_direction?: 'asc' | 'desc', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDealProducts(id, cursor, limit, sort_by, sort_direction, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns data about all deals. - * @summary Get all deals - * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned - * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. - * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. - * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. - * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. - * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. - * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async getDeals(filter_id?: number, ids?: string, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted', updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time', custom_fields?: string, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDeals(filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns data about products attached to deals - * @summary Get deal products of several deals - * @param {Array} deal_ids An array of integers with the IDs of the deals for which the attached products will be returned. A maximum of 100 deal IDs can be provided. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {'id' | 'deal_id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: `id`, `deal_id`, `add_time`, `update_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - - * @throws {RequiredError} - */ - async getDealsProducts(deal_ids: Array, cursor?: string, limit?: number, sort_by?: 'id' | 'deal_id' | 'add_time' | 'update_time', sort_direction?: 'asc' | 'desc', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDealsProducts(deal_ids, cursor, limit, sort_by, sort_direction, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Lists installments attached to a list of deals. Only available in Advanced and above plans. - * @summary List installments added to a list of deals - * @param {Array} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - - * @throws {RequiredError} - */ - async getInstallments(deal_ids: Array, cursor?: string, limit?: number, sort_by?: 'id' | 'billing_date' | 'deal_id', sort_direction?: 'asc' | 'desc', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstallments(deal_ids, cursor, limit, sort_by, sort_direction, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns the details of a specific organization. - * @summary Get details of a organization - * @param {number} id The ID of the organization - * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - - * @throws {RequiredError} - */ - async getOrganization(id: number, include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count', custom_fields?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganization(id, include_fields, custom_fields, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns data about all organizations. - * @summary Get all organizations - * @param {number} [filter_id] If supplied, only organizations matching the specified filter are returned - * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @param {number} [owner_id] If supplied, only organization owned by the specified user are returned. If filter_id is provided, this is ignored. - * @param {string} [updated_since] If set, only organizations with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {string} [updated_until] If set, only organizations with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async getOrganizations(filter_id?: number, ids?: string, owner_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count', custom_fields?: string, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizations(filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. - * @summary Get details of a person - * @param {number} id The ID of the person - * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. `marketing_status` and `doi_status` can only be included if the company has marketing app enabled. - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - - * @throws {RequiredError} - */ - async getPerson(id: number, include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getPerson(id, include_fields, custom_fields, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. - * @summary Get all persons - * @param {number} [filter_id] If supplied, only persons matching the specified filter are returned - * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored. - * @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @param {string} [updated_since] If set, only persons with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {string} [updated_until] If set, only persons with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. - * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. `marketing_status` and `doi_status` can only be included if the company has marketing app enabled. - * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async getPersons(filter_id?: number, ids?: string, owner_id?: number, org_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getPersons(filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Adds a discount to a deal changing, the deal value if the deal has one-time products attached. - * @summary Add a discount to a deal - * @param {number} id The ID of the deal - * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody] - - * @throws {RequiredError} - */ - async postAdditionalDiscount(id: number, AddAdditionalDiscountRequestBody?: AddAdditionalDiscountRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.postAdditionalDiscount(id, AddAdditionalDiscountRequestBody, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans. - * @summary Add an installment to a deal - * @param {number} id The ID of the deal - * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody] - - * @throws {RequiredError} - */ - async postInstallment(id: number, AddInstallmentRequestBody?: AddInstallmentRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.postInstallment(id, AddInstallmentRequestBody, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. - * @summary Search deals - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. - * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. - * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. - * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async searchDeals(term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, status?: 'open' | 'won' | 'lost', include_fields?: 'deal.cc_email', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchDeals(term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Performs a search from your choice of item types and fields. - * @summary Perform a search from multiple item types - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all. - * @param {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<br/> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. - * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {'deal.cc_email' | 'person.picture' | 'product.price'} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async searchItem(term: string, item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project', fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description', search_for_related_items?: boolean, exact_match?: boolean, include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). - * @summary Perform a search using a specific field from an item type - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if `match` is `exact`). Please note that the search term has to be URL encoded. - * @param {'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project'} entity_type The type of the field to perform the search from - * @param {string} field The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields\' API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @param {'exact' | 'beginning' | 'middle'} [match] The type of match used against the term. The search <b>is</b> case sensitive.<br/><br/> E.g. in case of searching for a value `monkey`, <ul> <li>with `exact` match, you will only find it if term is `monkey`</li> <li>with `beginning` match, you will only find it if the term matches the beginning or the whole string, e.g. `monk` and `monkey`</li> <li>with `middle` match, you will find the it if the term matches any substring of the value, e.g. `onk` and `ke`</li> </ul>. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async searchItemByField(term: string, entity_type: 'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project', field: string, match?: 'exact' | 'beginning' | 'middle', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchItemByField(term, entity_type, field, match, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. - * @summary Search leads - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. - * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async searchLeads(term: string, fields?: 'custom_fields' | 'notes' | 'title', exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: 'lead.was_seen', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. - * @summary Search organizations - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'address' | 'custom_fields' | 'notes' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async searchOrganization(term: string, fields?: 'address' | 'custom_fields' | 'notes' | 'name', exact_match?: boolean, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchOrganization(term, fields, exact_match, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. - * @summary Search persons - * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @param {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. - * @param {'person.picture'} [include_fields] Supports including optional fields in the results which are not provided by default - * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page - - * @throws {RequiredError} - */ - async searchPersons(term: string, fields?: 'custom_fields' | 'email' | 'notes' | 'phone' | 'name', exact_match?: boolean, organization_id?: number, include_fields?: 'person.picture', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchPersons(term, fields, exact_match, organization_id, include_fields, limit, cursor, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Updates the properties of an activity. - * @summary Update an activity - * @param {number} id The ID of the activity - * @param {AddActivityRequest} [AddActivityRequest] - - * @throws {RequiredError} - */ - async updateActivity(id: number, AddActivityRequest?: AddActivityRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateActivity(id, AddActivityRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. - * @summary Update a discount added to a deal - * @param {number} id The ID of the deal - * @param {number} discount_id The ID of the discount - * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody] - - * @throws {RequiredError} - */ - async updateAdditionalDiscount(id: number, discount_id: number, UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateAdditionalDiscount(id, discount_id, UpdateAdditionalDiscountRequestBody, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Updates the properties of a deal. - * @summary Update a deal - * @param {number} id The ID of the deal - * @param {UpdateDealRequest} [UpdateDealRequest] - - * @throws {RequiredError} - */ - async updateDeal(id: number, UpdateDealRequest?: UpdateDealRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateDeal(id, UpdateDealRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Updates the details of the product that has been attached to a deal. - * @summary Update the product attached to a deal - * @param {number} id The ID of the deal - * @param {number} product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) - * @param {UpdateDealProductRequest} [UpdateDealProductRequest] - - * @throws {RequiredError} - */ - async updateDealProduct(id: number, product_attachment_id: number, UpdateDealProductRequest?: UpdateDealProductRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateDealProduct(id, product_attachment_id, UpdateDealProductRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Edits an installment added to a deal. Only available in Advanced and above plans. - * @summary Update an installment added to a deal - * @param {number} id The ID of the deal - * @param {number} installment_id The ID of the installment - * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody] - - * @throws {RequiredError} - */ - async updateInstallment(id: number, installment_id: number, UpdateInstallmentRequestBody?: UpdateInstallmentRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateInstallment(id, installment_id, UpdateInstallmentRequestBody, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Updates the properties of a organization. - * @summary Update a organization - * @param {number} id The ID of the organization - * @param {UpdateOrganizationRequest} [UpdateOrganizationRequest] - - * @throws {RequiredError} - */ - async updateOrganization(id: number, UpdateOrganizationRequest?: UpdateOrganizationRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganization(id, UpdateOrganizationRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Updates the properties of a person. - * @summary Update a person - * @param {number} id The ID of the person - * @param {UpdatePersonRequest} [UpdatePersonRequest] - - * @throws {RequiredError} - */ - async updatePerson(id: number, UpdatePersonRequest?: UpdatePersonRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updatePerson(id, UpdatePersonRequest, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - } -}; - -/** - * BetaApi - factory interface - * @export - */ -export const BetaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = BetaApiFp(configuration) - return { - /** - * Adds a new activity. - * @summary Add a new activity - * @param {BetaApiAddActivityRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - addActivity(requestParameters: BetaApiAddActivityRequest = {}, ): Promise { - return localVarFp.addActivity(requestParameters.AddActivityRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Adds a new deal. - * @summary Add a new deal - * @param {BetaApiAddDealRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - addDeal(requestParameters: BetaApiAddDealRequest = {}, ): Promise { - return localVarFp.addDeal(requestParameters.AddDealRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Adds a product to a deal, creating a new item called a deal-product. - * @summary Add a product to a deal - * @param {BetaApiAddDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - addDealProduct(requestParameters: BetaApiAddDealProductRequest, ): Promise { - return localVarFp.addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Adds a new organization. - * @summary Add a new organization - * @param {BetaApiAddOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - addOrganization(requestParameters: BetaApiAddOrganizationRequest = {}, ): Promise { - return localVarFp.addOrganization(requestParameters.AddOrganizationRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Adds a new person. - * @summary Add a new person - * @param {BetaApiAddPersonRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - addPerson(requestParameters: BetaApiAddPersonRequest = {}, ): Promise { - return localVarFp.addPerson(requestParameters.AddPersonRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Marks an activity as deleted. After 30 days, the activity will be permanently deleted. - * @summary Delete an activity - * @param {BetaApiDeleteActivityRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - deleteActivity(requestParameters: BetaApiDeleteActivityRequest, ): Promise { - return localVarFp.deleteActivity(requestParameters.id, ).then((request) => request(axios, basePath)); - }, - /** - * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. - * @summary Delete a discount from a deal - * @param {BetaApiDeleteAdditionalDiscountRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - deleteAdditionalDiscount(requestParameters: BetaApiDeleteAdditionalDiscountRequest, ): Promise { - return localVarFp.deleteAdditionalDiscount(requestParameters.id, requestParameters.discount_id, ).then((request) => request(axios, basePath)); - }, - /** - * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. - * @summary Delete a deal - * @param {BetaApiDeleteDealRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - deleteDeal(requestParameters: BetaApiDeleteDealRequest, ): Promise { - return localVarFp.deleteDeal(requestParameters.id, ).then((request) => request(axios, basePath)); - }, - /** - * Deletes a product attachment from a deal, using the `product_attachment_id`. - * @summary Delete an attached product from a deal - * @param {BetaApiDeleteDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - deleteDealProduct(requestParameters: BetaApiDeleteDealProductRequest, ): Promise { - return localVarFp.deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id, ).then((request) => request(axios, basePath)); - }, - /** - * Removes an installment from a deal. Only available in Advanced and above plans. - * @summary Delete an installment from a deal - * @param {BetaApiDeleteInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - deleteInstallment(requestParameters: BetaApiDeleteInstallmentRequest, ): Promise { - return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(axios, basePath)); - }, - /** - * Marks a organization as deleted. After 30 days, the organization will be permanently deleted. - * @summary Delete a organization - * @param {BetaApiDeleteOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - deleteOrganization(requestParameters: BetaApiDeleteOrganizationRequest, ): Promise { - return localVarFp.deleteOrganization(requestParameters.id, ).then((request) => request(axios, basePath)); - }, - /** - * Marks a person as deleted. After 30 days, the person will be permanently deleted. - * @summary Delete a person - * @param {BetaApiDeletePersonRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - deletePerson(requestParameters: BetaApiDeletePersonRequest, ): Promise { - return localVarFp.deletePerson(requestParameters.id, ).then((request) => request(axios, basePath)); - }, - /** - * Returns data about all activities. - * @summary Get all activities - * @param {BetaApiGetActivitiesRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getActivities(requestParameters: BetaApiGetActivitiesRequest = {}, ): Promise { - return localVarFp.getActivities(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.person_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Returns the details of a specific activity. - * @summary Get details of an activity - * @param {BetaApiGetActivityRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getActivity(requestParameters: BetaApiGetActivityRequest, ): Promise { - return localVarFp.getActivity(requestParameters.id, requestParameters.include_fields, ).then((request) => request(axios, basePath)); - }, - /** - * Lists discounts attached to a deal. - * @summary List discounts added to a deal - * @param {BetaApiGetAdditionalDiscountsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getAdditionalDiscounts(requestParameters: BetaApiGetAdditionalDiscountsRequest, ): Promise { - return localVarFp.getAdditionalDiscounts(requestParameters.id, ).then((request) => request(axios, basePath)); - }, - /** - * Returns the details of a specific deal. - * @summary Get details of a deal - * @param {BetaApiGetDealRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getDeal(requestParameters: BetaApiGetDealRequest, ): Promise { - return localVarFp.getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(axios, basePath)); - }, - /** - * Lists products attached to a deal. - * @summary List products attached to a deal - * @param {BetaApiGetDealProductsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getDealProducts(requestParameters: BetaApiGetDealProductsRequest, ): Promise { - return localVarFp.getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(axios, basePath)); - }, - /** - * Returns data about all deals. - * @summary Get all deals - * @param {BetaApiGetDealsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getDeals(requestParameters: BetaApiGetDealsRequest = {}, ): Promise { - return localVarFp.getDeals(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.person_id, requestParameters.org_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Returns data about products attached to deals - * @summary Get deal products of several deals - * @param {BetaApiGetDealsProductsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getDealsProducts(requestParameters: BetaApiGetDealsProductsRequest, ): Promise { - return localVarFp.getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(axios, basePath)); - }, - /** - * Lists installments attached to a list of deals. Only available in Advanced and above plans. - * @summary List installments added to a list of deals - * @param {BetaApiGetInstallmentsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getInstallments(requestParameters: BetaApiGetInstallmentsRequest, ): Promise { - return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(axios, basePath)); - }, - /** - * Returns the details of a specific organization. - * @summary Get details of a organization - * @param {BetaApiGetOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getOrganization(requestParameters: BetaApiGetOrganizationRequest, ): Promise { - return localVarFp.getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(axios, basePath)); - }, - /** - * Returns data about all organizations. - * @summary Get all organizations - * @param {BetaApiGetOrganizationsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getOrganizations(requestParameters: BetaApiGetOrganizationsRequest = {}, ): Promise { - return localVarFp.getOrganizations(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. - * @summary Get details of a person - * @param {BetaApiGetPersonRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getPerson(requestParameters: BetaApiGetPersonRequest, ): Promise { - return localVarFp.getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(axios, basePath)); - }, - /** - * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. - * @summary Get all persons - * @param {BetaApiGetPersonsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getPersons(requestParameters: BetaApiGetPersonsRequest = {}, ): Promise { - return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Adds a discount to a deal changing, the deal value if the deal has one-time products attached. - * @summary Add a discount to a deal - * @param {BetaApiPostAdditionalDiscountRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - postAdditionalDiscount(requestParameters: BetaApiPostAdditionalDiscountRequest, ): Promise { - return localVarFp.postAdditionalDiscount(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody, ).then((request) => request(axios, basePath)); - }, - /** - * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans. - * @summary Add an installment to a deal - * @param {BetaApiPostInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - postInstallment(requestParameters: BetaApiPostInstallmentRequest, ): Promise { - return localVarFp.postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody, ).then((request) => request(axios, basePath)); - }, - /** - * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. - * @summary Search deals - * @param {BetaApiSearchDealsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - searchDeals(requestParameters: BetaApiSearchDealsRequest, ): Promise { - return localVarFp.searchDeals(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Performs a search from your choice of item types and fields. - * @summary Perform a search from multiple item types - * @param {BetaApiSearchItemRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - searchItem(requestParameters: BetaApiSearchItemRequest, ): Promise { - return localVarFp.searchItem(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). - * @summary Perform a search using a specific field from an item type - * @param {BetaApiSearchItemByFieldRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - searchItemByField(requestParameters: BetaApiSearchItemByFieldRequest, ): Promise { - return localVarFp.searchItemByField(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. - * @summary Search leads - * @param {BetaApiSearchLeadsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - searchLeads(requestParameters: BetaApiSearchLeadsRequest, ): Promise { - return localVarFp.searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. - * @summary Search organizations - * @param {BetaApiSearchOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - searchOrganization(requestParameters: BetaApiSearchOrganizationRequest, ): Promise { - return localVarFp.searchOrganization(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. - * @summary Search persons - * @param {BetaApiSearchPersonsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - searchPersons(requestParameters: BetaApiSearchPersonsRequest, ): Promise { - return localVarFp.searchPersons(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); - }, - /** - * Updates the properties of an activity. - * @summary Update an activity - * @param {BetaApiUpdateActivityRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updateActivity(requestParameters: BetaApiUpdateActivityRequest, ): Promise { - return localVarFp.updateActivity(requestParameters.id, requestParameters.AddActivityRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. - * @summary Update a discount added to a deal - * @param {BetaApiUpdateAdditionalDiscountRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updateAdditionalDiscount(requestParameters: BetaApiUpdateAdditionalDiscountRequest, ): Promise { - return localVarFp.updateAdditionalDiscount(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody, ).then((request) => request(axios, basePath)); - }, - /** - * Updates the properties of a deal. - * @summary Update a deal - * @param {BetaApiUpdateDealRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updateDeal(requestParameters: BetaApiUpdateDealRequest, ): Promise { - return localVarFp.updateDeal(requestParameters.id, requestParameters.UpdateDealRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Updates the details of the product that has been attached to a deal. - * @summary Update the product attached to a deal - * @param {BetaApiUpdateDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updateDealProduct(requestParameters: BetaApiUpdateDealProductRequest, ): Promise { - return localVarFp.updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Edits an installment added to a deal. Only available in Advanced and above plans. - * @summary Update an installment added to a deal - * @param {BetaApiUpdateInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updateInstallment(requestParameters: BetaApiUpdateInstallmentRequest, ): Promise { - return localVarFp.updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(axios, basePath)); - }, - /** - * Updates the properties of a organization. - * @summary Update a organization - * @param {BetaApiUpdateOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updateOrganization(requestParameters: BetaApiUpdateOrganizationRequest, ): Promise { - return localVarFp.updateOrganization(requestParameters.id, requestParameters.UpdateOrganizationRequest, ).then((request) => request(axios, basePath)); - }, - /** - * Updates the properties of a person. - * @summary Update a person - * @param {BetaApiUpdatePersonRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updatePerson(requestParameters: BetaApiUpdatePersonRequest, ): Promise { - return localVarFp.updatePerson(requestParameters.id, requestParameters.UpdatePersonRequest, ).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * Request parameters for addActivity operation in BetaApi. - * @export - * @interface BetaApiAddActivityRequest - */ -export interface BetaApiAddActivityRequest { - /** - * - * @type {AddActivityRequest} - * @memberof BetaApiAddActivity - */ - readonly AddActivityRequest?: AddActivityRequest -} - -/** - * Request parameters for addDeal operation in BetaApi. - * @export - * @interface BetaApiAddDealRequest - */ -export interface BetaApiAddDealRequest { - /** - * - * @type {AddDealRequest} - * @memberof BetaApiAddDeal - */ - readonly AddDealRequest?: AddDealRequest -} - -/** - * Request parameters for addDealProduct operation in BetaApi. - * @export - * @interface BetaApiAddDealProductRequest - */ -export interface BetaApiAddDealProductRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiAddDealProduct - */ - readonly id: number - - /** - * - * @type {AddDealProductRequest} - * @memberof BetaApiAddDealProduct - */ - readonly AddDealProductRequest?: AddDealProductRequest -} - -/** - * Request parameters for addOrganization operation in BetaApi. - * @export - * @interface BetaApiAddOrganizationRequest - */ -export interface BetaApiAddOrganizationRequest { - /** - * - * @type {AddOrganizationRequest} - * @memberof BetaApiAddOrganization - */ - readonly AddOrganizationRequest?: AddOrganizationRequest -} - -/** - * Request parameters for addPerson operation in BetaApi. - * @export - * @interface BetaApiAddPersonRequest - */ -export interface BetaApiAddPersonRequest { - /** - * - * @type {AddPersonRequest} - * @memberof BetaApiAddPerson - */ - readonly AddPersonRequest?: AddPersonRequest -} - -/** - * Request parameters for deleteActivity operation in BetaApi. - * @export - * @interface BetaApiDeleteActivityRequest - */ -export interface BetaApiDeleteActivityRequest { - /** - * The ID of the activity - * @type {number} - * @memberof BetaApiDeleteActivity - */ - readonly id: number -} - -/** - * Request parameters for deleteAdditionalDiscount operation in BetaApi. - * @export - * @interface BetaApiDeleteAdditionalDiscountRequest - */ -export interface BetaApiDeleteAdditionalDiscountRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiDeleteAdditionalDiscount - */ - readonly id: number - - /** - * The ID of the discount - * @type {number} - * @memberof BetaApiDeleteAdditionalDiscount - */ - readonly discount_id: number -} - -/** - * Request parameters for deleteDeal operation in BetaApi. - * @export - * @interface BetaApiDeleteDealRequest - */ -export interface BetaApiDeleteDealRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiDeleteDeal - */ - readonly id: number -} - -/** - * Request parameters for deleteDealProduct operation in BetaApi. - * @export - * @interface BetaApiDeleteDealProductRequest - */ -export interface BetaApiDeleteDealProductRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiDeleteDealProduct - */ - readonly id: number - - /** - * The product attachment ID - * @type {number} - * @memberof BetaApiDeleteDealProduct - */ - readonly product_attachment_id: number -} - -/** - * Request parameters for deleteInstallment operation in BetaApi. - * @export - * @interface BetaApiDeleteInstallmentRequest - */ -export interface BetaApiDeleteInstallmentRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiDeleteInstallment - */ - readonly id: number - - /** - * The ID of the installment - * @type {number} - * @memberof BetaApiDeleteInstallment - */ - readonly installment_id: number -} - -/** - * Request parameters for deleteOrganization operation in BetaApi. - * @export - * @interface BetaApiDeleteOrganizationRequest - */ -export interface BetaApiDeleteOrganizationRequest { - /** - * The ID of the organization - * @type {number} - * @memberof BetaApiDeleteOrganization - */ - readonly id: number -} - -/** - * Request parameters for deletePerson operation in BetaApi. - * @export - * @interface BetaApiDeletePersonRequest - */ -export interface BetaApiDeletePersonRequest { - /** - * The ID of the person - * @type {number} - * @memberof BetaApiDeletePerson - */ - readonly id: number -} - -/** - * Request parameters for getActivities operation in BetaApi. - * @export - * @interface BetaApiGetActivitiesRequest - */ -export interface BetaApiGetActivitiesRequest { - /** - * If supplied, only activities matching the specified filter are returned - * @type {number} - * @memberof BetaApiGetActivities - */ - readonly filter_id?: number - - /** - * Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @type {string} - * @memberof BetaApiGetActivities - */ - readonly ids?: string - - /** - * If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetActivities - */ - readonly owner_id?: number - - /** - * If supplied, only activities linked to the specified deal are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetActivities - */ - readonly deal_id?: number - - /** - * If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. - * @type {string} - * @memberof BetaApiGetActivities - */ - readonly lead_id?: string - - /** - * If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetActivities - */ - readonly person_id?: number - - /** - * If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetActivities - */ - readonly org_id?: number - - /** - * If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @type {string} - * @memberof BetaApiGetActivities - */ - readonly updated_since?: string - - /** - * If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @type {string} - * @memberof BetaApiGetActivities - */ - readonly updated_until?: string - - /** - * The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @type {'id' | 'update_time' | 'add_time'} - * @memberof BetaApiGetActivities - */ - readonly sort_by?: 'id' | 'update_time' | 'add_time' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof BetaApiGetActivities - */ - readonly sort_direction?: 'asc' | 'desc' - - /** - * Optional comma separated string array of additional fields to include - * @type {'attendees'} - * @memberof BetaApiGetActivities - */ - readonly include_fields?: 'attendees' - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiGetActivities - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiGetActivities - */ - readonly cursor?: string -} - -/** - * Request parameters for getActivity operation in BetaApi. - * @export - * @interface BetaApiGetActivityRequest - */ -export interface BetaApiGetActivityRequest { - /** - * The ID of the activity - * @type {number} - * @memberof BetaApiGetActivity - */ - readonly id: number - - /** - * Optional comma separated string array of additional fields to include - * @type {'attendees'} - * @memberof BetaApiGetActivity - */ - readonly include_fields?: 'attendees' -} - -/** - * Request parameters for getAdditionalDiscounts operation in BetaApi. - * @export - * @interface BetaApiGetAdditionalDiscountsRequest - */ -export interface BetaApiGetAdditionalDiscountsRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiGetAdditionalDiscounts - */ - readonly id: number -} - -/** - * Request parameters for getDeal operation in BetaApi. - * @export - * @interface BetaApiGetDealRequest - */ -export interface BetaApiGetDealRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiGetDeal - */ - readonly id: number - - /** - * Optional comma separated string array of additional fields to include - * @type {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} - * @memberof BetaApiGetDeal - */ - readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' - - /** - * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @type {string} - * @memberof BetaApiGetDeal - */ - readonly custom_fields?: string -} - -/** - * Request parameters for getDealProducts operation in BetaApi. - * @export - * @interface BetaApiGetDealProductsRequest - */ -export interface BetaApiGetDealProductsRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiGetDealProducts - */ - readonly id: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiGetDealProducts - */ - readonly cursor?: string - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiGetDealProducts - */ - readonly limit?: number - - /** - * The field to sort by. Supported fields: `id`, `add_time`, `update_time`. - * @type {'id' | 'add_time' | 'update_time'} - * @memberof BetaApiGetDealProducts - */ - readonly sort_by?: 'id' | 'add_time' | 'update_time' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof BetaApiGetDealProducts - */ - readonly sort_direction?: 'asc' | 'desc' -} - -/** - * Request parameters for getDeals operation in BetaApi. - * @export - * @interface BetaApiGetDealsRequest - */ -export interface BetaApiGetDealsRequest { - /** - * If supplied, only deals matching the specified filter are returned - * @type {number} - * @memberof BetaApiGetDeals - */ - readonly filter_id?: number - - /** - * Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @type {string} - * @memberof BetaApiGetDeals - */ - readonly ids?: string - - /** - * If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetDeals - */ - readonly owner_id?: number - - /** - * If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetDeals - */ - readonly person_id?: number - - /** - * If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetDeals - */ - readonly org_id?: number - - /** - * If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetDeals - */ - readonly pipeline_id?: number - - /** - * If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetDeals - */ - readonly stage_id?: number - - /** - * Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. - * @type {'open' | 'won' | 'lost' | 'deleted'} - * @memberof BetaApiGetDeals - */ - readonly status?: 'open' | 'won' | 'lost' | 'deleted' - - /** - * If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @type {string} - * @memberof BetaApiGetDeals - */ - readonly updated_since?: string - - /** - * If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @type {string} - * @memberof BetaApiGetDeals - */ - readonly updated_until?: string - - /** - * The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @type {'id' | 'update_time' | 'add_time'} - * @memberof BetaApiGetDeals - */ - readonly sort_by?: 'id' | 'update_time' | 'add_time' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof BetaApiGetDeals - */ - readonly sort_direction?: 'asc' | 'desc' - - /** - * Optional comma separated string array of additional fields to include - * @type {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} - * @memberof BetaApiGetDeals - */ - readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' - - /** - * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @type {string} - * @memberof BetaApiGetDeals - */ - readonly custom_fields?: string - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiGetDeals - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiGetDeals - */ - readonly cursor?: string -} - -/** - * Request parameters for getDealsProducts operation in BetaApi. - * @export - * @interface BetaApiGetDealsProductsRequest - */ -export interface BetaApiGetDealsProductsRequest { - /** - * An array of integers with the IDs of the deals for which the attached products will be returned. A maximum of 100 deal IDs can be provided. - * @type {Array} - * @memberof BetaApiGetDealsProducts - */ - readonly deal_ids: Array - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiGetDealsProducts - */ - readonly cursor?: string - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiGetDealsProducts - */ - readonly limit?: number - - /** - * The field to sort by. Supported fields: `id`, `deal_id`, `add_time`, `update_time`. - * @type {'id' | 'deal_id' | 'add_time' | 'update_time'} - * @memberof BetaApiGetDealsProducts - */ - readonly sort_by?: 'id' | 'deal_id' | 'add_time' | 'update_time' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof BetaApiGetDealsProducts - */ - readonly sort_direction?: 'asc' | 'desc' -} - -/** - * Request parameters for getInstallments operation in BetaApi. - * @export - * @interface BetaApiGetInstallmentsRequest - */ -export interface BetaApiGetInstallmentsRequest { - /** - * An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. - * @type {Array} - * @memberof BetaApiGetInstallments - */ - readonly deal_ids: Array - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiGetInstallments - */ - readonly cursor?: string - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiGetInstallments - */ - readonly limit?: number - - /** - * The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. - * @type {'id' | 'billing_date' | 'deal_id'} - * @memberof BetaApiGetInstallments - */ - readonly sort_by?: 'id' | 'billing_date' | 'deal_id' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof BetaApiGetInstallments - */ - readonly sort_direction?: 'asc' | 'desc' -} - -/** - * Request parameters for getOrganization operation in BetaApi. - * @export - * @interface BetaApiGetOrganizationRequest - */ -export interface BetaApiGetOrganizationRequest { - /** - * The ID of the organization - * @type {number} - * @memberof BetaApiGetOrganization - */ - readonly id: number - - /** - * Optional comma separated string array of additional fields to include - * @type {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} - * @memberof BetaApiGetOrganization - */ - readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' - - /** - * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @type {string} - * @memberof BetaApiGetOrganization - */ - readonly custom_fields?: string -} - -/** - * Request parameters for getOrganizations operation in BetaApi. - * @export - * @interface BetaApiGetOrganizationsRequest - */ -export interface BetaApiGetOrganizationsRequest { - /** - * If supplied, only organizations matching the specified filter are returned - * @type {number} - * @memberof BetaApiGetOrganizations - */ - readonly filter_id?: number - - /** - * Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @type {string} - * @memberof BetaApiGetOrganizations - */ - readonly ids?: string - - /** - * If supplied, only organization owned by the specified user are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetOrganizations - */ - readonly owner_id?: number - - /** - * If set, only organizations with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @type {string} - * @memberof BetaApiGetOrganizations - */ - readonly updated_since?: string - - /** - * If set, only organizations with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @type {string} - * @memberof BetaApiGetOrganizations - */ - readonly updated_until?: string - - /** - * The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @type {'id' | 'update_time' | 'add_time'} - * @memberof BetaApiGetOrganizations - */ - readonly sort_by?: 'id' | 'update_time' | 'add_time' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof BetaApiGetOrganizations - */ - readonly sort_direction?: 'asc' | 'desc' - - /** - * Optional comma separated string array of additional fields to include - * @type {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} - * @memberof BetaApiGetOrganizations - */ - readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' - - /** - * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @type {string} - * @memberof BetaApiGetOrganizations - */ - readonly custom_fields?: string - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiGetOrganizations - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiGetOrganizations - */ - readonly cursor?: string -} - -/** - * Request parameters for getPerson operation in BetaApi. - * @export - * @interface BetaApiGetPersonRequest - */ -export interface BetaApiGetPersonRequest { - /** - * The ID of the person - * @type {number} - * @memberof BetaApiGetPerson - */ - readonly id: number - - /** - * Optional comma separated string array of additional fields to include. `marketing_status` and `doi_status` can only be included if the company has marketing app enabled. - * @type {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} - * @memberof BetaApiGetPerson - */ - readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status' - - /** - * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @type {string} - * @memberof BetaApiGetPerson - */ - readonly custom_fields?: string -} - -/** - * Request parameters for getPersons operation in BetaApi. - * @export - * @interface BetaApiGetPersonsRequest - */ -export interface BetaApiGetPersonsRequest { - /** - * If supplied, only persons matching the specified filter are returned - * @type {number} - * @memberof BetaApiGetPersons - */ - readonly filter_id?: number - - /** - * Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. - * @type {string} - * @memberof BetaApiGetPersons - */ - readonly ids?: string - - /** - * If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetPersons - */ - readonly owner_id?: number - - /** - * If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored. - * @type {number} - * @memberof BetaApiGetPersons - */ - readonly org_id?: number - - /** - * If set, only persons with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @type {string} - * @memberof BetaApiGetPersons - */ - readonly updated_since?: string - - /** - * If set, only persons with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. - * @type {string} - * @memberof BetaApiGetPersons - */ - readonly updated_until?: string - - /** - * The field to sort by. Supported fields: `id`, `update_time`, `add_time`. - * @type {'id' | 'update_time' | 'add_time'} - * @memberof BetaApiGetPersons - */ - readonly sort_by?: 'id' | 'update_time' | 'add_time' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof BetaApiGetPersons - */ - readonly sort_direction?: 'asc' | 'desc' - - /** - * Optional comma separated string array of additional fields to include. `marketing_status` and `doi_status` can only be included if the company has marketing app enabled. - * @type {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} - * @memberof BetaApiGetPersons - */ - readonly include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status' - - /** - * Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. - * @type {string} - * @memberof BetaApiGetPersons - */ - readonly custom_fields?: string - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiGetPersons - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiGetPersons - */ - readonly cursor?: string -} - -/** - * Request parameters for postAdditionalDiscount operation in BetaApi. - * @export - * @interface BetaApiPostAdditionalDiscountRequest - */ -export interface BetaApiPostAdditionalDiscountRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiPostAdditionalDiscount - */ - readonly id: number - - /** - * - * @type {AddAdditionalDiscountRequestBody} - * @memberof BetaApiPostAdditionalDiscount - */ - readonly AddAdditionalDiscountRequestBody?: AddAdditionalDiscountRequestBody -} - -/** - * Request parameters for postInstallment operation in BetaApi. - * @export - * @interface BetaApiPostInstallmentRequest - */ -export interface BetaApiPostInstallmentRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiPostInstallment - */ - readonly id: number - - /** - * - * @type {AddInstallmentRequestBody} - * @memberof BetaApiPostInstallment - */ - readonly AddInstallmentRequestBody?: AddInstallmentRequestBody -} - -/** - * Request parameters for searchDeals operation in BetaApi. - * @export - * @interface BetaApiSearchDealsRequest - */ -export interface BetaApiSearchDealsRequest { - /** - * The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @type {string} - * @memberof BetaApiSearchDeals - */ - readonly term: string - - /** - * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'custom_fields' | 'notes' | 'title'} - * @memberof BetaApiSearchDeals - */ - readonly fields?: 'custom_fields' | 'notes' | 'title' - - /** - * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @type {boolean} - * @memberof BetaApiSearchDeals - */ - readonly exact_match?: boolean - - /** - * Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. - * @type {number} - * @memberof BetaApiSearchDeals - */ - readonly person_id?: number - - /** - * Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. - * @type {number} - * @memberof BetaApiSearchDeals - */ - readonly organization_id?: number - - /** - * Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. - * @type {'open' | 'won' | 'lost'} - * @memberof BetaApiSearchDeals - */ - readonly status?: 'open' | 'won' | 'lost' - - /** - * Supports including optional fields in the results which are not provided by default - * @type {'deal.cc_email'} - * @memberof BetaApiSearchDeals - */ - readonly include_fields?: 'deal.cc_email' - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiSearchDeals - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiSearchDeals - */ - readonly cursor?: string -} - -/** - * Request parameters for searchItem operation in BetaApi. - * @export - * @interface BetaApiSearchItemRequest - */ -export interface BetaApiSearchItemRequest { - /** - * The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @type {string} - * @memberof BetaApiSearchItem - */ - readonly term: string - - /** - * A comma-separated string array. The type of items to perform the search from. Defaults to all. - * @type {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} - * @memberof BetaApiSearchItem - */ - readonly item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project' - - /** - * A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<br/> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. - * @type {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description'} - * @memberof BetaApiSearchItem - */ - readonly fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description' - - /** - * When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization - * @type {boolean} - * @memberof BetaApiSearchItem - */ - readonly search_for_related_items?: boolean - - /** - * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @type {boolean} - * @memberof BetaApiSearchItem - */ - readonly exact_match?: boolean - - /** - * A comma-separated string array. Supports including optional fields in the results which are not provided by default. - * @type {'deal.cc_email' | 'person.picture' | 'product.price'} - * @memberof BetaApiSearchItem - */ - readonly include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price' - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiSearchItem - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiSearchItem - */ - readonly cursor?: string -} - -/** - * Request parameters for searchItemByField operation in BetaApi. - * @export - * @interface BetaApiSearchItemByFieldRequest - */ -export interface BetaApiSearchItemByFieldRequest { - /** - * The search term to look for. Minimum 2 characters (or 1 if `match` is `exact`). Please note that the search term has to be URL encoded. - * @type {string} - * @memberof BetaApiSearchItemByField - */ - readonly term: string - - /** - * The type of the field to perform the search from - * @type {'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project'} - * @memberof BetaApiSearchItemByField - */ - readonly entity_type: 'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project' - - /** - * The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields\' API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {string} - * @memberof BetaApiSearchItemByField - */ - readonly field: string - - /** - * The type of match used against the term. The search <b>is</b> case sensitive.<br/><br/> E.g. in case of searching for a value `monkey`, <ul> <li>with `exact` match, you will only find it if term is `monkey`</li> <li>with `beginning` match, you will only find it if the term matches the beginning or the whole string, e.g. `monk` and `monkey`</li> <li>with `middle` match, you will find the it if the term matches any substring of the value, e.g. `onk` and `ke`</li> </ul>. - * @type {'exact' | 'beginning' | 'middle'} - * @memberof BetaApiSearchItemByField - */ - readonly match?: 'exact' | 'beginning' | 'middle' - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiSearchItemByField - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiSearchItemByField - */ - readonly cursor?: string -} - -/** - * Request parameters for searchLeads operation in BetaApi. - * @export - * @interface BetaApiSearchLeadsRequest - */ -export interface BetaApiSearchLeadsRequest { - /** - * The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @type {string} - * @memberof BetaApiSearchLeads - */ - readonly term: string - - /** - * A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @type {'custom_fields' | 'notes' | 'title'} - * @memberof BetaApiSearchLeads - */ - readonly fields?: 'custom_fields' | 'notes' | 'title' - - /** - * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @type {boolean} - * @memberof BetaApiSearchLeads - */ - readonly exact_match?: boolean - - /** - * Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. - * @type {number} - * @memberof BetaApiSearchLeads - */ - readonly person_id?: number - - /** - * Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - * @type {number} - * @memberof BetaApiSearchLeads - */ - readonly organization_id?: number - - /** - * Supports including optional fields in the results which are not provided by default - * @type {'lead.was_seen'} - * @memberof BetaApiSearchLeads - */ - readonly include_fields?: 'lead.was_seen' - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiSearchLeads - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiSearchLeads - */ - readonly cursor?: string -} - -/** - * Request parameters for searchOrganization operation in BetaApi. - * @export - * @interface BetaApiSearchOrganizationRequest - */ -export interface BetaApiSearchOrganizationRequest { - /** - * The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @type {string} - * @memberof BetaApiSearchOrganization - */ - readonly term: string - - /** - * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'address' | 'custom_fields' | 'notes' | 'name'} - * @memberof BetaApiSearchOrganization - */ - readonly fields?: 'address' | 'custom_fields' | 'notes' | 'name' - - /** - * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @type {boolean} - * @memberof BetaApiSearchOrganization - */ - readonly exact_match?: boolean - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiSearchOrganization - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiSearchOrganization - */ - readonly cursor?: string -} - -/** - * Request parameters for searchPersons operation in BetaApi. - * @export - * @interface BetaApiSearchPersonsRequest - */ -export interface BetaApiSearchPersonsRequest { - /** - * The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. - * @type {string} - * @memberof BetaApiSearchPersons - */ - readonly term: string - - /** - * A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. - * @type {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} - * @memberof BetaApiSearchPersons - */ - readonly fields?: 'custom_fields' | 'email' | 'notes' | 'phone' | 'name' - - /** - * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. - * @type {boolean} - * @memberof BetaApiSearchPersons - */ - readonly exact_match?: boolean - - /** - * Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. - * @type {number} - * @memberof BetaApiSearchPersons - */ - readonly organization_id?: number - - /** - * Supports including optional fields in the results which are not provided by default - * @type {'person.picture'} - * @memberof BetaApiSearchPersons - */ - readonly include_fields?: 'person.picture' - - /** - * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - * @type {number} - * @memberof BetaApiSearchPersons - */ - readonly limit?: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof BetaApiSearchPersons - */ - readonly cursor?: string -} - -/** - * Request parameters for updateActivity operation in BetaApi. - * @export - * @interface BetaApiUpdateActivityRequest - */ -export interface BetaApiUpdateActivityRequest { - /** - * The ID of the activity - * @type {number} - * @memberof BetaApiUpdateActivity - */ - readonly id: number - - /** - * - * @type {AddActivityRequest} - * @memberof BetaApiUpdateActivity - */ - readonly AddActivityRequest?: AddActivityRequest -} - -/** - * Request parameters for updateAdditionalDiscount operation in BetaApi. - * @export - * @interface BetaApiUpdateAdditionalDiscountRequest - */ -export interface BetaApiUpdateAdditionalDiscountRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiUpdateAdditionalDiscount - */ - readonly id: number - - /** - * The ID of the discount - * @type {number} - * @memberof BetaApiUpdateAdditionalDiscount - */ - readonly discount_id: number - - /** - * - * @type {UpdateAdditionalDiscountRequestBody} - * @memberof BetaApiUpdateAdditionalDiscount - */ - readonly UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody -} - -/** - * Request parameters for updateDeal operation in BetaApi. - * @export - * @interface BetaApiUpdateDealRequest - */ -export interface BetaApiUpdateDealRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiUpdateDeal - */ - readonly id: number - - /** - * - * @type {UpdateDealRequest} - * @memberof BetaApiUpdateDeal - */ - readonly UpdateDealRequest?: UpdateDealRequest -} - -/** - * Request parameters for updateDealProduct operation in BetaApi. - * @export - * @interface BetaApiUpdateDealProductRequest - */ -export interface BetaApiUpdateDealProductRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiUpdateDealProduct - */ - readonly id: number - - /** - * The ID of the deal-product (the ID of the product attached to the deal) - * @type {number} - * @memberof BetaApiUpdateDealProduct - */ - readonly product_attachment_id: number - - /** - * - * @type {UpdateDealProductRequest} - * @memberof BetaApiUpdateDealProduct - */ - readonly UpdateDealProductRequest?: UpdateDealProductRequest -} - -/** - * Request parameters for updateInstallment operation in BetaApi. - * @export - * @interface BetaApiUpdateInstallmentRequest - */ -export interface BetaApiUpdateInstallmentRequest { - /** - * The ID of the deal - * @type {number} - * @memberof BetaApiUpdateInstallment - */ - readonly id: number - - /** - * The ID of the installment - * @type {number} - * @memberof BetaApiUpdateInstallment - */ - readonly installment_id: number - - /** - * - * @type {UpdateInstallmentRequestBody} - * @memberof BetaApiUpdateInstallment - */ - readonly UpdateInstallmentRequestBody?: UpdateInstallmentRequestBody -} - -/** - * Request parameters for updateOrganization operation in BetaApi. - * @export - * @interface BetaApiUpdateOrganizationRequest - */ -export interface BetaApiUpdateOrganizationRequest { - /** - * The ID of the organization - * @type {number} - * @memberof BetaApiUpdateOrganization - */ - readonly id: number - - /** - * - * @type {UpdateOrganizationRequest} - * @memberof BetaApiUpdateOrganization - */ - readonly UpdateOrganizationRequest?: UpdateOrganizationRequest -} - -/** - * Request parameters for updatePerson operation in BetaApi. - * @export - * @interface BetaApiUpdatePersonRequest - */ -export interface BetaApiUpdatePersonRequest { - /** - * The ID of the person - * @type {number} - * @memberof BetaApiUpdatePerson - */ - readonly id: number - - /** - * - * @type {UpdatePersonRequest} - * @memberof BetaApiUpdatePerson - */ - readonly UpdatePersonRequest?: UpdatePersonRequest -} + }; +}; /** - * BetaApi - object-oriented interface + * Request parameters for deleteInstallment operation in BetaApi. * @export - * @class BetaApi - * @extends {BaseAPI} - */ -export class BetaApi extends BaseAPI { - /** - * Adds a new activity. - * @summary Add a new activity - * @param {BetaApiAddActivityRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public addActivity(requestParameters: BetaApiAddActivityRequest = {}, ) { - return BetaApiFp(this.configuration).addActivity(requestParameters.AddActivityRequest, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Adds a new deal. - * @summary Add a new deal - * @param {BetaApiAddDealRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public addDeal(requestParameters: BetaApiAddDealRequest = {}, ) { - return BetaApiFp(this.configuration).addDeal(requestParameters.AddDealRequest, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Adds a product to a deal, creating a new item called a deal-product. - * @summary Add a product to a deal - * @param {BetaApiAddDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public addDealProduct(requestParameters: BetaApiAddDealProductRequest, ) { - return BetaApiFp(this.configuration).addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Adds a new organization. - * @summary Add a new organization - * @param {BetaApiAddOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public addOrganization(requestParameters: BetaApiAddOrganizationRequest = {}, ) { - return BetaApiFp(this.configuration).addOrganization(requestParameters.AddOrganizationRequest, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Adds a new person. - * @summary Add a new person - * @param {BetaApiAddPersonRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public addPerson(requestParameters: BetaApiAddPersonRequest = {}, ) { - return BetaApiFp(this.configuration).addPerson(requestParameters.AddPersonRequest, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Marks an activity as deleted. After 30 days, the activity will be permanently deleted. - * @summary Delete an activity - * @param {BetaApiDeleteActivityRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public deleteActivity(requestParameters: BetaApiDeleteActivityRequest, ) { - return BetaApiFp(this.configuration).deleteActivity(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); - } - + * @interface BetaApiDeleteInstallmentRequest + */ +export interface BetaApiDeleteInstallmentRequest { /** - * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. - * @summary Delete a discount from a deal - * @param {BetaApiDeleteAdditionalDiscountRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * The ID of the deal + * @type {number} + * @memberof BetaApiDeleteInstallment */ - public deleteAdditionalDiscount(requestParameters: BetaApiDeleteAdditionalDiscountRequest, ) { - return BetaApiFp(this.configuration).deleteAdditionalDiscount(requestParameters.id, requestParameters.discount_id, ).then((request) => request(this.axios, this.basePath)); - } + readonly id: number /** - * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. - * @summary Delete a deal - * @param {BetaApiDeleteDealRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * The ID of the installment + * @type {number} + * @memberof BetaApiDeleteInstallment */ - public deleteDeal(requestParameters: BetaApiDeleteDealRequest, ) { - return BetaApiFp(this.configuration).deleteDeal(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); - } + readonly installment_id: number +} +/** + * Request parameters for getInstallments operation in BetaApi. + * @export + * @interface BetaApiGetInstallmentsRequest + */ +export interface BetaApiGetInstallmentsRequest { /** - * Deletes a product attachment from a deal, using the `product_attachment_id`. - * @summary Delete an attached product from a deal - * @param {BetaApiDeleteDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. + * @type {Array} + * @memberof BetaApiGetInstallments */ - public deleteDealProduct(requestParameters: BetaApiDeleteDealProductRequest, ) { - return BetaApiFp(this.configuration).deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id, ).then((request) => request(this.axios, this.basePath)); - } + readonly deal_ids: Array /** - * Removes an installment from a deal. Only available in Advanced and above plans. - * @summary Delete an installment from a deal - * @param {BetaApiDeleteInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof BetaApiGetInstallments */ - public deleteInstallment(requestParameters: BetaApiDeleteInstallmentRequest, ) { - return BetaApiFp(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(this.axios, this.basePath)); - } + readonly cursor?: string /** - * Marks a organization as deleted. After 30 days, the organization will be permanently deleted. - * @summary Delete a organization - * @param {BetaApiDeleteOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. + * @type {number} + * @memberof BetaApiGetInstallments */ - public deleteOrganization(requestParameters: BetaApiDeleteOrganizationRequest, ) { - return BetaApiFp(this.configuration).deleteOrganization(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); - } + readonly limit?: number /** - * Marks a person as deleted. After 30 days, the person will be permanently deleted. - * @summary Delete a person - * @param {BetaApiDeletePersonRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. + * @type {'id' | 'billing_date' | 'deal_id'} + * @memberof BetaApiGetInstallments */ - public deletePerson(requestParameters: BetaApiDeletePersonRequest, ) { - return BetaApiFp(this.configuration).deletePerson(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); - } + readonly sort_by?: 'id' | 'billing_date' | 'deal_id' /** - * Returns data about all activities. - * @summary Get all activities - * @param {BetaApiGetActivitiesRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * The sorting direction. Supported values: `asc`, `desc`. + * @type {'asc' | 'desc'} + * @memberof BetaApiGetInstallments */ - public getActivities(requestParameters: BetaApiGetActivitiesRequest = {}, ) { - return BetaApiFp(this.configuration).getActivities(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.person_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } + readonly sort_direction?: 'asc' | 'desc' +} +/** + * Request parameters for postInstallment operation in BetaApi. + * @export + * @interface BetaApiPostInstallmentRequest + */ +export interface BetaApiPostInstallmentRequest { /** - * Returns the details of a specific activity. - * @summary Get details of an activity - * @param {BetaApiGetActivityRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * The ID of the deal + * @type {number} + * @memberof BetaApiPostInstallment */ - public getActivity(requestParameters: BetaApiGetActivityRequest, ) { - return BetaApiFp(this.configuration).getActivity(requestParameters.id, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); - } + readonly id: number /** - * Lists discounts attached to a deal. - * @summary List discounts added to a deal - * @param {BetaApiGetAdditionalDiscountsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * + * @type {AddInstallmentRequestBody} + * @memberof BetaApiPostInstallment */ - public getAdditionalDiscounts(requestParameters: BetaApiGetAdditionalDiscountsRequest, ) { - return BetaApiFp(this.configuration).getAdditionalDiscounts(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); - } + readonly AddInstallmentRequestBody?: AddInstallmentRequestBody +} +/** + * Request parameters for updateInstallment operation in BetaApi. + * @export + * @interface BetaApiUpdateInstallmentRequest + */ +export interface BetaApiUpdateInstallmentRequest { /** - * Returns the details of a specific deal. - * @summary Get details of a deal - * @param {BetaApiGetDealRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * The ID of the deal + * @type {number} + * @memberof BetaApiUpdateInstallment */ - public getDeal(requestParameters: BetaApiGetDealRequest, ) { - return BetaApiFp(this.configuration).getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(this.axios, this.basePath)); - } + readonly id: number /** - * Lists products attached to a deal. - * @summary List products attached to a deal - * @param {BetaApiGetDealProductsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * The ID of the installment + * @type {number} + * @memberof BetaApiUpdateInstallment */ - public getDealProducts(requestParameters: BetaApiGetDealProductsRequest, ) { - return BetaApiFp(this.configuration).getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(this.axios, this.basePath)); - } + readonly installment_id: number /** - * Returns data about all deals. - * @summary Get all deals - * @param {BetaApiGetDealsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi + * + * @type {UpdateInstallmentRequestBody} + * @memberof BetaApiUpdateInstallment */ - public getDeals(requestParameters: BetaApiGetDealsRequest = {}, ) { - return BetaApiFp(this.configuration).getDeals(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.person_id, requestParameters.org_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } + readonly UpdateInstallmentRequestBody?: UpdateInstallmentRequestBody +} +/** + * BetaApi - object-oriented interface + * @export + * @class BetaApi + * @extends {BaseAPI} + */ +export class BetaApi extends BaseAPI { /** - * Returns data about products attached to deals - * @summary Get deal products of several deals - * @param {BetaApiGetDealsProductsRequest} requestParameters Request parameters. + * Removes an installment from a deal. Only available in Advanced and above plans. + * @summary Delete an installment from a deal + * @param {BetaApiDeleteInstallmentRequest} requestParameters Request parameters. * @throws {RequiredError} * @memberof BetaApi */ - public getDealsProducts(requestParameters: BetaApiGetDealsProductsRequest, ) { - return BetaApiFp(this.configuration).getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(this.axios, this.basePath)); + public deleteInstallment(requestParameters: BetaApiDeleteInstallmentRequest, ) { + return BetaApiFp(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(this.axios, this.basePath)); } /** @@ -4935,66 +501,6 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(this.axios, this.basePath)); } - /** - * Returns the details of a specific organization. - * @summary Get details of a organization - * @param {BetaApiGetOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public getOrganization(requestParameters: BetaApiGetOrganizationRequest, ) { - return BetaApiFp(this.configuration).getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns data about all organizations. - * @summary Get all organizations - * @param {BetaApiGetOrganizationsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public getOrganizations(requestParameters: BetaApiGetOrganizationsRequest = {}, ) { - return BetaApiFp(this.configuration).getOrganizations(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. - * @summary Get details of a person - * @param {BetaApiGetPersonRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public getPerson(requestParameters: BetaApiGetPersonRequest, ) { - return BetaApiFp(this.configuration).getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. - * @summary Get all persons - * @param {BetaApiGetPersonsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public getPersons(requestParameters: BetaApiGetPersonsRequest = {}, ) { - return BetaApiFp(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Adds a discount to a deal changing, the deal value if the deal has one-time products attached. - * @summary Add a discount to a deal - * @param {BetaApiPostAdditionalDiscountRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public postAdditionalDiscount(requestParameters: BetaApiPostAdditionalDiscountRequest, ) { - return BetaApiFp(this.configuration).postAdditionalDiscount(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody, ).then((request) => request(this.axios, this.basePath)); - } - /** * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans. * @summary Add an installment to a deal @@ -5007,126 +513,6 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody, ).then((request) => request(this.axios, this.basePath)); } - /** - * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. - * @summary Search deals - * @param {BetaApiSearchDealsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public searchDeals(requestParameters: BetaApiSearchDealsRequest, ) { - return BetaApiFp(this.configuration).searchDeals(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Performs a search from your choice of item types and fields. - * @summary Perform a search from multiple item types - * @param {BetaApiSearchItemRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public searchItem(requestParameters: BetaApiSearchItemRequest, ) { - return BetaApiFp(this.configuration).searchItem(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). - * @summary Perform a search using a specific field from an item type - * @param {BetaApiSearchItemByFieldRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public searchItemByField(requestParameters: BetaApiSearchItemByFieldRequest, ) { - return BetaApiFp(this.configuration).searchItemByField(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. - * @summary Search leads - * @param {BetaApiSearchLeadsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public searchLeads(requestParameters: BetaApiSearchLeadsRequest, ) { - return BetaApiFp(this.configuration).searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. - * @summary Search organizations - * @param {BetaApiSearchOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public searchOrganization(requestParameters: BetaApiSearchOrganizationRequest, ) { - return BetaApiFp(this.configuration).searchOrganization(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. - * @summary Search persons - * @param {BetaApiSearchPersonsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public searchPersons(requestParameters: BetaApiSearchPersonsRequest, ) { - return BetaApiFp(this.configuration).searchPersons(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Updates the properties of an activity. - * @summary Update an activity - * @param {BetaApiUpdateActivityRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public updateActivity(requestParameters: BetaApiUpdateActivityRequest, ) { - return BetaApiFp(this.configuration).updateActivity(requestParameters.id, requestParameters.AddActivityRequest, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. - * @summary Update a discount added to a deal - * @param {BetaApiUpdateAdditionalDiscountRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public updateAdditionalDiscount(requestParameters: BetaApiUpdateAdditionalDiscountRequest, ) { - return BetaApiFp(this.configuration).updateAdditionalDiscount(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Updates the properties of a deal. - * @summary Update a deal - * @param {BetaApiUpdateDealRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public updateDeal(requestParameters: BetaApiUpdateDealRequest, ) { - return BetaApiFp(this.configuration).updateDeal(requestParameters.id, requestParameters.UpdateDealRequest, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Updates the details of the product that has been attached to a deal. - * @summary Update the product attached to a deal - * @param {BetaApiUpdateDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public updateDealProduct(requestParameters: BetaApiUpdateDealProductRequest, ) { - return BetaApiFp(this.configuration).updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest, ).then((request) => request(this.axios, this.basePath)); - } - /** * Edits an installment added to a deal. Only available in Advanced and above plans. * @summary Update an installment added to a deal @@ -5138,28 +524,4 @@ export class BetaApi extends BaseAPI { public updateInstallment(requestParameters: BetaApiUpdateInstallmentRequest, ) { return BetaApiFp(this.configuration).updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(this.axios, this.basePath)); } - - /** - * Updates the properties of a organization. - * @summary Update a organization - * @param {BetaApiUpdateOrganizationRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public updateOrganization(requestParameters: BetaApiUpdateOrganizationRequest, ) { - return BetaApiFp(this.configuration).updateOrganization(requestParameters.id, requestParameters.UpdateOrganizationRequest, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Updates the properties of a person. - * @summary Update a person - * @param {BetaApiUpdatePersonRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof BetaApi - */ - public updatePerson(requestParameters: BetaApiUpdatePersonRequest, ) { - return BetaApiFp(this.configuration).updatePerson(requestParameters.id, requestParameters.UpdatePersonRequest, ).then((request) => request(this.axios, this.basePath)); - } }