From 8b6eaf17a438ef73ff0c5f64e854fc448aeb84c2 Mon Sep 17 00:00:00 2001 From: pipedrive-bot Date: Fri, 3 Oct 2025 14:20:56 +0000 Subject: [PATCH] Build 286 - version-patch --- CHANGELOG.md | 2 + docs/v2.md | 2 + src/versions/v1/api/item-search-api.ts | 14 +- src/versions/v1/models/add-team-request.ts | 2 +- src/versions/v1/models/add-team-request1.ts | 2 +- .../v1/models/get-permitted-users-response.ts | 4 +- .../v1/models/get-products-response1.ts | 8 +- src/versions/v1/models/index.ts | 2 - src/versions/v2/api/deals-api.ts | 259 ++++++++++++++++-- src/versions/v2/api/item-search-api.ts | 14 +- .../models/add-many-deal-product-response.ts | 37 +++ .../create-many-deal-product-request.ts | 32 +++ ...y-deal-product-response-additional-data.ts | 29 ++ .../delete-many-deal-product-response-data.ts | 29 ++ .../delete-many-deal-product-response.ts | 45 +++ ...als-products-response-data-inner-all-of.ts | 5 + src/versions/v2/models/index.ts | 7 +- src/versions/v2/models/stage-item1.ts | 74 +++++ .../v2/models/upsert-stage-response.ts | 6 +- 19 files changed, 519 insertions(+), 54 deletions(-) create mode 100644 src/versions/v2/models/add-many-deal-product-response.ts create mode 100644 src/versions/v2/models/create-many-deal-product-request.ts create mode 100644 src/versions/v2/models/delete-many-deal-product-response-additional-data.ts create mode 100644 src/versions/v2/models/delete-many-deal-product-response-data.ts create mode 100644 src/versions/v2/models/delete-many-deal-product-response.ts create mode 100644 src/versions/v2/models/stage-item1.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 12aa14ea..e196a35e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ 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] +### Fixed +- Fixed PHP SDK v2 Configuration to use correct `/v2` API endpoints after OAuth token refresh instead of defaulting to `/v1` ## [29.2.5] - 2025-10-03 diff --git a/docs/v2.md b/docs/v2.md index 8aeb2ead..b4987ea7 100644 --- a/docs/v2.md +++ b/docs/v2.md @@ -24,12 +24,14 @@ BetaApi | uploadProductImage | **POST** /products/{id}/images | Upload an image DealsApi | addDeal | **POST** /deals | Add a new deal DealsApi | addDealFollower | **POST** /deals/{id}/followers | Add a follower to a deal DealsApi | addDealProduct | **POST** /deals/{id}/products | Add a product to a deal +DealsApi | addManyDealProducts | **POST** /deals/{id}/products/bulk | Add multiple products to a deal DealsApi | convertDealToLead | **POST** /deals/{id}/convert/lead | Convert a deal to a lead (BETA) DealsApi | deleteAdditionalDiscount | **DELETE** /deals/{id}/discounts/{discount_id} | Delete a discount from a deal DealsApi | deleteDeal | **DELETE** /deals/{id} | Delete a deal DealsApi | deleteDealFollower | **DELETE** /deals/{id}/followers/{follower_id} | Delete a follower from a deal DealsApi | deleteDealProduct | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal DealsApi | deleteInstallment | **DELETE** /deals/{id}/installments/{installment_id} | Delete an installment from a deal +DealsApi | deleteManyDealProducts | **DELETE** /deals/{id}/products | Delete many products from a deal DealsApi | getAdditionalDiscounts | **GET** /deals/{id}/discounts | List discounts added to a deal DealsApi | getArchivedDeals | **GET** /deals/archived | Get all archived deals DealsApi | getDeal | **GET** /deals/{id} | Get details of a deal diff --git a/src/versions/v1/api/item-search-api.ts b/src/versions/v1/api/item-search-api.ts index b1fb23cc..6e3a009e 100644 --- a/src/versions/v1/api/item-search-api.ts +++ b/src/versions/v1/api/item-search-api.ts @@ -36,7 +36,7 @@ export const ItemSearchApiAxiosParamCreator = function (configuration?: Configur * @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 {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | '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`, `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>. * @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. @@ -45,7 +45,7 @@ export const ItemSearchApiAxiosParamCreator = function (configuration?: Configur * @deprecated * @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', start?: number, limit?: number, ): Promise => { + searchItem: async (term: string, item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project', fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description', search_for_related_items?: boolean, exact_match?: boolean, include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price', start?: number, limit?: number, ): Promise => { // verify required parameter 'term' is not null or undefined assertParamExists('searchItem', 'term', term) const localVarPath = `/itemSearch`; @@ -204,7 +204,7 @@ export const ItemSearchApiFp = function(configuration?: Configuration) { * @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 {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | '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`, `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>. * @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. @@ -213,7 +213,7 @@ export const ItemSearchApiFp = function(configuration?: Configuration) { * @deprecated * @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', start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async searchItem(term: string, item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project', fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description', search_for_related_items?: boolean, exact_match?: boolean, include_fields?: 'deal.cc_email' | 'person.picture' | 'product.price', start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -288,11 +288,11 @@ export interface ItemSearchApiSearchItemRequest { 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'} + * 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`, `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>. + * @type {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'} * @memberof ItemSearchApiSearchItem */ - readonly fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description' + readonly fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | '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 diff --git a/src/versions/v1/models/add-team-request.ts b/src/versions/v1/models/add-team-request.ts index d6ea75a1..a39ee141 100644 --- a/src/versions/v1/models/add-team-request.ts +++ b/src/versions/v1/models/add-team-request.ts @@ -36,7 +36,7 @@ export interface AddTeamRequest { */ 'manager_id'?: number; /** - * The IDs of the users that belong to the team + * The list of user IDs * @type {Array} */ 'users'?: Array; diff --git a/src/versions/v1/models/add-team-request1.ts b/src/versions/v1/models/add-team-request1.ts index 1dbdacec..56f32c3f 100644 --- a/src/versions/v1/models/add-team-request1.ts +++ b/src/versions/v1/models/add-team-request1.ts @@ -36,7 +36,7 @@ export interface AddTeamRequest1 { */ 'description'?: string; /** - * The IDs of the users that belong to the team + * The list of user IDs * @type {Array} */ 'users'?: Array; diff --git a/src/versions/v1/models/get-permitted-users-response.ts b/src/versions/v1/models/get-permitted-users-response.ts index 0f4ee4db..e53945fc 100644 --- a/src/versions/v1/models/get-permitted-users-response.ts +++ b/src/versions/v1/models/get-permitted-users-response.ts @@ -15,12 +15,12 @@ // May contain unused imports in some cases // @ts-ignore -import { BaseResponse1 } from './base-response1'; +import { BaseResponse } from './base-response'; /** * @type GetPermittedUsersResponse * @export */ -export type GetPermittedUsersResponse = BaseResponse1; +export type GetPermittedUsersResponse = BaseResponse; diff --git a/src/versions/v1/models/get-products-response1.ts b/src/versions/v1/models/get-products-response1.ts index 60ca6018..ef66728c 100644 --- a/src/versions/v1/models/get-products-response1.ts +++ b/src/versions/v1/models/get-products-response1.ts @@ -18,10 +18,10 @@ import { GetActivitiesResponseRelatedObjects } from './get-activities-response-related-objects'; // May contain unused imports in some cases // @ts-ignore -import { GetProductResponse } from './get-product-response'; +import { GetFieldsResponseAllOfAdditionalData } from './get-fields-response-all-of-additional-data'; // May contain unused imports in some cases // @ts-ignore -import { GetProductsResponse1AdditionalData } from './get-products-response1-additional-data'; +import { GetProductResponse } from './get-product-response'; /** * @@ -41,9 +41,9 @@ export interface GetProductsResponse1 { 'data': Array; /** * - * @type {GetProductsResponse1AdditionalData} + * @type {GetFieldsResponseAllOfAdditionalData} */ - 'additional_data': GetProductsResponse1AdditionalData; + 'additional_data': GetFieldsResponseAllOfAdditionalData; /** * * @type {GetActivitiesResponseRelatedObjects} diff --git a/src/versions/v1/models/index.ts b/src/versions/v1/models/index.ts index 92fde7a0..8e473bc4 100644 --- a/src/versions/v1/models/index.ts +++ b/src/versions/v1/models/index.ts @@ -112,7 +112,6 @@ export * from './base-pipeline-with-selected-flag'; export * from './base-pipeline-with-selected-flag-all-of'; export * from './base-product'; export * from './base-response'; -export * from './base-response1'; export * from './base-response-all-of'; export * from './base-role-request'; export * from './base-stage'; @@ -497,7 +496,6 @@ export * from './get-product-search-response-all-of-data-items-inner-item'; export * from './get-product-search-response-all-of-data-items-inner-item-owner'; export * from './get-products-response'; export * from './get-products-response1'; -export * from './get-products-response1-additional-data'; export * from './get-products-response-all-of'; export * from './get-products-response-all-of-additional-data'; export * from './get-products-response-all-of-additional-data-all-of'; diff --git a/src/versions/v2/api/deals-api.ts b/src/versions/v2/api/deals-api.ts index e0c82e32..7a54af14 100644 --- a/src/versions/v2/api/deals-api.ts +++ b/src/versions/v2/api/deals-api.ts @@ -42,6 +42,10 @@ import { AddFollowerResponse } from '../models'; // @ts-ignore import { AddInstallmentRequestBody } from '../models'; // @ts-ignore +import { AddManyDealProductResponse } from '../models'; +// @ts-ignore +import { CreateManyDealProductRequest } from '../models'; +// @ts-ignore import { DeleteAdditionalDiscountResponse } from '../models'; // @ts-ignore import { DeleteDealProductResponse } from '../models'; @@ -52,6 +56,8 @@ import { DeleteFollowerResponse } from '../models'; // @ts-ignore import { DeleteInstallmentResponse } from '../models'; // @ts-ignore +import { DeleteManyDealProductResponse } from '../models'; +// @ts-ignore import { GetAdditionalDiscountsResponse } from '../models'; // @ts-ignore import { GetConvertResponse } from '../models'; @@ -220,6 +226,51 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, + /** + * Adds multiple products to a deal in a single request. Maximum of 100 products allowed per request. + * @summary Add multiple products to a deal + * @param {number} id The ID of the deal + * @param {CreateManyDealProductRequest} [CreateManyDealProductRequest] + + * @throws {RequiredError} + */ + addManyDealProducts: async (id: number, CreateManyDealProductRequest?: CreateManyDealProductRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('addManyDealProducts', 'id', id) + const localVarPath = `/deals/{id}/products/bulk` + .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(localVarHeaderParameter, "x-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(CreateManyDealProductRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. * @summary Convert a deal to a lead (BETA) @@ -265,11 +316,11 @@ export const DealsApiAxiosParamCreator = function (configuration?: 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 + * @param {string} discount_id The ID of the discount * @throws {RequiredError} */ - deleteAdditionalDiscount: async (id: number, discount_id: number, ): Promise => { + deleteAdditionalDiscount: async (id: number, discount_id: string, ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('deleteAdditionalDiscount', 'id', id) // verify required parameter 'discount_id' is not null or undefined @@ -473,6 +524,52 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Deletes multiple products from a deal. If no product IDs are specified, up to 100 products will be removed from the deal. A maximum of 100 product IDs can be provided per request. + * @summary Delete many products from a deal + * @param {number} id The ID of the deal + * @param {string} [ids] Comma-separated list of deal product IDs to delete. If not provided, all deal products will be deleted up to 100 items. Maximum 100 IDs allowed. + + * @throws {RequiredError} + */ + deleteManyDealProducts: async (id: number, ids?: string, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteManyDealProducts', '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: 'DELETE', ...baseOptions }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration) + + if (ids !== undefined) { + localVarQueryParameter['ids'] = ids; + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; @@ -844,12 +941,12 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @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 {'id' | 'add_time' | 'update_time' | 'order_nr'} [sort_by] The field to sort by. Supported fields: `id`, `add_time`, `update_time`, `order_nr`. * @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 => { + getDealProducts: async (id: number, cursor?: string, limit?: number, sort_by?: 'id' | 'add_time' | 'update_time' | 'order_nr', sort_direction?: 'asc' | 'desc', ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getDealProducts', 'id', id) const localVarPath = `/deals/{id}/products` @@ -1022,12 +1119,12 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @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 {'id' | 'deal_id' | 'add_time' | 'update_time' | 'order_nr'} [sort_by] The field to sort by. Supported fields: `id`, `deal_id`, `add_time`, `update_time`, `order_nr`. * @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 => { + getDealsProducts: async (deal_ids: Array, cursor?: string, limit?: number, sort_by?: 'id' | 'deal_id' | 'add_time' | 'update_time' | 'order_nr', 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`; @@ -1322,12 +1419,12 @@ export const DealsApiAxiosParamCreator = function (configuration?: 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 {string} discount_id The ID of the discount * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody] * @throws {RequiredError} */ - updateAdditionalDiscount: async (id: number, discount_id: number, UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody, ): Promise => { + updateAdditionalDiscount: async (id: number, discount_id: string, 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 @@ -1556,6 +1653,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealProduct(id, AddDealProductRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Adds multiple products to a deal in a single request. Maximum of 100 products allowed per request. + * @summary Add multiple products to a deal + * @param {number} id The ID of the deal + * @param {CreateManyDealProductRequest} [CreateManyDealProductRequest] + + * @throws {RequiredError} + */ + async addManyDealProducts(id: number, CreateManyDealProductRequest?: CreateManyDealProductRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addManyDealProducts(id, CreateManyDealProductRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. * @summary Convert a deal to a lead (BETA) @@ -1571,11 +1680,11 @@ export const DealsApiFp = function(configuration?: 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 + * @param {string} discount_id The ID of the discount * @throws {RequiredError} */ - async deleteAdditionalDiscount(id: number, discount_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + async deleteAdditionalDiscount(id: number, discount_id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAdditionalDiscount(id, discount_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1626,6 +1735,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInstallment(id, installment_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Deletes multiple products from a deal. If no product IDs are specified, up to 100 products will be removed from the deal. A maximum of 100 product IDs can be provided per request. + * @summary Delete many products from a deal + * @param {number} id The ID of the deal + * @param {string} [ids] Comma-separated list of deal product IDs to delete. If not provided, all deal products will be deleted up to 100 items. Maximum 100 IDs allowed. + + * @throws {RequiredError} + */ + async deleteManyDealProducts(id: number, ids?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteManyDealProducts(id, ids, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Lists discounts attached to a deal. * @summary List discounts added to a deal @@ -1720,12 +1841,12 @@ export const DealsApiFp = function(configuration?: Configuration) { * @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 {'id' | 'add_time' | 'update_time' | 'order_nr'} [sort_by] The field to sort by. Supported fields: `id`, `add_time`, `update_time`, `order_nr`. * @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> { + async getDealProducts(id: number, cursor?: string, limit?: number, sort_by?: 'id' | 'add_time' | 'update_time' | 'order_nr', 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); }, @@ -1761,12 +1882,12 @@ export const DealsApiFp = function(configuration?: Configuration) { * @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 {'id' | 'deal_id' | 'add_time' | 'update_time' | 'order_nr'} [sort_by] The field to sort by. Supported fields: `id`, `deal_id`, `add_time`, `update_time`, `order_nr`. * @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> { + async getDealsProducts(deal_ids: Array, cursor?: string, limit?: number, sort_by?: 'id' | 'deal_id' | 'add_time' | 'update_time' | 'order_nr', 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); }, @@ -1832,12 +1953,12 @@ export const DealsApiFp = function(configuration?: 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 {string} 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> { + async updateAdditionalDiscount(id: number, discount_id: string, UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateAdditionalDiscount(id, discount_id, UpdateAdditionalDiscountRequestBody, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -1919,6 +2040,16 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath addDealProduct(requestParameters: DealsApiAddDealProductRequest, ): Promise { return localVarFp.addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest, ).then((request) => request(axios, basePath)); }, + /** + * Adds multiple products to a deal in a single request. Maximum of 100 products allowed per request. + * @summary Add multiple products to a deal + * @param {DealsApiAddManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addManyDealProducts(requestParameters: DealsApiAddManyDealProductsRequest, ): Promise { + return localVarFp.addManyDealProducts(requestParameters.id, requestParameters.CreateManyDealProductRequest, ).then((request) => request(axios, basePath)); + }, /** * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. * @summary Convert a deal to a lead (BETA) @@ -1979,6 +2110,16 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath deleteInstallment(requestParameters: DealsApiDeleteInstallmentRequest, ): Promise { return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(axios, basePath)); }, + /** + * Deletes multiple products from a deal. If no product IDs are specified, up to 100 products will be removed from the deal. A maximum of 100 product IDs can be provided per request. + * @summary Delete many products from a deal + * @param {DealsApiDeleteManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteManyDealProducts(requestParameters: DealsApiDeleteManyDealProductsRequest, ): Promise { + return localVarFp.deleteManyDealProducts(requestParameters.id, requestParameters.ids, ).then((request) => request(axios, basePath)); + }, /** * Lists discounts attached to a deal. * @summary List discounts added to a deal @@ -2208,6 +2349,27 @@ export interface DealsApiAddDealProductRequest { readonly AddDealProductRequest?: AddDealProductRequest } +/** + * Request parameters for addManyDealProducts operation in DealsApi. + * @export + * @interface DealsApiAddManyDealProductsRequest + */ +export interface DealsApiAddManyDealProductsRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealsApiAddManyDealProducts + */ + readonly id: number + + /** + * + * @type {CreateManyDealProductRequest} + * @memberof DealsApiAddManyDealProducts + */ + readonly CreateManyDealProductRequest?: CreateManyDealProductRequest +} + /** * Request parameters for convertDealToLead operation in DealsApi. * @export @@ -2237,10 +2399,10 @@ export interface DealsApiDeleteAdditionalDiscountRequest { /** * The ID of the discount - * @type {number} + * @type {string} * @memberof DealsApiDeleteAdditionalDiscount */ - readonly discount_id: number + readonly discount_id: string } /** @@ -2320,6 +2482,27 @@ export interface DealsApiDeleteInstallmentRequest { readonly installment_id: number } +/** + * Request parameters for deleteManyDealProducts operation in DealsApi. + * @export + * @interface DealsApiDeleteManyDealProductsRequest + */ +export interface DealsApiDeleteManyDealProductsRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealsApiDeleteManyDealProducts + */ + readonly id: number + + /** + * Comma-separated list of deal product IDs to delete. If not provided, all deal products will be deleted up to 100 items. Maximum 100 IDs allowed. + * @type {string} + * @memberof DealsApiDeleteManyDealProducts + */ + readonly ids?: string +} + /** * Request parameters for getAdditionalDiscounts operation in DealsApi. * @export @@ -2586,11 +2769,11 @@ export interface DealsApiGetDealProductsRequest { readonly limit?: number /** - * The field to sort by. Supported fields: `id`, `add_time`, `update_time`. - * @type {'id' | 'add_time' | 'update_time'} + * The field to sort by. Supported fields: `id`, `add_time`, `update_time`, `order_nr`. + * @type {'id' | 'add_time' | 'update_time' | 'order_nr'} * @memberof DealsApiGetDealProducts */ - readonly sort_by?: 'id' | 'add_time' | 'update_time' + readonly sort_by?: 'id' | 'add_time' | 'update_time' | 'order_nr' /** * The sorting direction. Supported values: `asc`, `desc`. @@ -2747,11 +2930,11 @@ export interface DealsApiGetDealsProductsRequest { 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'} + * The field to sort by. Supported fields: `id`, `deal_id`, `add_time`, `update_time`, `order_nr`. + * @type {'id' | 'deal_id' | 'add_time' | 'update_time' | 'order_nr'} * @memberof DealsApiGetDealsProducts */ - readonly sort_by?: 'id' | 'deal_id' | 'add_time' | 'update_time' + readonly sort_by?: 'id' | 'deal_id' | 'add_time' | 'update_time' | 'order_nr' /** * The sorting direction. Supported values: `asc`, `desc`. @@ -2930,10 +3113,10 @@ export interface DealsApiUpdateAdditionalDiscountRequest { /** * The ID of the discount - * @type {number} + * @type {string} * @memberof DealsApiUpdateAdditionalDiscount */ - readonly discount_id: number + readonly discount_id: string /** * @@ -3063,6 +3246,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Adds multiple products to a deal in a single request. Maximum of 100 products allowed per request. + * @summary Add multiple products to a deal + * @param {DealsApiAddManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public addManyDealProducts(requestParameters: DealsApiAddManyDealProductsRequest, ) { + return DealsApiFp(this.configuration).addManyDealProducts(requestParameters.id, requestParameters.CreateManyDealProductRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint. * @summary Convert a deal to a lead (BETA) @@ -3135,6 +3330,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Deletes multiple products from a deal. If no product IDs are specified, up to 100 products will be removed from the deal. A maximum of 100 product IDs can be provided per request. + * @summary Delete many products from a deal + * @param {DealsApiDeleteManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public deleteManyDealProducts(requestParameters: DealsApiDeleteManyDealProductsRequest, ) { + return DealsApiFp(this.configuration).deleteManyDealProducts(requestParameters.id, requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists discounts attached to a deal. * @summary List discounts added to a deal diff --git a/src/versions/v2/api/item-search-api.ts b/src/versions/v2/api/item-search-api.ts index fd72e832..d5c410c1 100644 --- a/src/versions/v2/api/item-search-api.ts +++ b/src/versions/v2/api/item-search-api.ts @@ -36,7 +36,7 @@ export const ItemSearchApiAxiosParamCreator = function (configuration?: Configur * @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 {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | '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`, `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>. * @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. @@ -45,7 +45,7 @@ export const ItemSearchApiAxiosParamCreator = function (configuration?: Configur * @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 => { + searchItem: async (term: string, item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project', fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | '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`; @@ -199,7 +199,7 @@ export const ItemSearchApiFp = function(configuration?: Configuration) { * @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 {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | '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`, `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>. * @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. @@ -208,7 +208,7 @@ export const ItemSearchApiFp = function(configuration?: Configuration) { * @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> { + async searchItem(term: string, item_types?: 'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project', fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | '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); }, @@ -282,11 +282,11 @@ export interface ItemSearchApiSearchItemRequest { 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'} + * 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`, `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>. + * @type {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'} * @memberof ItemSearchApiSearchItem */ - readonly fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description' + readonly fields?: 'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | '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 diff --git a/src/versions/v2/models/add-many-deal-product-response.ts b/src/versions/v2/models/add-many-deal-product-response.ts new file mode 100644 index 00000000..6bcc7997 --- /dev/null +++ b/src/versions/v2/models/add-many-deal-product-response.ts @@ -0,0 +1,37 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { GetDealsProductsResponseDataInner } from './get-deals-products-response-data-inner'; + +/** +* +* @export +* @interface AddManyDealProductResponse +*/ +export interface AddManyDealProductResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * Array of created deal products + * @type {Array} + */ + 'data'?: Array; +} + diff --git a/src/versions/v2/models/create-many-deal-product-request.ts b/src/versions/v2/models/create-many-deal-product-request.ts new file mode 100644 index 00000000..0f94ab60 --- /dev/null +++ b/src/versions/v2/models/create-many-deal-product-request.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { AddDealProductRequest } from './add-deal-product-request'; + +/** +* +* @export +* @interface CreateManyDealProductRequest +*/ +export interface CreateManyDealProductRequest { + /** + * Array of products to attach to the deal. See the single product endpoint (https://developers.pipedrive.com/docs/api/v1/Deals#addDealProduct) for the expected format of array items. + * @type {Array} + */ + 'data': Array; +} + diff --git a/src/versions/v2/models/delete-many-deal-product-response-additional-data.ts b/src/versions/v2/models/delete-many-deal-product-response-additional-data.ts new file mode 100644 index 00000000..a1fe257f --- /dev/null +++ b/src/versions/v2/models/delete-many-deal-product-response-additional-data.ts @@ -0,0 +1,29 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** +* +* @export +* @interface DeleteManyDealProductResponseAdditionalData +*/ +export interface DeleteManyDealProductResponseAdditionalData { + /** + * Whether there are more products to delete (when the deal has more than 100 products) + * @type {boolean} + */ + 'more_items_in_collection'?: boolean; +} + diff --git a/src/versions/v2/models/delete-many-deal-product-response-data.ts b/src/versions/v2/models/delete-many-deal-product-response-data.ts new file mode 100644 index 00000000..363184ba --- /dev/null +++ b/src/versions/v2/models/delete-many-deal-product-response-data.ts @@ -0,0 +1,29 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** +* +* @export +* @interface DeleteManyDealProductResponseData +*/ +export interface DeleteManyDealProductResponseData { + /** + * Array of IDs of products that were deleted from the deal + * @type {Array} + */ + 'ids'?: Array; +} + diff --git a/src/versions/v2/models/delete-many-deal-product-response.ts b/src/versions/v2/models/delete-many-deal-product-response.ts new file mode 100644 index 00000000..b9981a28 --- /dev/null +++ b/src/versions/v2/models/delete-many-deal-product-response.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { DeleteManyDealProductResponseAdditionalData } from './delete-many-deal-product-response-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { DeleteManyDealProductResponseData } from './delete-many-deal-product-response-data'; + +/** +* +* @export +* @interface DeleteManyDealProductResponse +*/ +export interface DeleteManyDealProductResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {DeleteManyDealProductResponseData} + */ + 'data'?: DeleteManyDealProductResponseData; + /** + * + * @type {DeleteManyDealProductResponseAdditionalData} + */ + 'additional_data'?: DeleteManyDealProductResponseAdditionalData | null; +} + diff --git a/src/versions/v2/models/get-deals-products-response-data-inner-all-of.ts b/src/versions/v2/models/get-deals-products-response-data-inner-all-of.ts index 09ad593e..dcf8b9b5 100644 --- a/src/versions/v2/models/get-deals-products-response-data-inner-all-of.ts +++ b/src/versions/v2/models/get-deals-products-response-data-inner-all-of.ts @@ -56,6 +56,11 @@ export interface GetDealsProductsResponseDataInnerAllOf { */ 'product_variation_id'?: number | null; /** + * The order number of the product within the deal + * @type {number} + */ + 'order_nr'?: number | null; + /** * The date and time when the product was added to the deal * @type {string} */ diff --git a/src/versions/v2/models/index.ts b/src/versions/v2/models/index.ts index 15dc409a..6f36ceca 100644 --- a/src/versions/v2/models/index.ts +++ b/src/versions/v2/models/index.ts @@ -17,6 +17,7 @@ export * from './add-deal-request'; export * from './add-follower-response'; export * from './add-follower-response-all-of'; export * from './add-installment-request-body'; +export * from './add-many-deal-product-response'; export * from './add-organization-request'; export * from './add-person-request'; export * from './add-person-request-emails-inner'; @@ -32,6 +33,7 @@ export * from './base-product-all-of'; export * from './base-product-all-of1'; export * from './base-response'; export * from './convert-lead-to-deal-request'; +export * from './create-many-deal-product-request'; export * from './deal-item'; export * from './deal-item1'; export * from './deal-product-request-body'; @@ -48,6 +50,9 @@ export * from './delete-follower-response'; export * from './delete-follower-response-data'; export * from './delete-installment-response'; export * from './delete-installment-response-data'; +export * from './delete-many-deal-product-response'; +export * from './delete-many-deal-product-response-additional-data'; +export * from './delete-many-deal-product-response-data'; export * from './delete-organization-response'; export * from './delete-organization-response-data'; export * from './delete-person-response'; @@ -155,8 +160,8 @@ export * from './organization-item1'; export * from './organization-item-address'; export * from './prices-array'; export * from './product-request'; -export * from './stage'; export * from './stage-item'; +export * from './stage-item1'; export * from './update-additional-discount-request-body'; export * from './update-additional-discount-response'; export * from './update-deal-product-request'; diff --git a/src/versions/v2/models/stage-item1.ts b/src/versions/v2/models/stage-item1.ts new file mode 100644 index 00000000..2e5f7d1b --- /dev/null +++ b/src/versions/v2/models/stage-item1.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** +* The stage object +* @export +* @interface StageItem1 +*/ +export interface StageItem1 { + /** + * The ID of the stage + * @type {number} + */ + 'id'?: number; + /** + * Defines the order of the stage + * @type {number} + */ + 'order_nr'?: number; + /** + * The name of the stage + * @type {string} + */ + 'name'?: string; + /** + * Whether the stage is marked as deleted or not + * @type {boolean} + */ + 'is_deleted'?: boolean; + /** + * The success probability percentage of the deal. Used/shown when the deal weighted values are used. + * @type {number} + */ + 'deal_probability'?: number; + /** + * The ID of the pipeline to add the stage to + * @type {number} + */ + 'pipeline_id'?: number; + /** + * Whether deals in this stage can become rotten + * @type {boolean} + */ + 'is_deal_rot_enabled'?: boolean; + /** + * The number of days the deals not updated in this stage would become rotten. Applies only if the `is_deal_rot_enabled` is set. + * @type {number} + */ + 'days_to_rotten'?: number | null; + /** + * The stage creation time + * @type {string} + */ + 'add_time'?: string; + /** + * The stage update time + * @type {string} + */ + 'update_time'?: string; +} + diff --git a/src/versions/v2/models/upsert-stage-response.ts b/src/versions/v2/models/upsert-stage-response.ts index 9dd0306a..f3914063 100644 --- a/src/versions/v2/models/upsert-stage-response.ts +++ b/src/versions/v2/models/upsert-stage-response.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import { Stage } from './stage'; +import { StageItem1 } from './stage-item1'; /** * @@ -30,8 +30,8 @@ export interface UpsertStageResponse { 'success'?: boolean; /** * - * @type {Stage} + * @type {StageItem1} */ - 'data'?: Stage; + 'data'?: StageItem1; }