diff --git a/CHANGELOG.md b/CHANGELOG.md index 00e169d0..e528e954 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ 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 +- Added projects v2 API +- Added project boards v2 API +- Added project phases v2 API +- Added project tasks v2 API +- Added project search v2 API +- Added project templates v2 API +- Added project fields v2 API +- Added `include_option_labels` parameter for v2 GET deal, person and organization endpoints +- Added `include_labels` parameter to v2 GET deal, person, and organization endpoints ## [32.2.1] - 2026-04-20 ### Changed diff --git a/docs/v1.md b/docs/v1.md index dd8765ab..19318c4f 100644 --- a/docs/v1.md +++ b/docs/v1.md @@ -162,10 +162,12 @@ ProductsApi | getProductDeals | **GET** /products/{id}/deals | Get deals where a ProductsApi | getProductFiles | **GET** /products/{id}/files | List files attached to a product ProductsApi | getProductFollowers | **GET** /products/{id}/followers | List followers of a product ProductsApi | getProductUsers | **GET** /products/{id}/permittedUsers | List permitted users +ProjectBoardsApi | getProjectsBoard | **GET** /projects/boards/{id} | Get details of a board +ProjectBoardsApi | getProjectsBoards | **GET** /projects/boards | Get all project boards +ProjectPhasesApi | getProjectsPhase | **GET** /projects/phases/{id} | Get details of a phase +ProjectPhasesApi | getProjectsPhases | **GET** /projects/phases | Get project phases ProjectTemplatesApi | getProjectTemplate | **GET** /projectTemplates/{id} | Get details of a template ProjectTemplatesApi | getProjectTemplates | **GET** /projectTemplates | Get all project templates -ProjectTemplatesApi | getProjectsBoard | **GET** /projects/boards/{id} | Get details of a board -ProjectTemplatesApi | getProjectsPhase | **GET** /projects/phases/{id} | Get details of a phase ProjectsApi | addProject | **POST** /projects | Add a project ProjectsApi | archiveProject | **POST** /projects/{id}/archive | Archive a project ProjectsApi | deleteProject | **DELETE** /projects/{id} | Delete a project @@ -175,8 +177,6 @@ ProjectsApi | getProjectGroups | **GET** /projects/{id}/groups | Returns project ProjectsApi | getProjectPlan | **GET** /projects/{id}/plan | Returns project plan ProjectsApi | getProjectTasks | **GET** /projects/{id}/tasks | Returns project tasks ProjectsApi | getProjects | **GET** /projects | Get all projects -ProjectsApi | getProjectsBoards | **GET** /projects/boards | Get all project boards -ProjectsApi | getProjectsPhases | **GET** /projects/phases | Get project phases ProjectsApi | putProjectPlanActivity | **PUT** /projects/{id}/plan/activities/{activityId} | Update activity in project plan ProjectsApi | putProjectPlanTask | **PUT** /projects/{id}/plan/tasks/{taskId} | Update task in project plan ProjectsApi | updateProject | **PUT** /projects/{id} | Update a project diff --git a/docs/v2.md b/docs/v2.md index 5d56438b..8bd9432e 100644 --- a/docs/v2.md +++ b/docs/v2.md @@ -11,6 +11,30 @@ ActivitiesApi | getActivity | **GET** /activities/{id} | Get details of an activ ActivitiesApi | updateActivity | **PATCH** /activities/{id} | Update an activity ActivityFieldsApi | getActivityField | **GET** /activityFields/{field_code} | Get one activity field ActivityFieldsApi | getActivityFields | **GET** /activityFields | Get all activity fields +BetaApi | addProjectBoard | **POST** /boards | Add a project board +BetaApi | addProjectField | **POST** /projectFields | Create one project field +BetaApi | addProjectFieldOptions | **POST** /projectFields/{field_code}/options | Add project field options in bulk +BetaApi | addProjectPhase | **POST** /phases | Add a project phase +BetaApi | addTask | **POST** /tasks | Add a task +BetaApi | deleteProjectBoard | **DELETE** /boards/{id} | Delete a project board +BetaApi | deleteProjectField | **DELETE** /projectFields/{field_code} | Delete one project field +BetaApi | deleteProjectFieldOptions | **DELETE** /projectFields/{field_code}/options | Delete project field options in bulk +BetaApi | deleteProjectPhase | **DELETE** /phases/{id} | Delete a project phase +BetaApi | deleteTask | **DELETE** /tasks/{id} | Delete a task +BetaApi | getProjectField | **GET** /projectFields/{field_code} | Get one project field +BetaApi | getProjectFields | **GET** /projectFields | Get all project fields +BetaApi | getProjectsBoard | **GET** /boards/{id} | Get details of a project board +BetaApi | getProjectsBoards | **GET** /boards | Get all project boards +BetaApi | getProjectsPhase | **GET** /phases/{id} | Get details of a project phase +BetaApi | getProjectsPhases | **GET** /phases | Get project phases +BetaApi | getTask | **GET** /tasks/{id} | Get details of a task +BetaApi | getTasks | **GET** /tasks | Get all tasks +BetaApi | searchProjects | **GET** /projects/search | Search projects +BetaApi | updateProjectBoard | **PATCH** /boards/{id} | Update a project board +BetaApi | updateProjectField | **PATCH** /projectFields/{field_code} | Update one project field +BetaApi | updateProjectFieldOptions | **PATCH** /projectFields/{field_code}/options | Update project field options in bulk +BetaApi | updateProjectPhase | **PATCH** /phases/{id} | Update a project phase +BetaApi | updateTask | **PATCH** /tasks/{id} | Update a task DealFieldsApi | addDealField | **POST** /dealFields | Create one deal field DealFieldsApi | addDealFieldOptions | **POST** /dealFields/{field_code}/options | Add deal field options in bulk DealFieldsApi | deleteDealField | **DELETE** /dealFields/{field_code} | Delete one deal field @@ -19,34 +43,34 @@ DealFieldsApi | getDealField | **GET** /dealFields/{field_code} | Get one deal f DealFieldsApi | getDealFields | **GET** /dealFields | Get all deal fields DealFieldsApi | updateDealField | **PATCH** /dealFields/{field_code} | Update one deal field DealFieldsApi | updateDealFieldOptions | **PATCH** /dealFields/{field_code}/options | Update deal field options in bulk +DealInstallmentsApi | deleteInstallment | **DELETE** /deals/{id}/installments/{installment_id} | Delete an installment from a deal +DealInstallmentsApi | getInstallments | **GET** /deals/installments | List installments added to a list of deals +DealInstallmentsApi | postInstallment | **POST** /deals/{id}/installments | Add an installment to a deal +DealInstallmentsApi | updateInstallment | **PATCH** /deals/{id}/installments/{installment_id} | Update an installment added to a deal +DealProductsApi | addDealProduct | **POST** /deals/{id}/products | Add a product to a deal +DealProductsApi | addManyDealProducts | **POST** /deals/{id}/products/bulk | Add multiple products to a deal +DealProductsApi | deleteDealProduct | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal +DealProductsApi | deleteManyDealProducts | **DELETE** /deals/{id}/products | Delete many products from a deal +DealProductsApi | getDealProducts | **GET** /deals/{id}/products | List products attached to a deal +DealProductsApi | getDealsProducts | **GET** /deals/products | Get deal products of several deals +DealProductsApi | updateDealProduct | **PATCH** /deals/{id}/products/{product_attachment_id} | Update the product attached to a deal 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 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 DealsApi | getDealConversionStatus | **GET** /deals/{id}/convert/status/{conversion_id} | Get Deal conversion status DealsApi | getDealFollowers | **GET** /deals/{id}/followers | List followers of a deal DealsApi | getDealFollowersChangelog | **GET** /deals/{id}/followers/changelog | List followers changelog of a deal -DealsApi | getDealProducts | **GET** /deals/{id}/products | List products attached to a deal DealsApi | getDeals | **GET** /deals | Get all deals -DealsApi | getDealsProducts | **GET** /deals/products | Get deal products of several deals -DealsApi | getInstallments | **GET** /deals/installments | List installments added to a list of deals DealsApi | postAdditionalDiscount | **POST** /deals/{id}/discounts | Add a discount to a deal -DealsApi | postInstallment | **POST** /deals/{id}/installments | Add an installment to a deal DealsApi | searchDeals | **GET** /deals/search | Search deals DealsApi | updateAdditionalDiscount | **PATCH** /deals/{id}/discounts/{discount_id} | Update a discount added to a deal DealsApi | updateDeal | **PATCH** /deals/{id} | Update a deal -DealsApi | updateDealProduct | **PATCH** /deals/{id}/products/{product_attachment_id} | Update the product attached to a deal -DealsApi | updateInstallment | **PATCH** /deals/{id}/installments/{installment_id} | Update an installment added to a deal ItemSearchApi | searchItem | **GET** /itemSearch | Perform a search from multiple item types ItemSearchApi | searchItemByField | **GET** /itemSearch/field | Perform a search using a specific field from an item type LeadsApi | convertLeadToDeal | **POST** /leads/{id}/convert/deal | Convert a lead to a deal @@ -121,11 +145,46 @@ ProductsApi | updateProduct | **PATCH** /products/{id} | Update a product ProductsApi | updateProductImage | **PUT** /products/{id}/images | Update an image for a product ProductsApi | updateProductVariation | **PATCH** /products/{id}/variations/{product_variation_id} | Update a product variation ProductsApi | uploadProductImage | **POST** /products/{id}/images | Upload an image for a product +ProjectBoardsApi | addProjectBoard | **POST** /boards | Add a project board +ProjectBoardsApi | deleteProjectBoard | **DELETE** /boards/{id} | Delete a project board +ProjectBoardsApi | getProjectsBoard | **GET** /boards/{id} | Get details of a project board +ProjectBoardsApi | getProjectsBoards | **GET** /boards | Get all project boards +ProjectBoardsApi | updateProjectBoard | **PATCH** /boards/{id} | Update a project board +ProjectFieldsApi | addProjectField | **POST** /projectFields | Create one project field +ProjectFieldsApi | addProjectFieldOptions | **POST** /projectFields/{field_code}/options | Add project field options in bulk +ProjectFieldsApi | deleteProjectField | **DELETE** /projectFields/{field_code} | Delete one project field +ProjectFieldsApi | deleteProjectFieldOptions | **DELETE** /projectFields/{field_code}/options | Delete project field options in bulk +ProjectFieldsApi | getProjectField | **GET** /projectFields/{field_code} | Get one project field +ProjectFieldsApi | getProjectFields | **GET** /projectFields | Get all project fields +ProjectFieldsApi | updateProjectField | **PATCH** /projectFields/{field_code} | Update one project field +ProjectFieldsApi | updateProjectFieldOptions | **PATCH** /projectFields/{field_code}/options | Update project field options in bulk +ProjectPhasesApi | addProjectPhase | **POST** /phases | Add a project phase +ProjectPhasesApi | deleteProjectPhase | **DELETE** /phases/{id} | Delete a project phase +ProjectPhasesApi | getProjectsPhase | **GET** /phases/{id} | Get details of a project phase +ProjectPhasesApi | getProjectsPhases | **GET** /phases | Get project phases +ProjectPhasesApi | updateProjectPhase | **PATCH** /phases/{id} | Update a project phase +ProjectTemplatesApi | getProjectTemplate | **GET** /projectTemplates/{id} | Get details of a template +ProjectTemplatesApi | getProjectTemplates | **GET** /projectTemplates | Get all project templates +ProjectsApi | addProject | **POST** /projects | Add a project +ProjectsApi | archiveProject | **POST** /projects/{id}/archive | Archive a project +ProjectsApi | deleteProject | **DELETE** /projects/{id} | Delete a project +ProjectsApi | getArchivedProjects | **GET** /projects/archived | Get all archived projects +ProjectsApi | getProject | **GET** /projects/{id} | Get details of a project +ProjectsApi | getProjectChangelog | **GET** /projects/{id}/changelog | List updates about project field values +ProjectsApi | getProjectUsers | **GET** /projects/{id}/permittedUsers | List permitted users +ProjectsApi | getProjects | **GET** /projects | Get all projects +ProjectsApi | searchProjects | **GET** /projects/search | Search projects +ProjectsApi | updateProject | **PATCH** /projects/{id} | Update a project StagesApi | addStage | **POST** /stages | Add a new stage StagesApi | deleteStage | **DELETE** /stages/{id} | Delete a stage StagesApi | getStage | **GET** /stages/{id} | Get one stage StagesApi | getStages | **GET** /stages | Get all stages StagesApi | updateStage | **PATCH** /stages/{id} | Update stage details +TasksApi | addTask | **POST** /tasks | Add a task +TasksApi | deleteTask | **DELETE** /tasks/{id} | Delete a task +TasksApi | getTask | **GET** /tasks/{id} | Get details of a task +TasksApi | getTasks | **GET** /tasks | Get all tasks +TasksApi | updateTask | **PATCH** /tasks/{id} | Update a task UsersApi | getUserFollowers | **GET** /users/{id}/followers | List followers of a user ## Documentation for Authorization @@ -181,4 +240,5 @@ UsersApi | getUserFollowers | **GET** /users/{id}/followers | List followers of - deal-fields:full: Create, read, update and delete deal fields - product-fields:full: Create, read, update and delete product fields - contact-fields:full: Create, read, update and delete person and organization fields + - project-fields:full: Create, read, update and delete project fields diff --git a/src/versions/v1/api.ts b/src/versions/v1/api.ts index 45a4e1e7..f7efae68 100644 --- a/src/versions/v1/api.ts +++ b/src/versions/v1/api.ts @@ -43,6 +43,8 @@ export * from './api/persons-api'; export * from './api/pipelines-api'; export * from './api/product-fields-api'; export * from './api/products-api'; +export * from './api/project-boards-api'; +export * from './api/project-phases-api'; export * from './api/project-templates-api'; export * from './api/projects-api'; export * from './api/recents-api'; diff --git a/src/versions/v1/api/notes-api.ts b/src/versions/v1/api/notes-api.ts index 19d075ff..3baf1091 100644 --- a/src/versions/v1/api/notes-api.ts +++ b/src/versions/v1/api/notes-api.ts @@ -363,6 +363,7 @@ export const NotesApiAxiosParamCreator = function (configuration?: Configuration * @param {number} [person_id] The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. * @param {number} [org_id] The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. * @param {number} [project_id] The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. + * @param {number} [task_id] The ID of the task which notes to fetch. If omitted, notes about all tasks will be returned. * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [sort] The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. @@ -374,10 +375,11 @@ export const NotesApiAxiosParamCreator = function (configuration?: Configuration * @param {0 | 1} [pinned_to_organization_flag] If set, the results are filtered by note to organization pinning state * @param {0 | 1} [pinned_to_person_flag] If set, the results are filtered by note to person pinning state * @param {0 | 1} [pinned_to_project_flag] If set, the results are filtered by note to project pinning state + * @param {0 | 1} [pinned_to_task_flag] If set, the results are filtered by note to task pinning state * @throws {RequiredError} */ - getNotes: async (user_id?: number, lead_id?: string, deal_id?: number, person_id?: number, org_id?: number, project_id?: number, start?: number, limit?: number, sort?: string, start_date?: string, end_date?: string, updated_since?: string, pinned_to_lead_flag?: 0 | 1, pinned_to_deal_flag?: 0 | 1, pinned_to_organization_flag?: 0 | 1, pinned_to_person_flag?: 0 | 1, pinned_to_project_flag?: 0 | 1, ): Promise => { + getNotes: async (user_id?: number, lead_id?: string, deal_id?: number, person_id?: number, org_id?: number, project_id?: number, task_id?: number, start?: number, limit?: number, sort?: string, start_date?: string, end_date?: string, updated_since?: string, pinned_to_lead_flag?: 0 | 1, pinned_to_deal_flag?: 0 | 1, pinned_to_organization_flag?: 0 | 1, pinned_to_person_flag?: 0 | 1, pinned_to_project_flag?: 0 | 1, pinned_to_task_flag?: 0 | 1, ): Promise => { const localVarPath = `/notes`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -421,6 +423,10 @@ export const NotesApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['project_id'] = project_id; } + if (task_id !== undefined) { + localVarQueryParameter['task_id'] = task_id; + } + if (start !== undefined) { localVarQueryParameter['start'] = start; } @@ -471,6 +477,10 @@ export const NotesApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['pinned_to_project_flag'] = pinned_to_project_flag; } + if (pinned_to_task_flag !== undefined) { + localVarQueryParameter['pinned_to_task_flag'] = pinned_to_task_flag; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -678,6 +688,7 @@ export const NotesApiFp = function(configuration?: Configuration) { * @param {number} [person_id] The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. * @param {number} [org_id] The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. * @param {number} [project_id] The ID of the project which notes to fetch. If omitted, notes about all projects will be returned. + * @param {number} [task_id] The ID of the task which notes to fetch. If omitted, notes about all tasks will be returned. * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [sort] The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. @@ -689,11 +700,12 @@ export const NotesApiFp = function(configuration?: Configuration) { * @param {0 | 1} [pinned_to_organization_flag] If set, the results are filtered by note to organization pinning state * @param {0 | 1} [pinned_to_person_flag] If set, the results are filtered by note to person pinning state * @param {0 | 1} [pinned_to_project_flag] If set, the results are filtered by note to project pinning state + * @param {0 | 1} [pinned_to_task_flag] If set, the results are filtered by note to task pinning state * @throws {RequiredError} */ - async getNotes(user_id?: number, lead_id?: string, deal_id?: number, person_id?: number, org_id?: number, project_id?: number, start?: number, limit?: number, sort?: string, start_date?: string, end_date?: string, updated_since?: string, pinned_to_lead_flag?: 0 | 1, pinned_to_deal_flag?: 0 | 1, pinned_to_organization_flag?: 0 | 1, pinned_to_person_flag?: 0 | 1, pinned_to_project_flag?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getNotes(user_id, lead_id, deal_id, person_id, org_id, project_id, start, limit, sort, start_date, end_date, updated_since, pinned_to_lead_flag, pinned_to_deal_flag, pinned_to_organization_flag, pinned_to_person_flag, pinned_to_project_flag, ); + async getNotes(user_id?: number, lead_id?: string, deal_id?: number, person_id?: number, org_id?: number, project_id?: number, task_id?: number, start?: number, limit?: number, sort?: string, start_date?: string, end_date?: string, updated_since?: string, pinned_to_lead_flag?: 0 | 1, pinned_to_deal_flag?: 0 | 1, pinned_to_organization_flag?: 0 | 1, pinned_to_person_flag?: 0 | 1, pinned_to_project_flag?: 0 | 1, pinned_to_task_flag?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getNotes(user_id, lead_id, deal_id, person_id, org_id, project_id, task_id, start, limit, sort, start_date, end_date, updated_since, pinned_to_lead_flag, pinned_to_deal_flag, pinned_to_organization_flag, pinned_to_person_flag, pinned_to_project_flag, pinned_to_task_flag, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -809,7 +821,7 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getNotes(requestParameters: NotesApiGetNotesRequest = {}, ): Promise { - return localVarFp.getNotes(requestParameters.user_id, requestParameters.lead_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.project_id, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.start_date, requestParameters.end_date, requestParameters.updated_since, requestParameters.pinned_to_lead_flag, requestParameters.pinned_to_deal_flag, requestParameters.pinned_to_organization_flag, requestParameters.pinned_to_person_flag, requestParameters.pinned_to_project_flag, ).then((request) => request(axios, basePath)); + return localVarFp.getNotes(requestParameters.user_id, requestParameters.lead_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.project_id, requestParameters.task_id, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.start_date, requestParameters.end_date, requestParameters.updated_since, requestParameters.pinned_to_lead_flag, requestParameters.pinned_to_deal_flag, requestParameters.pinned_to_organization_flag, requestParameters.pinned_to_person_flag, requestParameters.pinned_to_project_flag, requestParameters.pinned_to_task_flag, ).then((request) => request(axios, basePath)); }, /** * Updates a comment related to a note. @@ -1015,6 +1027,13 @@ export interface NotesApiGetNotesRequest { */ readonly project_id?: number + /** + * The ID of the task which notes to fetch. If omitted, notes about all tasks will be returned. + * @type {number} + * @memberof NotesApiGetNotes + */ + readonly task_id?: number + /** * Pagination start * @type {number} @@ -1091,6 +1110,13 @@ export interface NotesApiGetNotesRequest { * @memberof NotesApiGetNotes */ readonly pinned_to_project_flag?: 0 | 1 + + /** + * If set, the results are filtered by note to task pinning state + * @type {0 | 1} + * @memberof NotesApiGetNotes + */ + readonly pinned_to_task_flag?: 0 | 1 } /** @@ -1242,7 +1268,7 @@ export class NotesApi extends BaseAPI { * @memberof NotesApi */ public getNotes(requestParameters: NotesApiGetNotesRequest = {}, ) { - return NotesApiFp(this.configuration).getNotes(requestParameters.user_id, requestParameters.lead_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.project_id, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.start_date, requestParameters.end_date, requestParameters.updated_since, requestParameters.pinned_to_lead_flag, requestParameters.pinned_to_deal_flag, requestParameters.pinned_to_organization_flag, requestParameters.pinned_to_person_flag, requestParameters.pinned_to_project_flag, ).then((request) => request(this.axios, this.basePath)); + return NotesApiFp(this.configuration).getNotes(requestParameters.user_id, requestParameters.lead_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.project_id, requestParameters.task_id, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.start_date, requestParameters.end_date, requestParameters.updated_since, requestParameters.pinned_to_lead_flag, requestParameters.pinned_to_deal_flag, requestParameters.pinned_to_organization_flag, requestParameters.pinned_to_person_flag, requestParameters.pinned_to_project_flag, requestParameters.pinned_to_task_flag, ).then((request) => request(this.axios, this.basePath)); } /** diff --git a/src/versions/v1/api/project-boards-api.ts b/src/versions/v1/api/project-boards-api.ts new file mode 100644 index 00000000..0b22b4ea --- /dev/null +++ b/src/versions/v1/api/project-boards-api.ts @@ -0,0 +1,219 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { GetProjectBoardResponse } from '../models'; +// @ts-ignore +import { GetProjectBoardsResponse } from '../models'; +/** + * ProjectBoardsApi - axios parameter creator + * @export + */ +export const ProjectBoardsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns the details of a specific project board. + * @summary Get details of a board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + getProjectsBoard: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectsBoard', 'id', id) + const localVarPath = `/projects/boards/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all projects boards that are not deleted. + * @summary Get all project boards + + * @throws {RequiredError} + */ + getProjectsBoards: async (): Promise => { + const localVarPath = `/projects/boards`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * ProjectBoardsApi - functional programming interface + * @export + */ +export const ProjectBoardsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProjectBoardsApiAxiosParamCreator(configuration) + return { + /** + * Returns the details of a specific project board. + * @summary Get details of a board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async getProjectsBoard(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all projects boards that are not deleted. + * @summary Get all project boards + + * @throws {RequiredError} + */ + async getProjectsBoards(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ProjectBoardsApi - factory interface + * @export + */ +export const ProjectBoardsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProjectBoardsApiFp(configuration) + return { + /** + * Returns the details of a specific project board. + * @summary Get details of a board + * @param {ProjectBoardsApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsBoard(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ): Promise { + return localVarFp.getProjectsBoard(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all projects boards that are not deleted. + * @summary Get all project boards + + * @throws {RequiredError} + */ + getProjectsBoards(): Promise { + return localVarFp.getProjectsBoards().then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for getProjectsBoard operation in ProjectBoardsApi. + * @export + * @interface ProjectBoardsApiGetProjectsBoardRequest + */ +export interface ProjectBoardsApiGetProjectsBoardRequest { + /** + * The ID of the project board + * @type {number} + * @memberof ProjectBoardsApiGetProjectsBoard + */ + readonly id: number +} + +/** + * ProjectBoardsApi - object-oriented interface + * @export + * @class ProjectBoardsApi + * @extends {BaseAPI} + */ +export class ProjectBoardsApi extends BaseAPI { + /** + * Returns the details of a specific project board. + * @summary Get details of a board + * @param {ProjectBoardsApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public getProjectsBoard(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).getProjectsBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all projects boards that are not deleted. + * @summary Get all project boards + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public getProjectsBoards() { + return ProjectBoardsApiFp(this.configuration).getProjectsBoards().then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v1/api/project-phases-api.ts b/src/versions/v1/api/project-phases-api.ts new file mode 100644 index 00000000..69e2e33a --- /dev/null +++ b/src/versions/v1/api/project-phases-api.ts @@ -0,0 +1,243 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { GetProjectPhaseResponse } from '../models'; +// @ts-ignore +import { GetProjectPhasesResponse } from '../models'; +/** + * ProjectPhasesApi - axios parameter creator + * @export + */ +export const ProjectPhasesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns the details of a specific project phase. + * @summary Get details of a phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + getProjectsPhase: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectsPhase', 'id', id) + const localVarPath = `/projects/phases/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {number} board_id ID of the board for which phases are requested + + * @throws {RequiredError} + */ + getProjectsPhases: async (board_id: number, ): Promise => { + // verify required parameter 'board_id' is not null or undefined + assertParamExists('getProjectsPhases', 'board_id', board_id) + const localVarPath = `/projects/phases`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + if (board_id !== undefined) { + localVarQueryParameter['board_id'] = board_id; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * ProjectPhasesApi - functional programming interface + * @export + */ +export const ProjectPhasesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProjectPhasesApiAxiosParamCreator(configuration) + return { + /** + * Returns the details of a specific project phase. + * @summary Get details of a phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async getProjectsPhase(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {number} board_id ID of the board for which phases are requested + + * @throws {RequiredError} + */ + async getProjectsPhases(board_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ProjectPhasesApi - factory interface + * @export + */ +export const ProjectPhasesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProjectPhasesApiFp(configuration) + return { + /** + * Returns the details of a specific project phase. + * @summary Get details of a phase + * @param {ProjectPhasesApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsPhase(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ): Promise { + return localVarFp.getProjectsPhase(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {ProjectPhasesApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsPhases(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ): Promise { + return localVarFp.getProjectsPhases(requestParameters.board_id, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for getProjectsPhase operation in ProjectPhasesApi. + * @export + * @interface ProjectPhasesApiGetProjectsPhaseRequest + */ +export interface ProjectPhasesApiGetProjectsPhaseRequest { + /** + * The ID of the project phase + * @type {number} + * @memberof ProjectPhasesApiGetProjectsPhase + */ + readonly id: number +} + +/** + * Request parameters for getProjectsPhases operation in ProjectPhasesApi. + * @export + * @interface ProjectPhasesApiGetProjectsPhasesRequest + */ +export interface ProjectPhasesApiGetProjectsPhasesRequest { + /** + * ID of the board for which phases are requested + * @type {number} + * @memberof ProjectPhasesApiGetProjectsPhases + */ + readonly board_id: number +} + +/** + * ProjectPhasesApi - object-oriented interface + * @export + * @class ProjectPhasesApi + * @extends {BaseAPI} + */ +export class ProjectPhasesApi extends BaseAPI { + /** + * Returns the details of a specific project phase. + * @summary Get details of a phase + * @param {ProjectPhasesApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public getProjectsPhase(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).getProjectsPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {ProjectPhasesApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public getProjectsPhases(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ) { + return ProjectPhasesApiFp(this.configuration).getProjectsPhases(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v1/api/project-templates-api.ts b/src/versions/v1/api/project-templates-api.ts index 307c4355..337d1ffc 100644 --- a/src/versions/v1/api/project-templates-api.ts +++ b/src/versions/v1/api/project-templates-api.ts @@ -22,10 +22,6 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { GetProjectBoardResponse } from '../models'; -// @ts-ignore -import { GetProjectPhaseResponse } from '../models'; -// @ts-ignore import { GetProjectTemplateResponse } from '../models'; // @ts-ignore import { GetProjectTemplatesResponse } from '../models'; @@ -114,88 +110,6 @@ export const ProjectTemplatesApiAxiosParamCreator = function (configuration?: Co - 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 project board. - * @summary Get details of a board - * @param {number} id The ID of the project board - - * @throws {RequiredError} - */ - getProjectsBoard: async (id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getProjectsBoard', 'id', id) - const localVarPath = `/projects/boards/{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(localVarHeaderParameter, "x-api-token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects: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 project phase. - * @summary Get details of a phase - * @param {number} id The ID of the project phase - - * @throws {RequiredError} - */ - getProjectsPhase: async (id: number, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getProjectsPhase', 'id', id) - const localVarPath = `/projects/phases/{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(localVarHeaderParameter, "x-api-token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read"], configuration) - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; @@ -239,28 +153,6 @@ export const ProjectTemplatesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplates(cursor, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * Returns the details of a specific project board. - * @summary Get details of a board - * @param {number} id The ID of the project board - - * @throws {RequiredError} - */ - async getProjectsBoard(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns the details of a specific project phase. - * @summary Get details of a phase - * @param {number} id The ID of the project phase - - * @throws {RequiredError} - */ - async getProjectsPhase(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, } }; @@ -291,26 +183,6 @@ export const ProjectTemplatesApiFactory = function (configuration?: Configuratio getProjectTemplates(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ): Promise { return localVarFp.getProjectTemplates(requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); }, - /** - * Returns the details of a specific project board. - * @summary Get details of a board - * @param {ProjectTemplatesApiGetProjectsBoardRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getProjectsBoard(requestParameters: ProjectTemplatesApiGetProjectsBoardRequest, ): Promise { - return localVarFp.getProjectsBoard(requestParameters.id, ).then((request) => request(axios, basePath)); - }, - /** - * Returns the details of a specific project phase. - * @summary Get details of a phase - * @param {ProjectTemplatesApiGetProjectsPhaseRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getProjectsPhase(requestParameters: ProjectTemplatesApiGetProjectsPhaseRequest, ): Promise { - return localVarFp.getProjectsPhase(requestParameters.id, ).then((request) => request(axios, basePath)); - }, }; }; @@ -349,34 +221,6 @@ export interface ProjectTemplatesApiGetProjectTemplatesRequest { readonly limit?: number } -/** - * Request parameters for getProjectsBoard operation in ProjectTemplatesApi. - * @export - * @interface ProjectTemplatesApiGetProjectsBoardRequest - */ -export interface ProjectTemplatesApiGetProjectsBoardRequest { - /** - * The ID of the project board - * @type {number} - * @memberof ProjectTemplatesApiGetProjectsBoard - */ - readonly id: number -} - -/** - * Request parameters for getProjectsPhase operation in ProjectTemplatesApi. - * @export - * @interface ProjectTemplatesApiGetProjectsPhaseRequest - */ -export interface ProjectTemplatesApiGetProjectsPhaseRequest { - /** - * The ID of the project phase - * @type {number} - * @memberof ProjectTemplatesApiGetProjectsPhase - */ - readonly id: number -} - /** * ProjectTemplatesApi - object-oriented interface * @export @@ -407,28 +251,4 @@ export class ProjectTemplatesApi extends BaseAPI { public getProjectTemplates(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ) { return ProjectTemplatesApiFp(this.configuration).getProjectTemplates(requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } - - /** - * Returns the details of a specific project board. - * @summary Get details of a board - * @param {ProjectTemplatesApiGetProjectsBoardRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof ProjectTemplatesApi - */ - public getProjectsBoard(requestParameters: ProjectTemplatesApiGetProjectsBoardRequest, ) { - return ProjectTemplatesApiFp(this.configuration).getProjectsBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the details of a specific project phase. - * @summary Get details of a phase - * @param {ProjectTemplatesApiGetProjectsPhaseRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof ProjectTemplatesApi - */ - public getProjectsPhase(requestParameters: ProjectTemplatesApiGetProjectsPhaseRequest, ) { - return ProjectTemplatesApiFp(this.configuration).getProjectsPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); - } } diff --git a/src/versions/v1/api/projects-api.ts b/src/versions/v1/api/projects-api.ts index 4da59237..5db29c16 100644 --- a/src/versions/v1/api/projects-api.ts +++ b/src/versions/v1/api/projects-api.ts @@ -30,12 +30,8 @@ import { DeleteProjectResponse } from '../models'; // @ts-ignore import { GetActivitiesCollectionResponse } from '../models'; // @ts-ignore -import { GetProjectBoardsResponse } from '../models'; -// @ts-ignore import { GetProjectGroupsResponse } from '../models'; // @ts-ignore -import { GetProjectPhasesResponse } from '../models'; -// @ts-ignore import { GetProjectPlanResponse } from '../models'; // @ts-ignore import { GetProjectResponse } from '../models'; @@ -445,87 +441,6 @@ export const ProjectsApiAxiosParamCreator = function (configuration?: Configurat - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns all projects boards that are not deleted. - * @summary Get all project boards - - * @throws {RequiredError} - */ - getProjectsBoards: async (): Promise => { - const localVarPath = `/projects/boards`; - // 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(localVarHeaderParameter, "x-api-token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns all active project phases under a specific board. - * @summary Get project phases - * @param {number} board_id ID of the board for which phases are requested - - * @throws {RequiredError} - */ - getProjectsPhases: async (board_id: number, ): Promise => { - // verify required parameter 'board_id' is not null or undefined - assertParamExists('getProjectsPhases', 'board_id', board_id) - const localVarPath = `/projects/phases`; - // 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(localVarHeaderParameter, "x-api-token", configuration) - - // authentication oauth2 required - // oauth required - await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) - - if (board_id !== undefined) { - localVarQueryParameter['board_id'] = board_id; - } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; @@ -793,27 +708,6 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjects(cursor, limit, filter_id, status, phase_id, include_archived, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * Returns all projects boards that are not deleted. - * @summary Get all project boards - - * @throws {RequiredError} - */ - async getProjectsBoards(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Returns all active project phases under a specific board. - * @summary Get project phases - * @param {number} board_id ID of the board for which phases are requested - - * @throws {RequiredError} - */ - async getProjectsPhases(board_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * Updates an activity phase or group in a project. * @summary Update activity in project plan @@ -952,25 +846,6 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProjects(requestParameters: ProjectsApiGetProjectsRequest = {}, ): Promise { return localVarFp.getProjects(requestParameters.cursor, requestParameters.limit, requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.include_archived, ).then((request) => request(axios, basePath)); }, - /** - * Returns all projects boards that are not deleted. - * @summary Get all project boards - - * @throws {RequiredError} - */ - getProjectsBoards(): Promise { - return localVarFp.getProjectsBoards().then((request) => request(axios, basePath)); - }, - /** - * Returns all active project phases under a specific board. - * @summary Get project phases - * @param {ProjectsApiGetProjectsPhasesRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getProjectsPhases(requestParameters: ProjectsApiGetProjectsPhasesRequest, ): Promise { - return localVarFp.getProjectsPhases(requestParameters.board_id, ).then((request) => request(axios, basePath)); - }, /** * Updates an activity phase or group in a project. * @summary Update activity in project plan @@ -1165,20 +1040,6 @@ export interface ProjectsApiGetProjectsRequest { readonly include_archived?: boolean } -/** - * Request parameters for getProjectsPhases operation in ProjectsApi. - * @export - * @interface ProjectsApiGetProjectsPhasesRequest - */ -export interface ProjectsApiGetProjectsPhasesRequest { - /** - * ID of the board for which phases are requested - * @type {number} - * @memberof ProjectsApiGetProjectsPhases - */ - readonly board_id: number -} - /** * Request parameters for putProjectPlanActivity operation in ProjectsApi. * @export @@ -1371,29 +1232,6 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProjects(requestParameters.cursor, requestParameters.limit, requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.include_archived, ).then((request) => request(this.axios, this.basePath)); } - /** - * Returns all projects boards that are not deleted. - * @summary Get all project boards - - * @throws {RequiredError} - * @memberof ProjectsApi - */ - public getProjectsBoards() { - return ProjectsApiFp(this.configuration).getProjectsBoards().then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns all active project phases under a specific board. - * @summary Get project phases - * @param {ProjectsApiGetProjectsPhasesRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof ProjectsApi - */ - public getProjectsPhases(requestParameters: ProjectsApiGetProjectsPhasesRequest, ) { - return ProjectsApiFp(this.configuration).getProjectsPhases(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); - } - /** * Updates an activity phase or group in a project. * @summary Update activity in project plan diff --git a/src/versions/v1/models/add-note-request-all-of.ts b/src/versions/v1/models/add-note-request-all-of.ts index aa924188..c0f3c943 100644 --- a/src/versions/v1/models/add-note-request-all-of.ts +++ b/src/versions/v1/models/add-note-request-all-of.ts @@ -28,29 +28,34 @@ export interface AddNoteRequestAllOf { */ 'content': string; /** - * The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id/project_id`) is specified. + * The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id/project_id/task_id`) is specified. * @type {string} */ 'lead_id'?: string; /** - * The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id/project_id`) is specified. + * The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id/project_id/task_id`) is specified. * @type {number} */ 'deal_id'?: number; /** - * The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id/project_id`) is specified. + * The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id/project_id/task_id`) is specified. * @type {number} */ 'person_id'?: number; /** - * The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/project_id`) is specified. + * The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/project_id/task_id`) is specified. * @type {number} */ 'org_id'?: number; /** - * The ID of the project the note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/org_id`) is specified. + * The ID of the project the note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/org_id/task_id`) is specified. * @type {number} */ 'project_id'?: number; + /** + * The ID of the task the note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id/org_id/project_id`) is specified. + * @type {number} + */ + 'task_id'?: number; } diff --git a/src/versions/v1/models/add-note-request-all-of1.ts b/src/versions/v1/models/add-note-request-all-of1.ts index 81a9164a..510d5abf 100644 --- a/src/versions/v1/models/add-note-request-all-of1.ts +++ b/src/versions/v1/models/add-note-request-all-of1.ts @@ -55,6 +55,11 @@ export interface AddNoteRequestAllOf1 { * @type {number} */ 'pinned_to_project_flag'?: AddNoteRequestAllOf1PinnedToProjectFlagConst; + /** + * + * @type {number} + */ + 'pinned_to_task_flag'?: AddNoteRequestAllOf1PinnedToTaskFlagConst; } export const AddNoteRequestAllOf1PinnedToLeadFlagConst = { @@ -87,5 +92,11 @@ export interface AddNoteRequestAllOf1 { } as const; export type AddNoteRequestAllOf1PinnedToProjectFlagConst = typeof AddNoteRequestAllOf1PinnedToProjectFlagConst[keyof typeof AddNoteRequestAllOf1PinnedToProjectFlagConst]; + export const AddNoteRequestAllOf1PinnedToTaskFlagConst = { + NUMBER_0: 0, + NUMBER_1: 1 + } as const; + + export type AddNoteRequestAllOf1PinnedToTaskFlagConst = typeof AddNoteRequestAllOf1PinnedToTaskFlagConst[keyof typeof AddNoteRequestAllOf1PinnedToTaskFlagConst]; diff --git a/src/versions/v1/models/index.ts b/src/versions/v1/models/index.ts index cb41a2c8..8b75e89e 100644 --- a/src/versions/v1/models/index.ts +++ b/src/versions/v1/models/index.ts @@ -444,6 +444,7 @@ export * from './note-project'; export * from './note-request'; export * from './note-request-all-of'; export * from './note-request-all-of1'; +export * from './note-task'; export * from './note-user'; export * from './organization-count-and-address-info'; export * from './organization-count-and-address-info-all-of'; diff --git a/src/versions/v1/models/note-request-all-of1.ts b/src/versions/v1/models/note-request-all-of1.ts index 63fe7754..e1d751cf 100644 --- a/src/versions/v1/models/note-request-all-of1.ts +++ b/src/versions/v1/models/note-request-all-of1.ts @@ -45,5 +45,10 @@ export interface NoteRequestAllOf1 { * @type {number} */ 'project_id'?: number; + /** + * The ID of the task the note will be attached to + * @type {number} + */ + 'task_id'?: number; } diff --git a/src/versions/v1/models/note-task.ts b/src/versions/v1/models/note-task.ts new file mode 100644 index 00000000..acc8f7b5 --- /dev/null +++ b/src/versions/v1/models/note-task.ts @@ -0,0 +1,29 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.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 task the note is attached to +* @export +* @interface NoteTask +*/ +export interface NoteTask { + /** + * The title of the task the note is attached to + * @type {string} + */ + 'title'?: string; +} + diff --git a/src/versions/v1/models/note.ts b/src/versions/v1/models/note.ts index d0ad4870..203e8f30 100644 --- a/src/versions/v1/models/note.ts +++ b/src/versions/v1/models/note.ts @@ -27,6 +27,9 @@ import { NotePerson } from './note-person'; import { NoteProject } from './note-project'; // May contain unused imports in some cases // @ts-ignore +import { NoteTask } from './note-task'; +// May contain unused imports in some cases +// @ts-ignore import { NoteUser } from './note-user'; /** @@ -106,6 +109,16 @@ export interface Note { */ 'project'?: NoteProject; /** + * The ID of the task the note is attached to + * @type {number} + */ + 'task_id'?: number; + /** + * + * @type {NoteTask} + */ + 'task'?: NoteTask; + /** * If true, the results are filtered by note to deal pinning state * @type {boolean} */ @@ -126,6 +139,11 @@ export interface Note { */ 'pinned_to_project_flag'?: boolean; /** + * If true, the results are filtered by note to task pinning state + * @type {boolean} + */ + 'pinned_to_task_flag'?: boolean; + /** * The last updated date and time of the note * @type {string} */ diff --git a/src/versions/v2/api.ts b/src/versions/v2/api.ts index 84b458b3..02e402ef 100644 --- a/src/versions/v2/api.ts +++ b/src/versions/v2/api.ts @@ -16,7 +16,10 @@ export * from './api/activities-api'; export * from './api/activity-fields-api'; +export * from './api/beta-api'; export * from './api/deal-fields-api'; +export * from './api/deal-installments-api'; +export * from './api/deal-products-api'; export * from './api/deals-api'; export * from './api/item-search-api'; export * from './api/leads-api'; @@ -27,6 +30,12 @@ export * from './api/persons-api'; export * from './api/pipelines-api'; export * from './api/product-fields-api'; export * from './api/products-api'; +export * from './api/project-boards-api'; +export * from './api/project-fields-api'; +export * from './api/project-phases-api'; +export * from './api/project-templates-api'; +export * from './api/projects-api'; export * from './api/stages-api'; +export * from './api/tasks-api'; export * from './api/users-api'; diff --git a/src/versions/v2/api/beta-api.ts b/src/versions/v2/api/beta-api.ts new file mode 100644 index 00000000..9cbeda31 --- /dev/null +++ b/src/versions/v2/api/beta-api.ts @@ -0,0 +1,2482 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddDealFieldOptions200Response } from '../models'; +// @ts-ignore +import { AddDealFieldOptionsRequestInner } from '../models'; +// @ts-ignore +import { AddProjectBoardRequest } from '../models'; +// @ts-ignore +import { AddProjectField200Response } from '../models'; +// @ts-ignore +import { AddProjectFieldRequest } from '../models'; +// @ts-ignore +import { AddProjectPhaseRequest } from '../models'; +// @ts-ignore +import { AddTaskRequest } from '../models'; +// @ts-ignore +import { AddTaskResponse } from '../models'; +// @ts-ignore +import { DeleteDealFieldOptionsRequestInner } from '../models'; +// @ts-ignore +import { DeleteProjectBoardResponse } from '../models'; +// @ts-ignore +import { DeleteProjectField200Response } from '../models'; +// @ts-ignore +import { DeleteProjectPhaseResponse } from '../models'; +// @ts-ignore +import { DeleteTaskResponse } from '../models'; +// @ts-ignore +import { GetProjectBoardsResponse } from '../models'; +// @ts-ignore +import { GetProjectFields200Response } from '../models'; +// @ts-ignore +import { GetProjectPhasesResponse } from '../models'; +// @ts-ignore +import { GetProjectSearchResponse } from '../models'; +// @ts-ignore +import { GetTaskResponse } from '../models'; +// @ts-ignore +import { GetTasksResponse } from '../models'; +// @ts-ignore +import { UpdateDealFieldOptionsRequestInner } from '../models'; +// @ts-ignore +import { UpdateProjectBoardRequest } from '../models'; +// @ts-ignore +import { UpdateProjectFieldRequest } from '../models'; +// @ts-ignore +import { UpdateProjectPhaseRequest } from '../models'; +// @ts-ignore +import { UpdateTaskRequest } from '../models'; +// @ts-ignore +import { UpdateTaskResponse } from '../models'; +// @ts-ignore +import { UpsertProjectBoardResponse } from '../models'; +// @ts-ignore +import { UpsertProjectPhaseResponse } from '../models'; +/** + * BetaApi - axios parameter creator + * @export + */ +export const BetaApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Adds a new project board. + * @summary Add a project board + * @param {AddProjectBoardRequest} AddProjectBoardRequest + + * @throws {RequiredError} + */ + addProjectBoard: async (AddProjectBoardRequest: AddProjectBoardRequest, ): Promise => { + // verify required parameter 'AddProjectBoardRequest' is not null or undefined + assertParamExists('addProjectBoard', 'AddProjectBoardRequest', AddProjectBoardRequest) + const localVarPath = `/boards`; + // 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", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddProjectBoardRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Creates a new project custom field. + * @summary Create one project field + * @param {AddProjectFieldRequest} AddProjectFieldRequest + + * @throws {RequiredError} + */ + addProjectField: async (AddProjectFieldRequest: AddProjectFieldRequest, ): Promise => { + // verify required parameter 'AddProjectFieldRequest' is not null or undefined + assertParamExists('addProjectField', 'AddProjectFieldRequest', AddProjectFieldRequest) + const localVarPath = `/projectFields`; + // 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", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddProjectFieldRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Adds new options to a project custom field that supports options (enum or set field types). This operation is atomic - all options are added or none are added. Returns only the newly added options. + * @summary Add project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + addProjectFieldOptions: async (field_code: string, AddDealFieldOptionsRequestInner: Array, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('addProjectFieldOptions', 'field_code', field_code) + // verify required parameter 'AddDealFieldOptionsRequestInner' is not null or undefined + assertParamExists('addProjectFieldOptions', 'AddDealFieldOptionsRequestInner', AddDealFieldOptionsRequestInner) + const localVarPath = `/projectFields/{field_code}/options` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddDealFieldOptionsRequestInner, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Adds a new project phase to a board. + * @summary Add a project phase + * @param {AddProjectPhaseRequest} AddProjectPhaseRequest + + * @throws {RequiredError} + */ + addProjectPhase: async (AddProjectPhaseRequest: AddProjectPhaseRequest, ): Promise => { + // verify required parameter 'AddProjectPhaseRequest' is not null or undefined + assertParamExists('addProjectPhase', 'AddProjectPhaseRequest', AddProjectPhaseRequest) + const localVarPath = `/phases`; + // 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", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddProjectPhaseRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Adds a new task. + * @summary Add a task + * @param {AddTaskRequest} AddTaskRequest + + * @throws {RequiredError} + */ + addTask: async (AddTaskRequest: AddTaskRequest, ): Promise => { + // verify required parameter 'AddTaskRequest' is not null or undefined + assertParamExists('addTask', 'AddTaskRequest', AddTaskRequest) + const localVarPath = `/tasks`; + // 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", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddTaskRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a project board as deleted. + * @summary Delete a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + deleteProjectBoard: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteProjectBoard', 'id', id) + const localVarPath = `/boards/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a custom field as deleted. + * @summary Delete one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + deleteProjectField: async (field_code: string, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('deleteProjectField', 'field_code', field_code) + const localVarPath = `/projectFields/{field_code}` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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", ["project-fields:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Removes existing options from a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the deleted options. + * @summary Delete project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + deleteProjectFieldOptions: async (field_code: string, DeleteDealFieldOptionsRequestInner: Array, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('deleteProjectFieldOptions', 'field_code', field_code) + // verify required parameter 'DeleteDealFieldOptionsRequestInner' is not null or undefined + assertParamExists('deleteProjectFieldOptions', 'DeleteDealFieldOptionsRequestInner', DeleteDealFieldOptionsRequestInner) + const localVarPath = `/projectFields/{field_code}/options` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(DeleteDealFieldOptionsRequestInner, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a project phase as deleted. + * @summary Delete a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + deleteProjectPhase: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteProjectPhase', 'id', id) + const localVarPath = `/phases/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a task as deleted. If the task has subtasks, those will also be deleted. + * @summary Delete a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + deleteTask: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteTask', 'id', id) + const localVarPath = `/tasks/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns metadata about a specific project field. + * @summary Get one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + getProjectField: async (field_code: string, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('getProjectField', 'field_code', field_code) + const localVarPath = `/projectFields/{field_code}` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full", "project-fields:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns metadata about all project fields in the company. + * @summary Get all project fields + * @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} + */ + getProjectFields: async (limit?: number, cursor?: string, ): Promise => { + const localVarPath = `/projectFields`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full", "project-fields:full"], configuration) + + 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 project board. + * @summary Get details of a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + getProjectsBoard: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectsBoard', 'id', id) + const localVarPath = `/boards/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all active project boards. + * @summary Get all project boards + + * @throws {RequiredError} + */ + getProjectsBoards: async (): Promise => { + const localVarPath = `/boards`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects: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 project phase. + * @summary Get details of a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + getProjectsPhase: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectsPhase', 'id', id) + const localVarPath = `/phases/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {number} board_id The ID of the board for which phases are requested + + * @throws {RequiredError} + */ + getProjectsPhases: async (board_id: number, ): Promise => { + // verify required parameter 'board_id' is not null or undefined + assertParamExists('getProjectsPhases', 'board_id', board_id) + const localVarPath = `/phases`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + if (board_id !== undefined) { + localVarQueryParameter['board_id'] = board_id; + } + + + + 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 task. + * @summary Get details of a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + getTask: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getTask', 'id', id) + const localVarPath = `/tasks/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all tasks. + * @summary Get all tasks + * @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 {boolean} [is_done] Whether the task is done or not. If omitted, both done and not done tasks are returned. + * @param {boolean} [is_milestone] Whether the task is a milestone or not. If omitted, both milestone and non-milestone tasks are returned. + * @param {number} [assignee_id] If supplied, only tasks assigned to this user are returned + * @param {number} [project_id] If supplied, only tasks belonging to this project are returned + * @param {string} [parent_task_id] If `null` is supplied, only root-level tasks (without a parent) are returned. If an integer is supplied, only subtasks of that specific task are returned. By default all tasks are returned. + + * @throws {RequiredError} + */ + getTasks: async (cursor?: string, limit?: number, is_done?: boolean, is_milestone?: boolean, assignee_id?: number, project_id?: number, parent_task_id?: string, ): Promise => { + const localVarPath = `/tasks`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (is_done !== undefined) { + localVarQueryParameter['is_done'] = is_done; + } + + if (is_milestone !== undefined) { + localVarQueryParameter['is_milestone'] = is_milestone; + } + + if (assignee_id !== undefined) { + localVarQueryParameter['assignee_id'] = assignee_id; + } + + if (project_id !== undefined) { + localVarQueryParameter['project_id'] = project_id; + } + + if (parent_task_id !== undefined) { + localVarQueryParameter['parent_task_id'] = parent_task_id; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. + * @summary Search projects + * @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' | 'description'} [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 projects by the provided person ID + * @param {number} [organization_id] Will filter projects by the provided organization ID + * @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} + */ + searchProjects: async (term: string, fields?: 'custom_fields' | 'notes' | 'title' | 'description', exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise => { + // verify required parameter 'term' is not null or undefined + assertParamExists('searchProjects', 'term', term) + const localVarPath = `/projects/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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects: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 (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 a project board. + * @summary Update a project board + * @param {number} id The ID of the project board + * @param {UpdateProjectBoardRequest} [UpdateProjectBoardRequest] + + * @throws {RequiredError} + */ + updateProjectBoard: async (id: number, UpdateProjectBoardRequest?: UpdateProjectBoardRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateProjectBoard', 'id', id) + const localVarPath = `/boards/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateProjectBoardRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates a project custom field. The field_code and field_type cannot be changed. At least one field must be provided in the request body. + * @summary Update one project field + * @param {string} field_code The unique code identifying the field + * @param {UpdateProjectFieldRequest} UpdateProjectFieldRequest + + * @throws {RequiredError} + */ + updateProjectField: async (field_code: string, UpdateProjectFieldRequest: UpdateProjectFieldRequest, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('updateProjectField', 'field_code', field_code) + // verify required parameter 'UpdateProjectFieldRequest' is not null or undefined + assertParamExists('updateProjectField', 'UpdateProjectFieldRequest', UpdateProjectFieldRequest) + const localVarPath = `/projectFields/{field_code}` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateProjectFieldRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates existing options for a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the updated options. + * @summary Update project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + updateProjectFieldOptions: async (field_code: string, UpdateDealFieldOptionsRequestInner: Array, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('updateProjectFieldOptions', 'field_code', field_code) + // verify required parameter 'UpdateDealFieldOptionsRequestInner' is not null or undefined + assertParamExists('updateProjectFieldOptions', 'UpdateDealFieldOptionsRequestInner', UpdateDealFieldOptionsRequestInner) + const localVarPath = `/projectFields/{field_code}/options` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateDealFieldOptionsRequestInner, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates the properties of a project phase. + * @summary Update a project phase + * @param {number} id The ID of the project phase + * @param {UpdateProjectPhaseRequest} [UpdateProjectPhaseRequest] + + * @throws {RequiredError} + */ + updateProjectPhase: async (id: number, UpdateProjectPhaseRequest?: UpdateProjectPhaseRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateProjectPhase', 'id', id) + const localVarPath = `/phases/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateProjectPhaseRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates a task. + * @summary Update a task + * @param {number} id The ID of the task + * @param {UpdateTaskRequest} [UpdateTaskRequest] + + * @throws {RequiredError} + */ + updateTask: async (id: number, UpdateTaskRequest?: UpdateTaskRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateTask', 'id', id) + const localVarPath = `/tasks/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateTaskRequest, 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 project board. + * @summary Add a project board + * @param {AddProjectBoardRequest} AddProjectBoardRequest + + * @throws {RequiredError} + */ + async addProjectBoard(AddProjectBoardRequest: AddProjectBoardRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectBoard(AddProjectBoardRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Creates a new project custom field. + * @summary Create one project field + * @param {AddProjectFieldRequest} AddProjectFieldRequest + + * @throws {RequiredError} + */ + async addProjectField(AddProjectFieldRequest: AddProjectFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectField(AddProjectFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Adds new options to a project custom field that supports options (enum or set field types). This operation is atomic - all options are added or none are added. Returns only the newly added options. + * @summary Add project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async addProjectFieldOptions(field_code: string, AddDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Adds a new project phase to a board. + * @summary Add a project phase + * @param {AddProjectPhaseRequest} AddProjectPhaseRequest + + * @throws {RequiredError} + */ + async addProjectPhase(AddProjectPhaseRequest: AddProjectPhaseRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectPhase(AddProjectPhaseRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Adds a new task. + * @summary Add a task + * @param {AddTaskRequest} AddTaskRequest + + * @throws {RequiredError} + */ + async addTask(AddTaskRequest: AddTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addTask(AddTaskRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a project board as deleted. + * @summary Delete a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async deleteProjectBoard(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a custom field as deleted. + * @summary Delete one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async deleteProjectField(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Removes existing options from a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the deleted options. + * @summary Delete project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async deleteProjectFieldOptions(field_code: string, DeleteDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a project phase as deleted. + * @summary Delete a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async deleteProjectPhase(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a task as deleted. If the task has subtasks, those will also be deleted. + * @summary Delete a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async deleteTask(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns metadata about a specific project field. + * @summary Get one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async getProjectField(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns metadata about all project fields in the company. + * @summary Get all project fields + * @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 getProjectFields(limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectFields(limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns the details of a specific project board. + * @summary Get details of a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async getProjectsBoard(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all active project boards. + * @summary Get all project boards + + * @throws {RequiredError} + */ + async getProjectsBoards(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns the details of a specific project phase. + * @summary Get details of a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async getProjectsPhase(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {number} board_id The ID of the board for which phases are requested + + * @throws {RequiredError} + */ + async getProjectsPhases(board_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns the details of a specific task. + * @summary Get details of a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async getTask(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all tasks. + * @summary Get all tasks + * @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 {boolean} [is_done] Whether the task is done or not. If omitted, both done and not done tasks are returned. + * @param {boolean} [is_milestone] Whether the task is a milestone or not. If omitted, both milestone and non-milestone tasks are returned. + * @param {number} [assignee_id] If supplied, only tasks assigned to this user are returned + * @param {number} [project_id] If supplied, only tasks belonging to this project are returned + * @param {string} [parent_task_id] If `null` is supplied, only root-level tasks (without a parent) are returned. If an integer is supplied, only subtasks of that specific task are returned. By default all tasks are returned. + + * @throws {RequiredError} + */ + async getTasks(cursor?: string, limit?: number, is_done?: boolean, is_milestone?: boolean, assignee_id?: number, project_id?: number, parent_task_id?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTasks(cursor, limit, is_done, is_milestone, assignee_id, project_id, parent_task_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. + * @summary Search projects + * @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' | 'description'} [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 projects by the provided person ID + * @param {number} [organization_id] Will filter projects by the provided organization ID + * @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 searchProjects(term: string, fields?: 'custom_fields' | 'notes' | 'title' | 'description', exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchProjects(term, fields, exact_match, person_id, organization_id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates the properties of a project board. + * @summary Update a project board + * @param {number} id The ID of the project board + * @param {UpdateProjectBoardRequest} [UpdateProjectBoardRequest] + + * @throws {RequiredError} + */ + async updateProjectBoard(id: number, UpdateProjectBoardRequest?: UpdateProjectBoardRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectBoard(id, UpdateProjectBoardRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates a project custom field. The field_code and field_type cannot be changed. At least one field must be provided in the request body. + * @summary Update one project field + * @param {string} field_code The unique code identifying the field + * @param {UpdateProjectFieldRequest} UpdateProjectFieldRequest + + * @throws {RequiredError} + */ + async updateProjectField(field_code: string, UpdateProjectFieldRequest: UpdateProjectFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectField(field_code, UpdateProjectFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates existing options for a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the updated options. + * @summary Update project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async updateProjectFieldOptions(field_code: string, UpdateDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates the properties of a project phase. + * @summary Update a project phase + * @param {number} id The ID of the project phase + * @param {UpdateProjectPhaseRequest} [UpdateProjectPhaseRequest] + + * @throws {RequiredError} + */ + async updateProjectPhase(id: number, UpdateProjectPhaseRequest?: UpdateProjectPhaseRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectPhase(id, UpdateProjectPhaseRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates a task. + * @summary Update a task + * @param {number} id The ID of the task + * @param {UpdateTaskRequest} [UpdateTaskRequest] + + * @throws {RequiredError} + */ + async updateTask(id: number, UpdateTaskRequest?: UpdateTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateTask(id, UpdateTaskRequest, ); + 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 project board. + * @summary Add a project board + * @param {BetaApiAddProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProjectBoard(requestParameters: BetaApiAddProjectBoardRequest, ): Promise { + return localVarFp.addProjectBoard(requestParameters.AddProjectBoardRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Creates a new project custom field. + * @summary Create one project field + * @param {BetaApiAddProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProjectField(requestParameters: BetaApiAddProjectFieldRequest, ): Promise { + return localVarFp.addProjectField(requestParameters.AddProjectFieldRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Adds new options to a project custom field that supports options (enum or set field types). This operation is atomic - all options are added or none are added. Returns only the newly added options. + * @summary Add project field options in bulk + * @param {BetaApiAddProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProjectFieldOptions(requestParameters: BetaApiAddProjectFieldOptionsRequest, ): Promise { + return localVarFp.addProjectFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, + /** + * Adds a new project phase to a board. + * @summary Add a project phase + * @param {BetaApiAddProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProjectPhase(requestParameters: BetaApiAddProjectPhaseRequest, ): Promise { + return localVarFp.addProjectPhase(requestParameters.AddProjectPhaseRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Adds a new task. + * @summary Add a task + * @param {BetaApiAddTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addTask(requestParameters: BetaApiAddTaskRequest, ): Promise { + return localVarFp.addTask(requestParameters.AddTaskRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a project board as deleted. + * @summary Delete a project board + * @param {BetaApiDeleteProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProjectBoard(requestParameters: BetaApiDeleteProjectBoardRequest, ): Promise { + return localVarFp.deleteProjectBoard(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a custom field as deleted. + * @summary Delete one project field + * @param {BetaApiDeleteProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProjectField(requestParameters: BetaApiDeleteProjectFieldRequest, ): Promise { + return localVarFp.deleteProjectField(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, + /** + * Removes existing options from a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the deleted options. + * @summary Delete project field options in bulk + * @param {BetaApiDeleteProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProjectFieldOptions(requestParameters: BetaApiDeleteProjectFieldOptionsRequest, ): Promise { + return localVarFp.deleteProjectFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a project phase as deleted. + * @summary Delete a project phase + * @param {BetaApiDeleteProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProjectPhase(requestParameters: BetaApiDeleteProjectPhaseRequest, ): Promise { + return localVarFp.deleteProjectPhase(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a task as deleted. If the task has subtasks, those will also be deleted. + * @summary Delete a task + * @param {BetaApiDeleteTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteTask(requestParameters: BetaApiDeleteTaskRequest, ): Promise { + return localVarFp.deleteTask(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns metadata about a specific project field. + * @summary Get one project field + * @param {BetaApiGetProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectField(requestParameters: BetaApiGetProjectFieldRequest, ): Promise { + return localVarFp.getProjectField(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, + /** + * Returns metadata about all project fields in the company. + * @summary Get all project fields + * @param {BetaApiGetProjectFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectFields(requestParameters: BetaApiGetProjectFieldsRequest = {}, ): Promise { + return localVarFp.getProjectFields(requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, + /** + * Returns the details of a specific project board. + * @summary Get details of a project board + * @param {BetaApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsBoard(requestParameters: BetaApiGetProjectsBoardRequest, ): Promise { + return localVarFp.getProjectsBoard(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all active project boards. + * @summary Get all project boards + + * @throws {RequiredError} + */ + getProjectsBoards(): Promise { + return localVarFp.getProjectsBoards().then((request) => request(axios, basePath)); + }, + /** + * Returns the details of a specific project phase. + * @summary Get details of a project phase + * @param {BetaApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsPhase(requestParameters: BetaApiGetProjectsPhaseRequest, ): Promise { + return localVarFp.getProjectsPhase(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {BetaApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsPhases(requestParameters: BetaApiGetProjectsPhasesRequest, ): Promise { + return localVarFp.getProjectsPhases(requestParameters.board_id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns the details of a specific task. + * @summary Get details of a task + * @param {BetaApiGetTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getTask(requestParameters: BetaApiGetTaskRequest, ): Promise { + return localVarFp.getTask(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all tasks. + * @summary Get all tasks + * @param {BetaApiGetTasksRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getTasks(requestParameters: BetaApiGetTasksRequest = {}, ): Promise { + return localVarFp.getTasks(requestParameters.cursor, requestParameters.limit, requestParameters.is_done, requestParameters.is_milestone, requestParameters.assignee_id, requestParameters.project_id, requestParameters.parent_task_id, ).then((request) => request(axios, basePath)); + }, + /** + * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. + * @summary Search projects + * @param {BetaApiSearchProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + searchProjects(requestParameters: BetaApiSearchProjectsRequest, ): Promise { + return localVarFp.searchProjects(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, + /** + * Updates the properties of a project board. + * @summary Update a project board + * @param {BetaApiUpdateProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProjectBoard(requestParameters: BetaApiUpdateProjectBoardRequest, ): Promise { + return localVarFp.updateProjectBoard(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Updates a project custom field. The field_code and field_type cannot be changed. At least one field must be provided in the request body. + * @summary Update one project field + * @param {BetaApiUpdateProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProjectField(requestParameters: BetaApiUpdateProjectFieldRequest, ): Promise { + return localVarFp.updateProjectField(requestParameters.field_code, requestParameters.UpdateProjectFieldRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Updates existing options for a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the updated options. + * @summary Update project field options in bulk + * @param {BetaApiUpdateProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProjectFieldOptions(requestParameters: BetaApiUpdateProjectFieldOptionsRequest, ): Promise { + return localVarFp.updateProjectFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, + /** + * Updates the properties of a project phase. + * @summary Update a project phase + * @param {BetaApiUpdateProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProjectPhase(requestParameters: BetaApiUpdateProjectPhaseRequest, ): Promise { + return localVarFp.updateProjectPhase(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Updates a task. + * @summary Update a task + * @param {BetaApiUpdateTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateTask(requestParameters: BetaApiUpdateTaskRequest, ): Promise { + return localVarFp.updateTask(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for addProjectBoard operation in BetaApi. + * @export + * @interface BetaApiAddProjectBoardRequest + */ +export interface BetaApiAddProjectBoardRequest { + /** + * + * @type {AddProjectBoardRequest} + * @memberof BetaApiAddProjectBoard + */ + readonly AddProjectBoardRequest: AddProjectBoardRequest +} + +/** + * Request parameters for addProjectField operation in BetaApi. + * @export + * @interface BetaApiAddProjectFieldRequest + */ +export interface BetaApiAddProjectFieldRequest { + /** + * + * @type {AddProjectFieldRequest} + * @memberof BetaApiAddProjectField + */ + readonly AddProjectFieldRequest: AddProjectFieldRequest +} + +/** + * Request parameters for addProjectFieldOptions operation in BetaApi. + * @export + * @interface BetaApiAddProjectFieldOptionsRequest + */ +export interface BetaApiAddProjectFieldOptionsRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof BetaApiAddProjectFieldOptions + */ + readonly field_code: string + + /** + * + * @type {Array} + * @memberof BetaApiAddProjectFieldOptions + */ + readonly AddDealFieldOptionsRequestInner: Array +} + +/** + * Request parameters for addProjectPhase operation in BetaApi. + * @export + * @interface BetaApiAddProjectPhaseRequest + */ +export interface BetaApiAddProjectPhaseRequest { + /** + * + * @type {AddProjectPhaseRequest} + * @memberof BetaApiAddProjectPhase + */ + readonly AddProjectPhaseRequest: AddProjectPhaseRequest +} + +/** + * Request parameters for addTask operation in BetaApi. + * @export + * @interface BetaApiAddTaskRequest + */ +export interface BetaApiAddTaskRequest { + /** + * + * @type {AddTaskRequest} + * @memberof BetaApiAddTask + */ + readonly AddTaskRequest: AddTaskRequest +} + +/** + * Request parameters for deleteProjectBoard operation in BetaApi. + * @export + * @interface BetaApiDeleteProjectBoardRequest + */ +export interface BetaApiDeleteProjectBoardRequest { + /** + * The ID of the project board + * @type {number} + * @memberof BetaApiDeleteProjectBoard + */ + readonly id: number +} + +/** + * Request parameters for deleteProjectField operation in BetaApi. + * @export + * @interface BetaApiDeleteProjectFieldRequest + */ +export interface BetaApiDeleteProjectFieldRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof BetaApiDeleteProjectField + */ + readonly field_code: string +} + +/** + * Request parameters for deleteProjectFieldOptions operation in BetaApi. + * @export + * @interface BetaApiDeleteProjectFieldOptionsRequest + */ +export interface BetaApiDeleteProjectFieldOptionsRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof BetaApiDeleteProjectFieldOptions + */ + readonly field_code: string + + /** + * + * @type {Array} + * @memberof BetaApiDeleteProjectFieldOptions + */ + readonly DeleteDealFieldOptionsRequestInner: Array +} + +/** + * Request parameters for deleteProjectPhase operation in BetaApi. + * @export + * @interface BetaApiDeleteProjectPhaseRequest + */ +export interface BetaApiDeleteProjectPhaseRequest { + /** + * The ID of the project phase + * @type {number} + * @memberof BetaApiDeleteProjectPhase + */ + readonly id: number +} + +/** + * Request parameters for deleteTask operation in BetaApi. + * @export + * @interface BetaApiDeleteTaskRequest + */ +export interface BetaApiDeleteTaskRequest { + /** + * The ID of the task + * @type {number} + * @memberof BetaApiDeleteTask + */ + readonly id: number +} + +/** + * Request parameters for getProjectField operation in BetaApi. + * @export + * @interface BetaApiGetProjectFieldRequest + */ +export interface BetaApiGetProjectFieldRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof BetaApiGetProjectField + */ + readonly field_code: string +} + +/** + * Request parameters for getProjectFields operation in BetaApi. + * @export + * @interface BetaApiGetProjectFieldsRequest + */ +export interface BetaApiGetProjectFieldsRequest { + /** + * 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 BetaApiGetProjectFields + */ + readonly limit?: number + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof BetaApiGetProjectFields + */ + readonly cursor?: string +} + +/** + * Request parameters for getProjectsBoard operation in BetaApi. + * @export + * @interface BetaApiGetProjectsBoardRequest + */ +export interface BetaApiGetProjectsBoardRequest { + /** + * The ID of the project board + * @type {number} + * @memberof BetaApiGetProjectsBoard + */ + readonly id: number +} + +/** + * Request parameters for getProjectsPhase operation in BetaApi. + * @export + * @interface BetaApiGetProjectsPhaseRequest + */ +export interface BetaApiGetProjectsPhaseRequest { + /** + * The ID of the project phase + * @type {number} + * @memberof BetaApiGetProjectsPhase + */ + readonly id: number +} + +/** + * Request parameters for getProjectsPhases operation in BetaApi. + * @export + * @interface BetaApiGetProjectsPhasesRequest + */ +export interface BetaApiGetProjectsPhasesRequest { + /** + * The ID of the board for which phases are requested + * @type {number} + * @memberof BetaApiGetProjectsPhases + */ + readonly board_id: number +} + +/** + * Request parameters for getTask operation in BetaApi. + * @export + * @interface BetaApiGetTaskRequest + */ +export interface BetaApiGetTaskRequest { + /** + * The ID of the task + * @type {number} + * @memberof BetaApiGetTask + */ + readonly id: number +} + +/** + * Request parameters for getTasks operation in BetaApi. + * @export + * @interface BetaApiGetTasksRequest + */ +export interface BetaApiGetTasksRequest { + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof BetaApiGetTasks + */ + 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 BetaApiGetTasks + */ + readonly limit?: number + + /** + * Whether the task is done or not. If omitted, both done and not done tasks are returned. + * @type {boolean} + * @memberof BetaApiGetTasks + */ + readonly is_done?: boolean + + /** + * Whether the task is a milestone or not. If omitted, both milestone and non-milestone tasks are returned. + * @type {boolean} + * @memberof BetaApiGetTasks + */ + readonly is_milestone?: boolean + + /** + * If supplied, only tasks assigned to this user are returned + * @type {number} + * @memberof BetaApiGetTasks + */ + readonly assignee_id?: number + + /** + * If supplied, only tasks belonging to this project are returned + * @type {number} + * @memberof BetaApiGetTasks + */ + readonly project_id?: number + + /** + * If `null` is supplied, only root-level tasks (without a parent) are returned. If an integer is supplied, only subtasks of that specific task are returned. By default all tasks are returned. + * @type {string} + * @memberof BetaApiGetTasks + */ + readonly parent_task_id?: string +} + +/** + * Request parameters for searchProjects operation in BetaApi. + * @export + * @interface BetaApiSearchProjectsRequest + */ +export interface BetaApiSearchProjectsRequest { + /** + * 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 BetaApiSearchProjects + */ + 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' | 'description'} + * @memberof BetaApiSearchProjects + */ + readonly fields?: 'custom_fields' | 'notes' | 'title' | 'description' + + /** + * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @type {boolean} + * @memberof BetaApiSearchProjects + */ + readonly exact_match?: boolean + + /** + * Will filter projects by the provided person ID + * @type {number} + * @memberof BetaApiSearchProjects + */ + readonly person_id?: number + + /** + * Will filter projects by the provided organization ID + * @type {number} + * @memberof BetaApiSearchProjects + */ + readonly organization_id?: number + + /** + * 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 BetaApiSearchProjects + */ + readonly limit?: number + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof BetaApiSearchProjects + */ + readonly cursor?: string +} + +/** + * Request parameters for updateProjectBoard operation in BetaApi. + * @export + * @interface BetaApiUpdateProjectBoardRequest + */ +export interface BetaApiUpdateProjectBoardRequest { + /** + * The ID of the project board + * @type {number} + * @memberof BetaApiUpdateProjectBoard + */ + readonly id: number + + /** + * + * @type {UpdateProjectBoardRequest} + * @memberof BetaApiUpdateProjectBoard + */ + readonly UpdateProjectBoardRequest?: UpdateProjectBoardRequest +} + +/** + * Request parameters for updateProjectField operation in BetaApi. + * @export + * @interface BetaApiUpdateProjectFieldRequest + */ +export interface BetaApiUpdateProjectFieldRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof BetaApiUpdateProjectField + */ + readonly field_code: string + + /** + * + * @type {UpdateProjectFieldRequest} + * @memberof BetaApiUpdateProjectField + */ + readonly UpdateProjectFieldRequest: UpdateProjectFieldRequest +} + +/** + * Request parameters for updateProjectFieldOptions operation in BetaApi. + * @export + * @interface BetaApiUpdateProjectFieldOptionsRequest + */ +export interface BetaApiUpdateProjectFieldOptionsRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof BetaApiUpdateProjectFieldOptions + */ + readonly field_code: string + + /** + * + * @type {Array} + * @memberof BetaApiUpdateProjectFieldOptions + */ + readonly UpdateDealFieldOptionsRequestInner: Array +} + +/** + * Request parameters for updateProjectPhase operation in BetaApi. + * @export + * @interface BetaApiUpdateProjectPhaseRequest + */ +export interface BetaApiUpdateProjectPhaseRequest { + /** + * The ID of the project phase + * @type {number} + * @memberof BetaApiUpdateProjectPhase + */ + readonly id: number + + /** + * + * @type {UpdateProjectPhaseRequest} + * @memberof BetaApiUpdateProjectPhase + */ + readonly UpdateProjectPhaseRequest?: UpdateProjectPhaseRequest +} + +/** + * Request parameters for updateTask operation in BetaApi. + * @export + * @interface BetaApiUpdateTaskRequest + */ +export interface BetaApiUpdateTaskRequest { + /** + * The ID of the task + * @type {number} + * @memberof BetaApiUpdateTask + */ + readonly id: number + + /** + * + * @type {UpdateTaskRequest} + * @memberof BetaApiUpdateTask + */ + readonly UpdateTaskRequest?: UpdateTaskRequest +} + +/** + * BetaApi - object-oriented interface + * @export + * @class BetaApi + * @extends {BaseAPI} + */ +export class BetaApi extends BaseAPI { + /** + * Adds a new project board. + * @summary Add a project board + * @param {BetaApiAddProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addProjectBoard(requestParameters: BetaApiAddProjectBoardRequest, ) { + return BetaApiFp(this.configuration).addProjectBoard(requestParameters.AddProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Creates a new project custom field. + * @summary Create one project field + * @param {BetaApiAddProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addProjectField(requestParameters: BetaApiAddProjectFieldRequest, ) { + return BetaApiFp(this.configuration).addProjectField(requestParameters.AddProjectFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Adds new options to a project custom field that supports options (enum or set field types). This operation is atomic - all options are added or none are added. Returns only the newly added options. + * @summary Add project field options in bulk + * @param {BetaApiAddProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addProjectFieldOptions(requestParameters: BetaApiAddProjectFieldOptionsRequest, ) { + return BetaApiFp(this.configuration).addProjectFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Adds a new project phase to a board. + * @summary Add a project phase + * @param {BetaApiAddProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addProjectPhase(requestParameters: BetaApiAddProjectPhaseRequest, ) { + return BetaApiFp(this.configuration).addProjectPhase(requestParameters.AddProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Adds a new task. + * @summary Add a task + * @param {BetaApiAddTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addTask(requestParameters: BetaApiAddTaskRequest, ) { + return BetaApiFp(this.configuration).addTask(requestParameters.AddTaskRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a project board as deleted. + * @summary Delete a project board + * @param {BetaApiDeleteProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteProjectBoard(requestParameters: BetaApiDeleteProjectBoardRequest, ) { + return BetaApiFp(this.configuration).deleteProjectBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a custom field as deleted. + * @summary Delete one project field + * @param {BetaApiDeleteProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteProjectField(requestParameters: BetaApiDeleteProjectFieldRequest, ) { + return BetaApiFp(this.configuration).deleteProjectField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Removes existing options from a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the deleted options. + * @summary Delete project field options in bulk + * @param {BetaApiDeleteProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteProjectFieldOptions(requestParameters: BetaApiDeleteProjectFieldOptionsRequest, ) { + return BetaApiFp(this.configuration).deleteProjectFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a project phase as deleted. + * @summary Delete a project phase + * @param {BetaApiDeleteProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteProjectPhase(requestParameters: BetaApiDeleteProjectPhaseRequest, ) { + return BetaApiFp(this.configuration).deleteProjectPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a task as deleted. If the task has subtasks, those will also be deleted. + * @summary Delete a task + * @param {BetaApiDeleteTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteTask(requestParameters: BetaApiDeleteTaskRequest, ) { + return BetaApiFp(this.configuration).deleteTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns metadata about a specific project field. + * @summary Get one project field + * @param {BetaApiGetProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectField(requestParameters: BetaApiGetProjectFieldRequest, ) { + return BetaApiFp(this.configuration).getProjectField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns metadata about all project fields in the company. + * @summary Get all project fields + * @param {BetaApiGetProjectFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectFields(requestParameters: BetaApiGetProjectFieldsRequest = {}, ) { + return BetaApiFp(this.configuration).getProjectFields(requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns the details of a specific project board. + * @summary Get details of a project board + * @param {BetaApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectsBoard(requestParameters: BetaApiGetProjectsBoardRequest, ) { + return BetaApiFp(this.configuration).getProjectsBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all active project boards. + * @summary Get all project boards + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectsBoards() { + return BetaApiFp(this.configuration).getProjectsBoards().then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns the details of a specific project phase. + * @summary Get details of a project phase + * @param {BetaApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectsPhase(requestParameters: BetaApiGetProjectsPhaseRequest, ) { + return BetaApiFp(this.configuration).getProjectsPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {BetaApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectsPhases(requestParameters: BetaApiGetProjectsPhasesRequest, ) { + return BetaApiFp(this.configuration).getProjectsPhases(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns the details of a specific task. + * @summary Get details of a task + * @param {BetaApiGetTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getTask(requestParameters: BetaApiGetTaskRequest, ) { + return BetaApiFp(this.configuration).getTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all tasks. + * @summary Get all tasks + * @param {BetaApiGetTasksRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getTasks(requestParameters: BetaApiGetTasksRequest = {}, ) { + return BetaApiFp(this.configuration).getTasks(requestParameters.cursor, requestParameters.limit, requestParameters.is_done, requestParameters.is_milestone, requestParameters.assignee_id, requestParameters.project_id, requestParameters.parent_task_id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. + * @summary Search projects + * @param {BetaApiSearchProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public searchProjects(requestParameters: BetaApiSearchProjectsRequest, ) { + return BetaApiFp(this.configuration).searchProjects(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the properties of a project board. + * @summary Update a project board + * @param {BetaApiUpdateProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateProjectBoard(requestParameters: BetaApiUpdateProjectBoardRequest, ) { + return BetaApiFp(this.configuration).updateProjectBoard(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates a project custom field. The field_code and field_type cannot be changed. At least one field must be provided in the request body. + * @summary Update one project field + * @param {BetaApiUpdateProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateProjectField(requestParameters: BetaApiUpdateProjectFieldRequest, ) { + return BetaApiFp(this.configuration).updateProjectField(requestParameters.field_code, requestParameters.UpdateProjectFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates existing options for a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the updated options. + * @summary Update project field options in bulk + * @param {BetaApiUpdateProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateProjectFieldOptions(requestParameters: BetaApiUpdateProjectFieldOptionsRequest, ) { + return BetaApiFp(this.configuration).updateProjectFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the properties of a project phase. + * @summary Update a project phase + * @param {BetaApiUpdateProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateProjectPhase(requestParameters: BetaApiUpdateProjectPhaseRequest, ) { + return BetaApiFp(this.configuration).updateProjectPhase(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates a task. + * @summary Update a task + * @param {BetaApiUpdateTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateTask(requestParameters: BetaApiUpdateTaskRequest, ) { + return BetaApiFp(this.configuration).updateTask(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/api/deal-installments-api.ts b/src/versions/v2/api/deal-installments-api.ts new file mode 100644 index 00000000..2d6137a3 --- /dev/null +++ b/src/versions/v2/api/deal-installments-api.ts @@ -0,0 +1,527 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddAInstallmentResponse } from '../models'; +// @ts-ignore +import { AddInstallmentRequestBody } from '../models'; +// @ts-ignore +import { DeleteInstallmentResponse } from '../models'; +// @ts-ignore +import { GetInstallmentsResponse } from '../models'; +// @ts-ignore +import { UpdateInstallmentRequestBody } from '../models'; +// @ts-ignore +import { UpdateInstallmentResponse } from '../models'; +/** + * DealInstallmentsApi - axios parameter creator + * @export + */ +export const DealInstallmentsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Removes an installment from a deal. Only available in Growth 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} + */ + 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(localVarHeaderParameter, "x-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, + }; + }, + /** + * Lists installments attached to a list of deals. Only available in Growth 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(localVarHeaderParameter, "x-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, + }; + }, + /** + * 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 Growth 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(localVarHeaderParameter, "x-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, + }; + }, + /** + * Edits an installment added to a deal. Only available in Growth 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(localVarHeaderParameter, "x-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, + }; + }, + } +}; + + +/** + * DealInstallmentsApi - functional programming interface + * @export + */ +export const DealInstallmentsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = DealInstallmentsApiAxiosParamCreator(configuration) + return { + /** + * Removes an installment from a deal. Only available in Growth 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); + }, + /** + * Lists installments attached to a list of deals. Only available in Growth 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); + }, + /** + * 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 Growth 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); + }, + /** + * Edits an installment added to a deal. Only available in Growth 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); + }, + } +}; + +/** + * DealInstallmentsApi - factory interface + * @export + */ +export const DealInstallmentsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = DealInstallmentsApiFp(configuration) + return { + /** + * Removes an installment from a deal. Only available in Growth and above plans. + * @summary Delete an installment from a deal + * @param {DealInstallmentsApiDeleteInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteInstallment(requestParameters: DealInstallmentsApiDeleteInstallmentRequest, ): Promise { + return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(axios, basePath)); + }, + /** + * Lists installments attached to a list of deals. Only available in Growth and above plans. + * @summary List installments added to a list of deals + * @param {DealInstallmentsApiGetInstallmentsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getInstallments(requestParameters: DealInstallmentsApiGetInstallmentsRequest, ): Promise { + return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).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 Growth and above plans. + * @summary Add an installment to a deal + * @param {DealInstallmentsApiPostInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + postInstallment(requestParameters: DealInstallmentsApiPostInstallmentRequest, ): Promise { + return localVarFp.postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody, ).then((request) => request(axios, basePath)); + }, + /** + * Edits an installment added to a deal. Only available in Growth and above plans. + * @summary Update an installment added to a deal + * @param {DealInstallmentsApiUpdateInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateInstallment(requestParameters: DealInstallmentsApiUpdateInstallmentRequest, ): Promise { + return localVarFp.updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for deleteInstallment operation in DealInstallmentsApi. + * @export + * @interface DealInstallmentsApiDeleteInstallmentRequest + */ +export interface DealInstallmentsApiDeleteInstallmentRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealInstallmentsApiDeleteInstallment + */ + readonly id: number + + /** + * The ID of the installment + * @type {number} + * @memberof DealInstallmentsApiDeleteInstallment + */ + readonly installment_id: number +} + +/** + * Request parameters for getInstallments operation in DealInstallmentsApi. + * @export + * @interface DealInstallmentsApiGetInstallmentsRequest + */ +export interface DealInstallmentsApiGetInstallmentsRequest { + /** + * 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 DealInstallmentsApiGetInstallments + */ + readonly deal_ids: Array + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof DealInstallmentsApiGetInstallments + */ + 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 DealInstallmentsApiGetInstallments + */ + readonly limit?: number + + /** + * The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. + * @type {'id' | 'billing_date' | 'deal_id'} + * @memberof DealInstallmentsApiGetInstallments + */ + readonly sort_by?: 'id' | 'billing_date' | 'deal_id' + + /** + * The sorting direction. Supported values: `asc`, `desc`. + * @type {'asc' | 'desc'} + * @memberof DealInstallmentsApiGetInstallments + */ + readonly sort_direction?: 'asc' | 'desc' +} + +/** + * Request parameters for postInstallment operation in DealInstallmentsApi. + * @export + * @interface DealInstallmentsApiPostInstallmentRequest + */ +export interface DealInstallmentsApiPostInstallmentRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealInstallmentsApiPostInstallment + */ + readonly id: number + + /** + * + * @type {AddInstallmentRequestBody} + * @memberof DealInstallmentsApiPostInstallment + */ + readonly AddInstallmentRequestBody?: AddInstallmentRequestBody +} + +/** + * Request parameters for updateInstallment operation in DealInstallmentsApi. + * @export + * @interface DealInstallmentsApiUpdateInstallmentRequest + */ +export interface DealInstallmentsApiUpdateInstallmentRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealInstallmentsApiUpdateInstallment + */ + readonly id: number + + /** + * The ID of the installment + * @type {number} + * @memberof DealInstallmentsApiUpdateInstallment + */ + readonly installment_id: number + + /** + * + * @type {UpdateInstallmentRequestBody} + * @memberof DealInstallmentsApiUpdateInstallment + */ + readonly UpdateInstallmentRequestBody?: UpdateInstallmentRequestBody +} + +/** + * DealInstallmentsApi - object-oriented interface + * @export + * @class DealInstallmentsApi + * @extends {BaseAPI} + */ +export class DealInstallmentsApi extends BaseAPI { + /** + * Removes an installment from a deal. Only available in Growth and above plans. + * @summary Delete an installment from a deal + * @param {DealInstallmentsApiDeleteInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealInstallmentsApi + */ + public deleteInstallment(requestParameters: DealInstallmentsApiDeleteInstallmentRequest, ) { + return DealInstallmentsApiFp(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Lists installments attached to a list of deals. Only available in Growth and above plans. + * @summary List installments added to a list of deals + * @param {DealInstallmentsApiGetInstallmentsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealInstallmentsApi + */ + public getInstallments(requestParameters: DealInstallmentsApiGetInstallmentsRequest, ) { + return DealInstallmentsApiFp(this.configuration).getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).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 Growth and above plans. + * @summary Add an installment to a deal + * @param {DealInstallmentsApiPostInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealInstallmentsApi + */ + public postInstallment(requestParameters: DealInstallmentsApiPostInstallmentRequest, ) { + return DealInstallmentsApiFp(this.configuration).postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Edits an installment added to a deal. Only available in Growth and above plans. + * @summary Update an installment added to a deal + * @param {DealInstallmentsApiUpdateInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealInstallmentsApi + */ + public updateInstallment(requestParameters: DealInstallmentsApiUpdateInstallmentRequest, ) { + return DealInstallmentsApiFp(this.configuration).updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/api/deal-products-api.ts b/src/versions/v2/api/deal-products-api.ts new file mode 100644 index 00000000..32c0bd37 --- /dev/null +++ b/src/versions/v2/api/deal-products-api.ts @@ -0,0 +1,872 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddDealProductRequest } from '../models'; +// @ts-ignore +import { AddDealProductResponse } from '../models'; +// @ts-ignore +import { AddManyDealProductResponse } from '../models'; +// @ts-ignore +import { CreateManyDealProductRequest } from '../models'; +// @ts-ignore +import { DeleteDealProductResponse } from '../models'; +// @ts-ignore +import { DeleteManyDealProductResponse } from '../models'; +// @ts-ignore +import { GetDealsProductsResponse } from '../models'; +// @ts-ignore +import { UpdateDealProductRequest } from '../models'; +/** + * DealProductsApi - axios parameter creator + * @export + */ +export const DealProductsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * 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} + */ + addDealProduct: async (id: number, AddDealProductRequest?: AddDealProductRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('addDealProduct', '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: '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(AddDealProductRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + 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, + }; + }, + /** + * 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(localVarHeaderParameter, "x-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, + }; + }, + /** + * 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, }; + + 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' | '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' | '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` + .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(localVarHeaderParameter, "x-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 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' | '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' | '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`; + // 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(localVarHeaderParameter, "x-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, + }; + }, + /** + * 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(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(UpdateDealProductRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * DealProductsApi - functional programming interface + * @export + */ +export const DealProductsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = DealProductsApiAxiosParamCreator(configuration) + return { + /** + * 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 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); + }, + /** + * 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); + }, + /** + * 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 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' | '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' | '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); + }, + /** + * 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' | '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' | '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); + }, + /** + * 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); + }, + } +}; + +/** + * DealProductsApi - factory interface + * @export + */ +export const DealProductsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = DealProductsApiFp(configuration) + return { + /** + * Adds a product to a deal, creating a new item called a deal-product. + * @summary Add a product to a deal + * @param {DealProductsApiAddDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addDealProduct(requestParameters: DealProductsApiAddDealProductRequest, ): 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 {DealProductsApiAddManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addManyDealProducts(requestParameters: DealProductsApiAddManyDealProductsRequest, ): Promise { + return localVarFp.addManyDealProducts(requestParameters.id, requestParameters.CreateManyDealProductRequest, ).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 {DealProductsApiDeleteDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteDealProduct(requestParameters: DealProductsApiDeleteDealProductRequest, ): Promise { + return localVarFp.deleteDealProduct(requestParameters.id, requestParameters.product_attachment_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 {DealProductsApiDeleteManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteManyDealProducts(requestParameters: DealProductsApiDeleteManyDealProductsRequest, ): Promise { + return localVarFp.deleteManyDealProducts(requestParameters.id, requestParameters.ids, ).then((request) => request(axios, basePath)); + }, + /** + * Lists products attached to a deal. + * @summary List products attached to a deal + * @param {DealProductsApiGetDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getDealProducts(requestParameters: DealProductsApiGetDealProductsRequest, ): Promise { + return localVarFp.getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(axios, basePath)); + }, + /** + * Returns data about products attached to deals + * @summary Get deal products of several deals + * @param {DealProductsApiGetDealsProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getDealsProducts(requestParameters: DealProductsApiGetDealsProductsRequest, ): Promise { + return localVarFp.getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).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 {DealProductsApiUpdateDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateDealProduct(requestParameters: DealProductsApiUpdateDealProductRequest, ): Promise { + return localVarFp.updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for addDealProduct operation in DealProductsApi. + * @export + * @interface DealProductsApiAddDealProductRequest + */ +export interface DealProductsApiAddDealProductRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealProductsApiAddDealProduct + */ + readonly id: number + + /** + * + * @type {AddDealProductRequest} + * @memberof DealProductsApiAddDealProduct + */ + readonly AddDealProductRequest?: AddDealProductRequest +} + +/** + * Request parameters for addManyDealProducts operation in DealProductsApi. + * @export + * @interface DealProductsApiAddManyDealProductsRequest + */ +export interface DealProductsApiAddManyDealProductsRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealProductsApiAddManyDealProducts + */ + readonly id: number + + /** + * + * @type {CreateManyDealProductRequest} + * @memberof DealProductsApiAddManyDealProducts + */ + readonly CreateManyDealProductRequest?: CreateManyDealProductRequest +} + +/** + * Request parameters for deleteDealProduct operation in DealProductsApi. + * @export + * @interface DealProductsApiDeleteDealProductRequest + */ +export interface DealProductsApiDeleteDealProductRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealProductsApiDeleteDealProduct + */ + readonly id: number + + /** + * The product attachment ID + * @type {number} + * @memberof DealProductsApiDeleteDealProduct + */ + readonly product_attachment_id: number +} + +/** + * Request parameters for deleteManyDealProducts operation in DealProductsApi. + * @export + * @interface DealProductsApiDeleteManyDealProductsRequest + */ +export interface DealProductsApiDeleteManyDealProductsRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealProductsApiDeleteManyDealProducts + */ + 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 DealProductsApiDeleteManyDealProducts + */ + readonly ids?: string +} + +/** + * Request parameters for getDealProducts operation in DealProductsApi. + * @export + * @interface DealProductsApiGetDealProductsRequest + */ +export interface DealProductsApiGetDealProductsRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealProductsApiGetDealProducts + */ + readonly id: number + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof DealProductsApiGetDealProducts + */ + 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 DealProductsApiGetDealProducts + */ + readonly limit?: number + + /** + * The field to sort by. Supported fields: `id`, `add_time`, `update_time`, `order_nr`. + * @type {'id' | 'add_time' | 'update_time' | 'order_nr'} + * @memberof DealProductsApiGetDealProducts + */ + readonly sort_by?: 'id' | 'add_time' | 'update_time' | 'order_nr' + + /** + * The sorting direction. Supported values: `asc`, `desc`. + * @type {'asc' | 'desc'} + * @memberof DealProductsApiGetDealProducts + */ + readonly sort_direction?: 'asc' | 'desc' +} + +/** + * Request parameters for getDealsProducts operation in DealProductsApi. + * @export + * @interface DealProductsApiGetDealsProductsRequest + */ +export interface DealProductsApiGetDealsProductsRequest { + /** + * 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 DealProductsApiGetDealsProducts + */ + readonly deal_ids: Array + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof DealProductsApiGetDealsProducts + */ + 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 DealProductsApiGetDealsProducts + */ + readonly limit?: number + + /** + * 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 DealProductsApiGetDealsProducts + */ + readonly sort_by?: 'id' | 'deal_id' | 'add_time' | 'update_time' | 'order_nr' + + /** + * The sorting direction. Supported values: `asc`, `desc`. + * @type {'asc' | 'desc'} + * @memberof DealProductsApiGetDealsProducts + */ + readonly sort_direction?: 'asc' | 'desc' +} + +/** + * Request parameters for updateDealProduct operation in DealProductsApi. + * @export + * @interface DealProductsApiUpdateDealProductRequest + */ +export interface DealProductsApiUpdateDealProductRequest { + /** + * The ID of the deal + * @type {number} + * @memberof DealProductsApiUpdateDealProduct + */ + readonly id: number + + /** + * The ID of the deal-product (the ID of the product attached to the deal) + * @type {number} + * @memberof DealProductsApiUpdateDealProduct + */ + readonly product_attachment_id: number + + /** + * + * @type {UpdateDealProductRequest} + * @memberof DealProductsApiUpdateDealProduct + */ + readonly UpdateDealProductRequest?: UpdateDealProductRequest +} + +/** + * DealProductsApi - object-oriented interface + * @export + * @class DealProductsApi + * @extends {BaseAPI} + */ +export class DealProductsApi extends BaseAPI { + /** + * Adds a product to a deal, creating a new item called a deal-product. + * @summary Add a product to a deal + * @param {DealProductsApiAddDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public addDealProduct(requestParameters: DealProductsApiAddDealProductRequest, ) { + return DealProductsApiFp(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 {DealProductsApiAddManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public addManyDealProducts(requestParameters: DealProductsApiAddManyDealProductsRequest, ) { + return DealProductsApiFp(this.configuration).addManyDealProducts(requestParameters.id, requestParameters.CreateManyDealProductRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Deletes a product attachment from a deal, using the `product_attachment_id`. + * @summary Delete an attached product from a deal + * @param {DealProductsApiDeleteDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public deleteDealProduct(requestParameters: DealProductsApiDeleteDealProductRequest, ) { + return DealProductsApiFp(this.configuration).deleteDealProduct(requestParameters.id, requestParameters.product_attachment_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 {DealProductsApiDeleteManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public deleteManyDealProducts(requestParameters: DealProductsApiDeleteManyDealProductsRequest, ) { + return DealProductsApiFp(this.configuration).deleteManyDealProducts(requestParameters.id, requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Lists products attached to a deal. + * @summary List products attached to a deal + * @param {DealProductsApiGetDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public getDealProducts(requestParameters: DealProductsApiGetDealProductsRequest, ) { + return DealProductsApiFp(this.configuration).getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns data about products attached to deals + * @summary Get deal products of several deals + * @param {DealProductsApiGetDealsProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public getDealsProducts(requestParameters: DealProductsApiGetDealsProductsRequest, ) { + return DealProductsApiFp(this.configuration).getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).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 {DealProductsApiUpdateDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public updateDealProduct(requestParameters: DealProductsApiUpdateDealProductRequest, ) { + return DealProductsApiFp(this.configuration).updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/api/deals-api.ts b/src/versions/v2/api/deals-api.ts index c7032aa4..d7a4c191 100644 --- a/src/versions/v2/api/deals-api.ts +++ b/src/versions/v2/api/deals-api.ts @@ -22,8 +22,6 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore -import { AddAInstallmentResponse } from '../models'; -// @ts-ignore import { AddAdditionalDiscountRequestBody } from '../models'; // @ts-ignore import { AddAdditionalDiscountResponse } from '../models'; @@ -32,32 +30,16 @@ import { AddConvertDealToLeadResponse } from '../models'; // @ts-ignore import { AddDealFollowerRequest } from '../models'; // @ts-ignore -import { AddDealProductRequest } from '../models'; -// @ts-ignore -import { AddDealProductResponse } from '../models'; -// @ts-ignore import { AddDealRequest } from '../models'; // @ts-ignore 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'; -// @ts-ignore import { DeleteDealResponse } from '../models'; // @ts-ignore 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'; @@ -66,28 +48,18 @@ import { GetConvertResponse1 } from '../models'; // @ts-ignore import { GetDealSearchResponse } from '../models'; // @ts-ignore -import { GetDealsProductsResponse } from '../models'; -// @ts-ignore import { GetDealsResponse } from '../models'; // @ts-ignore import { GetFollowerChangelogsResponse } from '../models'; // @ts-ignore import { GetFollowersResponse } from '../models'; // @ts-ignore -import { GetInstallmentsResponse } 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 { UpsertDealResponse } from '../models'; /** * DealsApi - axios parameter creator @@ -181,96 +153,6 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * 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} - */ - addDealProduct: async (id: number, AddDealProductRequest?: AddDealProductRequest, ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('addDealProduct', '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: '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(AddDealProductRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - 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 @@ -434,142 +316,6 @@ 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 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(localVarHeaderParameter, "x-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, - }; - }, - /** - * Removes an installment from a deal. Only available in Growth 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} - */ - 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(localVarHeaderParameter, "x-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, - }; - }, - /** - * 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, }; @@ -743,10 +489,12 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @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' | 'smart_bcc_email' | 'source_lead_id'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, ): Promise => { + 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' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getDeal', 'id', id) const localVarPath = `/deals/{id}` @@ -777,6 +525,14 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['custom_fields'] = custom_fields; } + if (include_option_labels !== undefined) { + localVarQueryParameter['include_option_labels'] = include_option_labels; + } + + if (include_labels !== undefined) { + localVarQueryParameter['include_labels'] = include_labels; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -926,67 +682,6 @@ 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, - }; - }, - /** - * 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' | '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' | '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` - .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(localVarHeaderParameter, "x-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, }; @@ -1013,12 +708,14 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration * @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' | 'smart_bcc_email' | 'source_lead_id'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, limit?: number, cursor?: string, ): Promise => { + 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' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, 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); @@ -1094,142 +791,22 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['custom_fields'] = custom_fields; } - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; + if (include_option_labels !== undefined) { + localVarQueryParameter['include_option_labels'] = include_option_labels; } - 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' | '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' | '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`; - // 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(localVarHeaderParameter, "x-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 (include_labels !== undefined) { + localVarQueryParameter['include_labels'] = include_labels; } 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 Growth 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(localVarHeaderParameter, "x-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); @@ -1286,51 +863,6 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration 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 Growth 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(localVarHeaderParameter, "x-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 @@ -1504,104 +1036,6 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration 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(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(UpdateDealProductRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Edits an installment added to a deal. Only available in Growth 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(localVarHeaderParameter, "x-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, @@ -1641,30 +1075,6 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealFollower(id, AddDealFollowerRequest, ); 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 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 @@ -1711,42 +1121,6 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFollower(id, follower_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 Growth 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); - }, - /** - * 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 @@ -1790,11 +1164,13 @@ export const DealsApiFp = function(configuration?: Configuration) { * @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' | 'smart_bcc_email' | 'source_lead_id'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDeal(id, include_fields, custom_fields, ); + 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' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDeal(id, include_fields, custom_fields, include_option_labels, include_labels, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -1835,21 +1211,6 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFollowersChangelog(id, limit, cursor, ); 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' | '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' | '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); - }, /** * Returns data about all not archived deals. * @summary Get all deals @@ -1867,43 +1228,15 @@ export const DealsApiFp = function(configuration?: Configuration) { * @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' | 'smart_bcc_email' | 'source_lead_id'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email' | 'source_lead_id', 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' | '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' | '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); - }, - /** - * Lists installments attached to a list of deals. Only available in Growth 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, ); + 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' | 'smart_bcc_email' | 'source_lead_id', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, 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, include_option_labels, include_labels, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -1918,18 +1251,6 @@ export const DealsApiFp = function(configuration?: Configuration) { 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 Growth 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 @@ -1974,32 +1295,6 @@ export const DealsApiFp = function(configuration?: Configuration) { 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 Growth 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); - }, } }; @@ -2030,26 +1325,6 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath addDealFollower(requestParameters: DealsApiAddDealFollowerRequest, ): Promise { return localVarFp.addDealFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).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 {DealsApiAddDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - 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 @@ -2090,36 +1365,6 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath deleteDealFollower(requestParameters: DealsApiDeleteDealFollowerRequest, ): Promise { return localVarFp.deleteDealFollower(requestParameters.id, requestParameters.follower_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 {DealsApiDeleteDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - deleteDealProduct(requestParameters: DealsApiDeleteDealProductRequest, ): Promise { - return localVarFp.deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id, ).then((request) => request(axios, basePath)); - }, - /** - * Removes an installment from a deal. Only available in Growth and above plans. - * @summary Delete an installment from a deal - * @param {DealsApiDeleteInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - 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 @@ -2148,7 +1393,7 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getDeal(requestParameters: DealsApiGetDealRequest, ): Promise { - return localVarFp.getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(axios, basePath)); + return localVarFp.getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(axios, basePath)); }, /** * Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. @@ -2180,16 +1425,6 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealFollowersChangelog(requestParameters: DealsApiGetDealFollowersChangelogRequest, ): Promise { return localVarFp.getDealFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, - /** - * Lists products attached to a deal. - * @summary List products attached to a deal - * @param {DealsApiGetDealProductsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getDealProducts(requestParameters: DealsApiGetDealProductsRequest, ): 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 not archived deals. * @summary Get all deals @@ -2198,27 +1433,7 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getDeals(requestParameters: DealsApiGetDealsRequest = {}, ): 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 {DealsApiGetDealsProductsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getDealsProducts(requestParameters: DealsApiGetDealsProductsRequest, ): 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 Growth and above plans. - * @summary List installments added to a list of deals - * @param {DealsApiGetInstallmentsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - getInstallments(requestParameters: DealsApiGetInstallmentsRequest, ): Promise { - return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(axios, basePath)); + 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.include_option_labels, requestParameters.include_labels, 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. @@ -2230,16 +1445,6 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath postAdditionalDiscount(requestParameters: DealsApiPostAdditionalDiscountRequest, ): 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 Growth and above plans. - * @summary Add an installment to a deal - * @param {DealsApiPostInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - postInstallment(requestParameters: DealsApiPostInstallmentRequest, ): 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 @@ -2270,26 +1475,6 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath updateDeal(requestParameters: DealsApiUpdateDealRequest, ): 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 {DealsApiUpdateDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updateDealProduct(requestParameters: DealsApiUpdateDealProductRequest, ): 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 Growth and above plans. - * @summary Update an installment added to a deal - * @param {DealsApiUpdateInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - */ - updateInstallment(requestParameters: DealsApiUpdateInstallmentRequest, ): Promise { - return localVarFp.updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(axios, basePath)); - }, }; }; @@ -2328,179 +1513,74 @@ export interface DealsApiAddDealFollowerRequest { readonly AddDealFollowerRequest?: AddDealFollowerRequest } -/** - * Request parameters for addDealProduct operation in DealsApi. - * @export - * @interface DealsApiAddDealProductRequest - */ -export interface DealsApiAddDealProductRequest { - /** - * The ID of the deal - * @type {number} - * @memberof DealsApiAddDealProduct - */ - readonly id: number - - /** - * - * @type {AddDealProductRequest} - * @memberof DealsApiAddDealProduct - */ - 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 * @interface DealsApiConvertDealToLeadRequest */ -export interface DealsApiConvertDealToLeadRequest { - /** - * The ID of the deal to convert - * @type {number} - * @memberof DealsApiConvertDealToLead - */ - readonly id: number -} - -/** - * Request parameters for deleteAdditionalDiscount operation in DealsApi. - * @export - * @interface DealsApiDeleteAdditionalDiscountRequest - */ -export interface DealsApiDeleteAdditionalDiscountRequest { - /** - * The ID of the deal - * @type {number} - * @memberof DealsApiDeleteAdditionalDiscount - */ - readonly id: number - - /** - * The ID of the discount - * @type {string} - * @memberof DealsApiDeleteAdditionalDiscount - */ - readonly discount_id: string -} - -/** - * Request parameters for deleteDeal operation in DealsApi. - * @export - * @interface DealsApiDeleteDealRequest - */ -export interface DealsApiDeleteDealRequest { - /** - * The ID of the deal - * @type {number} - * @memberof DealsApiDeleteDeal - */ - readonly id: number -} - -/** - * Request parameters for deleteDealFollower operation in DealsApi. - * @export - * @interface DealsApiDeleteDealFollowerRequest - */ -export interface DealsApiDeleteDealFollowerRequest { - /** - * The ID of the deal - * @type {number} - * @memberof DealsApiDeleteDealFollower - */ - readonly id: number - +export interface DealsApiConvertDealToLeadRequest { /** - * The ID of the following user + * The ID of the deal to convert * @type {number} - * @memberof DealsApiDeleteDealFollower + * @memberof DealsApiConvertDealToLead */ - readonly follower_id: number + readonly id: number } /** - * Request parameters for deleteDealProduct operation in DealsApi. + * Request parameters for deleteAdditionalDiscount operation in DealsApi. * @export - * @interface DealsApiDeleteDealProductRequest + * @interface DealsApiDeleteAdditionalDiscountRequest */ -export interface DealsApiDeleteDealProductRequest { +export interface DealsApiDeleteAdditionalDiscountRequest { /** * The ID of the deal * @type {number} - * @memberof DealsApiDeleteDealProduct + * @memberof DealsApiDeleteAdditionalDiscount */ readonly id: number /** - * The product attachment ID - * @type {number} - * @memberof DealsApiDeleteDealProduct + * The ID of the discount + * @type {string} + * @memberof DealsApiDeleteAdditionalDiscount */ - readonly product_attachment_id: number + readonly discount_id: string } /** - * Request parameters for deleteInstallment operation in DealsApi. + * Request parameters for deleteDeal operation in DealsApi. * @export - * @interface DealsApiDeleteInstallmentRequest + * @interface DealsApiDeleteDealRequest */ -export interface DealsApiDeleteInstallmentRequest { +export interface DealsApiDeleteDealRequest { /** * The ID of the deal * @type {number} - * @memberof DealsApiDeleteInstallment + * @memberof DealsApiDeleteDeal */ readonly id: number - - /** - * The ID of the installment - * @type {number} - * @memberof DealsApiDeleteInstallment - */ - readonly installment_id: number } /** - * Request parameters for deleteManyDealProducts operation in DealsApi. + * Request parameters for deleteDealFollower operation in DealsApi. * @export - * @interface DealsApiDeleteManyDealProductsRequest + * @interface DealsApiDeleteDealFollowerRequest */ -export interface DealsApiDeleteManyDealProductsRequest { +export interface DealsApiDeleteDealFollowerRequest { /** * The ID of the deal * @type {number} - * @memberof DealsApiDeleteManyDealProducts + * @memberof DealsApiDeleteDealFollower */ 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 + * The ID of the following user + * @type {number} + * @memberof DealsApiDeleteDealFollower */ - readonly ids?: string + readonly follower_id: number } /** @@ -2662,6 +1742,20 @@ export interface DealsApiGetDealRequest { * @memberof DealsApiGetDeal */ readonly custom_fields?: string + + /** + * When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @type {boolean} + * @memberof DealsApiGetDeal + */ + readonly include_option_labels?: boolean + + /** + * When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' + * @type {boolean} + * @memberof DealsApiGetDeal + */ + readonly include_labels?: boolean } /** @@ -2741,48 +1835,6 @@ export interface DealsApiGetDealFollowersChangelogRequest { readonly cursor?: string } -/** - * Request parameters for getDealProducts operation in DealsApi. - * @export - * @interface DealsApiGetDealProductsRequest - */ -export interface DealsApiGetDealProductsRequest { - /** - * The ID of the deal - * @type {number} - * @memberof DealsApiGetDealProducts - */ - readonly id: number - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof DealsApiGetDealProducts - */ - 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 DealsApiGetDealProducts - */ - readonly limit?: number - - /** - * 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' | 'order_nr' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof DealsApiGetDealProducts - */ - readonly sort_direction?: 'asc' | 'desc' -} - /** * Request parameters for getDeals operation in DealsApi. * @export @@ -2888,102 +1940,32 @@ export interface DealsApiGetDealsRequest { 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} + * When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @type {boolean} * @memberof DealsApiGetDeals */ - readonly limit?: number + readonly include_option_labels?: boolean /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} + * When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' + * @type {boolean} * @memberof DealsApiGetDeals */ - readonly cursor?: string -} - -/** - * Request parameters for getDealsProducts operation in DealsApi. - * @export - * @interface DealsApiGetDealsProductsRequest - */ -export interface DealsApiGetDealsProductsRequest { - /** - * 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 DealsApiGetDealsProducts - */ - readonly deal_ids: Array - - /** - * For pagination, the marker (an opaque string value) representing the first item on the next page - * @type {string} - * @memberof DealsApiGetDealsProducts - */ - readonly cursor?: string + readonly include_labels?: 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 DealsApiGetDealsProducts + * @memberof DealsApiGetDeals */ readonly limit?: number - /** - * 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' | 'order_nr' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof DealsApiGetDealsProducts - */ - readonly sort_direction?: 'asc' | 'desc' -} - -/** - * Request parameters for getInstallments operation in DealsApi. - * @export - * @interface DealsApiGetInstallmentsRequest - */ -export interface DealsApiGetInstallmentsRequest { - /** - * 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 DealsApiGetInstallments - */ - readonly deal_ids: Array - /** * For pagination, the marker (an opaque string value) representing the first item on the next page * @type {string} - * @memberof DealsApiGetInstallments + * @memberof DealsApiGetDeals */ 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 DealsApiGetInstallments - */ - readonly limit?: number - - /** - * The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`. - * @type {'id' | 'billing_date' | 'deal_id'} - * @memberof DealsApiGetInstallments - */ - readonly sort_by?: 'id' | 'billing_date' | 'deal_id' - - /** - * The sorting direction. Supported values: `asc`, `desc`. - * @type {'asc' | 'desc'} - * @memberof DealsApiGetInstallments - */ - readonly sort_direction?: 'asc' | 'desc' } /** @@ -3007,27 +1989,6 @@ export interface DealsApiPostAdditionalDiscountRequest { readonly AddAdditionalDiscountRequestBody?: AddAdditionalDiscountRequestBody } -/** - * Request parameters for postInstallment operation in DealsApi. - * @export - * @interface DealsApiPostInstallmentRequest - */ -export interface DealsApiPostInstallmentRequest { - /** - * The ID of the deal - * @type {number} - * @memberof DealsApiPostInstallment - */ - readonly id: number - - /** - * - * @type {AddInstallmentRequestBody} - * @memberof DealsApiPostInstallment - */ - readonly AddInstallmentRequestBody?: AddInstallmentRequestBody -} - /** * Request parameters for searchDeals operation in DealsApi. * @export @@ -3147,62 +2108,6 @@ export interface DealsApiUpdateDealRequest { readonly UpdateDealRequest?: UpdateDealRequest } -/** - * Request parameters for updateDealProduct operation in DealsApi. - * @export - * @interface DealsApiUpdateDealProductRequest - */ -export interface DealsApiUpdateDealProductRequest { - /** - * The ID of the deal - * @type {number} - * @memberof DealsApiUpdateDealProduct - */ - readonly id: number - - /** - * The ID of the deal-product (the ID of the product attached to the deal) - * @type {number} - * @memberof DealsApiUpdateDealProduct - */ - readonly product_attachment_id: number - - /** - * - * @type {UpdateDealProductRequest} - * @memberof DealsApiUpdateDealProduct - */ - readonly UpdateDealProductRequest?: UpdateDealProductRequest -} - -/** - * Request parameters for updateInstallment operation in DealsApi. - * @export - * @interface DealsApiUpdateInstallmentRequest - */ -export interface DealsApiUpdateInstallmentRequest { - /** - * The ID of the deal - * @type {number} - * @memberof DealsApiUpdateInstallment - */ - readonly id: number - - /** - * The ID of the installment - * @type {number} - * @memberof DealsApiUpdateInstallment - */ - readonly installment_id: number - - /** - * - * @type {UpdateInstallmentRequestBody} - * @memberof DealsApiUpdateInstallment - */ - readonly UpdateInstallmentRequestBody?: UpdateInstallmentRequestBody -} - /** * DealsApi - object-oriented interface * @export @@ -3234,30 +2139,6 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).addDealFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).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 {DealsApiAddDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public addDealProduct(requestParameters: DealsApiAddDealProductRequest, ) { - 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 @@ -3306,42 +2187,6 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).deleteDealFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } - /** - * Deletes a product attachment from a deal, using the `product_attachment_id`. - * @summary Delete an attached product from a deal - * @param {DealsApiDeleteDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public deleteDealProduct(requestParameters: DealsApiDeleteDealProductRequest, ) { - return DealsApiFp(this.configuration).deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Removes an installment from a deal. Only available in Growth and above plans. - * @summary Delete an installment from a deal - * @param {DealsApiDeleteInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public deleteInstallment(requestParameters: DealsApiDeleteInstallmentRequest, ) { - 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 @@ -3375,7 +2220,7 @@ export class DealsApi extends BaseAPI { * @memberof DealsApi */ public getDeal(requestParameters: DealsApiGetDealRequest, ) { - return DealsApiFp(this.configuration).getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(this.axios, this.basePath)); + return DealsApiFp(this.configuration).getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(this.axios, this.basePath)); } /** @@ -3414,18 +2259,6 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } - /** - * Lists products attached to a deal. - * @summary List products attached to a deal - * @param {DealsApiGetDealProductsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public getDealProducts(requestParameters: DealsApiGetDealProductsRequest, ) { - return DealsApiFp(this.configuration).getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(this.axios, this.basePath)); - } - /** * Returns data about all not archived deals. * @summary Get all deals @@ -3435,31 +2268,7 @@ export class DealsApi extends BaseAPI { * @memberof DealsApi */ public getDeals(requestParameters: DealsApiGetDealsRequest = {}, ) { - return DealsApiFp(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)); - } - - /** - * Returns data about products attached to deals - * @summary Get deal products of several deals - * @param {DealsApiGetDealsProductsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public getDealsProducts(requestParameters: DealsApiGetDealsProductsRequest, ) { - return DealsApiFp(this.configuration).getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(this.axios, this.basePath)); - } - - /** - * Lists installments attached to a list of deals. Only available in Growth and above plans. - * @summary List installments added to a list of deals - * @param {DealsApiGetInstallmentsRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public getInstallments(requestParameters: DealsApiGetInstallmentsRequest, ) { - return DealsApiFp(this.configuration).getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(this.axios, this.basePath)); + return DealsApiFp(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.include_option_labels, requestParameters.include_labels, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } /** @@ -3474,18 +2283,6 @@ export class DealsApi extends BaseAPI { return DealsApiFp(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 Growth and above plans. - * @summary Add an installment to a deal - * @param {DealsApiPostInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public postInstallment(requestParameters: DealsApiPostInstallmentRequest, ) { - return DealsApiFp(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 @@ -3521,28 +2318,4 @@ export class DealsApi extends BaseAPI { public updateDeal(requestParameters: DealsApiUpdateDealRequest, ) { return DealsApiFp(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 {DealsApiUpdateDealProductRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public updateDealProduct(requestParameters: DealsApiUpdateDealProductRequest, ) { - return DealsApiFp(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 Growth and above plans. - * @summary Update an installment added to a deal - * @param {DealsApiUpdateInstallmentRequest} requestParameters Request parameters. - - * @throws {RequiredError} - * @memberof DealsApi - */ - public updateInstallment(requestParameters: DealsApiUpdateInstallmentRequest, ) { - return DealsApiFp(this.configuration).updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(this.axios, this.basePath)); - } } diff --git a/src/versions/v2/api/organizations-api.ts b/src/versions/v2/api/organizations-api.ts index 7b0ec5bb..1f2c23dc 100644 --- a/src/versions/v2/api/organizations-api.ts +++ b/src/versions/v2/api/organizations-api.ts @@ -227,10 +227,12 @@ export const OrganizationsApiAxiosParamCreator = function (configuration?: Confi * @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' | 'smart_bcc_email'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email', custom_fields?: string, ): Promise => { + 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' | 'smart_bcc_email', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getOrganization', 'id', id) const localVarPath = `/organizations/{id}` @@ -261,6 +263,14 @@ export const OrganizationsApiAxiosParamCreator = function (configuration?: Confi localVarQueryParameter['custom_fields'] = custom_fields; } + if (include_option_labels !== undefined) { + localVarQueryParameter['include_option_labels'] = include_option_labels; + } + + if (include_labels !== undefined) { + localVarQueryParameter['include_labels'] = include_labels; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -386,12 +396,14 @@ export const OrganizationsApiAxiosParamCreator = function (configuration?: Confi * @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' | 'smart_bcc_email'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email', custom_fields?: string, limit?: number, cursor?: string, ): Promise => { + 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' | 'smart_bcc_email', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, 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); @@ -447,6 +459,14 @@ export const OrganizationsApiAxiosParamCreator = function (configuration?: Confi localVarQueryParameter['custom_fields'] = custom_fields; } + if (include_option_labels !== undefined) { + localVarQueryParameter['include_option_labels'] = include_option_labels; + } + + if (include_labels !== undefined) { + localVarQueryParameter['include_labels'] = include_labels; + } + if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } @@ -638,11 +658,13 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { * @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' | 'smart_bcc_email'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email', custom_fields?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganization(id, include_fields, custom_fields, ); + 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' | 'smart_bcc_email', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganization(id, include_fields, custom_fields, include_option_labels, include_labels, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -683,13 +705,15 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { * @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' | 'smart_bcc_email'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email', 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, ); + 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' | 'smart_bcc_email', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, 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, include_option_labels, include_labels, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -777,7 +801,7 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, * @throws {RequiredError} */ getOrganization(requestParameters: OrganizationsApiGetOrganizationRequest, ): Promise { - return localVarFp.getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(axios, basePath)); + return localVarFp.getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(axios, basePath)); }, /** * Lists users who are following the organization. @@ -807,7 +831,7 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, * @throws {RequiredError} */ getOrganizations(requestParameters: OrganizationsApiGetOrganizationsRequest = {}, ): 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)); + 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.include_option_labels, requestParameters.include_labels, 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. @@ -928,6 +952,20 @@ export interface OrganizationsApiGetOrganizationRequest { * @memberof OrganizationsApiGetOrganization */ readonly custom_fields?: string + + /** + * When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @type {boolean} + * @memberof OrganizationsApiGetOrganization + */ + readonly include_option_labels?: boolean + + /** + * When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' + * @type {boolean} + * @memberof OrganizationsApiGetOrganization + */ + readonly include_labels?: boolean } /** @@ -1055,6 +1093,20 @@ export interface OrganizationsApiGetOrganizationsRequest { */ readonly custom_fields?: string + /** + * When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @type {boolean} + * @memberof OrganizationsApiGetOrganizations + */ + readonly include_option_labels?: boolean + + /** + * When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' + * @type {boolean} + * @memberof OrganizationsApiGetOrganizations + */ + readonly include_labels?: 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} @@ -1197,7 +1249,7 @@ export class OrganizationsApi extends BaseAPI { * @memberof OrganizationsApi */ public getOrganization(requestParameters: OrganizationsApiGetOrganizationRequest, ) { - return OrganizationsApiFp(this.configuration).getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(this.axios, this.basePath)); + return OrganizationsApiFp(this.configuration).getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(this.axios, this.basePath)); } /** @@ -1233,7 +1285,7 @@ export class OrganizationsApi extends BaseAPI { * @memberof OrganizationsApi */ public getOrganizations(requestParameters: OrganizationsApiGetOrganizationsRequest = {}, ) { - return OrganizationsApiFp(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)); + return OrganizationsApiFp(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.include_option_labels, requestParameters.include_labels, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } /** diff --git a/src/versions/v2/api/persons-api.ts b/src/versions/v2/api/persons-api.ts index b6d438d8..534b5b0f 100644 --- a/src/versions/v2/api/persons-api.ts +++ b/src/versions/v2/api/persons-api.ts @@ -227,10 +227,12 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati * @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' | 'smart_bcc_email'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email', custom_fields?: string, ): Promise => { + 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' | 'smart_bcc_email', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, ): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getPerson', 'id', id) const localVarPath = `/persons/{id}` @@ -261,6 +263,14 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['custom_fields'] = custom_fields; } + if (include_option_labels !== undefined) { + localVarQueryParameter['include_option_labels'] = include_option_labels; + } + + if (include_labels !== undefined) { + localVarQueryParameter['include_labels'] = include_labels; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -429,12 +439,14 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati * @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' | 'smart_bcc_email'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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, deal_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' | 'smart_bcc_email', custom_fields?: string, limit?: number, cursor?: string, ): Promise => { + getPersons: async (filter_id?: number, ids?: string, owner_id?: number, org_id?: number, deal_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' | 'smart_bcc_email', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, 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); @@ -498,6 +510,14 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati localVarQueryParameter['custom_fields'] = custom_fields; } + if (include_option_labels !== undefined) { + localVarQueryParameter['include_option_labels'] = include_option_labels; + } + + if (include_labels !== undefined) { + localVarQueryParameter['include_labels'] = include_labels; + } + if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } @@ -699,11 +719,13 @@ export const PersonsApiFp = function(configuration?: Configuration) { * @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' | 'smart_bcc_email'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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' | 'smart_bcc_email', custom_fields?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getPerson(id, include_fields, custom_fields, ); + 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' | 'smart_bcc_email', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPerson(id, include_fields, custom_fields, include_option_labels, include_labels, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -757,13 +779,15 @@ export const PersonsApiFp = function(configuration?: Configuration) { * @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' | 'smart_bcc_email'} [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 {boolean} [include_option_labels] When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @param {boolean} [include_labels] When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' * @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, deal_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' | 'smart_bcc_email', 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, deal_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, ); + async getPersons(filter_id?: number, ids?: string, owner_id?: number, org_id?: number, deal_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' | 'smart_bcc_email', custom_fields?: string, include_option_labels?: boolean, include_labels?: boolean, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersons(filter_id, ids, owner_id, org_id, deal_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, include_option_labels, include_labels, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -853,7 +877,7 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa * @throws {RequiredError} */ getPerson(requestParameters: PersonsApiGetPersonRequest, ): Promise { - return localVarFp.getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(axios, basePath)); + return localVarFp.getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(axios, basePath)); }, /** * Lists users who are following the person. @@ -893,7 +917,7 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa * @throws {RequiredError} */ getPersons(requestParameters: PersonsApiGetPersonsRequest = {}, ): Promise { - return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.deal_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)); + return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.deal_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, 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. @@ -1014,6 +1038,20 @@ export interface PersonsApiGetPersonRequest { * @memberof PersonsApiGetPerson */ readonly custom_fields?: string + + /** + * When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @type {boolean} + * @memberof PersonsApiGetPerson + */ + readonly include_option_labels?: boolean + + /** + * When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' + * @type {boolean} + * @memberof PersonsApiGetPerson + */ + readonly include_labels?: boolean } /** @@ -1169,6 +1207,20 @@ export interface PersonsApiGetPersonsRequest { */ readonly custom_fields?: string + /** + * When provided with a \'true\' value, single option and multiple option custom fields values contain objects in the form of \'{ id: number, label: string }\' instead of plain id + * @type {boolean} + * @memberof PersonsApiGetPersons + */ + readonly include_option_labels?: boolean + + /** + * When provided with \'true\' value, response will include an array of label objects in the form of \'{ id: number, label: string }\' + * @type {boolean} + * @memberof PersonsApiGetPersons + */ + readonly include_labels?: 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} @@ -1325,7 +1377,7 @@ export class PersonsApi extends BaseAPI { * @memberof PersonsApi */ public getPerson(requestParameters: PersonsApiGetPersonRequest, ) { - return PersonsApiFp(this.configuration).getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, ).then((request) => request(this.axios, this.basePath)); + return PersonsApiFp(this.configuration).getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(this.axios, this.basePath)); } /** @@ -1373,7 +1425,7 @@ export class PersonsApi extends BaseAPI { * @memberof PersonsApi */ public getPersons(requestParameters: PersonsApiGetPersonsRequest = {}, ) { - return PersonsApiFp(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.deal_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)); + return PersonsApiFp(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.deal_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } /** diff --git a/src/versions/v2/api/project-boards-api.ts b/src/versions/v2/api/project-boards-api.ts new file mode 100644 index 00000000..62c220ed --- /dev/null +++ b/src/versions/v2/api/project-boards-api.ts @@ -0,0 +1,503 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddProjectBoardRequest } from '../models'; +// @ts-ignore +import { DeleteProjectBoardResponse } from '../models'; +// @ts-ignore +import { GetProjectBoardsResponse } from '../models'; +// @ts-ignore +import { UpdateProjectBoardRequest } from '../models'; +// @ts-ignore +import { UpsertProjectBoardResponse } from '../models'; +/** + * ProjectBoardsApi - axios parameter creator + * @export + */ +export const ProjectBoardsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Adds a new project board. + * @summary Add a project board + * @param {AddProjectBoardRequest} AddProjectBoardRequest + + * @throws {RequiredError} + */ + addProjectBoard: async (AddProjectBoardRequest: AddProjectBoardRequest, ): Promise => { + // verify required parameter 'AddProjectBoardRequest' is not null or undefined + assertParamExists('addProjectBoard', 'AddProjectBoardRequest', AddProjectBoardRequest) + const localVarPath = `/boards`; + // 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", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddProjectBoardRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a project board as deleted. + * @summary Delete a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + deleteProjectBoard: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteProjectBoard', 'id', id) + const localVarPath = `/boards/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects: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 project board. + * @summary Get details of a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + getProjectsBoard: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectsBoard', 'id', id) + const localVarPath = `/boards/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all active project boards. + * @summary Get all project boards + + * @throws {RequiredError} + */ + getProjectsBoards: async (): Promise => { + const localVarPath = `/boards`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates the properties of a project board. + * @summary Update a project board + * @param {number} id The ID of the project board + * @param {UpdateProjectBoardRequest} [UpdateProjectBoardRequest] + + * @throws {RequiredError} + */ + updateProjectBoard: async (id: number, UpdateProjectBoardRequest?: UpdateProjectBoardRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateProjectBoard', 'id', id) + const localVarPath = `/boards/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateProjectBoardRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * ProjectBoardsApi - functional programming interface + * @export + */ +export const ProjectBoardsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProjectBoardsApiAxiosParamCreator(configuration) + return { + /** + * Adds a new project board. + * @summary Add a project board + * @param {AddProjectBoardRequest} AddProjectBoardRequest + + * @throws {RequiredError} + */ + async addProjectBoard(AddProjectBoardRequest: AddProjectBoardRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectBoard(AddProjectBoardRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a project board as deleted. + * @summary Delete a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async deleteProjectBoard(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns the details of a specific project board. + * @summary Get details of a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async getProjectsBoard(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all active project boards. + * @summary Get all project boards + + * @throws {RequiredError} + */ + async getProjectsBoards(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates the properties of a project board. + * @summary Update a project board + * @param {number} id The ID of the project board + * @param {UpdateProjectBoardRequest} [UpdateProjectBoardRequest] + + * @throws {RequiredError} + */ + async updateProjectBoard(id: number, UpdateProjectBoardRequest?: UpdateProjectBoardRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectBoard(id, UpdateProjectBoardRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ProjectBoardsApi - factory interface + * @export + */ +export const ProjectBoardsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProjectBoardsApiFp(configuration) + return { + /** + * Adds a new project board. + * @summary Add a project board + * @param {ProjectBoardsApiAddProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProjectBoard(requestParameters: ProjectBoardsApiAddProjectBoardRequest, ): Promise { + return localVarFp.addProjectBoard(requestParameters.AddProjectBoardRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a project board as deleted. + * @summary Delete a project board + * @param {ProjectBoardsApiDeleteProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProjectBoard(requestParameters: ProjectBoardsApiDeleteProjectBoardRequest, ): Promise { + return localVarFp.deleteProjectBoard(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns the details of a specific project board. + * @summary Get details of a project board + * @param {ProjectBoardsApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsBoard(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ): Promise { + return localVarFp.getProjectsBoard(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all active project boards. + * @summary Get all project boards + + * @throws {RequiredError} + */ + getProjectsBoards(): Promise { + return localVarFp.getProjectsBoards().then((request) => request(axios, basePath)); + }, + /** + * Updates the properties of a project board. + * @summary Update a project board + * @param {ProjectBoardsApiUpdateProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProjectBoard(requestParameters: ProjectBoardsApiUpdateProjectBoardRequest, ): Promise { + return localVarFp.updateProjectBoard(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for addProjectBoard operation in ProjectBoardsApi. + * @export + * @interface ProjectBoardsApiAddProjectBoardRequest + */ +export interface ProjectBoardsApiAddProjectBoardRequest { + /** + * + * @type {AddProjectBoardRequest} + * @memberof ProjectBoardsApiAddProjectBoard + */ + readonly AddProjectBoardRequest: AddProjectBoardRequest +} + +/** + * Request parameters for deleteProjectBoard operation in ProjectBoardsApi. + * @export + * @interface ProjectBoardsApiDeleteProjectBoardRequest + */ +export interface ProjectBoardsApiDeleteProjectBoardRequest { + /** + * The ID of the project board + * @type {number} + * @memberof ProjectBoardsApiDeleteProjectBoard + */ + readonly id: number +} + +/** + * Request parameters for getProjectsBoard operation in ProjectBoardsApi. + * @export + * @interface ProjectBoardsApiGetProjectsBoardRequest + */ +export interface ProjectBoardsApiGetProjectsBoardRequest { + /** + * The ID of the project board + * @type {number} + * @memberof ProjectBoardsApiGetProjectsBoard + */ + readonly id: number +} + +/** + * Request parameters for updateProjectBoard operation in ProjectBoardsApi. + * @export + * @interface ProjectBoardsApiUpdateProjectBoardRequest + */ +export interface ProjectBoardsApiUpdateProjectBoardRequest { + /** + * The ID of the project board + * @type {number} + * @memberof ProjectBoardsApiUpdateProjectBoard + */ + readonly id: number + + /** + * + * @type {UpdateProjectBoardRequest} + * @memberof ProjectBoardsApiUpdateProjectBoard + */ + readonly UpdateProjectBoardRequest?: UpdateProjectBoardRequest +} + +/** + * ProjectBoardsApi - object-oriented interface + * @export + * @class ProjectBoardsApi + * @extends {BaseAPI} + */ +export class ProjectBoardsApi extends BaseAPI { + /** + * Adds a new project board. + * @summary Add a project board + * @param {ProjectBoardsApiAddProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public addProjectBoard(requestParameters: ProjectBoardsApiAddProjectBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).addProjectBoard(requestParameters.AddProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a project board as deleted. + * @summary Delete a project board + * @param {ProjectBoardsApiDeleteProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public deleteProjectBoard(requestParameters: ProjectBoardsApiDeleteProjectBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).deleteProjectBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns the details of a specific project board. + * @summary Get details of a project board + * @param {ProjectBoardsApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public getProjectsBoard(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).getProjectsBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all active project boards. + * @summary Get all project boards + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public getProjectsBoards() { + return ProjectBoardsApiFp(this.configuration).getProjectsBoards().then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the properties of a project board. + * @summary Update a project board + * @param {ProjectBoardsApiUpdateProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public updateProjectBoard(requestParameters: ProjectBoardsApiUpdateProjectBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).updateProjectBoard(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/api/project-fields-api.ts b/src/versions/v2/api/project-fields-api.ts new file mode 100644 index 00000000..bcbbe7d9 --- /dev/null +++ b/src/versions/v2/api/project-fields-api.ts @@ -0,0 +1,854 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddDealFieldOptions200Response } from '../models'; +// @ts-ignore +import { AddDealFieldOptionsRequestInner } from '../models'; +// @ts-ignore +import { AddProjectField200Response } from '../models'; +// @ts-ignore +import { AddProjectFieldRequest } from '../models'; +// @ts-ignore +import { DeleteDealFieldOptionsRequestInner } from '../models'; +// @ts-ignore +import { DeleteProjectField200Response } from '../models'; +// @ts-ignore +import { GetProjectFields200Response } from '../models'; +// @ts-ignore +import { UpdateDealFieldOptionsRequestInner } from '../models'; +// @ts-ignore +import { UpdateProjectFieldRequest } from '../models'; +/** + * ProjectFieldsApi - axios parameter creator + * @export + */ +export const ProjectFieldsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Creates a new project custom field. + * @summary Create one project field + * @param {AddProjectFieldRequest} AddProjectFieldRequest + + * @throws {RequiredError} + */ + addProjectField: async (AddProjectFieldRequest: AddProjectFieldRequest, ): Promise => { + // verify required parameter 'AddProjectFieldRequest' is not null or undefined + assertParamExists('addProjectField', 'AddProjectFieldRequest', AddProjectFieldRequest) + const localVarPath = `/projectFields`; + // 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", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddProjectFieldRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Adds new options to a project custom field that supports options (enum or set field types). This operation is atomic - all options are added or none are added. Returns only the newly added options. + * @summary Add project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + addProjectFieldOptions: async (field_code: string, AddDealFieldOptionsRequestInner: Array, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('addProjectFieldOptions', 'field_code', field_code) + // verify required parameter 'AddDealFieldOptionsRequestInner' is not null or undefined + assertParamExists('addProjectFieldOptions', 'AddDealFieldOptionsRequestInner', AddDealFieldOptionsRequestInner) + const localVarPath = `/projectFields/{field_code}/options` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddDealFieldOptionsRequestInner, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a custom field as deleted. + * @summary Delete one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + deleteProjectField: async (field_code: string, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('deleteProjectField', 'field_code', field_code) + const localVarPath = `/projectFields/{field_code}` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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", ["project-fields:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Removes existing options from a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the deleted options. + * @summary Delete project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + deleteProjectFieldOptions: async (field_code: string, DeleteDealFieldOptionsRequestInner: Array, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('deleteProjectFieldOptions', 'field_code', field_code) + // verify required parameter 'DeleteDealFieldOptionsRequestInner' is not null or undefined + assertParamExists('deleteProjectFieldOptions', 'DeleteDealFieldOptionsRequestInner', DeleteDealFieldOptionsRequestInner) + const localVarPath = `/projectFields/{field_code}/options` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(DeleteDealFieldOptionsRequestInner, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns metadata about a specific project field. + * @summary Get one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + getProjectField: async (field_code: string, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('getProjectField', 'field_code', field_code) + const localVarPath = `/projectFields/{field_code}` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full", "project-fields:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns metadata about all project fields in the company. + * @summary Get all project fields + * @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} + */ + getProjectFields: async (limit?: number, cursor?: string, ): Promise => { + const localVarPath = `/projectFields`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full", "project-fields:full"], configuration) + + 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 a project custom field. The field_code and field_type cannot be changed. At least one field must be provided in the request body. + * @summary Update one project field + * @param {string} field_code The unique code identifying the field + * @param {UpdateProjectFieldRequest} UpdateProjectFieldRequest + + * @throws {RequiredError} + */ + updateProjectField: async (field_code: string, UpdateProjectFieldRequest: UpdateProjectFieldRequest, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('updateProjectField', 'field_code', field_code) + // verify required parameter 'UpdateProjectFieldRequest' is not null or undefined + assertParamExists('updateProjectField', 'UpdateProjectFieldRequest', UpdateProjectFieldRequest) + const localVarPath = `/projectFields/{field_code}` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateProjectFieldRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates existing options for a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the updated options. + * @summary Update project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + updateProjectFieldOptions: async (field_code: string, UpdateDealFieldOptionsRequestInner: Array, ): Promise => { + // verify required parameter 'field_code' is not null or undefined + assertParamExists('updateProjectFieldOptions', 'field_code', field_code) + // verify required parameter 'UpdateDealFieldOptionsRequestInner' is not null or undefined + assertParamExists('updateProjectFieldOptions', 'UpdateDealFieldOptionsRequestInner', UpdateDealFieldOptionsRequestInner) + const localVarPath = `/projectFields/{field_code}/options` + .replace(`{${"field_code"}}`, encodeURIComponent(String(field_code))); + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["project-fields:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateDealFieldOptionsRequestInner, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * ProjectFieldsApi - functional programming interface + * @export + */ +export const ProjectFieldsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProjectFieldsApiAxiosParamCreator(configuration) + return { + /** + * Creates a new project custom field. + * @summary Create one project field + * @param {AddProjectFieldRequest} AddProjectFieldRequest + + * @throws {RequiredError} + */ + async addProjectField(AddProjectFieldRequest: AddProjectFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectField(AddProjectFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Adds new options to a project custom field that supports options (enum or set field types). This operation is atomic - all options are added or none are added. Returns only the newly added options. + * @summary Add project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async addProjectFieldOptions(field_code: string, AddDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a custom field as deleted. + * @summary Delete one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async deleteProjectField(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Removes existing options from a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the deleted options. + * @summary Delete project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async deleteProjectFieldOptions(field_code: string, DeleteDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns metadata about a specific project field. + * @summary Get one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async getProjectField(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns metadata about all project fields in the company. + * @summary Get all project fields + * @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 getProjectFields(limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectFields(limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates a project custom field. The field_code and field_type cannot be changed. At least one field must be provided in the request body. + * @summary Update one project field + * @param {string} field_code The unique code identifying the field + * @param {UpdateProjectFieldRequest} UpdateProjectFieldRequest + + * @throws {RequiredError} + */ + async updateProjectField(field_code: string, UpdateProjectFieldRequest: UpdateProjectFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectField(field_code, UpdateProjectFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates existing options for a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the updated options. + * @summary Update project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async updateProjectFieldOptions(field_code: string, UpdateDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ProjectFieldsApi - factory interface + * @export + */ +export const ProjectFieldsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProjectFieldsApiFp(configuration) + return { + /** + * Creates a new project custom field. + * @summary Create one project field + * @param {ProjectFieldsApiAddProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProjectField(requestParameters: ProjectFieldsApiAddProjectFieldRequest, ): Promise { + return localVarFp.addProjectField(requestParameters.AddProjectFieldRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Adds new options to a project custom field that supports options (enum or set field types). This operation is atomic - all options are added or none are added. Returns only the newly added options. + * @summary Add project field options in bulk + * @param {ProjectFieldsApiAddProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProjectFieldOptions(requestParameters: ProjectFieldsApiAddProjectFieldOptionsRequest, ): Promise { + return localVarFp.addProjectFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a custom field as deleted. + * @summary Delete one project field + * @param {ProjectFieldsApiDeleteProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProjectField(requestParameters: ProjectFieldsApiDeleteProjectFieldRequest, ): Promise { + return localVarFp.deleteProjectField(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, + /** + * Removes existing options from a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the deleted options. + * @summary Delete project field options in bulk + * @param {ProjectFieldsApiDeleteProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProjectFieldOptions(requestParameters: ProjectFieldsApiDeleteProjectFieldOptionsRequest, ): Promise { + return localVarFp.deleteProjectFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, + /** + * Returns metadata about a specific project field. + * @summary Get one project field + * @param {ProjectFieldsApiGetProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectField(requestParameters: ProjectFieldsApiGetProjectFieldRequest, ): Promise { + return localVarFp.getProjectField(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, + /** + * Returns metadata about all project fields in the company. + * @summary Get all project fields + * @param {ProjectFieldsApiGetProjectFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectFields(requestParameters: ProjectFieldsApiGetProjectFieldsRequest = {}, ): Promise { + return localVarFp.getProjectFields(requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, + /** + * Updates a project custom field. The field_code and field_type cannot be changed. At least one field must be provided in the request body. + * @summary Update one project field + * @param {ProjectFieldsApiUpdateProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProjectField(requestParameters: ProjectFieldsApiUpdateProjectFieldRequest, ): Promise { + return localVarFp.updateProjectField(requestParameters.field_code, requestParameters.UpdateProjectFieldRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Updates existing options for a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the updated options. + * @summary Update project field options in bulk + * @param {ProjectFieldsApiUpdateProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProjectFieldOptions(requestParameters: ProjectFieldsApiUpdateProjectFieldOptionsRequest, ): Promise { + return localVarFp.updateProjectFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for addProjectField operation in ProjectFieldsApi. + * @export + * @interface ProjectFieldsApiAddProjectFieldRequest + */ +export interface ProjectFieldsApiAddProjectFieldRequest { + /** + * + * @type {AddProjectFieldRequest} + * @memberof ProjectFieldsApiAddProjectField + */ + readonly AddProjectFieldRequest: AddProjectFieldRequest +} + +/** + * Request parameters for addProjectFieldOptions operation in ProjectFieldsApi. + * @export + * @interface ProjectFieldsApiAddProjectFieldOptionsRequest + */ +export interface ProjectFieldsApiAddProjectFieldOptionsRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof ProjectFieldsApiAddProjectFieldOptions + */ + readonly field_code: string + + /** + * + * @type {Array} + * @memberof ProjectFieldsApiAddProjectFieldOptions + */ + readonly AddDealFieldOptionsRequestInner: Array +} + +/** + * Request parameters for deleteProjectField operation in ProjectFieldsApi. + * @export + * @interface ProjectFieldsApiDeleteProjectFieldRequest + */ +export interface ProjectFieldsApiDeleteProjectFieldRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof ProjectFieldsApiDeleteProjectField + */ + readonly field_code: string +} + +/** + * Request parameters for deleteProjectFieldOptions operation in ProjectFieldsApi. + * @export + * @interface ProjectFieldsApiDeleteProjectFieldOptionsRequest + */ +export interface ProjectFieldsApiDeleteProjectFieldOptionsRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof ProjectFieldsApiDeleteProjectFieldOptions + */ + readonly field_code: string + + /** + * + * @type {Array} + * @memberof ProjectFieldsApiDeleteProjectFieldOptions + */ + readonly DeleteDealFieldOptionsRequestInner: Array +} + +/** + * Request parameters for getProjectField operation in ProjectFieldsApi. + * @export + * @interface ProjectFieldsApiGetProjectFieldRequest + */ +export interface ProjectFieldsApiGetProjectFieldRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof ProjectFieldsApiGetProjectField + */ + readonly field_code: string +} + +/** + * Request parameters for getProjectFields operation in ProjectFieldsApi. + * @export + * @interface ProjectFieldsApiGetProjectFieldsRequest + */ +export interface ProjectFieldsApiGetProjectFieldsRequest { + /** + * 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 ProjectFieldsApiGetProjectFields + */ + readonly limit?: number + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof ProjectFieldsApiGetProjectFields + */ + readonly cursor?: string +} + +/** + * Request parameters for updateProjectField operation in ProjectFieldsApi. + * @export + * @interface ProjectFieldsApiUpdateProjectFieldRequest + */ +export interface ProjectFieldsApiUpdateProjectFieldRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof ProjectFieldsApiUpdateProjectField + */ + readonly field_code: string + + /** + * + * @type {UpdateProjectFieldRequest} + * @memberof ProjectFieldsApiUpdateProjectField + */ + readonly UpdateProjectFieldRequest: UpdateProjectFieldRequest +} + +/** + * Request parameters for updateProjectFieldOptions operation in ProjectFieldsApi. + * @export + * @interface ProjectFieldsApiUpdateProjectFieldOptionsRequest + */ +export interface ProjectFieldsApiUpdateProjectFieldOptionsRequest { + /** + * The unique code identifying the field + * @type {string} + * @memberof ProjectFieldsApiUpdateProjectFieldOptions + */ + readonly field_code: string + + /** + * + * @type {Array} + * @memberof ProjectFieldsApiUpdateProjectFieldOptions + */ + readonly UpdateDealFieldOptionsRequestInner: Array +} + +/** + * ProjectFieldsApi - object-oriented interface + * @export + * @class ProjectFieldsApi + * @extends {BaseAPI} + */ +export class ProjectFieldsApi extends BaseAPI { + /** + * Creates a new project custom field. + * @summary Create one project field + * @param {ProjectFieldsApiAddProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public addProjectField(requestParameters: ProjectFieldsApiAddProjectFieldRequest, ) { + return ProjectFieldsApiFp(this.configuration).addProjectField(requestParameters.AddProjectFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Adds new options to a project custom field that supports options (enum or set field types). This operation is atomic - all options are added or none are added. Returns only the newly added options. + * @summary Add project field options in bulk + * @param {ProjectFieldsApiAddProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public addProjectFieldOptions(requestParameters: ProjectFieldsApiAddProjectFieldOptionsRequest, ) { + return ProjectFieldsApiFp(this.configuration).addProjectFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a custom field as deleted. + * @summary Delete one project field + * @param {ProjectFieldsApiDeleteProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public deleteProjectField(requestParameters: ProjectFieldsApiDeleteProjectFieldRequest, ) { + return ProjectFieldsApiFp(this.configuration).deleteProjectField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Removes existing options from a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the deleted options. + * @summary Delete project field options in bulk + * @param {ProjectFieldsApiDeleteProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public deleteProjectFieldOptions(requestParameters: ProjectFieldsApiDeleteProjectFieldOptionsRequest, ) { + return ProjectFieldsApiFp(this.configuration).deleteProjectFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns metadata about a specific project field. + * @summary Get one project field + * @param {ProjectFieldsApiGetProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public getProjectField(requestParameters: ProjectFieldsApiGetProjectFieldRequest, ) { + return ProjectFieldsApiFp(this.configuration).getProjectField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns metadata about all project fields in the company. + * @summary Get all project fields + * @param {ProjectFieldsApiGetProjectFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public getProjectFields(requestParameters: ProjectFieldsApiGetProjectFieldsRequest = {}, ) { + return ProjectFieldsApiFp(this.configuration).getProjectFields(requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates a project custom field. The field_code and field_type cannot be changed. At least one field must be provided in the request body. + * @summary Update one project field + * @param {ProjectFieldsApiUpdateProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public updateProjectField(requestParameters: ProjectFieldsApiUpdateProjectFieldRequest, ) { + return ProjectFieldsApiFp(this.configuration).updateProjectField(requestParameters.field_code, requestParameters.UpdateProjectFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates existing options for a project custom field. This operation is atomic and fails if any of the specified option IDs do not exist. Returns only the updated options. + * @summary Update project field options in bulk + * @param {ProjectFieldsApiUpdateProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public updateProjectFieldOptions(requestParameters: ProjectFieldsApiUpdateProjectFieldOptionsRequest, ) { + return ProjectFieldsApiFp(this.configuration).updateProjectFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/api/project-phases-api.ts b/src/versions/v2/api/project-phases-api.ts new file mode 100644 index 00000000..79546a51 --- /dev/null +++ b/src/versions/v2/api/project-phases-api.ts @@ -0,0 +1,527 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddProjectPhaseRequest } from '../models'; +// @ts-ignore +import { DeleteProjectPhaseResponse } from '../models'; +// @ts-ignore +import { GetProjectPhasesResponse } from '../models'; +// @ts-ignore +import { UpdateProjectPhaseRequest } from '../models'; +// @ts-ignore +import { UpsertProjectPhaseResponse } from '../models'; +/** + * ProjectPhasesApi - axios parameter creator + * @export + */ +export const ProjectPhasesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Adds a new project phase to a board. + * @summary Add a project phase + * @param {AddProjectPhaseRequest} AddProjectPhaseRequest + + * @throws {RequiredError} + */ + addProjectPhase: async (AddProjectPhaseRequest: AddProjectPhaseRequest, ): Promise => { + // verify required parameter 'AddProjectPhaseRequest' is not null or undefined + assertParamExists('addProjectPhase', 'AddProjectPhaseRequest', AddProjectPhaseRequest) + const localVarPath = `/phases`; + // 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", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddProjectPhaseRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a project phase as deleted. + * @summary Delete a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + deleteProjectPhase: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteProjectPhase', 'id', id) + const localVarPath = `/phases/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects: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 project phase. + * @summary Get details of a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + getProjectsPhase: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectsPhase', 'id', id) + const localVarPath = `/phases/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {number} board_id The ID of the board for which phases are requested + + * @throws {RequiredError} + */ + getProjectsPhases: async (board_id: number, ): Promise => { + // verify required parameter 'board_id' is not null or undefined + assertParamExists('getProjectsPhases', 'board_id', board_id) + const localVarPath = `/phases`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + if (board_id !== undefined) { + localVarQueryParameter['board_id'] = board_id; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates the properties of a project phase. + * @summary Update a project phase + * @param {number} id The ID of the project phase + * @param {UpdateProjectPhaseRequest} [UpdateProjectPhaseRequest] + + * @throws {RequiredError} + */ + updateProjectPhase: async (id: number, UpdateProjectPhaseRequest?: UpdateProjectPhaseRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateProjectPhase', 'id', id) + const localVarPath = `/phases/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateProjectPhaseRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * ProjectPhasesApi - functional programming interface + * @export + */ +export const ProjectPhasesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProjectPhasesApiAxiosParamCreator(configuration) + return { + /** + * Adds a new project phase to a board. + * @summary Add a project phase + * @param {AddProjectPhaseRequest} AddProjectPhaseRequest + + * @throws {RequiredError} + */ + async addProjectPhase(AddProjectPhaseRequest: AddProjectPhaseRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectPhase(AddProjectPhaseRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a project phase as deleted. + * @summary Delete a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async deleteProjectPhase(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns the details of a specific project phase. + * @summary Get details of a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async getProjectsPhase(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {number} board_id The ID of the board for which phases are requested + + * @throws {RequiredError} + */ + async getProjectsPhases(board_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates the properties of a project phase. + * @summary Update a project phase + * @param {number} id The ID of the project phase + * @param {UpdateProjectPhaseRequest} [UpdateProjectPhaseRequest] + + * @throws {RequiredError} + */ + async updateProjectPhase(id: number, UpdateProjectPhaseRequest?: UpdateProjectPhaseRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectPhase(id, UpdateProjectPhaseRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ProjectPhasesApi - factory interface + * @export + */ +export const ProjectPhasesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProjectPhasesApiFp(configuration) + return { + /** + * Adds a new project phase to a board. + * @summary Add a project phase + * @param {ProjectPhasesApiAddProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProjectPhase(requestParameters: ProjectPhasesApiAddProjectPhaseRequest, ): Promise { + return localVarFp.addProjectPhase(requestParameters.AddProjectPhaseRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a project phase as deleted. + * @summary Delete a project phase + * @param {ProjectPhasesApiDeleteProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProjectPhase(requestParameters: ProjectPhasesApiDeleteProjectPhaseRequest, ): Promise { + return localVarFp.deleteProjectPhase(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns the details of a specific project phase. + * @summary Get details of a project phase + * @param {ProjectPhasesApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsPhase(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ): Promise { + return localVarFp.getProjectsPhase(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {ProjectPhasesApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectsPhases(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ): Promise { + return localVarFp.getProjectsPhases(requestParameters.board_id, ).then((request) => request(axios, basePath)); + }, + /** + * Updates the properties of a project phase. + * @summary Update a project phase + * @param {ProjectPhasesApiUpdateProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProjectPhase(requestParameters: ProjectPhasesApiUpdateProjectPhaseRequest, ): Promise { + return localVarFp.updateProjectPhase(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for addProjectPhase operation in ProjectPhasesApi. + * @export + * @interface ProjectPhasesApiAddProjectPhaseRequest + */ +export interface ProjectPhasesApiAddProjectPhaseRequest { + /** + * + * @type {AddProjectPhaseRequest} + * @memberof ProjectPhasesApiAddProjectPhase + */ + readonly AddProjectPhaseRequest: AddProjectPhaseRequest +} + +/** + * Request parameters for deleteProjectPhase operation in ProjectPhasesApi. + * @export + * @interface ProjectPhasesApiDeleteProjectPhaseRequest + */ +export interface ProjectPhasesApiDeleteProjectPhaseRequest { + /** + * The ID of the project phase + * @type {number} + * @memberof ProjectPhasesApiDeleteProjectPhase + */ + readonly id: number +} + +/** + * Request parameters for getProjectsPhase operation in ProjectPhasesApi. + * @export + * @interface ProjectPhasesApiGetProjectsPhaseRequest + */ +export interface ProjectPhasesApiGetProjectsPhaseRequest { + /** + * The ID of the project phase + * @type {number} + * @memberof ProjectPhasesApiGetProjectsPhase + */ + readonly id: number +} + +/** + * Request parameters for getProjectsPhases operation in ProjectPhasesApi. + * @export + * @interface ProjectPhasesApiGetProjectsPhasesRequest + */ +export interface ProjectPhasesApiGetProjectsPhasesRequest { + /** + * The ID of the board for which phases are requested + * @type {number} + * @memberof ProjectPhasesApiGetProjectsPhases + */ + readonly board_id: number +} + +/** + * Request parameters for updateProjectPhase operation in ProjectPhasesApi. + * @export + * @interface ProjectPhasesApiUpdateProjectPhaseRequest + */ +export interface ProjectPhasesApiUpdateProjectPhaseRequest { + /** + * The ID of the project phase + * @type {number} + * @memberof ProjectPhasesApiUpdateProjectPhase + */ + readonly id: number + + /** + * + * @type {UpdateProjectPhaseRequest} + * @memberof ProjectPhasesApiUpdateProjectPhase + */ + readonly UpdateProjectPhaseRequest?: UpdateProjectPhaseRequest +} + +/** + * ProjectPhasesApi - object-oriented interface + * @export + * @class ProjectPhasesApi + * @extends {BaseAPI} + */ +export class ProjectPhasesApi extends BaseAPI { + /** + * Adds a new project phase to a board. + * @summary Add a project phase + * @param {ProjectPhasesApiAddProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public addProjectPhase(requestParameters: ProjectPhasesApiAddProjectPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).addProjectPhase(requestParameters.AddProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a project phase as deleted. + * @summary Delete a project phase + * @param {ProjectPhasesApiDeleteProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public deleteProjectPhase(requestParameters: ProjectPhasesApiDeleteProjectPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).deleteProjectPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns the details of a specific project phase. + * @summary Get details of a project phase + * @param {ProjectPhasesApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public getProjectsPhase(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).getProjectsPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all active project phases under a specific board. + * @summary Get project phases + * @param {ProjectPhasesApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public getProjectsPhases(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ) { + return ProjectPhasesApiFp(this.configuration).getProjectsPhases(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the properties of a project phase. + * @summary Update a project phase + * @param {ProjectPhasesApiUpdateProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public updateProjectPhase(requestParameters: ProjectPhasesApiUpdateProjectPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).updateProjectPhase(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/api/project-templates-api.ts b/src/versions/v2/api/project-templates-api.ts new file mode 100644 index 00000000..a4091a10 --- /dev/null +++ b/src/versions/v2/api/project-templates-api.ts @@ -0,0 +1,254 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { GetProjectTemplateResponse } from '../models'; +// @ts-ignore +import { GetProjectTemplatesResponse } from '../models'; +/** + * ProjectTemplatesApi - axios parameter creator + * @export + */ +export const ProjectTemplatesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns the details of a specific project template. + * @summary Get details of a template + * @param {number} id The ID of the project template + + * @throws {RequiredError} + */ + getProjectTemplate: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectTemplate', 'id', id) + const localVarPath = `/projectTemplates/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all not deleted project templates. + * @summary Get all project templates + * @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. + + * @throws {RequiredError} + */ + getProjectTemplates: async (cursor?: string, limit?: number, ): Promise => { + const localVarPath = `/projectTemplates`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * ProjectTemplatesApi - functional programming interface + * @export + */ +export const ProjectTemplatesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProjectTemplatesApiAxiosParamCreator(configuration) + return { + /** + * Returns the details of a specific project template. + * @summary Get details of a template + * @param {number} id The ID of the project template + + * @throws {RequiredError} + */ + async getProjectTemplate(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplate(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all not deleted project templates. + * @summary Get all project templates + * @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. + + * @throws {RequiredError} + */ + async getProjectTemplates(cursor?: string, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplates(cursor, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ProjectTemplatesApi - factory interface + * @export + */ +export const ProjectTemplatesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProjectTemplatesApiFp(configuration) + return { + /** + * Returns the details of a specific project template. + * @summary Get details of a template + * @param {ProjectTemplatesApiGetProjectTemplateRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectTemplate(requestParameters: ProjectTemplatesApiGetProjectTemplateRequest, ): Promise { + return localVarFp.getProjectTemplate(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all not deleted project templates. + * @summary Get all project templates + * @param {ProjectTemplatesApiGetProjectTemplatesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectTemplates(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ): Promise { + return localVarFp.getProjectTemplates(requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for getProjectTemplate operation in ProjectTemplatesApi. + * @export + * @interface ProjectTemplatesApiGetProjectTemplateRequest + */ +export interface ProjectTemplatesApiGetProjectTemplateRequest { + /** + * The ID of the project template + * @type {number} + * @memberof ProjectTemplatesApiGetProjectTemplate + */ + readonly id: number +} + +/** + * Request parameters for getProjectTemplates operation in ProjectTemplatesApi. + * @export + * @interface ProjectTemplatesApiGetProjectTemplatesRequest + */ +export interface ProjectTemplatesApiGetProjectTemplatesRequest { + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof ProjectTemplatesApiGetProjectTemplates + */ + 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 ProjectTemplatesApiGetProjectTemplates + */ + readonly limit?: number +} + +/** + * ProjectTemplatesApi - object-oriented interface + * @export + * @class ProjectTemplatesApi + * @extends {BaseAPI} + */ +export class ProjectTemplatesApi extends BaseAPI { + /** + * Returns the details of a specific project template. + * @summary Get details of a template + * @param {ProjectTemplatesApiGetProjectTemplateRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectTemplatesApi + */ + public getProjectTemplate(requestParameters: ProjectTemplatesApiGetProjectTemplateRequest, ) { + return ProjectTemplatesApiFp(this.configuration).getProjectTemplate(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all not deleted project templates. + * @summary Get all project templates + * @param {ProjectTemplatesApiGetProjectTemplatesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectTemplatesApi + */ + public getProjectTemplates(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ) { + return ProjectTemplatesApiFp(this.configuration).getProjectTemplates(requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/api/projects-api.ts b/src/versions/v2/api/projects-api.ts new file mode 100644 index 00000000..b749de86 --- /dev/null +++ b/src/versions/v2/api/projects-api.ts @@ -0,0 +1,1183 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddProjectRequest } from '../models'; +// @ts-ignore +import { DeleteProjectResponse } from '../models'; +// @ts-ignore +import { GetProjectChangelogResponse } from '../models'; +// @ts-ignore +import { GetProjectPermittedUsersResponse } from '../models'; +// @ts-ignore +import { GetProjectSearchResponse } from '../models'; +// @ts-ignore +import { GetProjectsResponse } from '../models'; +// @ts-ignore +import { UpdateProjectRequest } from '../models'; +// @ts-ignore +import { UpsertProjectResponse } from '../models'; +/** + * ProjectsApi - axios parameter creator + * @export + */ +export const ProjectsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Adds a new project. Custom fields should be wrapped in the `custom_fields` object. + * @summary Add a project + * @param {AddProjectRequest} AddProjectRequest + + * @throws {RequiredError} + */ + addProject: async (AddProjectRequest: AddProjectRequest, ): Promise => { + // verify required parameter 'AddProjectRequest' is not null or undefined + assertParamExists('addProject', 'AddProjectRequest', AddProjectRequest) + const localVarPath = `/projects`; + // 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", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddProjectRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Archives a project. + * @summary Archive a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + archiveProject: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('archiveProject', 'id', id) + const localVarPath = `/projects/{id}/archive` + .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", ["projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a project as deleted. + * @summary Delete a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + deleteProject: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteProject', 'id', id) + const localVarPath = `/projects/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all archived projects. + * @summary Get all archived projects + * @param {number} [filter_id] If supplied, only projects matching the specified filter are returned + * @param {string} [status] If supplied, includes only projects with the specified statuses. Possible values are `open`, `completed`, `canceled` and `deleted`. By default `deleted` projects are not returned. + * @param {number} [phase_id] If supplied, only projects in the specified phase are returned + * @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} + */ + getArchivedProjects: async (filter_id?: number, status?: string, phase_id?: number, limit?: number, cursor?: string, ): Promise => { + const localVarPath = `/projects/archived`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + if (filter_id !== undefined) { + localVarQueryParameter['filter_id'] = filter_id; + } + + if (status !== undefined) { + localVarQueryParameter['status'] = status; + } + + if (phase_id !== undefined) { + localVarQueryParameter['phase_id'] = phase_id; + } + + 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 project. Custom fields appear as keys inside the `custom_fields` object. + * @summary Get details of a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + getProject: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProject', 'id', id) + const localVarPath = `/projects/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Lists updates about field values of a project. + * @summary List updates about project field values + * @param {number} id The ID of the project + * @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} + */ + getProjectChangelog: async (id: number, limit?: number, cursor?: string, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectChangelog', 'id', id) + const localVarPath = `/projects/{id}/changelog` + .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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + 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, + }; + }, + /** + * Lists the users permitted to access a project. + * @summary List permitted users + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + getProjectUsers: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getProjectUsers', 'id', id) + const localVarPath = `/projects/{id}/permittedUsers` + .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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all non-archived projects. + * @summary Get all projects + * @param {number} [filter_id] If supplied, only projects matching the specified filter are returned + * @param {string} [status] If supplied, includes only projects with the specified statuses. Possible values are `open`, `completed`, `canceled` and `deleted`. By default `deleted` projects are not returned. + * @param {number} [phase_id] If supplied, only projects in the specified phase are returned + * @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} + */ + getProjects: async (filter_id?: number, status?: string, phase_id?: number, limit?: number, cursor?: string, ): Promise => { + const localVarPath = `/projects`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + if (filter_id !== undefined) { + localVarQueryParameter['filter_id'] = filter_id; + } + + if (status !== undefined) { + localVarQueryParameter['status'] = status; + } + + if (phase_id !== undefined) { + localVarQueryParameter['phase_id'] = phase_id; + } + + 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 projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. + * @summary Search projects + * @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' | 'description'} [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 projects by the provided person ID + * @param {number} [organization_id] Will filter projects by the provided organization ID + * @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} + */ + searchProjects: async (term: string, fields?: 'custom_fields' | 'notes' | 'title' | 'description', exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise => { + // verify required parameter 'term' is not null or undefined + assertParamExists('searchProjects', 'term', term) + const localVarPath = `/projects/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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects: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 (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 a project. + * @summary Update a project + * @param {number} id The ID of the project + * @param {UpdateProjectRequest} [UpdateProjectRequest] + + * @throws {RequiredError} + */ + updateProject: async (id: number, UpdateProjectRequest?: UpdateProjectRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateProject', 'id', id) + const localVarPath = `/projects/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateProjectRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * ProjectsApi - functional programming interface + * @export + */ +export const ProjectsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProjectsApiAxiosParamCreator(configuration) + return { + /** + * Adds a new project. Custom fields should be wrapped in the `custom_fields` object. + * @summary Add a project + * @param {AddProjectRequest} AddProjectRequest + + * @throws {RequiredError} + */ + async addProject(AddProjectRequest: AddProjectRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProject(AddProjectRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Archives a project. + * @summary Archive a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async archiveProject(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.archiveProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a project as deleted. + * @summary Delete a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async deleteProject(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all archived projects. + * @summary Get all archived projects + * @param {number} [filter_id] If supplied, only projects matching the specified filter are returned + * @param {string} [status] If supplied, includes only projects with the specified statuses. Possible values are `open`, `completed`, `canceled` and `deleted`. By default `deleted` projects are not returned. + * @param {number} [phase_id] If supplied, only projects in the specified phase are returned + * @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 getArchivedProjects(filter_id?: number, status?: string, phase_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedProjects(filter_id, status, phase_id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns the details of a specific project. Custom fields appear as keys inside the `custom_fields` object. + * @summary Get details of a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProject(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Lists updates about field values of a project. + * @summary List updates about project field values + * @param {number} id The ID of the project + * @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 getProjectChangelog(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectChangelog(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Lists the users permitted to access a project. + * @summary List permitted users + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProjectUsers(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectUsers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all non-archived projects. + * @summary Get all projects + * @param {number} [filter_id] If supplied, only projects matching the specified filter are returned + * @param {string} [status] If supplied, includes only projects with the specified statuses. Possible values are `open`, `completed`, `canceled` and `deleted`. By default `deleted` projects are not returned. + * @param {number} [phase_id] If supplied, only projects in the specified phase are returned + * @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 getProjects(filter_id?: number, status?: string, phase_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjects(filter_id, status, phase_id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. + * @summary Search projects + * @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' | 'description'} [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 projects by the provided person ID + * @param {number} [organization_id] Will filter projects by the provided organization ID + * @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 searchProjects(term: string, fields?: 'custom_fields' | 'notes' | 'title' | 'description', exact_match?: boolean, person_id?: number, organization_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchProjects(term, fields, exact_match, person_id, organization_id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates the properties of a project. + * @summary Update a project + * @param {number} id The ID of the project + * @param {UpdateProjectRequest} [UpdateProjectRequest] + + * @throws {RequiredError} + */ + async updateProject(id: number, UpdateProjectRequest?: UpdateProjectRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProject(id, UpdateProjectRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * ProjectsApi - factory interface + * @export + */ +export const ProjectsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProjectsApiFp(configuration) + return { + /** + * Adds a new project. Custom fields should be wrapped in the `custom_fields` object. + * @summary Add a project + * @param {ProjectsApiAddProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addProject(requestParameters: ProjectsApiAddProjectRequest, ): Promise { + return localVarFp.addProject(requestParameters.AddProjectRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Archives a project. + * @summary Archive a project + * @param {ProjectsApiArchiveProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + archiveProject(requestParameters: ProjectsApiArchiveProjectRequest, ): Promise { + return localVarFp.archiveProject(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a project as deleted. + * @summary Delete a project + * @param {ProjectsApiDeleteProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteProject(requestParameters: ProjectsApiDeleteProjectRequest, ): Promise { + return localVarFp.deleteProject(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all archived projects. + * @summary Get all archived projects + * @param {ProjectsApiGetArchivedProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getArchivedProjects(requestParameters: ProjectsApiGetArchivedProjectsRequest = {}, ): Promise { + return localVarFp.getArchivedProjects(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, + /** + * Returns the details of a specific project. Custom fields appear as keys inside the `custom_fields` object. + * @summary Get details of a project + * @param {ProjectsApiGetProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProject(requestParameters: ProjectsApiGetProjectRequest, ): Promise { + return localVarFp.getProject(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Lists updates about field values of a project. + * @summary List updates about project field values + * @param {ProjectsApiGetProjectChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectChangelog(requestParameters: ProjectsApiGetProjectChangelogRequest, ): Promise { + return localVarFp.getProjectChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, + /** + * Lists the users permitted to access a project. + * @summary List permitted users + * @param {ProjectsApiGetProjectUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjectUsers(requestParameters: ProjectsApiGetProjectUsersRequest, ): Promise { + return localVarFp.getProjectUsers(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all non-archived projects. + * @summary Get all projects + * @param {ProjectsApiGetProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getProjects(requestParameters: ProjectsApiGetProjectsRequest = {}, ): Promise { + return localVarFp.getProjects(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, + /** + * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. + * @summary Search projects + * @param {ProjectsApiSearchProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + searchProjects(requestParameters: ProjectsApiSearchProjectsRequest, ): Promise { + return localVarFp.searchProjects(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, + /** + * Updates the properties of a project. + * @summary Update a project + * @param {ProjectsApiUpdateProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateProject(requestParameters: ProjectsApiUpdateProjectRequest, ): Promise { + return localVarFp.updateProject(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for addProject operation in ProjectsApi. + * @export + * @interface ProjectsApiAddProjectRequest + */ +export interface ProjectsApiAddProjectRequest { + /** + * + * @type {AddProjectRequest} + * @memberof ProjectsApiAddProject + */ + readonly AddProjectRequest: AddProjectRequest +} + +/** + * Request parameters for archiveProject operation in ProjectsApi. + * @export + * @interface ProjectsApiArchiveProjectRequest + */ +export interface ProjectsApiArchiveProjectRequest { + /** + * The ID of the project + * @type {number} + * @memberof ProjectsApiArchiveProject + */ + readonly id: number +} + +/** + * Request parameters for deleteProject operation in ProjectsApi. + * @export + * @interface ProjectsApiDeleteProjectRequest + */ +export interface ProjectsApiDeleteProjectRequest { + /** + * The ID of the project + * @type {number} + * @memberof ProjectsApiDeleteProject + */ + readonly id: number +} + +/** + * Request parameters for getArchivedProjects operation in ProjectsApi. + * @export + * @interface ProjectsApiGetArchivedProjectsRequest + */ +export interface ProjectsApiGetArchivedProjectsRequest { + /** + * If supplied, only projects matching the specified filter are returned + * @type {number} + * @memberof ProjectsApiGetArchivedProjects + */ + readonly filter_id?: number + + /** + * If supplied, includes only projects with the specified statuses. Possible values are `open`, `completed`, `canceled` and `deleted`. By default `deleted` projects are not returned. + * @type {string} + * @memberof ProjectsApiGetArchivedProjects + */ + readonly status?: string + + /** + * If supplied, only projects in the specified phase are returned + * @type {number} + * @memberof ProjectsApiGetArchivedProjects + */ + readonly phase_id?: number + + /** + * 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 ProjectsApiGetArchivedProjects + */ + readonly limit?: number + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof ProjectsApiGetArchivedProjects + */ + readonly cursor?: string +} + +/** + * Request parameters for getProject operation in ProjectsApi. + * @export + * @interface ProjectsApiGetProjectRequest + */ +export interface ProjectsApiGetProjectRequest { + /** + * The ID of the project + * @type {number} + * @memberof ProjectsApiGetProject + */ + readonly id: number +} + +/** + * Request parameters for getProjectChangelog operation in ProjectsApi. + * @export + * @interface ProjectsApiGetProjectChangelogRequest + */ +export interface ProjectsApiGetProjectChangelogRequest { + /** + * The ID of the project + * @type {number} + * @memberof ProjectsApiGetProjectChangelog + */ + readonly id: number + + /** + * 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 ProjectsApiGetProjectChangelog + */ + readonly limit?: number + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof ProjectsApiGetProjectChangelog + */ + readonly cursor?: string +} + +/** + * Request parameters for getProjectUsers operation in ProjectsApi. + * @export + * @interface ProjectsApiGetProjectUsersRequest + */ +export interface ProjectsApiGetProjectUsersRequest { + /** + * The ID of the project + * @type {number} + * @memberof ProjectsApiGetProjectUsers + */ + readonly id: number +} + +/** + * Request parameters for getProjects operation in ProjectsApi. + * @export + * @interface ProjectsApiGetProjectsRequest + */ +export interface ProjectsApiGetProjectsRequest { + /** + * If supplied, only projects matching the specified filter are returned + * @type {number} + * @memberof ProjectsApiGetProjects + */ + readonly filter_id?: number + + /** + * If supplied, includes only projects with the specified statuses. Possible values are `open`, `completed`, `canceled` and `deleted`. By default `deleted` projects are not returned. + * @type {string} + * @memberof ProjectsApiGetProjects + */ + readonly status?: string + + /** + * If supplied, only projects in the specified phase are returned + * @type {number} + * @memberof ProjectsApiGetProjects + */ + readonly phase_id?: number + + /** + * 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 ProjectsApiGetProjects + */ + readonly limit?: number + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof ProjectsApiGetProjects + */ + readonly cursor?: string +} + +/** + * Request parameters for searchProjects operation in ProjectsApi. + * @export + * @interface ProjectsApiSearchProjectsRequest + */ +export interface ProjectsApiSearchProjectsRequest { + /** + * 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 ProjectsApiSearchProjects + */ + 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' | 'description'} + * @memberof ProjectsApiSearchProjects + */ + readonly fields?: 'custom_fields' | 'notes' | 'title' | 'description' + + /** + * When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @type {boolean} + * @memberof ProjectsApiSearchProjects + */ + readonly exact_match?: boolean + + /** + * Will filter projects by the provided person ID + * @type {number} + * @memberof ProjectsApiSearchProjects + */ + readonly person_id?: number + + /** + * Will filter projects by the provided organization ID + * @type {number} + * @memberof ProjectsApiSearchProjects + */ + readonly organization_id?: number + + /** + * 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 ProjectsApiSearchProjects + */ + readonly limit?: number + + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof ProjectsApiSearchProjects + */ + readonly cursor?: string +} + +/** + * Request parameters for updateProject operation in ProjectsApi. + * @export + * @interface ProjectsApiUpdateProjectRequest + */ +export interface ProjectsApiUpdateProjectRequest { + /** + * The ID of the project + * @type {number} + * @memberof ProjectsApiUpdateProject + */ + readonly id: number + + /** + * + * @type {UpdateProjectRequest} + * @memberof ProjectsApiUpdateProject + */ + readonly UpdateProjectRequest?: UpdateProjectRequest +} + +/** + * ProjectsApi - object-oriented interface + * @export + * @class ProjectsApi + * @extends {BaseAPI} + */ +export class ProjectsApi extends BaseAPI { + /** + * Adds a new project. Custom fields should be wrapped in the `custom_fields` object. + * @summary Add a project + * @param {ProjectsApiAddProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public addProject(requestParameters: ProjectsApiAddProjectRequest, ) { + return ProjectsApiFp(this.configuration).addProject(requestParameters.AddProjectRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Archives a project. + * @summary Archive a project + * @param {ProjectsApiArchiveProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public archiveProject(requestParameters: ProjectsApiArchiveProjectRequest, ) { + return ProjectsApiFp(this.configuration).archiveProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a project as deleted. + * @summary Delete a project + * @param {ProjectsApiDeleteProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public deleteProject(requestParameters: ProjectsApiDeleteProjectRequest, ) { + return ProjectsApiFp(this.configuration).deleteProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all archived projects. + * @summary Get all archived projects + * @param {ProjectsApiGetArchivedProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getArchivedProjects(requestParameters: ProjectsApiGetArchivedProjectsRequest = {}, ) { + return ProjectsApiFp(this.configuration).getArchivedProjects(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns the details of a specific project. Custom fields appear as keys inside the `custom_fields` object. + * @summary Get details of a project + * @param {ProjectsApiGetProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProject(requestParameters: ProjectsApiGetProjectRequest, ) { + return ProjectsApiFp(this.configuration).getProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Lists updates about field values of a project. + * @summary List updates about project field values + * @param {ProjectsApiGetProjectChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectChangelog(requestParameters: ProjectsApiGetProjectChangelogRequest, ) { + return ProjectsApiFp(this.configuration).getProjectChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Lists the users permitted to access a project. + * @summary List permitted users + * @param {ProjectsApiGetProjectUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectUsers(requestParameters: ProjectsApiGetProjectUsersRequest, ) { + return ProjectsApiFp(this.configuration).getProjectUsers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all non-archived projects. + * @summary Get all projects + * @param {ProjectsApiGetProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjects(requestParameters: ProjectsApiGetProjectsRequest = {}, ) { + return ProjectsApiFp(this.configuration).getProjects(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Searches all projects by title, description, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found projects can be filtered by person ID or organization ID. + * @summary Search projects + * @param {ProjectsApiSearchProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public searchProjects(requestParameters: ProjectsApiSearchProjectsRequest, ) { + return ProjectsApiFp(this.configuration).searchProjects(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates the properties of a project. + * @summary Update a project + * @param {ProjectsApiUpdateProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public updateProject(requestParameters: ProjectsApiUpdateProjectRequest, ) { + return ProjectsApiFp(this.configuration).updateProject(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/api/tasks-api.ts b/src/versions/v2/api/tasks-api.ts new file mode 100644 index 00000000..e1e39a22 --- /dev/null +++ b/src/versions/v2/api/tasks-api.ts @@ -0,0 +1,607 @@ +/* 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. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { AddTaskRequest } from '../models'; +// @ts-ignore +import { AddTaskResponse } from '../models'; +// @ts-ignore +import { DeleteTaskResponse } from '../models'; +// @ts-ignore +import { GetTaskResponse } from '../models'; +// @ts-ignore +import { GetTasksResponse } from '../models'; +// @ts-ignore +import { UpdateTaskRequest } from '../models'; +// @ts-ignore +import { UpdateTaskResponse } from '../models'; +/** + * TasksApi - axios parameter creator + * @export + */ +export const TasksApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Adds a new task. + * @summary Add a task + * @param {AddTaskRequest} AddTaskRequest + + * @throws {RequiredError} + */ + addTask: async (AddTaskRequest: AddTaskRequest, ): Promise => { + // verify required parameter 'AddTaskRequest' is not null or undefined + assertParamExists('addTask', 'AddTaskRequest', AddTaskRequest) + const localVarPath = `/tasks`; + // 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", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(AddTaskRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Marks a task as deleted. If the task has subtasks, those will also be deleted. + * @summary Delete a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + deleteTask: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteTask', 'id', id) + const localVarPath = `/tasks/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects: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 task. + * @summary Get details of a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + getTask: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getTask', 'id', id) + const localVarPath = `/tasks/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns all tasks. + * @summary Get all tasks + * @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 {boolean} [is_done] Whether the task is done or not. If omitted, both done and not done tasks are returned. + * @param {boolean} [is_milestone] Whether the task is a milestone or not. If omitted, both milestone and non-milestone tasks are returned. + * @param {number} [assignee_id] If supplied, only tasks assigned to this user are returned + * @param {number} [project_id] If supplied, only tasks belonging to this project are returned + * @param {string} [parent_task_id] If `null` is supplied, only root-level tasks (without a parent) are returned. If an integer is supplied, only subtasks of that specific task are returned. By default all tasks are returned. + + * @throws {RequiredError} + */ + getTasks: async (cursor?: string, limit?: number, is_done?: boolean, is_milestone?: boolean, assignee_id?: number, project_id?: number, parent_task_id?: string, ): Promise => { + const localVarPath = `/tasks`; + // 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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:read", "projects:full"], configuration) + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (is_done !== undefined) { + localVarQueryParameter['is_done'] = is_done; + } + + if (is_milestone !== undefined) { + localVarQueryParameter['is_milestone'] = is_milestone; + } + + if (assignee_id !== undefined) { + localVarQueryParameter['assignee_id'] = assignee_id; + } + + if (project_id !== undefined) { + localVarQueryParameter['project_id'] = project_id; + } + + if (parent_task_id !== undefined) { + localVarQueryParameter['parent_task_id'] = parent_task_id; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Updates a task. + * @summary Update a task + * @param {number} id The ID of the task + * @param {UpdateTaskRequest} [UpdateTaskRequest] + + * @throws {RequiredError} + */ + updateTask: async (id: number, UpdateTaskRequest?: UpdateTaskRequest, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateTask', 'id', id) + const localVarPath = `/tasks/{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(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["projects:full"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + localVarRequestOptions.data = serializeDataIfNeeded(UpdateTaskRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * TasksApi - functional programming interface + * @export + */ +export const TasksApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = TasksApiAxiosParamCreator(configuration) + return { + /** + * Adds a new task. + * @summary Add a task + * @param {AddTaskRequest} AddTaskRequest + + * @throws {RequiredError} + */ + async addTask(AddTaskRequest: AddTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addTask(AddTaskRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Marks a task as deleted. If the task has subtasks, those will also be deleted. + * @summary Delete a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async deleteTask(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns the details of a specific task. + * @summary Get details of a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async getTask(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns all tasks. + * @summary Get all tasks + * @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 {boolean} [is_done] Whether the task is done or not. If omitted, both done and not done tasks are returned. + * @param {boolean} [is_milestone] Whether the task is a milestone or not. If omitted, both milestone and non-milestone tasks are returned. + * @param {number} [assignee_id] If supplied, only tasks assigned to this user are returned + * @param {number} [project_id] If supplied, only tasks belonging to this project are returned + * @param {string} [parent_task_id] If `null` is supplied, only root-level tasks (without a parent) are returned. If an integer is supplied, only subtasks of that specific task are returned. By default all tasks are returned. + + * @throws {RequiredError} + */ + async getTasks(cursor?: string, limit?: number, is_done?: boolean, is_milestone?: boolean, assignee_id?: number, project_id?: number, parent_task_id?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTasks(cursor, limit, is_done, is_milestone, assignee_id, project_id, parent_task_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Updates a task. + * @summary Update a task + * @param {number} id The ID of the task + * @param {UpdateTaskRequest} [UpdateTaskRequest] + + * @throws {RequiredError} + */ + async updateTask(id: number, UpdateTaskRequest?: UpdateTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateTask(id, UpdateTaskRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * TasksApi - factory interface + * @export + */ +export const TasksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = TasksApiFp(configuration) + return { + /** + * Adds a new task. + * @summary Add a task + * @param {TasksApiAddTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + addTask(requestParameters: TasksApiAddTaskRequest, ): Promise { + return localVarFp.addTask(requestParameters.AddTaskRequest, ).then((request) => request(axios, basePath)); + }, + /** + * Marks a task as deleted. If the task has subtasks, those will also be deleted. + * @summary Delete a task + * @param {TasksApiDeleteTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + deleteTask(requestParameters: TasksApiDeleteTaskRequest, ): Promise { + return localVarFp.deleteTask(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns the details of a specific task. + * @summary Get details of a task + * @param {TasksApiGetTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getTask(requestParameters: TasksApiGetTaskRequest, ): Promise { + return localVarFp.getTask(requestParameters.id, ).then((request) => request(axios, basePath)); + }, + /** + * Returns all tasks. + * @summary Get all tasks + * @param {TasksApiGetTasksRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getTasks(requestParameters: TasksApiGetTasksRequest = {}, ): Promise { + return localVarFp.getTasks(requestParameters.cursor, requestParameters.limit, requestParameters.is_done, requestParameters.is_milestone, requestParameters.assignee_id, requestParameters.project_id, requestParameters.parent_task_id, ).then((request) => request(axios, basePath)); + }, + /** + * Updates a task. + * @summary Update a task + * @param {TasksApiUpdateTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + updateTask(requestParameters: TasksApiUpdateTaskRequest, ): Promise { + return localVarFp.updateTask(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for addTask operation in TasksApi. + * @export + * @interface TasksApiAddTaskRequest + */ +export interface TasksApiAddTaskRequest { + /** + * + * @type {AddTaskRequest} + * @memberof TasksApiAddTask + */ + readonly AddTaskRequest: AddTaskRequest +} + +/** + * Request parameters for deleteTask operation in TasksApi. + * @export + * @interface TasksApiDeleteTaskRequest + */ +export interface TasksApiDeleteTaskRequest { + /** + * The ID of the task + * @type {number} + * @memberof TasksApiDeleteTask + */ + readonly id: number +} + +/** + * Request parameters for getTask operation in TasksApi. + * @export + * @interface TasksApiGetTaskRequest + */ +export interface TasksApiGetTaskRequest { + /** + * The ID of the task + * @type {number} + * @memberof TasksApiGetTask + */ + readonly id: number +} + +/** + * Request parameters for getTasks operation in TasksApi. + * @export + * @interface TasksApiGetTasksRequest + */ +export interface TasksApiGetTasksRequest { + /** + * For pagination, the marker (an opaque string value) representing the first item on the next page + * @type {string} + * @memberof TasksApiGetTasks + */ + 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 TasksApiGetTasks + */ + readonly limit?: number + + /** + * Whether the task is done or not. If omitted, both done and not done tasks are returned. + * @type {boolean} + * @memberof TasksApiGetTasks + */ + readonly is_done?: boolean + + /** + * Whether the task is a milestone or not. If omitted, both milestone and non-milestone tasks are returned. + * @type {boolean} + * @memberof TasksApiGetTasks + */ + readonly is_milestone?: boolean + + /** + * If supplied, only tasks assigned to this user are returned + * @type {number} + * @memberof TasksApiGetTasks + */ + readonly assignee_id?: number + + /** + * If supplied, only tasks belonging to this project are returned + * @type {number} + * @memberof TasksApiGetTasks + */ + readonly project_id?: number + + /** + * If `null` is supplied, only root-level tasks (without a parent) are returned. If an integer is supplied, only subtasks of that specific task are returned. By default all tasks are returned. + * @type {string} + * @memberof TasksApiGetTasks + */ + readonly parent_task_id?: string +} + +/** + * Request parameters for updateTask operation in TasksApi. + * @export + * @interface TasksApiUpdateTaskRequest + */ +export interface TasksApiUpdateTaskRequest { + /** + * The ID of the task + * @type {number} + * @memberof TasksApiUpdateTask + */ + readonly id: number + + /** + * + * @type {UpdateTaskRequest} + * @memberof TasksApiUpdateTask + */ + readonly UpdateTaskRequest?: UpdateTaskRequest +} + +/** + * TasksApi - object-oriented interface + * @export + * @class TasksApi + * @extends {BaseAPI} + */ +export class TasksApi extends BaseAPI { + /** + * Adds a new task. + * @summary Add a task + * @param {TasksApiAddTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public addTask(requestParameters: TasksApiAddTaskRequest, ) { + return TasksApiFp(this.configuration).addTask(requestParameters.AddTaskRequest, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Marks a task as deleted. If the task has subtasks, those will also be deleted. + * @summary Delete a task + * @param {TasksApiDeleteTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public deleteTask(requestParameters: TasksApiDeleteTaskRequest, ) { + return TasksApiFp(this.configuration).deleteTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns the details of a specific task. + * @summary Get details of a task + * @param {TasksApiGetTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public getTask(requestParameters: TasksApiGetTaskRequest, ) { + return TasksApiFp(this.configuration).getTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns all tasks. + * @summary Get all tasks + * @param {TasksApiGetTasksRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public getTasks(requestParameters: TasksApiGetTasksRequest = {}, ) { + return TasksApiFp(this.configuration).getTasks(requestParameters.cursor, requestParameters.limit, requestParameters.is_done, requestParameters.is_milestone, requestParameters.assignee_id, requestParameters.project_id, requestParameters.parent_task_id, ).then((request) => request(this.axios, this.basePath)); + } + + /** + * Updates a task. + * @summary Update a task + * @param {TasksApiUpdateTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public updateTask(requestParameters: TasksApiUpdateTaskRequest, ) { + return TasksApiFp(this.configuration).updateTask(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/versions/v2/models/add-deal-request.ts b/src/versions/v2/models/add-deal-request.ts index 82338c8f..d5a610fc 100644 --- a/src/versions/v2/models/add-deal-request.ts +++ b/src/versions/v2/models/add-deal-request.ts @@ -121,7 +121,7 @@ export interface AddDealRequest { */ 'label_ids'?: Array; /** - * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. * @type {{ [key: string]: any | undefined; }} */ 'custom_fields'?: { [key: string]: any | undefined; }; diff --git a/src/versions/v2/models/add-organization-request.ts b/src/versions/v2/models/add-organization-request.ts index 8cff7007..a7c084ae 100644 --- a/src/versions/v2/models/add-organization-request.ts +++ b/src/versions/v2/models/add-organization-request.ts @@ -59,7 +59,7 @@ export interface AddOrganizationRequest { */ 'address'?: OrganizationItemAddress; /** - * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. * @type {{ [key: string]: any | undefined; }} */ 'custom_fields'?: { [key: string]: any | undefined; }; diff --git a/src/versions/v2/models/add-person-request.ts b/src/versions/v2/models/add-person-request.ts index 2b60c04c..84cceeef 100644 --- a/src/versions/v2/models/add-person-request.ts +++ b/src/versions/v2/models/add-person-request.ts @@ -77,7 +77,7 @@ export interface AddPersonRequest { */ 'marketing_status'?: AddPersonRequestMarketingStatusConst; /** - * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. * @type {{ [key: string]: any | undefined; }} */ 'custom_fields'?: { [key: string]: any | undefined; }; diff --git a/src/versions/v2/models/add-product-request.ts b/src/versions/v2/models/add-product-request.ts index 603ef368..afe04c7d 100644 --- a/src/versions/v2/models/add-product-request.ts +++ b/src/versions/v2/models/add-product-request.ts @@ -18,7 +18,7 @@ import { AddProductRequestAllOf } from './add-product-request-all-of'; // May contain unused imports in some cases // @ts-ignore -import { BaseProductAllOf } from './base-product-all-of'; +import { BaseProductAllOf1 } from './base-product-all-of1'; // May contain unused imports in some cases // @ts-ignore import { GetDealsProductsResponseDataInnerAllOf2 } from './get-deals-products-response-data-inner-all-of2'; @@ -30,6 +30,6 @@ import { ProductRequest } from './product-request'; * @type AddProductRequest * @export */ -export type AddProductRequest = AddProductRequestAllOf & BaseProductAllOf & GetDealsProductsResponseDataInnerAllOf2 & ProductRequest; +export type AddProductRequest = AddProductRequestAllOf & BaseProductAllOf1 & GetDealsProductsResponseDataInnerAllOf2 & ProductRequest; diff --git a/src/versions/v2/models/add-project-board-request.ts b/src/versions/v2/models/add-project-board-request.ts new file mode 100644 index 00000000..172a3036 --- /dev/null +++ b/src/versions/v2/models/add-project-board-request.ts @@ -0,0 +1,34 @@ +/* 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 AddProjectBoardRequest +*/ +export interface AddProjectBoardRequest { + /** + * The name of the project board + * @type {string} + */ + 'name': string; + /** + * The order of the board. Must be between 1 and the total number of boards + 1. + * @type {number} + */ + 'order_nr'?: number; +} + diff --git a/src/versions/v2/models/add-project-field-request-important-fields.ts b/src/versions/v2/models/add-project-field-request-important-fields.ts new file mode 100644 index 00000000..65378706 --- /dev/null +++ b/src/versions/v2/models/add-project-field-request-important-fields.ts @@ -0,0 +1,36 @@ +/* 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. + */ + + + +/** +* Configuration for highlighting the field at specific stages. +* @export +* @interface AddProjectFieldRequestImportantFields +*/ +export interface AddProjectFieldRequestImportantFields { + [key: string]: any | any; + + /** + * Whether the field is marked as important. When false, the field is not highlighted. When true with empty stage_ids, the field is important everywhere. When true with specific stage_ids, the field is important only at those deal stages. Default is false. + * @type {boolean} + */ + 'enabled'?: boolean; + /** + * Array of deal stage IDs where this project field should be highlighted as important. Must reference valid, active deal stages. Empty array when enabled is false. + * @type {Array} + */ + 'stage_ids'?: Array; +} + diff --git a/src/versions/v2/models/add-project-field-request-required-fields.ts b/src/versions/v2/models/add-project-field-request-required-fields.ts new file mode 100644 index 00000000..4d10edbb --- /dev/null +++ b/src/versions/v2/models/add-project-field-request-required-fields.ts @@ -0,0 +1,31 @@ +/* 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. + */ + + + +/** +* Required fields configuration for marking the field as mandatory when interacted with in the Pipedrive web UI. +* @export +* @interface AddProjectFieldRequestRequiredFields +*/ +export interface AddProjectFieldRequestRequiredFields { + [key: string]: any | any; + + /** + * Whether the field is required. When false, the field is optional. When true, the field is required when creating or updating projects. Default is false. + * @type {boolean} + */ + 'enabled'?: boolean; +} + diff --git a/src/versions/v2/models/add-project-field-request-ui-visibility.ts b/src/versions/v2/models/add-project-field-request-ui-visibility.ts new file mode 100644 index 00000000..a0b28187 --- /dev/null +++ b/src/versions/v2/models/add-project-field-request-ui-visibility.ts @@ -0,0 +1,36 @@ +/* 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. + */ + + + +/** +* UI visibility settings for the field. Controls where the field appears in the Pipedrive web UI. +* @export +* @interface AddProjectFieldRequestUiVisibility +*/ +export interface AddProjectFieldRequestUiVisibility { + [key: string]: any | any; + + /** + * Whether the field is shown in the add project modal. Default is false. + * @type {boolean} + */ + 'add_visible_flag'?: boolean; + /** + * Whether the field is shown in the project details view. Default is true. + * @type {boolean} + */ + 'details_visible_flag'?: boolean; +} + diff --git a/src/versions/v2/models/add-project-field-request.ts b/src/versions/v2/models/add-project-field-request.ts new file mode 100644 index 00000000..607ad48f --- /dev/null +++ b/src/versions/v2/models/add-project-field-request.ts @@ -0,0 +1,88 @@ +/* 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 { AddDealFieldRequestOptionsInner } from './add-deal-field-request-options-inner'; +// May contain unused imports in some cases +// @ts-ignore +import { AddProjectFieldRequestImportantFields } from './add-project-field-request-important-fields'; +// May contain unused imports in some cases +// @ts-ignore +import { AddProjectFieldRequestRequiredFields } from './add-project-field-request-required-fields'; +// May contain unused imports in some cases +// @ts-ignore +import { AddProjectFieldRequestUiVisibility } from './add-project-field-request-ui-visibility'; + +/** +* +* @export +* @interface AddProjectFieldRequest +*/ +export interface AddProjectFieldRequest { + /** + * Field name + * @type {string} + */ + 'field_name': string; + /** + * The type of the field
ValueDescription
`varchar`Text (up to 255 characters)
`varchar_auto`Autocomplete text (up to 255 characters)
`text`Long text (up to 65k characters)
`double`Numeric value
`monetary`Monetary field (has a numeric value and a currency value)
`date`Date (format YYYY-MM-DD)
`set`Options field with a possibility of having multiple chosen options
`enum`Options field with a single possible chosen option
`user`User field (contains a user ID of another Pipedrive user)
`org`Organization field (contains an organization ID which is stored on the same account)
`people`Person field (contains a person ID which is stored on the same account)
`phone`Phone field (up to 255 numbers and/or characters)
`time`Time field (format HH:MM:SS)
`timerange`Time-range field (has a start time and end time value, both HH:MM:SS)
`daterange`Date-range field (has a start date and end date value, both YYYY-MM-DD)
`address`Address field
+ * @type {string} + */ + 'field_type': AddProjectFieldRequestFieldTypeConst; + /** + * Field options (required for enum and set field types) + * @type {Array} + */ + 'options'?: Array; + /** + * + * @type {AddProjectFieldRequestUiVisibility} + */ + 'ui_visibility'?: AddProjectFieldRequestUiVisibility; + /** + * + * @type {AddProjectFieldRequestImportantFields} + */ + 'important_fields'?: AddProjectFieldRequestImportantFields; + /** + * + * @type {AddProjectFieldRequestRequiredFields} + */ + 'required_fields'?: AddProjectFieldRequestRequiredFields; +} + + export const AddProjectFieldRequestFieldTypeConst = { + varchar: 'varchar', + text: 'text', + double: 'double', + phone: 'phone', + date: 'date', + daterange: 'daterange', + time: 'time', + timerange: 'timerange', + set: 'set', + enum: 'enum', + varchar_auto: 'varchar_auto', + address: 'address', + monetary: 'monetary', + org: 'org', + people: 'people', + user: 'user' + } as const; + + export type AddProjectFieldRequestFieldTypeConst = typeof AddProjectFieldRequestFieldTypeConst[keyof typeof AddProjectFieldRequestFieldTypeConst]; + + diff --git a/src/versions/v2/models/add-project-field200-response.ts b/src/versions/v2/models/add-project-field200-response.ts new file mode 100644 index 00000000..90e9ea69 --- /dev/null +++ b/src/versions/v2/models/add-project-field200-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 { GetProjectFields200ResponseDataInner } from './get-project-fields200-response-data-inner'; + +/** +* +* @export +* @interface AddProjectField200Response +*/ +export interface AddProjectField200Response { + /** + * Whether the request was successful + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {GetProjectFields200ResponseDataInner} + */ + 'data'?: GetProjectFields200ResponseDataInner; +} + diff --git a/src/versions/v2/models/add-project-phase-request.ts b/src/versions/v2/models/add-project-phase-request.ts new file mode 100644 index 00000000..5bfd16de --- /dev/null +++ b/src/versions/v2/models/add-project-phase-request.ts @@ -0,0 +1,39 @@ +/* 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 AddProjectPhaseRequest +*/ +export interface AddProjectPhaseRequest { + /** + * The name of the project phase + * @type {string} + */ + 'name': string; + /** + * The ID of the project board to add the phase to + * @type {number} + */ + 'board_id': number; + /** + * The order of the phase within its board. Must be between 1 and the total number of phases on the board + 1. + * @type {number} + */ + 'order_nr'?: number; +} + diff --git a/src/versions/v2/models/add-project-request.ts b/src/versions/v2/models/add-project-request.ts new file mode 100644 index 00000000..60bb0e9d --- /dev/null +++ b/src/versions/v2/models/add-project-request.ts @@ -0,0 +1,94 @@ +/* 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 AddProjectRequest +*/ +export interface AddProjectRequest { + /** + * The title of the project + * @type {string} + */ + 'title': string; + /** + * The description of the project + * @type {string} + */ + 'description'?: string; + /** + * The status of the project + * @type {string} + */ + 'status'?: string; + /** + * The ID of the board this project is associated with + * @type {number} + */ + 'board_id'?: number; + /** + * The ID of the phase this project is associated with + * @type {number} + */ + 'phase_id'?: number; + /** + * The ID of the user who owns the project + * @type {number} + */ + 'owner_id'?: number; + /** + * The start date of the project. Format: YYYY-MM-DD + * @type {string} + */ + 'start_date'?: string; + /** + * The end date of the project. Format: YYYY-MM-DD + * @type {string} + */ + 'end_date'?: string; + /** + * An array of IDs of the deals this project is associated with + * @type {Array} + */ + 'deal_ids'?: Array; + /** + * An array of IDs of the persons this project is associated with + * @type {Array} + */ + 'person_ids'?: Array; + /** + * An array of IDs of the organizations this project is associated with + * @type {Array} + */ + 'org_ids'?: Array; + /** + * An array of IDs of the labels this project has + * @type {Array} + */ + 'label_ids'?: Array; + /** + * The ID of the template the project will be based on. Only used when creating a new project. + * @type {number} + */ + 'template_id'?: number; + /** + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * @type {{ [key: string]: any | undefined; }} + */ + 'custom_fields'?: { [key: string]: any | undefined; }; +} + diff --git a/src/versions/v2/models/add-task-request.ts b/src/versions/v2/models/add-task-request.ts new file mode 100644 index 00000000..233519d8 --- /dev/null +++ b/src/versions/v2/models/add-task-request.ts @@ -0,0 +1,93 @@ +/* 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 AddTaskRequest +*/ +export interface AddTaskRequest { + /** + * The title of the task + * @type {string} + */ + 'title': string; + /** + * The ID of the project this task is associated with + * @type {number} + */ + 'project_id': number; + /** + * The ID of the parent task. Cannot be the ID of a task that is already a subtask. + * @type {number} + */ + 'parent_task_id'?: number | null; + /** + * The description of the task + * @type {string} + */ + 'description'?: string | null; + /** + * Whether the task is done or not. `0` = Not done, `1` = Done. + * @type {number} + */ + 'done'?: AddTaskRequestDoneConst; + /** + * Whether the task is a milestone or not. `0` = Not a milestone, `1` = Milestone. + * @type {number} + */ + 'milestone'?: AddTaskRequestMilestoneConst; + /** + * The due date of the task. Format: YYYY-MM-DD. + * @type {string} + */ + 'due_date'?: string | null; + /** + * The start date of the task. Format: YYYY-MM-DD. + * @type {string} + */ + 'start_date'?: string | null; + /** + * The ID of the user assigned to the task. When set, the `assignee_ids` field will be overwritten with this value. + * @type {number} + */ + 'assignee_id'?: number | null; + /** + * The IDs of users assigned to the task. When set, the `assignee_id` field will be set to the first value in this array, or `null` if empty. + * @type {Array} + */ + 'assignee_ids'?: Array; + /** + * The priority of the task + * @type {number} + */ + 'priority'?: number | null; +} + + export const AddTaskRequestDoneConst = { + NUMBER_0: 0, + NUMBER_1: 1 + } as const; + + export type AddTaskRequestDoneConst = typeof AddTaskRequestDoneConst[keyof typeof AddTaskRequestDoneConst]; + export const AddTaskRequestMilestoneConst = { + NUMBER_0: 0, + NUMBER_1: 1 + } as const; + + export type AddTaskRequestMilestoneConst = typeof AddTaskRequestMilestoneConst[keyof typeof AddTaskRequestMilestoneConst]; + + diff --git a/src/versions/v2/models/add-task-response.ts b/src/versions/v2/models/add-task-response.ts new file mode 100644 index 00000000..96a30625 --- /dev/null +++ b/src/versions/v2/models/add-task-response.ts @@ -0,0 +1,42 @@ +/* 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 { GetTasksResponseDataInner } from './get-tasks-response-data-inner'; + +/** +* +* @export +* @interface AddTaskResponse +*/ +export interface AddTaskResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {GetTasksResponseDataInner} + */ + 'data'?: GetTasksResponseDataInner; + /** + * + * @type {object} + */ + 'additional_data'?: object | null; +} + diff --git a/src/versions/v2/models/base-product-all-of.ts b/src/versions/v2/models/base-product-all-of.ts index 84e20ae2..005d5d2a 100644 --- a/src/versions/v2/models/base-product-all-of.ts +++ b/src/versions/v2/models/base-product-all-of.ts @@ -21,21 +21,64 @@ */ export interface BaseProductAllOf { /** - * Only available in Growth and above plans How often a customer is billed for access to a service or product + * The ID of the product + * @type {number} + */ + 'id'?: number; + /** + * The name of the product + * @type {string} + */ + 'name'?: string; + /** + * The product code * @type {string} */ - 'billing_frequency'?: BaseProductAllOfBillingFrequencyConst; + 'code'?: string; + /** + * The unit in which this product is sold + * @type {string} + */ + 'unit'?: string; + /** + * The tax percentage + * @type {number} + */ + 'tax'?: number; + /** + * Whether this product will be marked as deleted or not + * @type {boolean} + */ + 'is_deleted'?: boolean; + /** + * Whether this product can be added to a deal or not + * @type {boolean} + */ + 'is_linkable'?: boolean; + /** + * + * @type {number} + */ + 'visible_to'?: BaseProductAllOfVisibleToConst; + /** + * Information about the Pipedrive user who owns the product + * @type {number} + */ + 'owner_id'?: number; + /** + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * @type {{ [key: string]: any | undefined; }} + */ + 'custom_fields'?: { [key: string]: any | undefined; }; } - export const BaseProductAllOfBillingFrequencyConst = { - one_time: 'one-time', - annually: 'annually', - semi_annually: 'semi-annually', - quarterly: 'quarterly', - monthly: 'monthly', - weekly: 'weekly' + export const BaseProductAllOfVisibleToConst = { + NUMBER_1: 1, + NUMBER_3: 3, + NUMBER_5: 5, + NUMBER_7: 7 } as const; - export type BaseProductAllOfBillingFrequencyConst = typeof BaseProductAllOfBillingFrequencyConst[keyof typeof BaseProductAllOfBillingFrequencyConst]; + export type BaseProductAllOfVisibleToConst = typeof BaseProductAllOfVisibleToConst[keyof typeof BaseProductAllOfVisibleToConst]; diff --git a/src/versions/v2/models/base-product-all-of1.ts b/src/versions/v2/models/base-product-all-of1.ts new file mode 100644 index 00000000..8aa03b41 --- /dev/null +++ b/src/versions/v2/models/base-product-all-of1.ts @@ -0,0 +1,41 @@ +/* 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 BaseProductAllOf1 +*/ +export interface BaseProductAllOf1 { + /** + * Only available in Growth and above plans How often a customer is billed for access to a service or product + * @type {string} + */ + 'billing_frequency'?: BaseProductAllOf1BillingFrequencyConst; +} + + export const BaseProductAllOf1BillingFrequencyConst = { + one_time: 'one-time', + annually: 'annually', + semi_annually: 'semi-annually', + quarterly: 'quarterly', + monthly: 'monthly', + weekly: 'weekly' + } as const; + + export type BaseProductAllOf1BillingFrequencyConst = typeof BaseProductAllOf1BillingFrequencyConst[keyof typeof BaseProductAllOf1BillingFrequencyConst]; + + diff --git a/src/versions/v2/models/base-product.ts b/src/versions/v2/models/base-product.ts index 0b1ec114..e2bb6451 100644 --- a/src/versions/v2/models/base-product.ts +++ b/src/versions/v2/models/base-product.ts @@ -18,18 +18,15 @@ import { BaseProductAllOf } from './base-product-all-of'; // May contain unused imports in some cases // @ts-ignore -import { GetDealsProductsResponseDataInnerAllOf2 } from './get-deals-products-response-data-inner-all-of2'; -// May contain unused imports in some cases -// @ts-ignore -import { OrganizationItem } from './organization-item'; +import { BaseProductAllOf1 } from './base-product-all-of1'; // May contain unused imports in some cases // @ts-ignore -import { OrganizationItemAddress } from './organization-item-address'; +import { GetDealsProductsResponseDataInnerAllOf2 } from './get-deals-products-response-data-inner-all-of2'; /** * @type BaseProduct * @export */ -export type BaseProduct = BaseProductAllOf & GetDealsProductsResponseDataInnerAllOf2 & OrganizationItem; +export type BaseProduct = BaseProductAllOf & BaseProductAllOf1 & GetDealsProductsResponseDataInnerAllOf2; diff --git a/src/versions/v2/models/deal.ts b/src/versions/v2/models/deal.ts index 49032ccc..24040fa4 100644 --- a/src/versions/v2/models/deal.ts +++ b/src/versions/v2/models/deal.ts @@ -176,7 +176,7 @@ export interface Deal { */ 'acv'?: number | null; /** - * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. * @type {{ [key: string]: any | undefined; }} */ 'custom_fields'?: { [key: string]: any | undefined; }; diff --git a/src/versions/v2/models/delete-project-board-response-data.ts b/src/versions/v2/models/delete-project-board-response-data.ts new file mode 100644 index 00000000..a21b9450 --- /dev/null +++ b/src/versions/v2/models/delete-project-board-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 DeleteProjectBoardResponseData +*/ +export interface DeleteProjectBoardResponseData { + /** + * The ID of the deleted project board + * @type {number} + */ + 'id'?: number; +} + diff --git a/src/versions/v2/models/delete-project-board-response.ts b/src/versions/v2/models/delete-project-board-response.ts new file mode 100644 index 00000000..34638ef1 --- /dev/null +++ b/src/versions/v2/models/delete-project-board-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 { DeleteProjectBoardResponseData } from './delete-project-board-response-data'; + +/** +* +* @export +* @interface DeleteProjectBoardResponse +*/ +export interface DeleteProjectBoardResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {DeleteProjectBoardResponseData} + */ + 'data'?: DeleteProjectBoardResponseData; +} + diff --git a/src/versions/v2/models/delete-project-field200-response-data.ts b/src/versions/v2/models/delete-project-field200-response-data.ts new file mode 100644 index 00000000..93420ce3 --- /dev/null +++ b/src/versions/v2/models/delete-project-field200-response-data.ts @@ -0,0 +1,59 @@ +/* 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 DeleteProjectField200ResponseData +*/ +export interface DeleteProjectField200ResponseData { + /** + * The display name/label of the field + * @type {string} + */ + 'field_name': string; + /** + * The unique identifier for the field (40-character hash for custom fields) + * @type {string} + */ + 'field_code': string; + /** + * The type of the field + * @type {string} + */ + 'field_type': string; + /** + * Whether this is a user-created custom field + * @type {boolean} + */ + 'is_custom_field': boolean; + /** + * Whether this field is not returned by default in entity responses + * @type {boolean} + */ + 'is_optional_response_field': boolean; + /** + * Array of available options for enum/set fields, null for other field types + * @type {Array} + */ + 'options'?: Array | null; + /** + * Array of subfields for complex field types, null for simple field types + * @type {Array} + */ + 'subfields'?: Array | null; +} + diff --git a/src/versions/v2/models/delete-project-field200-response.ts b/src/versions/v2/models/delete-project-field200-response.ts new file mode 100644 index 00000000..dd4ea835 --- /dev/null +++ b/src/versions/v2/models/delete-project-field200-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 { DeleteProjectField200ResponseData } from './delete-project-field200-response-data'; + +/** +* +* @export +* @interface DeleteProjectField200Response +*/ +export interface DeleteProjectField200Response { + /** + * Whether the request was successful + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {DeleteProjectField200ResponseData} + */ + 'data'?: DeleteProjectField200ResponseData; +} + diff --git a/src/versions/v2/models/delete-project-phase-response-data.ts b/src/versions/v2/models/delete-project-phase-response-data.ts new file mode 100644 index 00000000..f35acaa6 --- /dev/null +++ b/src/versions/v2/models/delete-project-phase-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 DeleteProjectPhaseResponseData +*/ +export interface DeleteProjectPhaseResponseData { + /** + * The ID of the deleted project phase + * @type {number} + */ + 'id'?: number; +} + diff --git a/src/versions/v2/models/delete-project-phase-response.ts b/src/versions/v2/models/delete-project-phase-response.ts new file mode 100644 index 00000000..e04e8ea8 --- /dev/null +++ b/src/versions/v2/models/delete-project-phase-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 { DeleteProjectPhaseResponseData } from './delete-project-phase-response-data'; + +/** +* +* @export +* @interface DeleteProjectPhaseResponse +*/ +export interface DeleteProjectPhaseResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {DeleteProjectPhaseResponseData} + */ + 'data'?: DeleteProjectPhaseResponseData; +} + diff --git a/src/versions/v2/models/delete-project-response-data.ts b/src/versions/v2/models/delete-project-response-data.ts new file mode 100644 index 00000000..cff886a5 --- /dev/null +++ b/src/versions/v2/models/delete-project-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 DeleteProjectResponseData +*/ +export interface DeleteProjectResponseData { + /** + * The ID of the deleted project + * @type {number} + */ + 'id'?: number; +} + diff --git a/src/versions/v2/models/delete-project-response.ts b/src/versions/v2/models/delete-project-response.ts new file mode 100644 index 00000000..50fa901a --- /dev/null +++ b/src/versions/v2/models/delete-project-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 { DeleteProjectResponseData } from './delete-project-response-data'; + +/** +* +* @export +* @interface DeleteProjectResponse +*/ +export interface DeleteProjectResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {DeleteProjectResponseData} + */ + 'data'?: DeleteProjectResponseData; +} + diff --git a/src/versions/v2/models/delete-task-response-data.ts b/src/versions/v2/models/delete-task-response-data.ts new file mode 100644 index 00000000..34ecce66 --- /dev/null +++ b/src/versions/v2/models/delete-task-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 DeleteTaskResponseData +*/ +export interface DeleteTaskResponseData { + /** + * The ID of the deleted task + * @type {number} + */ + 'id'?: number; +} + diff --git a/src/versions/v2/models/delete-task-response.ts b/src/versions/v2/models/delete-task-response.ts new file mode 100644 index 00000000..639aaa5d --- /dev/null +++ b/src/versions/v2/models/delete-task-response.ts @@ -0,0 +1,42 @@ +/* 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 { DeleteTaskResponseData } from './delete-task-response-data'; + +/** +* +* @export +* @interface DeleteTaskResponse +*/ +export interface DeleteTaskResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {DeleteTaskResponseData} + */ + 'data'?: DeleteTaskResponseData; + /** + * + * @type {object} + */ + 'additional_data'?: object | null; +} + diff --git a/src/versions/v2/models/get-persons-response-all-of.ts b/src/versions/v2/models/get-persons-response-all-of.ts index 0991cb68..17df91a6 100644 --- a/src/versions/v2/models/get-persons-response-all-of.ts +++ b/src/versions/v2/models/get-persons-response-all-of.ts @@ -18,7 +18,7 @@ import { GetActivitiesResponseAllOfAdditionalData } from './get-activities-response-all-of-additional-data'; // May contain unused imports in some cases // @ts-ignore -import { OrganizationItem } from './organization-item'; +import { Person } from './person'; /** * @@ -28,9 +28,9 @@ import { OrganizationItem } from './organization-item'; export interface GetPersonsResponseAllOf { /** * Persons array - * @type {Array} + * @type {Array} */ - 'data'?: Array; + 'data'?: Array; /** * * @type {GetActivitiesResponseAllOfAdditionalData} diff --git a/src/versions/v2/models/get-persons-response.ts b/src/versions/v2/models/get-persons-response.ts index 1f45098f..8d9fb6f6 100644 --- a/src/versions/v2/models/get-persons-response.ts +++ b/src/versions/v2/models/get-persons-response.ts @@ -24,7 +24,7 @@ import { GetActivitiesResponseAllOfAdditionalData } from './get-activities-respo import { GetPersonsResponseAllOf } from './get-persons-response-all-of'; // May contain unused imports in some cases // @ts-ignore -import { OrganizationItem } from './organization-item'; +import { Person } from './person'; /** * @type GetPersonsResponse diff --git a/src/versions/v2/models/get-product-response-data.ts b/src/versions/v2/models/get-product-response-data.ts index 6d7236f8..b644dce4 100644 --- a/src/versions/v2/models/get-product-response-data.ts +++ b/src/versions/v2/models/get-product-response-data.ts @@ -18,9 +18,6 @@ import { BaseProduct } from './base-product'; // May contain unused imports in some cases // @ts-ignore -import { OrganizationItemAddress } from './organization-item-address'; -// May contain unused imports in some cases -// @ts-ignore import { PricesArray } from './prices-array'; /** diff --git a/src/versions/v2/models/get-project-boards-response-data-inner.ts b/src/versions/v2/models/get-project-boards-response-data-inner.ts new file mode 100644 index 00000000..e495310a --- /dev/null +++ b/src/versions/v2/models/get-project-boards-response-data-inner.ts @@ -0,0 +1,49 @@ +/* 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 GetProjectBoardsResponseDataInner +*/ +export interface GetProjectBoardsResponseDataInner { + /** + * The ID of the project board + * @type {number} + */ + 'id'?: number; + /** + * The name of the project board + * @type {string} + */ + 'name'?: string; + /** + * The order of the board + * @type {number} + */ + 'order_nr'?: number; + /** + * The creation date and time of the board in ISO 8601 format + * @type {string} + */ + 'add_time'?: string; + /** + * The update date and time of the board in ISO 8601 format + * @type {string} + */ + 'update_time'?: string; +} + diff --git a/src/versions/v2/models/get-project-boards-response.ts b/src/versions/v2/models/get-project-boards-response.ts new file mode 100644 index 00000000..a670af1f --- /dev/null +++ b/src/versions/v2/models/get-project-boards-response.ts @@ -0,0 +1,42 @@ +/* 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 { GetProjectBoardsResponseDataInner } from './get-project-boards-response-data-inner'; + +/** +* +* @export +* @interface GetProjectBoardsResponse +*/ +export interface GetProjectBoardsResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * The array of project boards + * @type {Array} + */ + 'data'?: Array; + /** + * + * @type {object} + */ + 'additional_data'?: object | null; +} + diff --git a/src/versions/v2/models/get-project-changelog-response-data-inner.ts b/src/versions/v2/models/get-project-changelog-response-data-inner.ts new file mode 100644 index 00000000..cd6b102c --- /dev/null +++ b/src/versions/v2/models/get-project-changelog-response-data-inner.ts @@ -0,0 +1,54 @@ +/* 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 GetProjectChangelogResponseDataInner +*/ +export interface GetProjectChangelogResponseDataInner { + /** + * The source of change, for example \'app\', \'mobile\', \'api\', etc. + * @type {string} + */ + 'change_source'?: string | null; + /** + * The user agent from which the change was made + * @type {string} + */ + 'change_source_user_agent'?: string | null; + /** + * The date and time of the change in ISO 8601 format + * @type {string} + */ + 'time'?: string; + /** + * A map of field keys to their new values after the change + * @type {{ [key: string]: any | undefined; }} + */ + 'new_values'?: { [key: string]: any | undefined; }; + /** + * A map of field keys to their previous values before the change + * @type {{ [key: string]: any | undefined; }} + */ + 'old_values'?: { [key: string]: any | undefined; }; + /** + * The ID of the user who made the change + * @type {number} + */ + 'actor_user_id'?: number; +} + diff --git a/src/versions/v2/models/get-project-changelog-response.ts b/src/versions/v2/models/get-project-changelog-response.ts new file mode 100644 index 00000000..c23602a0 --- /dev/null +++ b/src/versions/v2/models/get-project-changelog-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 { GetActivitiesResponseAllOfAdditionalData } from './get-activities-response-all-of-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectChangelogResponseDataInner } from './get-project-changelog-response-data-inner'; + +/** +* +* @export +* @interface GetProjectChangelogResponse +*/ +export interface GetProjectChangelogResponse { + /** + * + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {Array} + */ + 'data'?: Array; + /** + * + * @type {GetActivitiesResponseAllOfAdditionalData} + */ + 'additional_data'?: GetActivitiesResponseAllOfAdditionalData; +} + diff --git a/src/versions/v2/models/get-project-fields200-response-data-inner-ui-visibility.ts b/src/versions/v2/models/get-project-fields200-response-data-inner-ui-visibility.ts new file mode 100644 index 00000000..fa079073 --- /dev/null +++ b/src/versions/v2/models/get-project-fields200-response-data-inner-ui-visibility.ts @@ -0,0 +1,34 @@ +/* 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. + */ + + + +/** +* UI visibility settings (only included when requested via include_fields parameter) +* @export +* @interface GetProjectFields200ResponseDataInnerUiVisibility +*/ +export interface GetProjectFields200ResponseDataInnerUiVisibility { + /** + * Whether the field is shown in the add modal + * @type {boolean} + */ + 'add_visible_flag'?: boolean; + /** + * Whether the field is shown in the details view + * @type {boolean} + */ + 'details_visible_flag'?: boolean; +} + diff --git a/src/versions/v2/models/get-project-fields200-response-data-inner.ts b/src/versions/v2/models/get-project-fields200-response-data-inner.ts new file mode 100644 index 00000000..4a4be886 --- /dev/null +++ b/src/versions/v2/models/get-project-fields200-response-data-inner.ts @@ -0,0 +1,128 @@ +/* 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 { GetActivityFields200ResponseDataInnerOptionsInner } from './get-activity-fields200-response-data-inner-options-inner'; +// May contain unused imports in some cases +// @ts-ignore +import { GetActivityFields200ResponseDataInnerSubfieldsInner } from './get-activity-fields200-response-data-inner-subfields-inner'; +// May contain unused imports in some cases +// @ts-ignore +import { GetPersonFields200ResponseDataInnerImportantFields } from './get-person-fields200-response-data-inner-important-fields'; +// May contain unused imports in some cases +// @ts-ignore +import { GetPersonFields200ResponseDataInnerRequiredFields } from './get-person-fields200-response-data-inner-required-fields'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectFields200ResponseDataInnerUiVisibility } from './get-project-fields200-response-data-inner-ui-visibility'; + +/** +* +* @export +* @interface GetProjectFields200ResponseDataInner +*/ +export interface GetProjectFields200ResponseDataInner { + /** + * The display name/label of the field + * @type {string} + */ + 'field_name': string; + /** + * The unique identifier for the field (40-character hash for custom fields) + * @type {string} + */ + 'field_code': string; + /** + * The type of the field + * @type {string} + */ + 'field_type': GetProjectFields200ResponseDataInnerFieldTypeConst; + /** + * Whether this is a user-created custom field + * @type {boolean} + */ + 'is_custom_field': boolean; + /** + * Whether this field is not returned by default in entity responses + * @type {boolean} + */ + 'is_optional_response_field': boolean; + /** + * Array of available options for enum/set fields, null for other field types + * @type {Array} + */ + 'options'?: Array | null; + /** + * Array of subfields for complex field types (address, monetary), null for simple field types + * @type {Array} + */ + 'subfields'?: Array | null; + /** + * + * @type {GetProjectFields200ResponseDataInnerUiVisibility} + */ + 'ui_visibility'?: GetProjectFields200ResponseDataInnerUiVisibility; + /** + * + * @type {GetPersonFields200ResponseDataInnerImportantFields} + */ + 'important_fields'?: GetPersonFields200ResponseDataInnerImportantFields; + /** + * + * @type {GetPersonFields200ResponseDataInnerRequiredFields} + */ + 'required_fields'?: GetPersonFields200ResponseDataInnerRequiredFields; +} + + export const GetProjectFields200ResponseDataInnerFieldTypeConst = { + int: 'int', + double: 'double', + boolean: 'boolean', + varchar: 'varchar', + text: 'text', + phone: 'phone', + varchar_options: 'varchar_options', + varchar_auto: 'varchar_auto', + date: 'date', + daterange: 'daterange', + time: 'time', + timerange: 'timerange', + enum: 'enum', + set: 'set', + address: 'address', + monetary: 'monetary', + deal: 'deal', + deals: 'deals', + lead: 'lead', + org: 'org', + people: 'people', + project: 'project', + stage: 'stage', + user: 'user', + activity: 'activity', + json: 'json', + picture: 'picture', + status: 'status', + visible_to: 'visible_to', + price_list: 'price_list', + billing_frequency: 'billing_frequency', + projects_board: 'projects_board', + projects_phase: 'projects_phase' + } as const; + + export type GetProjectFields200ResponseDataInnerFieldTypeConst = typeof GetProjectFields200ResponseDataInnerFieldTypeConst[keyof typeof GetProjectFields200ResponseDataInnerFieldTypeConst]; + + diff --git a/src/versions/v2/models/get-project-fields200-response.ts b/src/versions/v2/models/get-project-fields200-response.ts new file mode 100644 index 00000000..585cee53 --- /dev/null +++ b/src/versions/v2/models/get-project-fields200-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 { GetActivityFields200ResponseAdditionalData } from './get-activity-fields200-response-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectFields200ResponseDataInner } from './get-project-fields200-response-data-inner'; + +/** +* +* @export +* @interface GetProjectFields200Response +*/ +export interface GetProjectFields200Response { + /** + * Whether the request was successful + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {Array} + */ + 'data'?: Array; + /** + * + * @type {GetActivityFields200ResponseAdditionalData} + */ + 'additional_data'?: GetActivityFields200ResponseAdditionalData; +} + diff --git a/src/versions/v2/models/get-project-permitted-users-response.ts b/src/versions/v2/models/get-project-permitted-users-response.ts new file mode 100644 index 00000000..9dcac2c5 --- /dev/null +++ b/src/versions/v2/models/get-project-permitted-users-response.ts @@ -0,0 +1,34 @@ +/* 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 GetProjectPermittedUsersResponse +*/ +export interface GetProjectPermittedUsersResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * The list of permitted user IDs + * @type {Array} + */ + 'data'?: Array; +} + diff --git a/src/versions/v2/models/get-project-phases-response-data-inner.ts b/src/versions/v2/models/get-project-phases-response-data-inner.ts new file mode 100644 index 00000000..74c2ea7f --- /dev/null +++ b/src/versions/v2/models/get-project-phases-response-data-inner.ts @@ -0,0 +1,54 @@ +/* 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 GetProjectPhasesResponseDataInner +*/ +export interface GetProjectPhasesResponseDataInner { + /** + * The ID of the project phase + * @type {number} + */ + 'id'?: number; + /** + * The name of the project phase + * @type {string} + */ + 'name'?: string; + /** + * The ID of the project board this phase belongs to + * @type {number} + */ + 'board_id'?: number; + /** + * The order of the phase within its board + * @type {number} + */ + 'order_nr'?: number; + /** + * The creation date and time of the phase in ISO 8601 format + * @type {string} + */ + 'add_time'?: string; + /** + * The update date and time of the phase in ISO 8601 format + * @type {string} + */ + 'update_time'?: string; +} + diff --git a/src/versions/v2/models/get-project-phases-response.ts b/src/versions/v2/models/get-project-phases-response.ts new file mode 100644 index 00000000..2ddccf57 --- /dev/null +++ b/src/versions/v2/models/get-project-phases-response.ts @@ -0,0 +1,42 @@ +/* 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 { GetProjectPhasesResponseDataInner } from './get-project-phases-response-data-inner'; + +/** +* +* @export +* @interface GetProjectPhasesResponse +*/ +export interface GetProjectPhasesResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * The array of project phases + * @type {Array} + */ + 'data'?: Array; + /** + * + * @type {object} + */ + 'additional_data'?: object | null; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-deal.ts b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-deal.ts new file mode 100644 index 00000000..9ddbc31c --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-deal.ts @@ -0,0 +1,34 @@ +/* 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 GetProjectSearchResponseAllOfDataItemsInnerItemDeal +*/ +export interface GetProjectSearchResponseAllOfDataItemsInnerItemDeal { + /** + * The ID of the deal the project is associated with + * @type {number} + */ + 'id'?: number; + /** + * The title of the deal the project is associated with + * @type {string} + */ + 'title'?: string | null; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-organization.ts b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-organization.ts new file mode 100644 index 00000000..30b68b55 --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-organization.ts @@ -0,0 +1,39 @@ +/* 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 GetProjectSearchResponseAllOfDataItemsInnerItemOrganization +*/ +export interface GetProjectSearchResponseAllOfDataItemsInnerItemOrganization { + /** + * The ID of the organization the project is associated with + * @type {number} + */ + 'id'?: number; + /** + * The name of the organization the project is associated with + * @type {string} + */ + 'name'?: string | null; + /** + * The address of the organization the project is associated with + * @type {string} + */ + 'address'?: string | null; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-owner.ts b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-owner.ts new file mode 100644 index 00000000..631034e1 --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-owner.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 GetProjectSearchResponseAllOfDataItemsInnerItemOwner +*/ +export interface GetProjectSearchResponseAllOfDataItemsInnerItemOwner { + /** + * The ID of the owner of the project + * @type {number} + */ + 'id'?: number | null; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-person.ts b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-person.ts new file mode 100644 index 00000000..b51a7deb --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-person.ts @@ -0,0 +1,34 @@ +/* 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 GetProjectSearchResponseAllOfDataItemsInnerItemPerson +*/ +export interface GetProjectSearchResponseAllOfDataItemsInnerItemPerson { + /** + * The ID of the person the project is associated with + * @type {number} + */ + 'id'?: number; + /** + * The name of the person the project is associated with + * @type {string} + */ + 'name'?: string | null; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-phase.ts b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-phase.ts new file mode 100644 index 00000000..c6ed7121 --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item-phase.ts @@ -0,0 +1,34 @@ +/* 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 GetProjectSearchResponseAllOfDataItemsInnerItemPhase +*/ +export interface GetProjectSearchResponseAllOfDataItemsInnerItemPhase { + /** + * The ID of the phase + * @type {number} + */ + 'id'?: number; + /** + * The name of the phase + * @type {string} + */ + 'name'?: string; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item.ts b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item.ts new file mode 100644 index 00000000..03f9fa70 --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner-item.ts @@ -0,0 +1,114 @@ +/* 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 { GetProjectSearchResponseAllOfDataItemsInnerItemDeal } from './get-project-search-response-all-of-data-items-inner-item-deal'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectSearchResponseAllOfDataItemsInnerItemOrganization } from './get-project-search-response-all-of-data-items-inner-item-organization'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectSearchResponseAllOfDataItemsInnerItemOwner } from './get-project-search-response-all-of-data-items-inner-item-owner'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectSearchResponseAllOfDataItemsInnerItemPerson } from './get-project-search-response-all-of-data-items-inner-item-person'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectSearchResponseAllOfDataItemsInnerItemPhase } from './get-project-search-response-all-of-data-items-inner-item-phase'; + +/** +* +* @export +* @interface GetProjectSearchResponseAllOfDataItemsInnerItem +*/ +export interface GetProjectSearchResponseAllOfDataItemsInnerItem { + /** + * The ID of the project + * @type {number} + */ + 'id'?: number; + /** + * The type of the item + * @type {string} + */ + 'type'?: string; + /** + * The title of the project + * @type {string} + */ + 'title'?: string; + /** + * The status of the project + * @type {string} + */ + 'status'?: string | null; + /** + * + * @type {GetProjectSearchResponseAllOfDataItemsInnerItemOwner} + */ + 'owner'?: GetProjectSearchResponseAllOfDataItemsInnerItemOwner; + /** + * The ID of the board the project belongs to + * @type {number} + */ + 'board_id'?: number | null; + /** + * + * @type {GetProjectSearchResponseAllOfDataItemsInnerItemPhase} + */ + 'phase'?: GetProjectSearchResponseAllOfDataItemsInnerItemPhase | null; + /** + * + * @type {GetProjectSearchResponseAllOfDataItemsInnerItemPerson} + */ + 'person'?: GetProjectSearchResponseAllOfDataItemsInnerItemPerson | null; + /** + * + * @type {GetProjectSearchResponseAllOfDataItemsInnerItemOrganization} + */ + 'organization'?: GetProjectSearchResponseAllOfDataItemsInnerItemOrganization | null; + /** + * + * @type {GetProjectSearchResponseAllOfDataItemsInnerItemDeal} + */ + 'deal'?: GetProjectSearchResponseAllOfDataItemsInnerItemDeal | null; + /** + * The number of deals associated with the project + * @type {number} + */ + 'deal_count'?: number; + /** + * The description of the project + * @type {string} + */ + 'description'?: string | null; + /** + * The end date of the project + * @type {string} + */ + 'end_date'?: string | null; + /** + * Custom fields + * @type {Array} + */ + 'custom_fields'?: Array; + /** + * An array of notes + * @type {Array} + */ + 'notes'?: Array; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of-data-items-inner.ts b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner.ts new file mode 100644 index 00000000..81b13af5 --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of-data-items-inner.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 { GetProjectSearchResponseAllOfDataItemsInnerItem } from './get-project-search-response-all-of-data-items-inner-item'; + +/** +* +* @export +* @interface GetProjectSearchResponseAllOfDataItemsInner +*/ +export interface GetProjectSearchResponseAllOfDataItemsInner { + /** + * Search result relevancy + * @type {number} + */ + 'result_score'?: number; + /** + * + * @type {GetProjectSearchResponseAllOfDataItemsInnerItem} + */ + 'item'?: GetProjectSearchResponseAllOfDataItemsInnerItem; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of-data.ts b/src/versions/v2/models/get-project-search-response-all-of-data.ts new file mode 100644 index 00000000..a7194feb --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of-data.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 { GetProjectSearchResponseAllOfDataItemsInner } from './get-project-search-response-all-of-data-items-inner'; + +/** +* +* @export +* @interface GetProjectSearchResponseAllOfData +*/ +export interface GetProjectSearchResponseAllOfData { + /** + * The array of found projects + * @type {Array} + */ + 'items'?: Array; +} + diff --git a/src/versions/v2/models/get-project-search-response-all-of.ts b/src/versions/v2/models/get-project-search-response-all-of.ts new file mode 100644 index 00000000..b2952bde --- /dev/null +++ b/src/versions/v2/models/get-project-search-response-all-of.ts @@ -0,0 +1,40 @@ +/* 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 { GetActivitiesResponseAllOfAdditionalData } from './get-activities-response-all-of-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectSearchResponseAllOfData } from './get-project-search-response-all-of-data'; + +/** +* +* @export +* @interface GetProjectSearchResponseAllOf +*/ +export interface GetProjectSearchResponseAllOf { + /** + * + * @type {GetProjectSearchResponseAllOfData} + */ + 'data'?: GetProjectSearchResponseAllOfData; + /** + * + * @type {GetActivitiesResponseAllOfAdditionalData} + */ + 'additional_data'?: GetActivitiesResponseAllOfAdditionalData; +} + diff --git a/src/versions/v2/models/get-project-search-response.ts b/src/versions/v2/models/get-project-search-response.ts new file mode 100644 index 00000000..bb6abaad --- /dev/null +++ b/src/versions/v2/models/get-project-search-response.ts @@ -0,0 +1,35 @@ +/* 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 { BaseResponse } from './base-response'; +// May contain unused imports in some cases +// @ts-ignore +import { GetActivitiesResponseAllOfAdditionalData } from './get-activities-response-all-of-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectSearchResponseAllOf } from './get-project-search-response-all-of'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectSearchResponseAllOfData } from './get-project-search-response-all-of-data'; + +/** + * @type GetProjectSearchResponse + * @export + */ +export type GetProjectSearchResponse = BaseResponse & GetProjectSearchResponseAllOf; + + diff --git a/src/versions/v2/models/get-project-template-response.ts b/src/versions/v2/models/get-project-template-response.ts new file mode 100644 index 00000000..f10e20bb --- /dev/null +++ b/src/versions/v2/models/get-project-template-response.ts @@ -0,0 +1,42 @@ +/* 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 { ProjectTemplate } from './project-template'; + +/** +* +* @export +* @interface GetProjectTemplateResponse +*/ +export interface GetProjectTemplateResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {ProjectTemplate} + */ + 'data'?: ProjectTemplate; + /** + * + * @type {object} + */ + 'additional_data'?: object | null; +} + diff --git a/src/versions/v2/models/get-project-templates-response.ts b/src/versions/v2/models/get-project-templates-response.ts new file mode 100644 index 00000000..9e854156 --- /dev/null +++ b/src/versions/v2/models/get-project-templates-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 { GetActivitiesResponseAllOfAdditionalData } from './get-activities-response-all-of-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { ProjectTemplate } from './project-template'; + +/** +* +* @export +* @interface GetProjectTemplatesResponse +*/ +export interface GetProjectTemplatesResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {Array} + */ + 'data'?: Array; + /** + * + * @type {GetActivitiesResponseAllOfAdditionalData} + */ + 'additional_data'?: GetActivitiesResponseAllOfAdditionalData; +} + diff --git a/src/versions/v2/models/get-projects-response-all-of.ts b/src/versions/v2/models/get-projects-response-all-of.ts new file mode 100644 index 00000000..94658208 --- /dev/null +++ b/src/versions/v2/models/get-projects-response-all-of.ts @@ -0,0 +1,40 @@ +/* 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 { GetActivitiesResponseAllOfAdditionalData } from './get-activities-response-all-of-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { Project } from './project'; + +/** +* +* @export +* @interface GetProjectsResponseAllOf +*/ +export interface GetProjectsResponseAllOf { + /** + * Projects array + * @type {Array} + */ + 'data'?: Array; + /** + * + * @type {GetActivitiesResponseAllOfAdditionalData} + */ + 'additional_data'?: GetActivitiesResponseAllOfAdditionalData; +} + diff --git a/src/versions/v2/models/get-projects-response.ts b/src/versions/v2/models/get-projects-response.ts new file mode 100644 index 00000000..3bc151a6 --- /dev/null +++ b/src/versions/v2/models/get-projects-response.ts @@ -0,0 +1,35 @@ +/* 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 { BaseResponse } from './base-response'; +// May contain unused imports in some cases +// @ts-ignore +import { GetActivitiesResponseAllOfAdditionalData } from './get-activities-response-all-of-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { GetProjectsResponseAllOf } from './get-projects-response-all-of'; +// May contain unused imports in some cases +// @ts-ignore +import { Project } from './project'; + +/** + * @type GetProjectsResponse + * @export + */ +export type GetProjectsResponse = BaseResponse & GetProjectsResponseAllOf; + + diff --git a/src/versions/v2/models/get-task-response.ts b/src/versions/v2/models/get-task-response.ts new file mode 100644 index 00000000..710ecdc1 --- /dev/null +++ b/src/versions/v2/models/get-task-response.ts @@ -0,0 +1,42 @@ +/* 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 { GetTasksResponseDataInner } from './get-tasks-response-data-inner'; + +/** +* +* @export +* @interface GetTaskResponse +*/ +export interface GetTaskResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {GetTasksResponseDataInner} + */ + 'data'?: GetTasksResponseDataInner; + /** + * + * @type {object} + */ + 'additional_data'?: object | null; +} + diff --git a/src/versions/v2/models/get-tasks-response-data-inner.ts b/src/versions/v2/models/get-tasks-response-data-inner.ts new file mode 100644 index 00000000..a3956db8 --- /dev/null +++ b/src/versions/v2/models/get-tasks-response-data-inner.ts @@ -0,0 +1,99 @@ +/* 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 GetTasksResponseDataInner +*/ +export interface GetTasksResponseDataInner { + /** + * The ID of the task + * @type {number} + */ + 'id'?: number; + /** + * The title of the task + * @type {string} + */ + 'title'?: string; + /** + * The ID of the user who created the task + * @type {number} + */ + 'creator_id'?: number; + /** + * The description of the task + * @type {string} + */ + 'description'?: string | null; + /** + * The ID of the project this task is associated with + * @type {number} + */ + 'project_id'?: number; + /** + * Whether the task is done or not. + * @type {boolean} + */ + 'is_done'?: boolean; + /** + * Whether the task is a milestone or not. + * @type {boolean} + */ + 'is_milestone'?: boolean; + /** + * The due date of the task. Format: YYYY-MM-DD. + * @type {string} + */ + 'due_date'?: string | null; + /** + * The start date of the task. Format: YYYY-MM-DD. + * @type {string} + */ + 'start_date'?: string | null; + /** + * The ID of the parent task. If `null`, the task is a root-level task. + * @type {number} + */ + 'parent_task_id'?: number | null; + /** + * The IDs of users assigned to the task + * @type {Array} + */ + 'assignee_ids'?: Array; + /** + * The priority of the task + * @type {number} + */ + 'priority'?: number | null; + /** + * The creation date and time of the task in ISO 8601 format + * @type {string} + */ + 'add_time'?: string; + /** + * The update date and time of the task in ISO 8601 format + * @type {string} + */ + 'update_time'?: string; + /** + * The date and time the task was marked as done in ISO 8601 format + * @type {string} + */ + 'marked_as_done_time'?: string | null; +} + diff --git a/src/versions/v2/models/get-tasks-response.ts b/src/versions/v2/models/get-tasks-response.ts new file mode 100644 index 00000000..aa5ff457 --- /dev/null +++ b/src/versions/v2/models/get-tasks-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 { GetActivitiesResponseAllOfAdditionalData } from './get-activities-response-all-of-additional-data'; +// May contain unused imports in some cases +// @ts-ignore +import { GetTasksResponseDataInner } from './get-tasks-response-data-inner'; + +/** +* +* @export +* @interface GetTasksResponse +*/ +export interface GetTasksResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {Array} + */ + 'data'?: Array; + /** + * + * @type {GetActivitiesResponseAllOfAdditionalData} + */ + 'additional_data'?: GetActivitiesResponseAllOfAdditionalData; +} + diff --git a/src/versions/v2/models/index.ts b/src/versions/v2/models/index.ts index 60ee28f4..6691172d 100644 --- a/src/versions/v2/models/index.ts +++ b/src/versions/v2/models/index.ts @@ -51,9 +51,20 @@ export * from './add-product-image-response'; export * from './add-product-request'; export * from './add-product-request-all-of'; export * from './add-product-variation-request'; +export * from './add-project-board-request'; +export * from './add-project-field200-response'; +export * from './add-project-field-request'; +export * from './add-project-field-request-important-fields'; +export * from './add-project-field-request-required-fields'; +export * from './add-project-field-request-ui-visibility'; +export * from './add-project-phase-request'; +export * from './add-project-request'; export * from './add-stage-request'; +export * from './add-task-request'; +export * from './add-task-response'; export * from './base-product'; 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'; @@ -92,8 +103,18 @@ export * from './delete-product-response'; export * from './delete-product-response-data'; export * from './delete-product-variation-response'; export * from './delete-product-variation-response-data'; +export * from './delete-project-board-response'; +export * from './delete-project-board-response-data'; +export * from './delete-project-field200-response'; +export * from './delete-project-field200-response-data'; +export * from './delete-project-phase-response'; +export * from './delete-project-phase-response-data'; +export * from './delete-project-response'; +export * from './delete-project-response-data'; export * from './delete-stage-response'; export * from './delete-stage-response-data'; +export * from './delete-task-response'; +export * from './delete-task-response-data'; export * from './follower-changelog-item'; export * from './follower-item'; export * from './get-activities-response'; @@ -195,7 +216,34 @@ export * from './get-product-variation-response'; export * from './get-product-variations-response'; export * from './get-product-variations-response-data-inner'; export * from './get-products-response'; +export * from './get-project-boards-response'; +export * from './get-project-boards-response-data-inner'; +export * from './get-project-changelog-response'; +export * from './get-project-changelog-response-data-inner'; +export * from './get-project-fields200-response'; +export * from './get-project-fields200-response-data-inner'; +export * from './get-project-fields200-response-data-inner-ui-visibility'; +export * from './get-project-permitted-users-response'; +export * from './get-project-phases-response'; +export * from './get-project-phases-response-data-inner'; +export * from './get-project-search-response'; +export * from './get-project-search-response-all-of'; +export * from './get-project-search-response-all-of-data'; +export * from './get-project-search-response-all-of-data-items-inner'; +export * from './get-project-search-response-all-of-data-items-inner-item'; +export * from './get-project-search-response-all-of-data-items-inner-item-deal'; +export * from './get-project-search-response-all-of-data-items-inner-item-organization'; +export * from './get-project-search-response-all-of-data-items-inner-item-owner'; +export * from './get-project-search-response-all-of-data-items-inner-item-person'; +export * from './get-project-search-response-all-of-data-items-inner-item-phase'; +export * from './get-project-template-response'; +export * from './get-project-templates-response'; +export * from './get-projects-response'; +export * from './get-projects-response-all-of'; export * from './get-stages-response'; +export * from './get-task-response'; +export * from './get-tasks-response'; +export * from './get-tasks-response-data-inner'; export * from './item-search-item'; export * from './lead-search-item'; export * from './lead-search-item-item'; @@ -204,8 +252,13 @@ export * from './lead-search-item-item-owner'; export * from './lead-search-item-item-person'; export * from './organization-item'; export * from './organization-item-address'; +export * from './person'; +export * from './person-im-inner'; +export * from './person-postal-address'; export * from './prices-array'; export * from './product-request'; +export * from './project'; +export * from './project-template'; export * from './stage-item'; export * from './stage-item1'; export * from './update-additional-discount-request-body'; @@ -229,7 +282,13 @@ export * from './update-product-request-all-of'; export * from './update-product-request-all-of1'; export * from './update-product-response'; export * from './update-product-variation-request'; +export * from './update-project-board-request'; +export * from './update-project-field-request'; +export * from './update-project-phase-request'; +export * from './update-project-request'; export * from './update-stage-request'; +export * from './update-task-request'; +export * from './update-task-response'; export * from './upsert-activity-response'; export * from './upsert-activity-response-data'; export * from './upsert-deal-response'; @@ -241,4 +300,8 @@ export * from './upsert-person-response-data'; export * from './upsert-pipeline-response'; export * from './upsert-pipeline-response-data'; export * from './upsert-pipeline-response-data-data'; +export * from './upsert-project-board-response'; +export * from './upsert-project-phase-response'; +export * from './upsert-project-response'; +export * from './upsert-project-response-all-of'; export * from './upsert-stage-response'; diff --git a/src/versions/v2/models/organization-item.ts b/src/versions/v2/models/organization-item.ts index ff253f45..5d468669 100644 --- a/src/versions/v2/models/organization-item.ts +++ b/src/versions/v2/models/organization-item.ts @@ -69,7 +69,7 @@ export interface OrganizationItem { */ 'label_ids'?: Array; /** - * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. * @type {{ [key: string]: any | undefined; }} */ 'custom_fields'?: { [key: string]: any | undefined; }; diff --git a/src/versions/v2/models/person-im-inner.ts b/src/versions/v2/models/person-im-inner.ts new file mode 100644 index 00000000..8ee43092 --- /dev/null +++ b/src/versions/v2/models/person-im-inner.ts @@ -0,0 +1,39 @@ +/* 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 PersonImInner +*/ +export interface PersonImInner { + /** + * The instant messaging account of the person + * @type {string} + */ + 'value'?: string; + /** + * Whether the instant messaging account is primary or not + * @type {boolean} + */ + 'primary'?: boolean; + /** + * The instant messaging account classification label + * @type {string} + */ + 'label'?: string; +} + diff --git a/src/versions/v2/models/person-postal-address.ts b/src/versions/v2/models/person-postal-address.ts new file mode 100644 index 00000000..d9d9892d --- /dev/null +++ b/src/versions/v2/models/person-postal-address.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. + */ + + + +/** +* Postal address of the person, included if contact sync is enabled for the company +* @export +* @interface PersonPostalAddress +*/ +export interface PersonPostalAddress { + /** + * The full address of the person + * @type {string} + */ + 'value'?: string; + /** + * Country of the person + * @type {string} + */ + 'country'?: string; + /** + * Admin area level 1 (e.g. state) of the person + * @type {string} + */ + 'admin_area_level_1'?: string; + /** + * Admin area level 2 (e.g. county) of the person + * @type {string} + */ + 'admin_area_level_2'?: string; + /** + * Locality (e.g. city) of the person + * @type {string} + */ + 'locality'?: string; + /** + * Sublocality (e.g. neighborhood) of the person + * @type {string} + */ + 'sublocality'?: string; + /** + * Route (e.g. street) of the person + * @type {string} + */ + 'route'?: string; + /** + * Street number of the person + * @type {string} + */ + 'street_number'?: string; + /** + * Subpremise (e.g. apartment/suite number) of the person + * @type {string} + */ + 'subpremise'?: string; + /** + * Postal code of the person + * @type {string} + */ + 'postal_code'?: string; +} + diff --git a/src/versions/v2/models/person.ts b/src/versions/v2/models/person.ts new file mode 100644 index 00000000..b17d2cef --- /dev/null +++ b/src/versions/v2/models/person.ts @@ -0,0 +1,136 @@ +/* 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 { AddPersonRequestEmailsInner } from './add-person-request-emails-inner'; +// May contain unused imports in some cases +// @ts-ignore +import { AddPersonRequestPhonesInner } from './add-person-request-phones-inner'; +// May contain unused imports in some cases +// @ts-ignore +import { PersonImInner } from './person-im-inner'; +// May contain unused imports in some cases +// @ts-ignore +import { PersonPostalAddress } from './person-postal-address'; + +/** +* +* @export +* @interface Person +*/ +export interface Person { + /** + * The ID of the person + * @type {number} + */ + 'id'?: number; + /** + * The name of the person + * @type {string} + */ + 'name'?: string; + /** + * The first name of the person + * @type {string} + */ + 'first_name'?: string; + /** + * The last name of the person + * @type {string} + */ + 'last_name'?: string; + /** + * The ID of the user who owns the person + * @type {number} + */ + 'owner_id'?: number; + /** + * The ID of the organization linked to the person + * @type {number} + */ + 'org_id'?: number; + /** + * The creation date and time of the person + * @type {string} + */ + 'add_time'?: string; + /** + * The last updated date and time of the person + * @type {string} + */ + 'update_time'?: string; + /** + * The emails of the person + * @type {Array} + */ + 'emails'?: Array; + /** + * The phones of the person + * @type {Array} + */ + 'phones'?: Array; + /** + * Whether the person is deleted or not + * @type {boolean} + */ + 'is_deleted'?: boolean; + /** + * The visibility of the person + * @type {number} + */ + 'visible_to'?: number; + /** + * The IDs of labels assigned to the person + * @type {Array} + */ + 'label_ids'?: Array; + /** + * The ID of the picture associated with the person + * @type {number} + */ + 'picture_id'?: number; + /** + * + * @type {PersonPostalAddress} + */ + 'postal_address'?: PersonPostalAddress; + /** + * Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company + * @type {string} + */ + 'notes'?: string; + /** + * The instant messaging accounts of the person, included if contact sync is enabled for the company + * @type {Array} + */ + 'im'?: Array; + /** + * The birthday of the person, included if contact sync is enabled for the company + * @type {string} + */ + 'birthday'?: string; + /** + * The job title of the person, included if contact sync is enabled for the company + * @type {string} + */ + 'job_title'?: string; + /** + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * @type {{ [key: string]: any | undefined; }} + */ + 'custom_fields'?: { [key: string]: any | undefined; }; +} + diff --git a/src/versions/v2/models/product-request.ts b/src/versions/v2/models/product-request.ts index 5883be58..dcd214a7 100644 --- a/src/versions/v2/models/product-request.ts +++ b/src/versions/v2/models/product-request.ts @@ -66,7 +66,7 @@ export interface ProductRequest { */ 'prices'?: Array; /** - * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. * @type {{ [key: string]: any | undefined; }} */ 'custom_fields'?: { [key: string]: any | undefined; }; diff --git a/src/versions/v2/models/project-template.ts b/src/versions/v2/models/project-template.ts new file mode 100644 index 00000000..0b69fe7d --- /dev/null +++ b/src/versions/v2/models/project-template.ts @@ -0,0 +1,59 @@ +/* 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 ProjectTemplate +*/ +export interface ProjectTemplate { + /** + * The ID of the project template + * @type {number} + */ + 'id'?: number; + /** + * The title of the project template + * @type {string} + */ + 'title'?: string; + /** + * The description of the project template + * @type {string} + */ + 'description'?: string; + /** + * The ID of the project board this template is associated with + * @type {number} + */ + 'projects_board_id'?: number; + /** + * The ID of the owner of the project template + * @type {number} + */ + 'owner_id'?: number; + /** + * The creation date and time of the project template in ISO 8601 format + * @type {string} + */ + 'add_time'?: string; + /** + * The update date and time of the project template in ISO 8601 format + * @type {string} + */ + 'update_time'?: string; +} + diff --git a/src/versions/v2/models/project.ts b/src/versions/v2/models/project.ts new file mode 100644 index 00000000..7ef4ad04 --- /dev/null +++ b/src/versions/v2/models/project.ts @@ -0,0 +1,119 @@ +/* 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 Project +*/ +export interface Project { + /** + * The ID of the project + * @type {number} + */ + 'id'?: number; + /** + * The title of the project + * @type {string} + */ + 'title'?: string; + /** + * The description of the project + * @type {string} + */ + 'description'?: string; + /** + * The status of the project + * @type {string} + */ + 'status'?: string; + /** + * The ID of the board this project is associated with + * @type {number} + */ + 'board_id'?: number; + /** + * The ID of the phase this project is associated with + * @type {number} + */ + 'phase_id'?: number; + /** + * The ID of the user who owns the project + * @type {number} + */ + 'owner_id'?: number; + /** + * The start date of the project. Format: YYYY-MM-DD + * @type {string} + */ + 'start_date'?: string; + /** + * The end date of the project. Format: YYYY-MM-DD + * @type {string} + */ + 'end_date'?: string; + /** + * An array of IDs of the deals this project is associated with + * @type {Array} + */ + 'deal_ids'?: Array; + /** + * An array of IDs of the persons this project is associated with + * @type {Array} + */ + 'person_ids'?: Array; + /** + * An array of IDs of the organizations this project is associated with + * @type {Array} + */ + 'org_ids'?: Array; + /** + * An array of IDs of the labels this project has + * @type {Array} + */ + 'label_ids'?: Array; + /** + * The health status of the project + * @type {string} + */ + 'health_status'?: string | null; + /** + * The creation date and time of the project in ISO 8601 format + * @type {string} + */ + 'add_time'?: string; + /** + * The last updated date and time of the project in ISO 8601 format + * @type {string} + */ + 'update_time'?: string; + /** + * The date and time of the last status change of the project in ISO 8601 format + * @type {string} + */ + 'status_change_time'?: string; + /** + * The date and time the project was archived in ISO 8601 format. If not archived, this field is null. + * @type {string} + */ + 'archive_time'?: string | null; + /** + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * @type {{ [key: string]: any | undefined; }} + */ + 'custom_fields'?: { [key: string]: any | undefined; }; +} + diff --git a/src/versions/v2/models/update-deal-request.ts b/src/versions/v2/models/update-deal-request.ts index 2e5545a0..f2251ac4 100644 --- a/src/versions/v2/models/update-deal-request.ts +++ b/src/versions/v2/models/update-deal-request.ts @@ -121,7 +121,7 @@ export interface UpdateDealRequest { */ 'label_ids'?: Array; /** - * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. * @type {{ [key: string]: any | undefined; }} */ 'custom_fields'?: { [key: string]: any | undefined; }; diff --git a/src/versions/v2/models/update-organization-field-request.ts b/src/versions/v2/models/update-organization-field-request.ts index d684ff93..6d4ccbf4 100644 --- a/src/versions/v2/models/update-organization-field-request.ts +++ b/src/versions/v2/models/update-organization-field-request.ts @@ -49,10 +49,5 @@ export interface UpdateOrganizationFieldRequest { * @type {AddOrganizationFieldRequestRequiredFields} */ 'required_fields'?: AddOrganizationFieldRequestRequiredFields; - /** - * Field description - * @type {string} - */ - 'description'?: string | null; } diff --git a/src/versions/v2/models/update-organization-request.ts b/src/versions/v2/models/update-organization-request.ts index 8348d688..4fd58e59 100644 --- a/src/versions/v2/models/update-organization-request.ts +++ b/src/versions/v2/models/update-organization-request.ts @@ -59,7 +59,7 @@ export interface UpdateOrganizationRequest { */ 'address'?: OrganizationItemAddress; /** - * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. * @type {{ [key: string]: any | undefined; }} */ 'custom_fields'?: { [key: string]: any | undefined; }; diff --git a/src/versions/v2/models/update-project-board-request.ts b/src/versions/v2/models/update-project-board-request.ts new file mode 100644 index 00000000..12650929 --- /dev/null +++ b/src/versions/v2/models/update-project-board-request.ts @@ -0,0 +1,34 @@ +/* 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 UpdateProjectBoardRequest +*/ +export interface UpdateProjectBoardRequest { + /** + * The name of the project board + * @type {string} + */ + 'name'?: string; + /** + * The order of the board. Must be between 1 and the total number of boards + 1. + * @type {number} + */ + 'order_nr'?: number; +} + diff --git a/src/versions/v2/models/update-project-field-request.ts b/src/versions/v2/models/update-project-field-request.ts new file mode 100644 index 00000000..7bb3e931 --- /dev/null +++ b/src/versions/v2/models/update-project-field-request.ts @@ -0,0 +1,53 @@ +/* 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 { AddProjectFieldRequestImportantFields } from './add-project-field-request-important-fields'; +// May contain unused imports in some cases +// @ts-ignore +import { AddProjectFieldRequestRequiredFields } from './add-project-field-request-required-fields'; +// May contain unused imports in some cases +// @ts-ignore +import { AddProjectFieldRequestUiVisibility } from './add-project-field-request-ui-visibility'; + +/** +* +* @export +* @interface UpdateProjectFieldRequest +*/ +export interface UpdateProjectFieldRequest { + /** + * Field name + * @type {string} + */ + 'field_name'?: string; + /** + * + * @type {AddProjectFieldRequestUiVisibility} + */ + 'ui_visibility'?: AddProjectFieldRequestUiVisibility; + /** + * + * @type {AddProjectFieldRequestImportantFields} + */ + 'important_fields'?: AddProjectFieldRequestImportantFields; + /** + * + * @type {AddProjectFieldRequestRequiredFields} + */ + 'required_fields'?: AddProjectFieldRequestRequiredFields; +} + diff --git a/src/versions/v2/models/update-project-phase-request.ts b/src/versions/v2/models/update-project-phase-request.ts new file mode 100644 index 00000000..b6728d85 --- /dev/null +++ b/src/versions/v2/models/update-project-phase-request.ts @@ -0,0 +1,39 @@ +/* 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 UpdateProjectPhaseRequest +*/ +export interface UpdateProjectPhaseRequest { + /** + * The name of the project phase + * @type {string} + */ + 'name'?: string; + /** + * The ID of the project board to add the phase to + * @type {number} + */ + 'board_id'?: number; + /** + * The order of the phase within its board. Must be between 1 and the total number of phases on the board + 1. + * @type {number} + */ + 'order_nr'?: number; +} + diff --git a/src/versions/v2/models/update-project-request.ts b/src/versions/v2/models/update-project-request.ts new file mode 100644 index 00000000..8490a53b --- /dev/null +++ b/src/versions/v2/models/update-project-request.ts @@ -0,0 +1,94 @@ +/* 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 UpdateProjectRequest +*/ +export interface UpdateProjectRequest { + /** + * The title of the project + * @type {string} + */ + 'title'?: string; + /** + * The description of the project + * @type {string} + */ + 'description'?: string; + /** + * The status of the project + * @type {string} + */ + 'status'?: string; + /** + * The ID of the board this project is associated with + * @type {number} + */ + 'board_id'?: number; + /** + * The ID of the phase this project is associated with + * @type {number} + */ + 'phase_id'?: number; + /** + * The ID of the user who owns the project + * @type {number} + */ + 'owner_id'?: number; + /** + * The start date of the project. Format: YYYY-MM-DD + * @type {string} + */ + 'start_date'?: string; + /** + * The end date of the project. Format: YYYY-MM-DD + * @type {string} + */ + 'end_date'?: string; + /** + * An array of IDs of the deals this project is associated with + * @type {Array} + */ + 'deal_ids'?: Array; + /** + * An array of IDs of the persons this project is associated with + * @type {Array} + */ + 'person_ids'?: Array; + /** + * An array of IDs of the organizations this project is associated with + * @type {Array} + */ + 'org_ids'?: Array; + /** + * An array of IDs of the labels this project has + * @type {Array} + */ + 'label_ids'?: Array; + /** + * The ID of the template the project will be based on. Only used when creating a new project. + * @type {number} + */ + 'template_id'?: number; + /** + * An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. + * @type {{ [key: string]: any | undefined; }} + */ + 'custom_fields'?: { [key: string]: any | undefined; }; +} + diff --git a/src/versions/v2/models/update-task-request.ts b/src/versions/v2/models/update-task-request.ts new file mode 100644 index 00000000..12f90d89 --- /dev/null +++ b/src/versions/v2/models/update-task-request.ts @@ -0,0 +1,93 @@ +/* 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 UpdateTaskRequest +*/ +export interface UpdateTaskRequest { + /** + * The title of the task + * @type {string} + */ + 'title'?: string; + /** + * The ID of the project this task is associated with + * @type {number} + */ + 'project_id'?: number; + /** + * The ID of the parent task. Cannot be the ID of a task that is already a subtask. + * @type {number} + */ + 'parent_task_id'?: number | null; + /** + * The description of the task + * @type {string} + */ + 'description'?: string | null; + /** + * Whether the task is done or not. `0` = Not done, `1` = Done. + * @type {number} + */ + 'done'?: UpdateTaskRequestDoneConst; + /** + * Whether the task is a milestone or not. `0` = Not a milestone, `1` = Milestone. + * @type {number} + */ + 'milestone'?: UpdateTaskRequestMilestoneConst; + /** + * The due date of the task. Format: YYYY-MM-DD. + * @type {string} + */ + 'due_date'?: string | null; + /** + * The start date of the task. Format: YYYY-MM-DD. + * @type {string} + */ + 'start_date'?: string | null; + /** + * The ID of the user assigned to the task. When set, the `assignee_ids` field will be overwritten with this value. + * @type {number} + */ + 'assignee_id'?: number | null; + /** + * The IDs of users assigned to the task. When set, the `assignee_id` field will be set to the first value in this array, or `null` if empty. + * @type {Array} + */ + 'assignee_ids'?: Array; + /** + * The priority of the task + * @type {number} + */ + 'priority'?: number | null; +} + + export const UpdateTaskRequestDoneConst = { + NUMBER_0: 0, + NUMBER_1: 1 + } as const; + + export type UpdateTaskRequestDoneConst = typeof UpdateTaskRequestDoneConst[keyof typeof UpdateTaskRequestDoneConst]; + export const UpdateTaskRequestMilestoneConst = { + NUMBER_0: 0, + NUMBER_1: 1 + } as const; + + export type UpdateTaskRequestMilestoneConst = typeof UpdateTaskRequestMilestoneConst[keyof typeof UpdateTaskRequestMilestoneConst]; + + diff --git a/src/versions/v2/models/update-task-response.ts b/src/versions/v2/models/update-task-response.ts new file mode 100644 index 00000000..2f749444 --- /dev/null +++ b/src/versions/v2/models/update-task-response.ts @@ -0,0 +1,42 @@ +/* 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 { GetTasksResponseDataInner } from './get-tasks-response-data-inner'; + +/** +* +* @export +* @interface UpdateTaskResponse +*/ +export interface UpdateTaskResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {GetTasksResponseDataInner} + */ + 'data'?: GetTasksResponseDataInner; + /** + * + * @type {object} + */ + 'additional_data'?: object | null; +} + diff --git a/src/versions/v2/models/upsert-person-response-data.ts b/src/versions/v2/models/upsert-person-response-data.ts index 3ad5cac2..aa1570ee 100644 --- a/src/versions/v2/models/upsert-person-response-data.ts +++ b/src/versions/v2/models/upsert-person-response-data.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import { OrganizationItem } from './organization-item'; +import { Person } from './person'; /** * @@ -25,8 +25,8 @@ import { OrganizationItem } from './organization-item'; export interface UpsertPersonResponseData { /** * - * @type {OrganizationItem} + * @type {Person} */ - 'data'?: OrganizationItem; + 'data'?: Person; } diff --git a/src/versions/v2/models/upsert-person-response.ts b/src/versions/v2/models/upsert-person-response.ts index 0da43731..7d4d3c19 100644 --- a/src/versions/v2/models/upsert-person-response.ts +++ b/src/versions/v2/models/upsert-person-response.ts @@ -18,7 +18,7 @@ import { BaseResponse } from './base-response'; // May contain unused imports in some cases // @ts-ignore -import { OrganizationItem } from './organization-item'; +import { Person } from './person'; // May contain unused imports in some cases // @ts-ignore import { UpsertPersonResponseData } from './upsert-person-response-data'; diff --git a/src/versions/v2/models/upsert-project-board-response.ts b/src/versions/v2/models/upsert-project-board-response.ts new file mode 100644 index 00000000..ea081887 --- /dev/null +++ b/src/versions/v2/models/upsert-project-board-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 { GetProjectBoardsResponseDataInner } from './get-project-boards-response-data-inner'; + +/** +* +* @export +* @interface UpsertProjectBoardResponse +*/ +export interface UpsertProjectBoardResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {GetProjectBoardsResponseDataInner} + */ + 'data'?: GetProjectBoardsResponseDataInner; +} + diff --git a/src/versions/v2/models/upsert-project-phase-response.ts b/src/versions/v2/models/upsert-project-phase-response.ts new file mode 100644 index 00000000..446a80cb --- /dev/null +++ b/src/versions/v2/models/upsert-project-phase-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 { GetProjectPhasesResponseDataInner } from './get-project-phases-response-data-inner'; + +/** +* +* @export +* @interface UpsertProjectPhaseResponse +*/ +export interface UpsertProjectPhaseResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {GetProjectPhasesResponseDataInner} + */ + 'data'?: GetProjectPhasesResponseDataInner; +} + diff --git a/src/versions/v2/models/upsert-project-response-all-of.ts b/src/versions/v2/models/upsert-project-response-all-of.ts new file mode 100644 index 00000000..33fbbbc7 --- /dev/null +++ b/src/versions/v2/models/upsert-project-response-all-of.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 { Project } from './project'; + +/** +* +* @export +* @interface UpsertProjectResponseAllOf +*/ +export interface UpsertProjectResponseAllOf { + /** + * + * @type {Project} + */ + 'data'?: Project; +} + diff --git a/src/versions/v2/models/upsert-project-response.ts b/src/versions/v2/models/upsert-project-response.ts new file mode 100644 index 00000000..3e07bcb1 --- /dev/null +++ b/src/versions/v2/models/upsert-project-response.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 { BaseResponse } from './base-response'; +// May contain unused imports in some cases +// @ts-ignore +import { Project } from './project'; +// May contain unused imports in some cases +// @ts-ignore +import { UpsertProjectResponseAllOf } from './upsert-project-response-all-of'; + +/** + * @type UpsertProjectResponse + * @export + */ +export type UpsertProjectResponse = BaseResponse & UpsertProjectResponseAllOf; + +