diff --git a/CHANGELOG.md b/CHANGELOG.md index d945c4a8..89c7771b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ 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 +- Every API method now has a `WithHttpInfo` variant (e.g. `getDealWithHttpInfo`) that resolves with `{ data, status, headers }`, so the HTTP status and response headers, such as rate limit headers, can be read. The existing methods are unchanged and still return only the response body. +- When a `WithHttpInfo` call fails, the rejected error keeps its usual fields and also carries `$response: { status, headers }`, so headers on error responses (e.g. `Retry-After` on a 429) are available too. +- Exported the `ApiResponse` type for typing these results. +Example usage, if you want to include it: +```typescript +const { data, status, headers } = await api.getDealWithHttpInfo({ id: 1 }); +console.log(headers['x-ratelimit-remaining']); +``` ## [36.0.1] - 2026-10-13 ### Fixed diff --git a/src/versions/v1/api/activity-fields-api.ts b/src/versions/v1/api/activity-fields-api.ts index 008d5337..3933e7f3 100644 --- a/src/versions/v1/api/activity-fields-api.ts +++ b/src/versions/v1/api/activity-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetFieldsResponse } from '../models'; /** @@ -87,6 +87,16 @@ export const ActivityFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityFields(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getActivityFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all activity fields + + * @throws {RequiredError} + */ + async getActivityFieldsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityFields(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -106,6 +116,9 @@ export const ActivityFieldsApiFactory = function (configuration?: Configuration, getActivityFields(): Promise { return localVarFp.getActivityFields().then((request) => request(axios, basePath)); }, + getActivityFieldsWithHttpInfo(): Promise> { + return localVarFp.getActivityFieldsWithHttpInfo().then((request) => request(axios, basePath)); + }, }; }; @@ -126,4 +139,15 @@ export class ActivityFieldsApi extends BaseAPI { public getActivityFields() { return ActivityFieldsApiFp(this.configuration).getActivityFields().then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getActivityFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof ActivityFieldsApi + */ + public getActivityFieldsWithHttpInfo() { + return ActivityFieldsApiFp(this.configuration).getActivityFieldsWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/activity-types-api.ts b/src/versions/v1/api/activity-types-api.ts index dd1f7614..f7c08539 100644 --- a/src/versions/v1/api/activity-types-api.ts +++ b/src/versions/v1/api/activity-types-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddActivityTypeRequest } from '../models'; // @ts-ignore @@ -221,6 +221,17 @@ export const ActivityTypesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addActivityType(AddActivityTypeRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addActivityType`, but resolves with the response body together with the HTTP status and headers. + * @summary Add new activity type + * @param {AddActivityTypeRequest} [AddActivityTypeRequest] + + * @throws {RequiredError} + */ + async addActivityTypeWithHttpInfo(AddActivityTypeRequest?: AddActivityTypeRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addActivityType(AddActivityTypeRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks an activity type as deleted. * @summary Delete an activity type @@ -232,6 +243,17 @@ export const ActivityTypesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteActivityType(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteActivityType`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete an activity type + * @param {number} id The ID of the activity type + + * @throws {RequiredError} + */ + async deleteActivityTypeWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteActivityType(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all activity types. * @summary Get all activity types @@ -242,6 +264,16 @@ export const ActivityTypesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityTypes(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getActivityTypes`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all activity types + + * @throws {RequiredError} + */ + async getActivityTypesWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityTypes(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates an activity type. * @summary Update an activity type @@ -254,6 +286,18 @@ export const ActivityTypesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateActivityType(id, UpdateActivityTypeRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateActivityType`, but resolves with the response body together with the HTTP status and headers. + * @summary Update an activity type + * @param {number} id The ID of the activity type + * @param {UpdateActivityTypeRequest} [UpdateActivityTypeRequest] + + * @throws {RequiredError} + */ + async updateActivityTypeWithHttpInfo(id: number, UpdateActivityTypeRequest?: UpdateActivityTypeRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateActivityType(id, UpdateActivityTypeRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -274,6 +318,9 @@ export const ActivityTypesApiFactory = function (configuration?: Configuration, addActivityType(requestParameters: ActivityTypesApiAddActivityTypeRequest = {}, ): Promise { return localVarFp.addActivityType(requestParameters.AddActivityTypeRequest, ).then((request) => request(axios, basePath)); }, + addActivityTypeWithHttpInfo(requestParameters: ActivityTypesApiAddActivityTypeRequest = {}, ): Promise> { + return localVarFp.addActivityTypeWithHttpInfo(requestParameters.AddActivityTypeRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks an activity type as deleted. * @summary Delete an activity type @@ -284,6 +331,9 @@ export const ActivityTypesApiFactory = function (configuration?: Configuration, deleteActivityType(requestParameters: ActivityTypesApiDeleteActivityTypeRequest, ): Promise { return localVarFp.deleteActivityType(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteActivityTypeWithHttpInfo(requestParameters: ActivityTypesApiDeleteActivityTypeRequest, ): Promise> { + return localVarFp.deleteActivityTypeWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all activity types. * @summary Get all activity types @@ -293,6 +343,9 @@ export const ActivityTypesApiFactory = function (configuration?: Configuration, getActivityTypes(): Promise { return localVarFp.getActivityTypes().then((request) => request(axios, basePath)); }, + getActivityTypesWithHttpInfo(): Promise> { + return localVarFp.getActivityTypesWithHttpInfo().then((request) => request(axios, basePath)); + }, /** * Updates an activity type. * @summary Update an activity type @@ -303,6 +356,9 @@ export const ActivityTypesApiFactory = function (configuration?: Configuration, updateActivityType(requestParameters: ActivityTypesApiUpdateActivityTypeRequest, ): Promise { return localVarFp.updateActivityType(requestParameters.id, requestParameters.UpdateActivityTypeRequest, ).then((request) => request(axios, basePath)); }, + updateActivityTypeWithHttpInfo(requestParameters: ActivityTypesApiUpdateActivityTypeRequest, ): Promise> { + return localVarFp.updateActivityTypeWithHttpInfo(requestParameters.id, requestParameters.UpdateActivityTypeRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -374,6 +430,18 @@ export class ActivityTypesApi extends BaseAPI { return ActivityTypesApiFp(this.configuration).addActivityType(requestParameters.AddActivityTypeRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addActivityType`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivityTypesApiAddActivityTypeRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivityTypesApi + */ + public addActivityTypeWithHttpInfo(requestParameters: ActivityTypesApiAddActivityTypeRequest = {}, ) { + return ActivityTypesApiFp(this.configuration).addActivityTypeWithHttpInfo(requestParameters.AddActivityTypeRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks an activity type as deleted. * @summary Delete an activity type @@ -386,6 +454,18 @@ export class ActivityTypesApi extends BaseAPI { return ActivityTypesApiFp(this.configuration).deleteActivityType(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteActivityType`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivityTypesApiDeleteActivityTypeRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivityTypesApi + */ + public deleteActivityTypeWithHttpInfo(requestParameters: ActivityTypesApiDeleteActivityTypeRequest, ) { + return ActivityTypesApiFp(this.configuration).deleteActivityTypeWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all activity types. * @summary Get all activity types @@ -397,6 +477,17 @@ export class ActivityTypesApi extends BaseAPI { return ActivityTypesApiFp(this.configuration).getActivityTypes().then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getActivityTypes`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof ActivityTypesApi + */ + public getActivityTypesWithHttpInfo() { + return ActivityTypesApiFp(this.configuration).getActivityTypesWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } + /** * Updates an activity type. * @summary Update an activity type @@ -408,4 +499,16 @@ export class ActivityTypesApi extends BaseAPI { public updateActivityType(requestParameters: ActivityTypesApiUpdateActivityTypeRequest, ) { return ActivityTypesApiFp(this.configuration).updateActivityType(requestParameters.id, requestParameters.UpdateActivityTypeRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateActivityType`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivityTypesApiUpdateActivityTypeRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivityTypesApi + */ + public updateActivityTypeWithHttpInfo(requestParameters: ActivityTypesApiUpdateActivityTypeRequest, ) { + return ActivityTypesApiFp(this.configuration).updateActivityTypeWithHttpInfo(requestParameters.id, requestParameters.UpdateActivityTypeRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/billing-api.ts b/src/versions/v1/api/billing-api.ts index 38f602fd..61af6e26 100644 --- a/src/versions/v1/api/billing-api.ts +++ b/src/versions/v1/api/billing-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetSubscriptionAddonsResponse } from '../models'; /** @@ -87,6 +87,16 @@ export const BillingApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getCompanyAddons(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getCompanyAddons`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all add-ons for a single company + + * @throws {RequiredError} + */ + async getCompanyAddonsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCompanyAddons(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -106,6 +116,9 @@ export const BillingApiFactory = function (configuration?: Configuration, basePa getCompanyAddons(): Promise { return localVarFp.getCompanyAddons().then((request) => request(axios, basePath)); }, + getCompanyAddonsWithHttpInfo(): Promise> { + return localVarFp.getCompanyAddonsWithHttpInfo().then((request) => request(axios, basePath)); + }, }; }; @@ -126,4 +139,15 @@ export class BillingApi extends BaseAPI { public getCompanyAddons() { return BillingApiFp(this.configuration).getCompanyAddons().then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getCompanyAddons`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof BillingApi + */ + public getCompanyAddonsWithHttpInfo() { + return BillingApiFp(this.configuration).getCompanyAddonsWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/call-logs-api.ts b/src/versions/v1/api/call-logs-api.ts index 774d9504..653f476b 100644 --- a/src/versions/v1/api/call-logs-api.ts +++ b/src/versions/v1/api/call-logs-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddCallLogRequest } from '../models'; // @ts-ignore @@ -291,6 +291,17 @@ export const CallLogsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addCallLog(AddCallLogRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addCallLog`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a call log + * @param {AddCallLogRequest} [AddCallLogRequest] + + * @throws {RequiredError} + */ + async addCallLogWithHttpInfo(AddCallLogRequest?: AddCallLogRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addCallLog(AddCallLogRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds an audio recording to the call log. That audio can be played by those who have access to the call log object. * @summary Attach an audio file to the call log @@ -303,6 +314,18 @@ export const CallLogsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addCallLogAudioFile(id, file, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addCallLogAudioFile`, but resolves with the response body together with the HTTP status and headers. + * @summary Attach an audio file to the call log + * @param {string} id The ID received when you create the call log + * @param {File} file Audio file supported by the HTML5 specification + + * @throws {RequiredError} + */ + async addCallLogAudioFileWithHttpInfo(id: string, file: File, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addCallLogAudioFile(id, file, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities. * @summary Delete a call log @@ -314,6 +337,17 @@ export const CallLogsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCallLog(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteCallLog`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a call log + * @param {string} id The ID received when you create the call log + + * @throws {RequiredError} + */ + async deleteCallLogWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCallLog(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns details of a specific call log. * @summary Get details of a call log @@ -325,6 +359,17 @@ export const CallLogsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getCallLog(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getCallLog`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a call log + * @param {string} id The ID received when you create the call log + + * @throws {RequiredError} + */ + async getCallLogWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCallLog(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all call logs assigned to a particular user. * @summary Get all call logs assigned to a particular user @@ -337,6 +382,18 @@ export const CallLogsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserCallLogs(start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserCallLogs`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all call logs assigned to a particular user + * @param {number} [start] Pagination start + * @param {number} [limit] For pagination, the limit of entries to be returned. The upper limit is 50. + + * @throws {RequiredError} + */ + async getUserCallLogsWithHttpInfo(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserCallLogs(start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -357,6 +414,9 @@ export const CallLogsApiFactory = function (configuration?: Configuration, baseP addCallLog(requestParameters: CallLogsApiAddCallLogRequest = {}, ): Promise { return localVarFp.addCallLog(requestParameters.AddCallLogRequest, ).then((request) => request(axios, basePath)); }, + addCallLogWithHttpInfo(requestParameters: CallLogsApiAddCallLogRequest = {}, ): Promise> { + return localVarFp.addCallLogWithHttpInfo(requestParameters.AddCallLogRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds an audio recording to the call log. That audio can be played by those who have access to the call log object. * @summary Attach an audio file to the call log @@ -367,6 +427,9 @@ export const CallLogsApiFactory = function (configuration?: Configuration, baseP addCallLogAudioFile(requestParameters: CallLogsApiAddCallLogAudioFileRequest, ): Promise { return localVarFp.addCallLogAudioFile(requestParameters.id, requestParameters.file, ).then((request) => request(axios, basePath)); }, + addCallLogAudioFileWithHttpInfo(requestParameters: CallLogsApiAddCallLogAudioFileRequest, ): Promise> { + return localVarFp.addCallLogAudioFileWithHttpInfo(requestParameters.id, requestParameters.file, ).then((request) => request(axios, basePath)); + }, /** * Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities. * @summary Delete a call log @@ -377,6 +440,9 @@ export const CallLogsApiFactory = function (configuration?: Configuration, baseP deleteCallLog(requestParameters: CallLogsApiDeleteCallLogRequest, ): Promise { return localVarFp.deleteCallLog(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteCallLogWithHttpInfo(requestParameters: CallLogsApiDeleteCallLogRequest, ): Promise> { + return localVarFp.deleteCallLogWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns details of a specific call log. * @summary Get details of a call log @@ -387,6 +453,9 @@ export const CallLogsApiFactory = function (configuration?: Configuration, baseP getCallLog(requestParameters: CallLogsApiGetCallLogRequest, ): Promise { return localVarFp.getCallLog(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getCallLogWithHttpInfo(requestParameters: CallLogsApiGetCallLogRequest, ): Promise> { + return localVarFp.getCallLogWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all call logs assigned to a particular user. * @summary Get all call logs assigned to a particular user @@ -397,6 +466,9 @@ export const CallLogsApiFactory = function (configuration?: Configuration, baseP getUserCallLogs(requestParameters: CallLogsApiGetUserCallLogsRequest = {}, ): Promise { return localVarFp.getUserCallLogs(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getUserCallLogsWithHttpInfo(requestParameters: CallLogsApiGetUserCallLogsRequest = {}, ): Promise> { + return localVarFp.getUserCallLogsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, }; }; @@ -503,6 +575,18 @@ export class CallLogsApi extends BaseAPI { return CallLogsApiFp(this.configuration).addCallLog(requestParameters.AddCallLogRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addCallLog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {CallLogsApiAddCallLogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof CallLogsApi + */ + public addCallLogWithHttpInfo(requestParameters: CallLogsApiAddCallLogRequest = {}, ) { + return CallLogsApiFp(this.configuration).addCallLogWithHttpInfo(requestParameters.AddCallLogRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds an audio recording to the call log. That audio can be played by those who have access to the call log object. * @summary Attach an audio file to the call log @@ -515,6 +599,18 @@ export class CallLogsApi extends BaseAPI { return CallLogsApiFp(this.configuration).addCallLogAudioFile(requestParameters.id, requestParameters.file, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addCallLogAudioFile`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {CallLogsApiAddCallLogAudioFileRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof CallLogsApi + */ + public addCallLogAudioFileWithHttpInfo(requestParameters: CallLogsApiAddCallLogAudioFileRequest, ) { + return CallLogsApiFp(this.configuration).addCallLogAudioFileWithHttpInfo(requestParameters.id, requestParameters.file, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities. * @summary Delete a call log @@ -527,6 +623,18 @@ export class CallLogsApi extends BaseAPI { return CallLogsApiFp(this.configuration).deleteCallLog(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteCallLog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {CallLogsApiDeleteCallLogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof CallLogsApi + */ + public deleteCallLogWithHttpInfo(requestParameters: CallLogsApiDeleteCallLogRequest, ) { + return CallLogsApiFp(this.configuration).deleteCallLogWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns details of a specific call log. * @summary Get details of a call log @@ -539,6 +647,18 @@ export class CallLogsApi extends BaseAPI { return CallLogsApiFp(this.configuration).getCallLog(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getCallLog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {CallLogsApiGetCallLogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof CallLogsApi + */ + public getCallLogWithHttpInfo(requestParameters: CallLogsApiGetCallLogRequest, ) { + return CallLogsApiFp(this.configuration).getCallLogWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all call logs assigned to a particular user. * @summary Get all call logs assigned to a particular user @@ -550,4 +670,16 @@ export class CallLogsApi extends BaseAPI { public getUserCallLogs(requestParameters: CallLogsApiGetUserCallLogsRequest = {}, ) { return CallLogsApiFp(this.configuration).getUserCallLogs(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getUserCallLogs`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {CallLogsApiGetUserCallLogsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof CallLogsApi + */ + public getUserCallLogsWithHttpInfo(requestParameters: CallLogsApiGetUserCallLogsRequest = {}, ) { + return CallLogsApiFp(this.configuration).getUserCallLogsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/channels-api.ts b/src/versions/v1/api/channels-api.ts index ea4ace8f..3e46d6a2 100644 --- a/src/versions/v1/api/channels-api.ts +++ b/src/versions/v1/api/channels-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddChannelBadRequestResponse } from '../models'; // @ts-ignore @@ -237,6 +237,17 @@ export const ChannelsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addChannel(AddChannelRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addChannel`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a channel + * @param {AddChannelRequest} [AddChannelRequest] + * @deprecated + * @throws {RequiredError} + */ + async addChannelWithHttpInfo(AddChannelRequest?: AddChannelRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addChannel(AddChannelRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes an existing messenger’s channel and all related entities (conversations and messages). To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Delete a channel @@ -248,6 +259,17 @@ export const ChannelsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteChannel(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteChannel`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a channel + * @param {string} id The ID of the channel provided by the integration + * @deprecated + * @throws {RequiredError} + */ + async deleteChannelWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteChannel(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes an existing conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Delete a conversation @@ -260,6 +282,18 @@ export const ChannelsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteConversation(channel_id, conversation_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteConversation`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a conversation + * @param {string} channel_id The ID of the channel provided by the integration + * @param {string} conversation_id The ID of the conversation provided by the integration + * @deprecated + * @throws {RequiredError} + */ + async deleteConversationWithHttpInfo(channel_id: string, conversation_id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteConversation(channel_id, conversation_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a message to a conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Receives an incoming message @@ -271,6 +305,17 @@ export const ChannelsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.receiveMessage(ReceiveMessageRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `receiveMessage`, but resolves with the response body together with the HTTP status and headers. + * @summary Receives an incoming message + * @param {ReceiveMessageRequest} [ReceiveMessageRequest] + * @deprecated + * @throws {RequiredError} + */ + async receiveMessageWithHttpInfo(ReceiveMessageRequest?: ReceiveMessageRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.receiveMessage(ReceiveMessageRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -291,6 +336,9 @@ export const ChannelsApiFactory = function (configuration?: Configuration, baseP addChannel(requestParameters: ChannelsApiAddChannelRequest = {}, ): Promise { return localVarFp.addChannel(requestParameters.AddChannelRequest, ).then((request) => request(axios, basePath)); }, + addChannelWithHttpInfo(requestParameters: ChannelsApiAddChannelRequest = {}, ): Promise> { + return localVarFp.addChannelWithHttpInfo(requestParameters.AddChannelRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes an existing messenger’s channel and all related entities (conversations and messages). To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Delete a channel @@ -301,6 +349,9 @@ export const ChannelsApiFactory = function (configuration?: Configuration, baseP deleteChannel(requestParameters: ChannelsApiDeleteChannelRequest, ): Promise { return localVarFp.deleteChannel(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteChannelWithHttpInfo(requestParameters: ChannelsApiDeleteChannelRequest, ): Promise> { + return localVarFp.deleteChannelWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Deletes an existing conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Delete a conversation @@ -311,6 +362,9 @@ export const ChannelsApiFactory = function (configuration?: Configuration, baseP deleteConversation(requestParameters: ChannelsApiDeleteConversationRequest, ): Promise { return localVarFp.deleteConversation(requestParameters.channel_id, requestParameters.conversation_id, ).then((request) => request(axios, basePath)); }, + deleteConversationWithHttpInfo(requestParameters: ChannelsApiDeleteConversationRequest, ): Promise> { + return localVarFp.deleteConversationWithHttpInfo(requestParameters.channel_id, requestParameters.conversation_id, ).then((request) => request(axios, basePath)); + }, /** * Adds a message to a conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Receives an incoming message @@ -321,6 +375,9 @@ export const ChannelsApiFactory = function (configuration?: Configuration, baseP receiveMessage(requestParameters: ChannelsApiReceiveMessageRequest = {}, ): Promise { return localVarFp.receiveMessage(requestParameters.ReceiveMessageRequest, ).then((request) => request(axios, basePath)); }, + receiveMessageWithHttpInfo(requestParameters: ChannelsApiReceiveMessageRequest = {}, ): Promise> { + return localVarFp.receiveMessageWithHttpInfo(requestParameters.ReceiveMessageRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -406,6 +463,18 @@ export class ChannelsApi extends BaseAPI { return ChannelsApiFp(this.configuration).addChannel(requestParameters.AddChannelRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addChannel`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ChannelsApiAddChannelRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof ChannelsApi + */ + public addChannelWithHttpInfo(requestParameters: ChannelsApiAddChannelRequest = {}, ) { + return ChannelsApiFp(this.configuration).addChannelWithHttpInfo(requestParameters.AddChannelRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes an existing messenger’s channel and all related entities (conversations and messages). To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Delete a channel @@ -418,6 +487,18 @@ export class ChannelsApi extends BaseAPI { return ChannelsApiFp(this.configuration).deleteChannel(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteChannel`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ChannelsApiDeleteChannelRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof ChannelsApi + */ + public deleteChannelWithHttpInfo(requestParameters: ChannelsApiDeleteChannelRequest, ) { + return ChannelsApiFp(this.configuration).deleteChannelWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes an existing conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Delete a conversation @@ -430,6 +511,18 @@ export class ChannelsApi extends BaseAPI { return ChannelsApiFp(this.configuration).deleteConversation(requestParameters.channel_id, requestParameters.conversation_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteConversation`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ChannelsApiDeleteConversationRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof ChannelsApi + */ + public deleteConversationWithHttpInfo(requestParameters: ChannelsApiDeleteConversationRequest, ) { + return ChannelsApiFp(this.configuration).deleteConversationWithHttpInfo(requestParameters.channel_id, requestParameters.conversation_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a message to a conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). * @summary Receives an incoming message @@ -441,4 +534,16 @@ export class ChannelsApi extends BaseAPI { public receiveMessage(requestParameters: ChannelsApiReceiveMessageRequest = {}, ) { return ChannelsApiFp(this.configuration).receiveMessage(requestParameters.ReceiveMessageRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `receiveMessage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ChannelsApiReceiveMessageRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof ChannelsApi + */ + public receiveMessageWithHttpInfo(requestParameters: ChannelsApiReceiveMessageRequest = {}, ) { + return ChannelsApiFp(this.configuration).receiveMessageWithHttpInfo(requestParameters.ReceiveMessageRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/currencies-api.ts b/src/versions/v1/api/currencies-api.ts index 426ea1b2..3ee0728f 100644 --- a/src/versions/v1/api/currencies-api.ts +++ b/src/versions/v1/api/currencies-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetCurrenciesResponse } from '../models'; /** @@ -93,6 +93,17 @@ export const CurrenciesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getCurrencies(term, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getCurrencies`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all supported currencies + * @param {string} [term] Optional search term that is searched for from currency\'s name and/or code + + * @throws {RequiredError} + */ + async getCurrenciesWithHttpInfo(term?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCurrencies(term, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -113,6 +124,9 @@ export const CurrenciesApiFactory = function (configuration?: Configuration, bas getCurrencies(requestParameters: CurrenciesApiGetCurrenciesRequest = {}, ): Promise { return localVarFp.getCurrencies(requestParameters.term, ).then((request) => request(axios, basePath)); }, + getCurrenciesWithHttpInfo(requestParameters: CurrenciesApiGetCurrenciesRequest = {}, ): Promise> { + return localVarFp.getCurrenciesWithHttpInfo(requestParameters.term, ).then((request) => request(axios, basePath)); + }, }; }; @@ -148,4 +162,16 @@ export class CurrenciesApi extends BaseAPI { public getCurrencies(requestParameters: CurrenciesApiGetCurrenciesRequest = {}, ) { return CurrenciesApiFp(this.configuration).getCurrencies(requestParameters.term, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getCurrencies`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {CurrenciesApiGetCurrenciesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof CurrenciesApi + */ + public getCurrenciesWithHttpInfo(requestParameters: CurrenciesApiGetCurrenciesRequest = {}, ) { + return CurrenciesApiFp(this.configuration).getCurrenciesWithHttpInfo(requestParameters.term, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/deal-fields-api.ts b/src/versions/v1/api/deal-fields-api.ts index 7b053c55..22b22b89 100644 --- a/src/versions/v1/api/deal-fields-api.ts +++ b/src/versions/v1/api/deal-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { CreateFieldRequest } from '../models'; // @ts-ignore @@ -320,6 +320,17 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealField(CreateFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addDealField`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new deal field + * @param {CreateFieldRequest} [CreateFieldRequest] + + * @throws {RequiredError} + */ + async addDealFieldWithHttpInfo(CreateFieldRequest?: CreateFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addDealField(CreateFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a deal field @@ -331,6 +342,17 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealField(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDealField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a deal field + * @param {number} id The ID of the field + + * @throws {RequiredError} + */ + async deleteDealFieldWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealField(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks multiple deal fields as deleted. * @summary Delete multiple deal fields in bulk @@ -342,6 +364,17 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFields(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDealFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete multiple deal fields in bulk + * @param {Set} ids The comma-separated field IDs to delete + + * @throws {RequiredError} + */ + async deleteDealFieldsWithHttpInfo(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFields(ids, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific deal field. * @summary Get one deal field @@ -353,6 +386,17 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealField(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one deal field + * @param {number} id The ID of the field + + * @throws {RequiredError} + */ + async getDealFieldWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealField(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all deal fields. * @summary Get all deal fields @@ -365,6 +409,18 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFields(start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all deal fields + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getDealFieldsWithHttpInfo(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFields(start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a deal field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a deal field @@ -377,6 +433,18 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateDealField(id, UpdateFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateDealField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a deal field + * @param {number} id The ID of the field + * @param {UpdateFieldRequest} [UpdateFieldRequest] + + * @throws {RequiredError} + */ + async updateDealFieldWithHttpInfo(id: number, UpdateFieldRequest?: UpdateFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateDealField(id, UpdateFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -397,6 +465,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas addDealField(requestParameters: DealFieldsApiAddDealFieldRequest = {}, ): Promise { return localVarFp.addDealField(requestParameters.CreateFieldRequest, ).then((request) => request(axios, basePath)); }, + addDealFieldWithHttpInfo(requestParameters: DealFieldsApiAddDealFieldRequest = {}, ): Promise> { + return localVarFp.addDealFieldWithHttpInfo(requestParameters.CreateFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a deal field @@ -407,6 +478,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas deleteDealField(requestParameters: DealFieldsApiDeleteDealFieldRequest, ): Promise { return localVarFp.deleteDealField(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteDealFieldWithHttpInfo(requestParameters: DealFieldsApiDeleteDealFieldRequest, ): Promise> { + return localVarFp.deleteDealFieldWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Marks multiple deal fields as deleted. * @summary Delete multiple deal fields in bulk @@ -417,6 +491,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas deleteDealFields(requestParameters: DealFieldsApiDeleteDealFieldsRequest, ): Promise { return localVarFp.deleteDealFields(requestParameters.ids, ).then((request) => request(axios, basePath)); }, + deleteDealFieldsWithHttpInfo(requestParameters: DealFieldsApiDeleteDealFieldsRequest, ): Promise> { + return localVarFp.deleteDealFieldsWithHttpInfo(requestParameters.ids, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific deal field. * @summary Get one deal field @@ -427,6 +504,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas getDealField(requestParameters: DealFieldsApiGetDealFieldRequest, ): Promise { return localVarFp.getDealField(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getDealFieldWithHttpInfo(requestParameters: DealFieldsApiGetDealFieldRequest, ): Promise> { + return localVarFp.getDealFieldWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all deal fields. * @summary Get all deal fields @@ -437,6 +517,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas getDealFields(requestParameters: DealFieldsApiGetDealFieldsRequest = {}, ): Promise { return localVarFp.getDealFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getDealFieldsWithHttpInfo(requestParameters: DealFieldsApiGetDealFieldsRequest = {}, ): Promise> { + return localVarFp.getDealFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Updates a deal field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a deal field @@ -447,6 +530,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas updateDealField(requestParameters: DealFieldsApiUpdateDealFieldRequest, ): Promise { return localVarFp.updateDealField(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(axios, basePath)); }, + updateDealFieldWithHttpInfo(requestParameters: DealFieldsApiUpdateDealFieldRequest, ): Promise> { + return localVarFp.updateDealFieldWithHttpInfo(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -567,6 +653,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).addDealField(requestParameters.CreateFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addDealField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiAddDealFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public addDealFieldWithHttpInfo(requestParameters: DealFieldsApiAddDealFieldRequest = {}, ) { + return DealFieldsApiFp(this.configuration).addDealFieldWithHttpInfo(requestParameters.CreateFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a deal field @@ -579,6 +677,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).deleteDealField(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDealField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiDeleteDealFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public deleteDealFieldWithHttpInfo(requestParameters: DealFieldsApiDeleteDealFieldRequest, ) { + return DealFieldsApiFp(this.configuration).deleteDealFieldWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks multiple deal fields as deleted. * @summary Delete multiple deal fields in bulk @@ -591,6 +701,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).deleteDealFields(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDealFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiDeleteDealFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public deleteDealFieldsWithHttpInfo(requestParameters: DealFieldsApiDeleteDealFieldsRequest, ) { + return DealFieldsApiFp(this.configuration).deleteDealFieldsWithHttpInfo(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific deal field. * @summary Get one deal field @@ -603,6 +725,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).getDealField(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiGetDealFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public getDealFieldWithHttpInfo(requestParameters: DealFieldsApiGetDealFieldRequest, ) { + return DealFieldsApiFp(this.configuration).getDealFieldWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all deal fields. * @summary Get all deal fields @@ -615,6 +749,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).getDealFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiGetDealFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public getDealFieldsWithHttpInfo(requestParameters: DealFieldsApiGetDealFieldsRequest = {}, ) { + return DealFieldsApiFp(this.configuration).getDealFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a deal field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a deal field @@ -626,4 +772,16 @@ export class DealFieldsApi extends BaseAPI { public updateDealField(requestParameters: DealFieldsApiUpdateDealFieldRequest, ) { return DealFieldsApiFp(this.configuration).updateDealField(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateDealField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiUpdateDealFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public updateDealFieldWithHttpInfo(requestParameters: DealFieldsApiUpdateDealFieldRequest, ) { + return DealFieldsApiFp(this.configuration).updateDealFieldWithHttpInfo(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/deals-api.ts b/src/versions/v1/api/deals-api.ts index 6c8d9542..1fdb4f49 100644 --- a/src/versions/v1/api/deals-api.ts +++ b/src/versions/v1/api/deals-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFollowerRequest } from '../models'; // @ts-ignore @@ -1169,6 +1169,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealFollower(id, AddDealFollowerRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addDealFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a follower to a deal + * @param {number} id The ID of the deal + * @param {AddDealFollowerRequest} [AddDealFollowerRequest] + + * @throws {RequiredError} + */ + async addDealFollowerWithHttpInfo(id: number, AddDealFollowerRequest?: AddDealFollowerRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addDealFollower(id, AddDealFollowerRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a participant to a deal. * @summary Add a participant to a deal @@ -1181,6 +1193,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealParticipant(id, AddDealParticipantRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addDealParticipant`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a participant to a deal + * @param {number} id The ID of the deal + * @param {AddDealParticipantRequest} [AddDealParticipantRequest] + + * @throws {RequiredError} + */ + async addDealParticipantWithHttpInfo(id: number, AddDealParticipantRequest?: AddDealParticipantRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addDealParticipant(id, AddDealParticipantRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a follower from a deal. * @summary Delete a follower from a deal @@ -1193,6 +1217,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFollower(id, follower_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDealFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a follower from a deal + * @param {number} id The ID of the deal + * @param {number} follower_id The ID of the relationship between the follower and the deal + + * @throws {RequiredError} + */ + async deleteDealFollowerWithHttpInfo(id: number, follower_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFollower(id, follower_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a participant from a deal. * @summary Delete a participant from a deal @@ -1205,6 +1241,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealParticipant(id, deal_participant_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDealParticipant`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a participant from a deal + * @param {number} id The ID of the deal + * @param {number} deal_participant_id The ID of the participant of the deal + + * @throws {RequiredError} + */ + async deleteDealParticipantWithHttpInfo(id: number, deal_participant_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealParticipant(id, deal_participant_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Duplicates a deal. * @summary Duplicate deal @@ -1216,6 +1264,17 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.duplicateDeal(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `duplicateDeal`, but resolves with the response body together with the HTTP status and headers. + * @summary Duplicate deal + * @param {number} id The ID of the deal + + * @throws {RequiredError} + */ + async duplicateDealWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.duplicateDeal(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all archived deals. * @summary Get all archived deals @@ -1238,6 +1297,28 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDeals(user_id, filter_id, person_id, org_id, product_id, pipeline_id, stage_id, status, start, limit, sort, owned_by_you, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getArchivedDeals`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all archived deals + * @param {number} [user_id] If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. + * @param {number} [filter_id] The ID of the filter to use + * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. + * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. + * @param {number} [product_id] If supplied, only deals linked to the specified product are returned. If filter_id is provided, this is ignored. + * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. + * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. + * @param {'open' | 'won' | 'lost' | 'deleted' | 'all_not_deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. + * @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). + * @param {0 | 1} [owned_by_you] When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. + * @deprecated + * @throws {RequiredError} + */ + async getArchivedDealsWithHttpInfo(user_id?: number, filter_id?: number, person_id?: number, org_id?: number, product_id?: number, pipeline_id?: number, stage_id?: number, status?: 'open' | 'won' | 'lost' | 'deleted' | 'all_not_deleted', start?: number, limit?: number, sort?: string, owned_by_you?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDeals(user_id, filter_id, person_id, org_id, product_id, pipeline_id, stage_id, status, start, limit, sort, owned_by_you, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns a summary of all archived deals. * @summary Get archived deals summary @@ -1253,6 +1334,21 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDealsSummary(status, filter_id, user_id, pipeline_id, stage_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getArchivedDealsSummary`, but resolves with the response body together with the HTTP status and headers. + * @summary Get archived deals summary + * @param {'open' | 'won' | 'lost'} [status] Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. + * @param {number} [filter_id] <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. + * @param {number} [user_id] Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. + * @param {number} [pipeline_id] Only deals within the given pipeline will be returned + * @param {number} [stage_id] Only deals within the given stage will be returned + * @deprecated + * @throws {RequiredError} + */ + async getArchivedDealsSummaryWithHttpInfo(status?: 'open' | 'won' | 'lost', filter_id?: number, user_id?: number, pipeline_id?: number, stage_id?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDealsSummary(status, filter_id, user_id, pipeline_id, stage_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns archived open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. * @summary Get archived deals timeline @@ -1272,6 +1368,25 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDealsTimeline(start_date, interval, amount, field_key, user_id, pipeline_id, filter_id, exclude_deals, totals_convert_currency, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getArchivedDealsTimeline`, but resolves with the response body together with the HTTP status and headers. + * @summary Get archived deals timeline + * @param {string} start_date The date when the first interval starts. Format: YYYY-MM-DD. + * @param {'day' | 'week' | 'month' | 'quarter'} interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> + * @param {number} amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). + * @param {string} field_key The date field key which deals will be retrieved from + * @param {number} [user_id] If supplied, only deals matching the given user will be returned + * @param {number} [pipeline_id] If supplied, only deals matching the given pipeline will be returned + * @param {number} [filter_id] If supplied, only deals matching the given filter will be returned + * @param {0 | 1} [exclude_deals] Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. + * @param {string} [totals_convert_currency] The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user\'s default currency is used. + * @deprecated + * @throws {RequiredError} + */ + async getArchivedDealsTimelineWithHttpInfo(start_date: string, interval: 'day' | 'week' | 'month' | 'quarter', amount: number, field_key: string, user_id?: number, pipeline_id?: number, filter_id?: number, exclude_deals?: 0 | 1, totals_convert_currency?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDealsTimeline(start_date, interval, amount, field_key, user_id, pipeline_id, filter_id, exclude_deals, totals_convert_currency, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists updates about field values of a deal. * @summary List updates about deal field values @@ -1285,6 +1400,19 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealChangelog(id, cursor, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealChangelog`, but resolves with the response body together with the HTTP status and headers. + * @summary List updates about deal field values + * @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] Items shown per page + + * @throws {RequiredError} + */ + async getDealChangelogWithHttpInfo(id: number, cursor?: string, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealChangelog(id, cursor, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists files associated with a deal. * @summary List files attached to a deal @@ -1299,6 +1427,20 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFiles(id, start, limit, sort, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealFiles`, but resolves with the response body together with the HTTP status and headers. + * @summary List files attached to a deal + * @param {number} id The ID of the deal + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page. Please note that a maximum value of 100 is allowed. + * @param {string} [sort] Supported fields: `id`, `update_time` + + * @throws {RequiredError} + */ + async getDealFilesWithHttpInfo(id: number, start?: number, limit?: number, sort?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFiles(id, start, limit, sort, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the followers of a deal. * @summary List followers of a deal @@ -1310,6 +1452,17 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFollowers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of a deal + * @param {number} id The ID of the deal + + * @throws {RequiredError} + */ + async getDealFollowersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFollowers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists mail messages associated with a deal. * @summary List mail messages associated with a deal @@ -1324,6 +1477,20 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealMailMessages(id, start, limit, include_body, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealMailMessages`, but resolves with the response body together with the HTTP status and headers. + * @summary List mail messages associated with a deal + * @param {number} id The ID of the deal + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @param {0 | 1} [include_body] Whether to include the mail message body content in the response. `0` = Don\'t include, `1` = Include. + + * @throws {RequiredError} + */ + async getDealMailMessagesWithHttpInfo(id: number, start?: number, limit?: number, include_body?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealMailMessages(id, start, limit, include_body, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the participants associated with a deal.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. * @summary List participants of a deal @@ -1337,6 +1504,19 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealParticipants(id, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealParticipants`, but resolves with the response body together with the HTTP status and headers. + * @summary List participants of a deal + * @param {number} id The ID of the deal + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getDealParticipantsWithHttpInfo(id: number, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealParticipants(id, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * List updates about participants of a deal. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary List updates about participants of a deal @@ -1350,6 +1530,19 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealParticipantsChangelog(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealParticipantsChangelog`, but resolves with the response body together with the HTTP status and headers. + * @summary List updates about participants of a deal + * @param {number} id The ID of the deal + * @param {number} [limit] Items shown per page + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async getDealParticipantsChangelogWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealParticipantsChangelog(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists updates about a deal. * @summary List updates about a deal @@ -1365,6 +1558,21 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealUpdates(id, start, limit, all_changes, items, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealUpdates`, but resolves with the response body together with the HTTP status and headers. + * @summary List updates about a deal + * @param {number} id The ID of the deal + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). + + * @throws {RequiredError} + */ + async getDealUpdatesWithHttpInfo(id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealUpdates(id, start, limit, all_changes, items, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the users permitted to access a deal. * @summary List permitted users @@ -1376,6 +1584,17 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealUsers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealUsers`, but resolves with the response body together with the HTTP status and headers. + * @summary List permitted users + * @param {number} id The ID of the deal + + * @throws {RequiredError} + */ + async getDealUsersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealUsers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns a summary of all not archived deals. * @summary Get deals summary @@ -1391,6 +1610,21 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealsSummary(status, filter_id, user_id, pipeline_id, stage_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealsSummary`, but resolves with the response body together with the HTTP status and headers. + * @summary Get deals summary + * @param {'open' | 'won' | 'lost'} [status] Only fetch deals with a specific status. open = Open, won = Won, lost = Lost. + * @param {number} [filter_id] <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. + * @param {number} [user_id] Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. + * @param {number} [pipeline_id] Only deals within the given pipeline will be returned + * @param {number} [stage_id] Only deals within the given stage will be returned + + * @throws {RequiredError} + */ + async getDealsSummaryWithHttpInfo(status?: 'open' | 'won' | 'lost', filter_id?: number, user_id?: number, pipeline_id?: number, stage_id?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealsSummary(status, filter_id, user_id, pipeline_id, stage_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns not archived open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. * @summary Get deals timeline @@ -1410,6 +1644,25 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealsTimeline(start_date, interval, amount, field_key, user_id, pipeline_id, filter_id, exclude_deals, totals_convert_currency, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealsTimeline`, but resolves with the response body together with the HTTP status and headers. + * @summary Get deals timeline + * @param {string} start_date The date when the first interval starts. Format: YYYY-MM-DD. + * @param {'day' | 'week' | 'month' | 'quarter'} interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> + * @param {number} amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). + * @param {string} field_key The date field key which deals will be retrieved from + * @param {number} [user_id] If supplied, only deals matching the given user will be returned + * @param {number} [pipeline_id] If supplied, only deals matching the given pipeline will be returned + * @param {number} [filter_id] If supplied, only deals matching the given filter will be returned + * @param {0 | 1} [exclude_deals] Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. + * @param {string} [totals_convert_currency] The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user\'s default currency is used. + + * @throws {RequiredError} + */ + async getDealsTimelineWithHttpInfo(start_date: string, interval: 'day' | 'week' | 'month' | 'quarter', amount: number, field_key: string, user_id?: number, pipeline_id?: number, filter_id?: number, exclude_deals?: 0 | 1, totals_convert_currency?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealsTimeline(start_date, interval, amount, field_key, user_id, pipeline_id, filter_id, exclude_deals, totals_convert_currency, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Merges a deal with another deal. For more information, see the tutorial for merging two deals. * @summary Merge two deals @@ -1422,6 +1675,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.mergeDeals(id, MergeDealsRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `mergeDeals`, but resolves with the response body together with the HTTP status and headers. + * @summary Merge two deals + * @param {number} id The ID of the deal + * @param {MergeDealsRequest} [MergeDealsRequest] + + * @throws {RequiredError} + */ + async mergeDealsWithHttpInfo(id: number, MergeDealsRequest?: MergeDealsRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.mergeDeals(id, MergeDealsRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -1442,6 +1707,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath addDealFollower(requestParameters: DealsApiAddDealFollowerRequest, ): Promise { return localVarFp.addDealFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); }, + addDealFollowerWithHttpInfo(requestParameters: DealsApiAddDealFollowerRequest, ): Promise> { + return localVarFp.addDealFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a participant to a deal. * @summary Add a participant to a deal @@ -1452,6 +1720,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath addDealParticipant(requestParameters: DealsApiAddDealParticipantRequest, ): Promise { return localVarFp.addDealParticipant(requestParameters.id, requestParameters.AddDealParticipantRequest, ).then((request) => request(axios, basePath)); }, + addDealParticipantWithHttpInfo(requestParameters: DealsApiAddDealParticipantRequest, ): Promise> { + return localVarFp.addDealParticipantWithHttpInfo(requestParameters.id, requestParameters.AddDealParticipantRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes a follower from a deal. * @summary Delete a follower from a deal @@ -1462,6 +1733,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath deleteDealFollower(requestParameters: DealsApiDeleteDealFollowerRequest, ): Promise { return localVarFp.deleteDealFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); }, + deleteDealFollowerWithHttpInfo(requestParameters: DealsApiDeleteDealFollowerRequest, ): Promise> { + return localVarFp.deleteDealFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); + }, /** * Deletes a participant from a deal. * @summary Delete a participant from a deal @@ -1472,6 +1746,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath deleteDealParticipant(requestParameters: DealsApiDeleteDealParticipantRequest, ): Promise { return localVarFp.deleteDealParticipant(requestParameters.id, requestParameters.deal_participant_id, ).then((request) => request(axios, basePath)); }, + deleteDealParticipantWithHttpInfo(requestParameters: DealsApiDeleteDealParticipantRequest, ): Promise> { + return localVarFp.deleteDealParticipantWithHttpInfo(requestParameters.id, requestParameters.deal_participant_id, ).then((request) => request(axios, basePath)); + }, /** * Duplicates a deal. * @summary Duplicate deal @@ -1482,6 +1759,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath duplicateDeal(requestParameters: DealsApiDuplicateDealRequest, ): Promise { return localVarFp.duplicateDeal(requestParameters.id, ).then((request) => request(axios, basePath)); }, + duplicateDealWithHttpInfo(requestParameters: DealsApiDuplicateDealRequest, ): Promise> { + return localVarFp.duplicateDealWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all archived deals. * @summary Get all archived deals @@ -1492,6 +1772,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getArchivedDeals(requestParameters: DealsApiGetArchivedDealsRequest = {}, ): Promise { return localVarFp.getArchivedDeals(requestParameters.user_id, requestParameters.filter_id, requestParameters.person_id, requestParameters.org_id, requestParameters.product_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.owned_by_you, ).then((request) => request(axios, basePath)); }, + getArchivedDealsWithHttpInfo(requestParameters: DealsApiGetArchivedDealsRequest = {}, ): Promise> { + return localVarFp.getArchivedDealsWithHttpInfo(requestParameters.user_id, requestParameters.filter_id, requestParameters.person_id, requestParameters.org_id, requestParameters.product_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.owned_by_you, ).then((request) => request(axios, basePath)); + }, /** * Returns a summary of all archived deals. * @summary Get archived deals summary @@ -1502,6 +1785,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getArchivedDealsSummary(requestParameters: DealsApiGetArchivedDealsSummaryRequest = {}, ): Promise { return localVarFp.getArchivedDealsSummary(requestParameters.status, requestParameters.filter_id, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.stage_id, ).then((request) => request(axios, basePath)); }, + getArchivedDealsSummaryWithHttpInfo(requestParameters: DealsApiGetArchivedDealsSummaryRequest = {}, ): Promise> { + return localVarFp.getArchivedDealsSummaryWithHttpInfo(requestParameters.status, requestParameters.filter_id, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.stage_id, ).then((request) => request(axios, basePath)); + }, /** * Returns archived open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. * @summary Get archived deals timeline @@ -1512,6 +1798,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getArchivedDealsTimeline(requestParameters: DealsApiGetArchivedDealsTimelineRequest, ): Promise { return localVarFp.getArchivedDealsTimeline(requestParameters.start_date, requestParameters.interval, requestParameters.amount, requestParameters.field_key, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.filter_id, requestParameters.exclude_deals, requestParameters.totals_convert_currency, ).then((request) => request(axios, basePath)); }, + getArchivedDealsTimelineWithHttpInfo(requestParameters: DealsApiGetArchivedDealsTimelineRequest, ): Promise> { + return localVarFp.getArchivedDealsTimelineWithHttpInfo(requestParameters.start_date, requestParameters.interval, requestParameters.amount, requestParameters.field_key, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.filter_id, requestParameters.exclude_deals, requestParameters.totals_convert_currency, ).then((request) => request(axios, basePath)); + }, /** * Lists updates about field values of a deal. * @summary List updates about deal field values @@ -1522,6 +1811,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealChangelog(requestParameters: DealsApiGetDealChangelogRequest, ): Promise { return localVarFp.getDealChangelog(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getDealChangelogWithHttpInfo(requestParameters: DealsApiGetDealChangelogRequest, ): Promise> { + return localVarFp.getDealChangelogWithHttpInfo(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Lists files associated with a deal. * @summary List files attached to a deal @@ -1532,6 +1824,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealFiles(requestParameters: DealsApiGetDealFilesRequest, ): Promise { return localVarFp.getDealFiles(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); }, + getDealFilesWithHttpInfo(requestParameters: DealsApiGetDealFilesRequest, ): Promise> { + return localVarFp.getDealFilesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); + }, /** * Lists the followers of a deal. * @summary List followers of a deal @@ -1542,6 +1837,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealFollowers(requestParameters: DealsApiGetDealFollowersRequest, ): Promise { return localVarFp.getDealFollowers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getDealFollowersWithHttpInfo(requestParameters: DealsApiGetDealFollowersRequest, ): Promise> { + return localVarFp.getDealFollowersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists mail messages associated with a deal. * @summary List mail messages associated with a deal @@ -1552,6 +1850,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealMailMessages(requestParameters: DealsApiGetDealMailMessagesRequest, ): Promise { return localVarFp.getDealMailMessages(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(axios, basePath)); }, + getDealMailMessagesWithHttpInfo(requestParameters: DealsApiGetDealMailMessagesRequest, ): Promise> { + return localVarFp.getDealMailMessagesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(axios, basePath)); + }, /** * Lists the participants associated with a deal.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. * @summary List participants of a deal @@ -1562,6 +1863,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealParticipants(requestParameters: DealsApiGetDealParticipantsRequest, ): Promise { return localVarFp.getDealParticipants(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getDealParticipantsWithHttpInfo(requestParameters: DealsApiGetDealParticipantsRequest, ): Promise> { + return localVarFp.getDealParticipantsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * List updates about participants of a deal. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary List updates about participants of a deal @@ -1572,6 +1876,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealParticipantsChangelog(requestParameters: DealsApiGetDealParticipantsChangelogRequest, ): Promise { return localVarFp.getDealParticipantsChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getDealParticipantsChangelogWithHttpInfo(requestParameters: DealsApiGetDealParticipantsChangelogRequest, ): Promise> { + return localVarFp.getDealParticipantsChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Lists updates about a deal. * @summary List updates about a deal @@ -1582,6 +1889,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealUpdates(requestParameters: DealsApiGetDealUpdatesRequest, ): Promise { return localVarFp.getDealUpdates(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(axios, basePath)); }, + getDealUpdatesWithHttpInfo(requestParameters: DealsApiGetDealUpdatesRequest, ): Promise> { + return localVarFp.getDealUpdatesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(axios, basePath)); + }, /** * Lists the users permitted to access a deal. * @summary List permitted users @@ -1592,6 +1902,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealUsers(requestParameters: DealsApiGetDealUsersRequest, ): Promise { return localVarFp.getDealUsers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getDealUsersWithHttpInfo(requestParameters: DealsApiGetDealUsersRequest, ): Promise> { + return localVarFp.getDealUsersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns a summary of all not archived deals. * @summary Get deals summary @@ -1602,6 +1915,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealsSummary(requestParameters: DealsApiGetDealsSummaryRequest = {}, ): Promise { return localVarFp.getDealsSummary(requestParameters.status, requestParameters.filter_id, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.stage_id, ).then((request) => request(axios, basePath)); }, + getDealsSummaryWithHttpInfo(requestParameters: DealsApiGetDealsSummaryRequest = {}, ): Promise> { + return localVarFp.getDealsSummaryWithHttpInfo(requestParameters.status, requestParameters.filter_id, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.stage_id, ).then((request) => request(axios, basePath)); + }, /** * Returns not archived open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. * @summary Get deals timeline @@ -1612,6 +1928,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealsTimeline(requestParameters: DealsApiGetDealsTimelineRequest, ): Promise { return localVarFp.getDealsTimeline(requestParameters.start_date, requestParameters.interval, requestParameters.amount, requestParameters.field_key, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.filter_id, requestParameters.exclude_deals, requestParameters.totals_convert_currency, ).then((request) => request(axios, basePath)); }, + getDealsTimelineWithHttpInfo(requestParameters: DealsApiGetDealsTimelineRequest, ): Promise> { + return localVarFp.getDealsTimelineWithHttpInfo(requestParameters.start_date, requestParameters.interval, requestParameters.amount, requestParameters.field_key, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.filter_id, requestParameters.exclude_deals, requestParameters.totals_convert_currency, ).then((request) => request(axios, basePath)); + }, /** * Merges a deal with another deal. For more information, see the tutorial for merging two deals. * @summary Merge two deals @@ -1622,6 +1941,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath mergeDeals(requestParameters: DealsApiMergeDealsRequest, ): Promise { return localVarFp.mergeDeals(requestParameters.id, requestParameters.MergeDealsRequest, ).then((request) => request(axios, basePath)); }, + mergeDealsWithHttpInfo(requestParameters: DealsApiMergeDealsRequest, ): Promise> { + return localVarFp.mergeDealsWithHttpInfo(requestParameters.id, requestParameters.MergeDealsRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -2302,6 +2624,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).addDealFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addDealFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiAddDealFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public addDealFollowerWithHttpInfo(requestParameters: DealsApiAddDealFollowerRequest, ) { + return DealsApiFp(this.configuration).addDealFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a participant to a deal. * @summary Add a participant to a deal @@ -2314,6 +2648,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).addDealParticipant(requestParameters.id, requestParameters.AddDealParticipantRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addDealParticipant`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiAddDealParticipantRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public addDealParticipantWithHttpInfo(requestParameters: DealsApiAddDealParticipantRequest, ) { + return DealsApiFp(this.configuration).addDealParticipantWithHttpInfo(requestParameters.id, requestParameters.AddDealParticipantRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a follower from a deal. * @summary Delete a follower from a deal @@ -2326,6 +2672,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).deleteDealFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDealFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiDeleteDealFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public deleteDealFollowerWithHttpInfo(requestParameters: DealsApiDeleteDealFollowerRequest, ) { + return DealsApiFp(this.configuration).deleteDealFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a participant from a deal. * @summary Delete a participant from a deal @@ -2338,6 +2696,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).deleteDealParticipant(requestParameters.id, requestParameters.deal_participant_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDealParticipant`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiDeleteDealParticipantRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public deleteDealParticipantWithHttpInfo(requestParameters: DealsApiDeleteDealParticipantRequest, ) { + return DealsApiFp(this.configuration).deleteDealParticipantWithHttpInfo(requestParameters.id, requestParameters.deal_participant_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Duplicates a deal. * @summary Duplicate deal @@ -2350,6 +2720,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).duplicateDeal(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `duplicateDeal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiDuplicateDealRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public duplicateDealWithHttpInfo(requestParameters: DealsApiDuplicateDealRequest, ) { + return DealsApiFp(this.configuration).duplicateDealWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all archived deals. * @summary Get all archived deals @@ -2362,6 +2744,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getArchivedDeals(requestParameters.user_id, requestParameters.filter_id, requestParameters.person_id, requestParameters.org_id, requestParameters.product_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.owned_by_you, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getArchivedDeals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetArchivedDealsRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof DealsApi + */ + public getArchivedDealsWithHttpInfo(requestParameters: DealsApiGetArchivedDealsRequest = {}, ) { + return DealsApiFp(this.configuration).getArchivedDealsWithHttpInfo(requestParameters.user_id, requestParameters.filter_id, requestParameters.person_id, requestParameters.org_id, requestParameters.product_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.start, requestParameters.limit, requestParameters.sort, requestParameters.owned_by_you, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns a summary of all archived deals. * @summary Get archived deals summary @@ -2374,6 +2768,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getArchivedDealsSummary(requestParameters.status, requestParameters.filter_id, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.stage_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getArchivedDealsSummary`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetArchivedDealsSummaryRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof DealsApi + */ + public getArchivedDealsSummaryWithHttpInfo(requestParameters: DealsApiGetArchivedDealsSummaryRequest = {}, ) { + return DealsApiFp(this.configuration).getArchivedDealsSummaryWithHttpInfo(requestParameters.status, requestParameters.filter_id, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.stage_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns archived open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. * @summary Get archived deals timeline @@ -2386,6 +2792,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getArchivedDealsTimeline(requestParameters.start_date, requestParameters.interval, requestParameters.amount, requestParameters.field_key, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.filter_id, requestParameters.exclude_deals, requestParameters.totals_convert_currency, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getArchivedDealsTimeline`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetArchivedDealsTimelineRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof DealsApi + */ + public getArchivedDealsTimelineWithHttpInfo(requestParameters: DealsApiGetArchivedDealsTimelineRequest, ) { + return DealsApiFp(this.configuration).getArchivedDealsTimelineWithHttpInfo(requestParameters.start_date, requestParameters.interval, requestParameters.amount, requestParameters.field_key, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.filter_id, requestParameters.exclude_deals, requestParameters.totals_convert_currency, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists updates about field values of a deal. * @summary List updates about deal field values @@ -2398,6 +2816,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealChangelog(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealChangelogWithHttpInfo(requestParameters: DealsApiGetDealChangelogRequest, ) { + return DealsApiFp(this.configuration).getDealChangelogWithHttpInfo(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists files associated with a deal. * @summary List files attached to a deal @@ -2410,6 +2840,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealFiles(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealFiles`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealFilesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealFilesWithHttpInfo(requestParameters: DealsApiGetDealFilesRequest, ) { + return DealsApiFp(this.configuration).getDealFilesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the followers of a deal. * @summary List followers of a deal @@ -2422,6 +2864,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealFollowers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealFollowersWithHttpInfo(requestParameters: DealsApiGetDealFollowersRequest, ) { + return DealsApiFp(this.configuration).getDealFollowersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists mail messages associated with a deal. * @summary List mail messages associated with a deal @@ -2434,6 +2888,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealMailMessages(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealMailMessages`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealMailMessagesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealMailMessagesWithHttpInfo(requestParameters: DealsApiGetDealMailMessagesRequest, ) { + return DealsApiFp(this.configuration).getDealMailMessagesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the participants associated with a deal.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. * @summary List participants of a deal @@ -2446,6 +2912,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealParticipants(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealParticipants`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealParticipantsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealParticipantsWithHttpInfo(requestParameters: DealsApiGetDealParticipantsRequest, ) { + return DealsApiFp(this.configuration).getDealParticipantsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * List updates about participants of a deal. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary List updates about participants of a deal @@ -2458,6 +2936,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealParticipantsChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealParticipantsChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealParticipantsChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealParticipantsChangelogWithHttpInfo(requestParameters: DealsApiGetDealParticipantsChangelogRequest, ) { + return DealsApiFp(this.configuration).getDealParticipantsChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists updates about a deal. * @summary List updates about a deal @@ -2470,6 +2960,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealUpdates(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealUpdates`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealUpdatesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealUpdatesWithHttpInfo(requestParameters: DealsApiGetDealUpdatesRequest, ) { + return DealsApiFp(this.configuration).getDealUpdatesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the users permitted to access a deal. * @summary List permitted users @@ -2482,6 +2984,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealUsers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealUsers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealUsersWithHttpInfo(requestParameters: DealsApiGetDealUsersRequest, ) { + return DealsApiFp(this.configuration).getDealUsersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns a summary of all not archived deals. * @summary Get deals summary @@ -2494,6 +3008,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealsSummary(requestParameters.status, requestParameters.filter_id, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.stage_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealsSummary`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealsSummaryRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealsSummaryWithHttpInfo(requestParameters: DealsApiGetDealsSummaryRequest = {}, ) { + return DealsApiFp(this.configuration).getDealsSummaryWithHttpInfo(requestParameters.status, requestParameters.filter_id, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.stage_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns not archived open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. * @summary Get deals timeline @@ -2506,6 +3032,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealsTimeline(requestParameters.start_date, requestParameters.interval, requestParameters.amount, requestParameters.field_key, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.filter_id, requestParameters.exclude_deals, requestParameters.totals_convert_currency, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealsTimeline`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealsTimelineRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealsTimelineWithHttpInfo(requestParameters: DealsApiGetDealsTimelineRequest, ) { + return DealsApiFp(this.configuration).getDealsTimelineWithHttpInfo(requestParameters.start_date, requestParameters.interval, requestParameters.amount, requestParameters.field_key, requestParameters.user_id, requestParameters.pipeline_id, requestParameters.filter_id, requestParameters.exclude_deals, requestParameters.totals_convert_currency, ).then((request) => request(this.axios, this.basePath)); + } + /** * Merges a deal with another deal. For more information, see the tutorial for merging two deals. * @summary Merge two deals @@ -2517,4 +3055,16 @@ export class DealsApi extends BaseAPI { public mergeDeals(requestParameters: DealsApiMergeDealsRequest, ) { return DealsApiFp(this.configuration).mergeDeals(requestParameters.id, requestParameters.MergeDealsRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `mergeDeals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiMergeDealsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public mergeDealsWithHttpInfo(requestParameters: DealsApiMergeDealsRequest, ) { + return DealsApiFp(this.configuration).mergeDealsWithHttpInfo(requestParameters.id, requestParameters.MergeDealsRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/files-api.ts b/src/versions/v1/api/files-api.ts index 2e3ba381..0c570470 100644 --- a/src/versions/v1/api/files-api.ts +++ b/src/versions/v1/api/files-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddFileResponse } from '../models'; // @ts-ignore @@ -528,6 +528,24 @@ export const FilesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addFile(file, deal_id, person_id, org_id, product_id, activity_id, lead_id, project_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addFile`, but resolves with the response body together with the HTTP status and headers. + * @summary Add file + * @param {File} file A single file, supplied in the multipart/form-data encoding and contained within the given boundaries + * @param {number} [deal_id] The ID of the deal to associate file(s) with + * @param {number} [person_id] The ID of the person to associate file(s) with + * @param {number} [org_id] The ID of the organization to associate file(s) with + * @param {number} [product_id] The ID of the product to associate file(s) with + * @param {number} [activity_id] The ID of the activity to associate file(s) with + * @param {string} [lead_id] The ID of the lead to associate file(s) with + * @param {number} [project_id] The ID of the project to associate file(s) with + + * @throws {RequiredError} + */ + async addFileWithHttpInfo(file: File, deal_id?: number, person_id?: number, org_id?: number, product_id?: number, activity_id?: number, lead_id?: string, project_id?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addFile(file, deal_id, person_id, org_id, product_id, activity_id, lead_id, project_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Creates a new empty file in the remote location (`googledrive`) that will be linked to the item you supply. For more information, see the tutorial for adding a remote file. * @summary Create a remote file and link it to an item @@ -543,6 +561,21 @@ export const FilesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addFileAndLinkIt(file_type, title, item_type, item_id, remote_location, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addFileAndLinkIt`, but resolves with the response body together with the HTTP status and headers. + * @summary Create a remote file and link it to an item + * @param {string} file_type The file type + * @param {string} title The title of the file + * @param {string} item_type The item type + * @param {number} item_id The ID of the item to associate the file with + * @param {string} remote_location The location type to send the file to. Only `googledrive` is supported at the moment. + + * @throws {RequiredError} + */ + async addFileAndLinkItWithHttpInfo(file_type: string, title: string, item_type: string, item_id: number, remote_location: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addFileAndLinkIt(file_type, title, item_type, item_id, remote_location, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a file as deleted. After 30 days, the file will be permanently deleted. * @summary Delete a file @@ -554,6 +587,17 @@ export const FilesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFile(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteFile`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a file + * @param {number} id The ID of the file + + * @throws {RequiredError} + */ + async deleteFileWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFile(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Initializes a file download. * @summary Download one file @@ -565,6 +609,17 @@ export const FilesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.downloadFile(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `downloadFile`, but resolves with the response body together with the HTTP status and headers. + * @summary Download one file + * @param {number} id The ID of the file + + * @throws {RequiredError} + */ + async downloadFileWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.downloadFile(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific file. * @summary Get one file @@ -576,6 +631,17 @@ export const FilesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getFile(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getFile`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one file + * @param {number} id The ID of the file + + * @throws {RequiredError} + */ + async getFileWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFile(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all files. * @summary Get all files @@ -589,6 +655,19 @@ export const FilesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getFiles(start, limit, sort, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getFiles`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all files + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page. Please note that a maximum value of 100 is allowed. + * @param {string} [sort] Supported fields: `id`, `update_time` + + * @throws {RequiredError} + */ + async getFilesWithHttpInfo(start?: number, limit?: number, sort?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFiles(start, limit, sort, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Links an existing remote file (`googledrive`) to the item you supply. For more information, see the tutorial for adding a remote file. * @summary Link a remote file to an item @@ -603,6 +682,20 @@ export const FilesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.linkFileToItem(item_type, item_id, remote_id, remote_location, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `linkFileToItem`, but resolves with the response body together with the HTTP status and headers. + * @summary Link a remote file to an item + * @param {string} item_type The item type + * @param {number} item_id The ID of the item to associate the file with + * @param {string} remote_id The remote item ID + * @param {string} remote_location The location type to send the file to. Only `googledrive` is supported at the moment. + + * @throws {RequiredError} + */ + async linkFileToItemWithHttpInfo(item_type: string, item_id: number, remote_id: string, remote_location: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.linkFileToItem(item_type, item_id, remote_id, remote_location, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a file. * @summary Update file details @@ -616,6 +709,19 @@ export const FilesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateFile(id, name, description, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateFile`, but resolves with the response body together with the HTTP status and headers. + * @summary Update file details + * @param {number} id The ID of the file + * @param {string} [name] The visible name of the file + * @param {string} [description] The description of the file + + * @throws {RequiredError} + */ + async updateFileWithHttpInfo(id: number, name?: string, description?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateFile(id, name, description, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -636,6 +742,9 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath addFile(requestParameters: FilesApiAddFileRequest, ): Promise { return localVarFp.addFile(requestParameters.file, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.product_id, requestParameters.activity_id, requestParameters.lead_id, requestParameters.project_id, ).then((request) => request(axios, basePath)); }, + addFileWithHttpInfo(requestParameters: FilesApiAddFileRequest, ): Promise> { + return localVarFp.addFileWithHttpInfo(requestParameters.file, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.product_id, requestParameters.activity_id, requestParameters.lead_id, requestParameters.project_id, ).then((request) => request(axios, basePath)); + }, /** * Creates a new empty file in the remote location (`googledrive`) that will be linked to the item you supply. For more information, see the tutorial for adding a remote file. * @summary Create a remote file and link it to an item @@ -646,6 +755,9 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath addFileAndLinkIt(requestParameters: FilesApiAddFileAndLinkItRequest, ): Promise { return localVarFp.addFileAndLinkIt(requestParameters.file_type, requestParameters.title, requestParameters.item_type, requestParameters.item_id, requestParameters.remote_location, ).then((request) => request(axios, basePath)); }, + addFileAndLinkItWithHttpInfo(requestParameters: FilesApiAddFileAndLinkItRequest, ): Promise> { + return localVarFp.addFileAndLinkItWithHttpInfo(requestParameters.file_type, requestParameters.title, requestParameters.item_type, requestParameters.item_id, requestParameters.remote_location, ).then((request) => request(axios, basePath)); + }, /** * Marks a file as deleted. After 30 days, the file will be permanently deleted. * @summary Delete a file @@ -656,6 +768,9 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath deleteFile(requestParameters: FilesApiDeleteFileRequest, ): Promise { return localVarFp.deleteFile(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteFileWithHttpInfo(requestParameters: FilesApiDeleteFileRequest, ): Promise> { + return localVarFp.deleteFileWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Initializes a file download. * @summary Download one file @@ -666,6 +781,9 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath downloadFile(requestParameters: FilesApiDownloadFileRequest, ): Promise { return localVarFp.downloadFile(requestParameters.id, ).then((request) => request(axios, basePath)); }, + downloadFileWithHttpInfo(requestParameters: FilesApiDownloadFileRequest, ): Promise> { + return localVarFp.downloadFileWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific file. * @summary Get one file @@ -676,6 +794,9 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath getFile(requestParameters: FilesApiGetFileRequest, ): Promise { return localVarFp.getFile(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getFileWithHttpInfo(requestParameters: FilesApiGetFileRequest, ): Promise> { + return localVarFp.getFileWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all files. * @summary Get all files @@ -686,6 +807,9 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath getFiles(requestParameters: FilesApiGetFilesRequest = {}, ): Promise { return localVarFp.getFiles(requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); }, + getFilesWithHttpInfo(requestParameters: FilesApiGetFilesRequest = {}, ): Promise> { + return localVarFp.getFilesWithHttpInfo(requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); + }, /** * Links an existing remote file (`googledrive`) to the item you supply. For more information, see the tutorial for adding a remote file. * @summary Link a remote file to an item @@ -696,6 +820,9 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath linkFileToItem(requestParameters: FilesApiLinkFileToItemRequest, ): Promise { return localVarFp.linkFileToItem(requestParameters.item_type, requestParameters.item_id, requestParameters.remote_id, requestParameters.remote_location, ).then((request) => request(axios, basePath)); }, + linkFileToItemWithHttpInfo(requestParameters: FilesApiLinkFileToItemRequest, ): Promise> { + return localVarFp.linkFileToItemWithHttpInfo(requestParameters.item_type, requestParameters.item_id, requestParameters.remote_id, requestParameters.remote_location, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a file. * @summary Update file details @@ -706,6 +833,9 @@ export const FilesApiFactory = function (configuration?: Configuration, basePath updateFile(requestParameters: FilesApiUpdateFileRequest, ): Promise { return localVarFp.updateFile(requestParameters.id, requestParameters.name, requestParameters.description, ).then((request) => request(axios, basePath)); }, + updateFileWithHttpInfo(requestParameters: FilesApiUpdateFileRequest, ): Promise> { + return localVarFp.updateFileWithHttpInfo(requestParameters.id, requestParameters.name, requestParameters.description, ).then((request) => request(axios, basePath)); + }, }; }; @@ -966,6 +1096,18 @@ export class FilesApi extends BaseAPI { return FilesApiFp(this.configuration).addFile(requestParameters.file, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.product_id, requestParameters.activity_id, requestParameters.lead_id, requestParameters.project_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addFile`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FilesApiAddFileRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FilesApi + */ + public addFileWithHttpInfo(requestParameters: FilesApiAddFileRequest, ) { + return FilesApiFp(this.configuration).addFileWithHttpInfo(requestParameters.file, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.product_id, requestParameters.activity_id, requestParameters.lead_id, requestParameters.project_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Creates a new empty file in the remote location (`googledrive`) that will be linked to the item you supply. For more information, see the tutorial for adding a remote file. * @summary Create a remote file and link it to an item @@ -978,6 +1120,18 @@ export class FilesApi extends BaseAPI { return FilesApiFp(this.configuration).addFileAndLinkIt(requestParameters.file_type, requestParameters.title, requestParameters.item_type, requestParameters.item_id, requestParameters.remote_location, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addFileAndLinkIt`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FilesApiAddFileAndLinkItRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FilesApi + */ + public addFileAndLinkItWithHttpInfo(requestParameters: FilesApiAddFileAndLinkItRequest, ) { + return FilesApiFp(this.configuration).addFileAndLinkItWithHttpInfo(requestParameters.file_type, requestParameters.title, requestParameters.item_type, requestParameters.item_id, requestParameters.remote_location, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a file as deleted. After 30 days, the file will be permanently deleted. * @summary Delete a file @@ -990,6 +1144,18 @@ export class FilesApi extends BaseAPI { return FilesApiFp(this.configuration).deleteFile(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteFile`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FilesApiDeleteFileRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FilesApi + */ + public deleteFileWithHttpInfo(requestParameters: FilesApiDeleteFileRequest, ) { + return FilesApiFp(this.configuration).deleteFileWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Initializes a file download. * @summary Download one file @@ -1002,6 +1168,18 @@ export class FilesApi extends BaseAPI { return FilesApiFp(this.configuration).downloadFile(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `downloadFile`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FilesApiDownloadFileRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FilesApi + */ + public downloadFileWithHttpInfo(requestParameters: FilesApiDownloadFileRequest, ) { + return FilesApiFp(this.configuration).downloadFileWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific file. * @summary Get one file @@ -1014,6 +1192,18 @@ export class FilesApi extends BaseAPI { return FilesApiFp(this.configuration).getFile(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getFile`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FilesApiGetFileRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FilesApi + */ + public getFileWithHttpInfo(requestParameters: FilesApiGetFileRequest, ) { + return FilesApiFp(this.configuration).getFileWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all files. * @summary Get all files @@ -1026,6 +1216,18 @@ export class FilesApi extends BaseAPI { return FilesApiFp(this.configuration).getFiles(requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getFiles`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FilesApiGetFilesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FilesApi + */ + public getFilesWithHttpInfo(requestParameters: FilesApiGetFilesRequest = {}, ) { + return FilesApiFp(this.configuration).getFilesWithHttpInfo(requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); + } + /** * Links an existing remote file (`googledrive`) to the item you supply. For more information, see the tutorial for adding a remote file. * @summary Link a remote file to an item @@ -1038,6 +1240,18 @@ export class FilesApi extends BaseAPI { return FilesApiFp(this.configuration).linkFileToItem(requestParameters.item_type, requestParameters.item_id, requestParameters.remote_id, requestParameters.remote_location, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `linkFileToItem`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FilesApiLinkFileToItemRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FilesApi + */ + public linkFileToItemWithHttpInfo(requestParameters: FilesApiLinkFileToItemRequest, ) { + return FilesApiFp(this.configuration).linkFileToItemWithHttpInfo(requestParameters.item_type, requestParameters.item_id, requestParameters.remote_id, requestParameters.remote_location, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a file. * @summary Update file details @@ -1049,4 +1263,16 @@ export class FilesApi extends BaseAPI { public updateFile(requestParameters: FilesApiUpdateFileRequest, ) { return FilesApiFp(this.configuration).updateFile(requestParameters.id, requestParameters.name, requestParameters.description, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateFile`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FilesApiUpdateFileRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FilesApi + */ + public updateFileWithHttpInfo(requestParameters: FilesApiUpdateFileRequest, ) { + return FilesApiFp(this.configuration).updateFileWithHttpInfo(requestParameters.id, requestParameters.name, requestParameters.description, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/filters-api.ts b/src/versions/v1/api/filters-api.ts index ec897e7a..01db700b 100644 --- a/src/versions/v1/api/filters-api.ts +++ b/src/versions/v1/api/filters-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddFilterRequest } from '../models'; // @ts-ignore @@ -370,6 +370,18 @@ export const FiltersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addFilter(include_field_code, AddFilterRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addFilter`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new filter + * @param {boolean} [include_field_code] If set to `true`, each condition in the response includes a `field_code` field identifying the field by its code name + * @param {AddFilterRequest} [AddFilterRequest] + + * @throws {RequiredError} + */ + async addFilterWithHttpInfo(include_field_code?: boolean, AddFilterRequest?: AddFilterRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addFilter(include_field_code, AddFilterRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a filter as deleted. * @summary Delete a filter @@ -381,6 +393,17 @@ export const FiltersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFilter(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteFilter`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a filter + * @param {number} id The ID of the filter + + * @throws {RequiredError} + */ + async deleteFilterWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFilter(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks multiple filters as deleted. * @summary Delete multiple filters in bulk @@ -392,6 +415,17 @@ export const FiltersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFilters(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteFilters`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete multiple filters in bulk + * @param {Set} ids The comma-separated filter IDs to delete + + * @throws {RequiredError} + */ + async deleteFiltersWithHttpInfo(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFilters(ids, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific filter. Note that this also returns the condition lines of the filter. * @summary Get one filter @@ -404,6 +438,18 @@ export const FiltersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getFilter(id, include_field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getFilter`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one filter + * @param {number} id The ID of the filter + * @param {boolean} [include_field_code] If set to `true`, each condition in the response includes a `field_code` field identifying the field by its code name + + * @throws {RequiredError} + */ + async getFilterWithHttpInfo(id: number, include_field_code?: boolean, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFilter(id, include_field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to add or update filters. For more information, see the tutorial for adding a filter. * @summary Get all filter helpers @@ -414,6 +460,16 @@ export const FiltersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getFilterHelpers(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getFilterHelpers`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all filter helpers + + * @throws {RequiredError} + */ + async getFilterHelpersWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFilterHelpers(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all filters. * @summary Get all filters @@ -425,6 +481,17 @@ export const FiltersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getFilters(type, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getFilters`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all filters + * @param {'deals' | 'leads' | 'org' | 'people' | 'products' | 'activity' | 'projects'} [type] The types of filters to fetch + + * @throws {RequiredError} + */ + async getFiltersWithHttpInfo(type?: 'deals' | 'leads' | 'org' | 'people' | 'products' | 'activity' | 'projects', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFilters(type, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates an existing filter. * @summary Update filter @@ -438,6 +505,19 @@ export const FiltersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateFilter(id, include_field_code, UpdateFilterRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateFilter`, but resolves with the response body together with the HTTP status and headers. + * @summary Update filter + * @param {number} id The ID of the filter + * @param {boolean} [include_field_code] If set to `true`, each condition in the response includes a `field_code` field identifying the field by its code name + * @param {UpdateFilterRequest} [UpdateFilterRequest] + + * @throws {RequiredError} + */ + async updateFilterWithHttpInfo(id: number, include_field_code?: boolean, UpdateFilterRequest?: UpdateFilterRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateFilter(id, include_field_code, UpdateFilterRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -458,6 +538,9 @@ export const FiltersApiFactory = function (configuration?: Configuration, basePa addFilter(requestParameters: FiltersApiAddFilterRequest = {}, ): Promise { return localVarFp.addFilter(requestParameters.include_field_code, requestParameters.AddFilterRequest, ).then((request) => request(axios, basePath)); }, + addFilterWithHttpInfo(requestParameters: FiltersApiAddFilterRequest = {}, ): Promise> { + return localVarFp.addFilterWithHttpInfo(requestParameters.include_field_code, requestParameters.AddFilterRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a filter as deleted. * @summary Delete a filter @@ -468,6 +551,9 @@ export const FiltersApiFactory = function (configuration?: Configuration, basePa deleteFilter(requestParameters: FiltersApiDeleteFilterRequest, ): Promise { return localVarFp.deleteFilter(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteFilterWithHttpInfo(requestParameters: FiltersApiDeleteFilterRequest, ): Promise> { + return localVarFp.deleteFilterWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Marks multiple filters as deleted. * @summary Delete multiple filters in bulk @@ -478,6 +564,9 @@ export const FiltersApiFactory = function (configuration?: Configuration, basePa deleteFilters(requestParameters: FiltersApiDeleteFiltersRequest, ): Promise { return localVarFp.deleteFilters(requestParameters.ids, ).then((request) => request(axios, basePath)); }, + deleteFiltersWithHttpInfo(requestParameters: FiltersApiDeleteFiltersRequest, ): Promise> { + return localVarFp.deleteFiltersWithHttpInfo(requestParameters.ids, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific filter. Note that this also returns the condition lines of the filter. * @summary Get one filter @@ -488,6 +577,9 @@ export const FiltersApiFactory = function (configuration?: Configuration, basePa getFilter(requestParameters: FiltersApiGetFilterRequest, ): Promise { return localVarFp.getFilter(requestParameters.id, requestParameters.include_field_code, ).then((request) => request(axios, basePath)); }, + getFilterWithHttpInfo(requestParameters: FiltersApiGetFilterRequest, ): Promise> { + return localVarFp.getFilterWithHttpInfo(requestParameters.id, requestParameters.include_field_code, ).then((request) => request(axios, basePath)); + }, /** * Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to add or update filters. For more information, see the tutorial for adding a filter. * @summary Get all filter helpers @@ -497,6 +589,9 @@ export const FiltersApiFactory = function (configuration?: Configuration, basePa getFilterHelpers(): Promise { return localVarFp.getFilterHelpers().then((request) => request(axios, basePath)); }, + getFilterHelpersWithHttpInfo(): Promise> { + return localVarFp.getFilterHelpersWithHttpInfo().then((request) => request(axios, basePath)); + }, /** * Returns data about all filters. * @summary Get all filters @@ -507,6 +602,9 @@ export const FiltersApiFactory = function (configuration?: Configuration, basePa getFilters(requestParameters: FiltersApiGetFiltersRequest = {}, ): Promise { return localVarFp.getFilters(requestParameters.type, ).then((request) => request(axios, basePath)); }, + getFiltersWithHttpInfo(requestParameters: FiltersApiGetFiltersRequest = {}, ): Promise> { + return localVarFp.getFiltersWithHttpInfo(requestParameters.type, ).then((request) => request(axios, basePath)); + }, /** * Updates an existing filter. * @summary Update filter @@ -517,6 +615,9 @@ export const FiltersApiFactory = function (configuration?: Configuration, basePa updateFilter(requestParameters: FiltersApiUpdateFilterRequest, ): Promise { return localVarFp.updateFilter(requestParameters.id, requestParameters.include_field_code, requestParameters.UpdateFilterRequest, ).then((request) => request(axios, basePath)); }, + updateFilterWithHttpInfo(requestParameters: FiltersApiUpdateFilterRequest, ): Promise> { + return localVarFp.updateFilterWithHttpInfo(requestParameters.id, requestParameters.include_field_code, requestParameters.UpdateFilterRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -651,6 +752,18 @@ export class FiltersApi extends BaseAPI { return FiltersApiFp(this.configuration).addFilter(requestParameters.include_field_code, requestParameters.AddFilterRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addFilter`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FiltersApiAddFilterRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FiltersApi + */ + public addFilterWithHttpInfo(requestParameters: FiltersApiAddFilterRequest = {}, ) { + return FiltersApiFp(this.configuration).addFilterWithHttpInfo(requestParameters.include_field_code, requestParameters.AddFilterRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a filter as deleted. * @summary Delete a filter @@ -663,6 +776,18 @@ export class FiltersApi extends BaseAPI { return FiltersApiFp(this.configuration).deleteFilter(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteFilter`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FiltersApiDeleteFilterRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FiltersApi + */ + public deleteFilterWithHttpInfo(requestParameters: FiltersApiDeleteFilterRequest, ) { + return FiltersApiFp(this.configuration).deleteFilterWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks multiple filters as deleted. * @summary Delete multiple filters in bulk @@ -675,6 +800,18 @@ export class FiltersApi extends BaseAPI { return FiltersApiFp(this.configuration).deleteFilters(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteFilters`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FiltersApiDeleteFiltersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FiltersApi + */ + public deleteFiltersWithHttpInfo(requestParameters: FiltersApiDeleteFiltersRequest, ) { + return FiltersApiFp(this.configuration).deleteFiltersWithHttpInfo(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific filter. Note that this also returns the condition lines of the filter. * @summary Get one filter @@ -687,6 +824,18 @@ export class FiltersApi extends BaseAPI { return FiltersApiFp(this.configuration).getFilter(requestParameters.id, requestParameters.include_field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getFilter`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FiltersApiGetFilterRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FiltersApi + */ + public getFilterWithHttpInfo(requestParameters: FiltersApiGetFilterRequest, ) { + return FiltersApiFp(this.configuration).getFilterWithHttpInfo(requestParameters.id, requestParameters.include_field_code, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to add or update filters. For more information, see the tutorial for adding a filter. * @summary Get all filter helpers @@ -698,6 +847,17 @@ export class FiltersApi extends BaseAPI { return FiltersApiFp(this.configuration).getFilterHelpers().then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getFilterHelpers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof FiltersApi + */ + public getFilterHelpersWithHttpInfo() { + return FiltersApiFp(this.configuration).getFilterHelpersWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all filters. * @summary Get all filters @@ -710,6 +870,18 @@ export class FiltersApi extends BaseAPI { return FiltersApiFp(this.configuration).getFilters(requestParameters.type, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getFilters`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FiltersApiGetFiltersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FiltersApi + */ + public getFiltersWithHttpInfo(requestParameters: FiltersApiGetFiltersRequest = {}, ) { + return FiltersApiFp(this.configuration).getFiltersWithHttpInfo(requestParameters.type, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates an existing filter. * @summary Update filter @@ -721,4 +893,16 @@ export class FiltersApi extends BaseAPI { public updateFilter(requestParameters: FiltersApiUpdateFilterRequest, ) { return FiltersApiFp(this.configuration).updateFilter(requestParameters.id, requestParameters.include_field_code, requestParameters.UpdateFilterRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateFilter`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {FiltersApiUpdateFilterRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof FiltersApi + */ + public updateFilterWithHttpInfo(requestParameters: FiltersApiUpdateFilterRequest, ) { + return FiltersApiFp(this.configuration).updateFilterWithHttpInfo(requestParameters.id, requestParameters.include_field_code, requestParameters.UpdateFilterRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/goals-api.ts b/src/versions/v1/api/goals-api.ts index 232fcb03..e263ab1e 100644 --- a/src/versions/v1/api/goals-api.ts +++ b/src/versions/v1/api/goals-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddGoalRequest } from '../models'; // @ts-ignore @@ -353,6 +353,17 @@ export const GoalsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addGoal(AddGoalRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addGoal`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new goal + * @param {AddGoalRequest} [AddGoalRequest] + + * @throws {RequiredError} + */ + async addGoalWithHttpInfo(AddGoalRequest?: AddGoalRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addGoal(AddGoalRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a goal as deleted. * @summary Delete existing goal @@ -364,6 +375,17 @@ export const GoalsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGoal(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteGoal`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete existing goal + * @param {string} id The ID of the goal + + * @throws {RequiredError} + */ + async deleteGoalWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGoal(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Gets the progress of a goal for the specified period. * @summary Get result of a goal @@ -377,6 +399,19 @@ export const GoalsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getGoalResult(id, period_start, period_end, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getGoalResult`, but resolves with the response body together with the HTTP status and headers. + * @summary Get result of a goal + * @param {string} id The ID of the goal that the results are looked for + * @param {string} period_start The start date of the period for which to find the goal\'s progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. + * @param {string} period_end The end date of the period for which to find the goal\'s progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. + + * @throws {RequiredError} + */ + async getGoalResultWithHttpInfo(id: string, period_start: string, period_end: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getGoalResult(id, period_start, period_end, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa. * @summary Find goals @@ -400,6 +435,29 @@ export const GoalsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getGoals(type_name, title, is_active, assignee_id, assignee_type, expected_outcome_target, expected_outcome_tracking_metric, expected_outcome_currency_id, type_params_pipeline_id, type_params_stage_id, type_params_activity_type_id, period_start, period_end, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getGoals`, but resolves with the response body together with the HTTP status and headers. + * @summary Find goals + * @param {'deals_won' | 'deals_progressed' | 'activities_completed' | 'activities_added' | 'deals_started'} [type_name] The type of the goal. If provided, everyone\'s goals will be returned. + * @param {string} [title] The title of the goal + * @param {boolean} [is_active] Whether the goal is active or not + * @param {number} [assignee_id] The ID of the user who\'s goal to fetch. When omitted, only your goals will be returned. + * @param {'person' | 'company' | 'team'} [assignee_type] The type of the goal\'s assignee. If provided, everyone\'s goals will be returned. + * @param {number} [expected_outcome_target] The numeric value of the outcome. If provided, everyone\'s goals will be returned. + * @param {'quantity' | 'sum'} [expected_outcome_tracking_metric] The tracking metric of the expected outcome of the goal. If provided, everyone\'s goals will be returned. + * @param {number} [expected_outcome_currency_id] The numeric ID of the goal\'s currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone\'s goals will be returned. + * @param {Array} [type_params_pipeline_id] An array of pipeline IDs or `null` for all pipelines. If provided, everyone\'s goals will be returned. + * @param {number} [type_params_stage_id] The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone\'s goals will be returned. + * @param {Array} [type_params_activity_type_id] An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone\'s goals will be returned. + * @param {string} [period_start] The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. + * @param {string} [period_end] The end date of the period for which to find goals. Date in format of YYYY-MM-DD. + + * @throws {RequiredError} + */ + async getGoalsWithHttpInfo(type_name?: 'deals_won' | 'deals_progressed' | 'activities_completed' | 'activities_added' | 'deals_started', title?: string, is_active?: boolean, assignee_id?: number, assignee_type?: 'person' | 'company' | 'team', expected_outcome_target?: number, expected_outcome_tracking_metric?: 'quantity' | 'sum', expected_outcome_currency_id?: number, type_params_pipeline_id?: Array, type_params_stage_id?: number, type_params_activity_type_id?: Array, period_start?: string, period_end?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getGoals(type_name, title, is_active, assignee_id, assignee_type, expected_outcome_target, expected_outcome_tracking_metric, expected_outcome_currency_id, type_params_pipeline_id, type_params_stage_id, type_params_activity_type_id, period_start, period_end, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates an existing goal. * @summary Update existing goal @@ -412,6 +470,18 @@ export const GoalsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateGoal(id, BasicGoalRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateGoal`, but resolves with the response body together with the HTTP status and headers. + * @summary Update existing goal + * @param {string} id The ID of the goal + * @param {BasicGoalRequest} [BasicGoalRequest] + + * @throws {RequiredError} + */ + async updateGoalWithHttpInfo(id: string, BasicGoalRequest?: BasicGoalRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateGoal(id, BasicGoalRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -432,6 +502,9 @@ export const GoalsApiFactory = function (configuration?: Configuration, basePath addGoal(requestParameters: GoalsApiAddGoalRequest = {}, ): Promise { return localVarFp.addGoal(requestParameters.AddGoalRequest, ).then((request) => request(axios, basePath)); }, + addGoalWithHttpInfo(requestParameters: GoalsApiAddGoalRequest = {}, ): Promise> { + return localVarFp.addGoalWithHttpInfo(requestParameters.AddGoalRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a goal as deleted. * @summary Delete existing goal @@ -442,6 +515,9 @@ export const GoalsApiFactory = function (configuration?: Configuration, basePath deleteGoal(requestParameters: GoalsApiDeleteGoalRequest, ): Promise { return localVarFp.deleteGoal(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteGoalWithHttpInfo(requestParameters: GoalsApiDeleteGoalRequest, ): Promise> { + return localVarFp.deleteGoalWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Gets the progress of a goal for the specified period. * @summary Get result of a goal @@ -452,6 +528,9 @@ export const GoalsApiFactory = function (configuration?: Configuration, basePath getGoalResult(requestParameters: GoalsApiGetGoalResultRequest, ): Promise { return localVarFp.getGoalResult(requestParameters.id, requestParameters.period_start, requestParameters.period_end, ).then((request) => request(axios, basePath)); }, + getGoalResultWithHttpInfo(requestParameters: GoalsApiGetGoalResultRequest, ): Promise> { + return localVarFp.getGoalResultWithHttpInfo(requestParameters.id, requestParameters.period_start, requestParameters.period_end, ).then((request) => request(axios, basePath)); + }, /** * Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa. * @summary Find goals @@ -462,6 +541,9 @@ export const GoalsApiFactory = function (configuration?: Configuration, basePath getGoals(requestParameters: GoalsApiGetGoalsRequest = {}, ): Promise { return localVarFp.getGoals(requestParameters.type_name, requestParameters.title, requestParameters.is_active, requestParameters.assignee_id, requestParameters.assignee_type, requestParameters.expected_outcome_target, requestParameters.expected_outcome_tracking_metric, requestParameters.expected_outcome_currency_id, requestParameters.type_params_pipeline_id, requestParameters.type_params_stage_id, requestParameters.type_params_activity_type_id, requestParameters.period_start, requestParameters.period_end, ).then((request) => request(axios, basePath)); }, + getGoalsWithHttpInfo(requestParameters: GoalsApiGetGoalsRequest = {}, ): Promise> { + return localVarFp.getGoalsWithHttpInfo(requestParameters.type_name, requestParameters.title, requestParameters.is_active, requestParameters.assignee_id, requestParameters.assignee_type, requestParameters.expected_outcome_target, requestParameters.expected_outcome_tracking_metric, requestParameters.expected_outcome_currency_id, requestParameters.type_params_pipeline_id, requestParameters.type_params_stage_id, requestParameters.type_params_activity_type_id, requestParameters.period_start, requestParameters.period_end, ).then((request) => request(axios, basePath)); + }, /** * Updates an existing goal. * @summary Update existing goal @@ -472,6 +554,9 @@ export const GoalsApiFactory = function (configuration?: Configuration, basePath updateGoal(requestParameters: GoalsApiUpdateGoalRequest, ): Promise { return localVarFp.updateGoal(requestParameters.id, requestParameters.BasicGoalRequest, ).then((request) => request(axios, basePath)); }, + updateGoalWithHttpInfo(requestParameters: GoalsApiUpdateGoalRequest, ): Promise> { + return localVarFp.updateGoalWithHttpInfo(requestParameters.id, requestParameters.BasicGoalRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -669,6 +754,18 @@ export class GoalsApi extends BaseAPI { return GoalsApiFp(this.configuration).addGoal(requestParameters.AddGoalRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addGoal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {GoalsApiAddGoalRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof GoalsApi + */ + public addGoalWithHttpInfo(requestParameters: GoalsApiAddGoalRequest = {}, ) { + return GoalsApiFp(this.configuration).addGoalWithHttpInfo(requestParameters.AddGoalRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a goal as deleted. * @summary Delete existing goal @@ -681,6 +778,18 @@ export class GoalsApi extends BaseAPI { return GoalsApiFp(this.configuration).deleteGoal(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteGoal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {GoalsApiDeleteGoalRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof GoalsApi + */ + public deleteGoalWithHttpInfo(requestParameters: GoalsApiDeleteGoalRequest, ) { + return GoalsApiFp(this.configuration).deleteGoalWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Gets the progress of a goal for the specified period. * @summary Get result of a goal @@ -693,6 +802,18 @@ export class GoalsApi extends BaseAPI { return GoalsApiFp(this.configuration).getGoalResult(requestParameters.id, requestParameters.period_start, requestParameters.period_end, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getGoalResult`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {GoalsApiGetGoalResultRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof GoalsApi + */ + public getGoalResultWithHttpInfo(requestParameters: GoalsApiGetGoalResultRequest, ) { + return GoalsApiFp(this.configuration).getGoalResultWithHttpInfo(requestParameters.id, requestParameters.period_start, requestParameters.period_end, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa. * @summary Find goals @@ -705,6 +826,18 @@ export class GoalsApi extends BaseAPI { return GoalsApiFp(this.configuration).getGoals(requestParameters.type_name, requestParameters.title, requestParameters.is_active, requestParameters.assignee_id, requestParameters.assignee_type, requestParameters.expected_outcome_target, requestParameters.expected_outcome_tracking_metric, requestParameters.expected_outcome_currency_id, requestParameters.type_params_pipeline_id, requestParameters.type_params_stage_id, requestParameters.type_params_activity_type_id, requestParameters.period_start, requestParameters.period_end, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getGoals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {GoalsApiGetGoalsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof GoalsApi + */ + public getGoalsWithHttpInfo(requestParameters: GoalsApiGetGoalsRequest = {}, ) { + return GoalsApiFp(this.configuration).getGoalsWithHttpInfo(requestParameters.type_name, requestParameters.title, requestParameters.is_active, requestParameters.assignee_id, requestParameters.assignee_type, requestParameters.expected_outcome_target, requestParameters.expected_outcome_tracking_metric, requestParameters.expected_outcome_currency_id, requestParameters.type_params_pipeline_id, requestParameters.type_params_stage_id, requestParameters.type_params_activity_type_id, requestParameters.period_start, requestParameters.period_end, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates an existing goal. * @summary Update existing goal @@ -716,4 +849,16 @@ export class GoalsApi extends BaseAPI { public updateGoal(requestParameters: GoalsApiUpdateGoalRequest, ) { return GoalsApiFp(this.configuration).updateGoal(requestParameters.id, requestParameters.BasicGoalRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateGoal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {GoalsApiUpdateGoalRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof GoalsApi + */ + public updateGoalWithHttpInfo(requestParameters: GoalsApiUpdateGoalRequest, ) { + return GoalsApiFp(this.configuration).updateGoalWithHttpInfo(requestParameters.id, requestParameters.BasicGoalRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/lead-fields-api.ts b/src/versions/v1/api/lead-fields-api.ts index cd5211e0..d1f5c8de 100644 --- a/src/versions/v1/api/lead-fields-api.ts +++ b/src/versions/v1/api/lead-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetFieldsResponse } from '../models'; /** @@ -99,6 +99,18 @@ export const LeadFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadFields(start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getLeadFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all lead fields + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getLeadFieldsWithHttpInfo(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadFields(start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -119,6 +131,9 @@ export const LeadFieldsApiFactory = function (configuration?: Configuration, bas getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ): Promise { return localVarFp.getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getLeadFieldsWithHttpInfo(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ): Promise> { + return localVarFp.getLeadFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, }; }; @@ -161,4 +176,16 @@ export class LeadFieldsApi extends BaseAPI { public getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ) { return LeadFieldsApiFp(this.configuration).getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getLeadFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadFieldsApi + */ + public getLeadFieldsWithHttpInfo(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ) { + return LeadFieldsApiFp(this.configuration).getLeadFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/lead-labels-api.ts b/src/versions/v1/api/lead-labels-api.ts index 8d354cfd..65b04dc8 100644 --- a/src/versions/v1/api/lead-labels-api.ts +++ b/src/versions/v1/api/lead-labels-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddLeadLabelRequest } from '../models'; // @ts-ignore @@ -225,6 +225,17 @@ export const LeadLabelsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addLeadLabel(AddLeadLabelRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addLeadLabel`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a lead label + * @param {AddLeadLabelRequest} [AddLeadLabelRequest] + + * @throws {RequiredError} + */ + async addLeadLabelWithHttpInfo(AddLeadLabelRequest?: AddLeadLabelRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addLeadLabel(AddLeadLabelRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a specific lead label. * @summary Delete a lead label @@ -236,6 +247,17 @@ export const LeadLabelsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteLeadLabel(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteLeadLabel`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a lead label + * @param {string} id The ID of the lead label + + * @throws {RequiredError} + */ + async deleteLeadLabelWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteLeadLabel(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns details of all lead labels. This endpoint does not support pagination and all labels are always returned. * @summary Get all lead labels @@ -246,6 +268,16 @@ export const LeadLabelsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadLabels(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getLeadLabels`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all lead labels + + * @throws {RequiredError} + */ + async getLeadLabelsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadLabels(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates one or more properties of a lead label. Only properties included in the request will be updated. * @summary Update a lead label @@ -258,6 +290,18 @@ export const LeadLabelsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateLeadLabel(id, UpdateLeadLabelRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateLeadLabel`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a lead label + * @param {string} id The ID of the lead label + * @param {UpdateLeadLabelRequest} [UpdateLeadLabelRequest] + + * @throws {RequiredError} + */ + async updateLeadLabelWithHttpInfo(id: string, UpdateLeadLabelRequest?: UpdateLeadLabelRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateLeadLabel(id, UpdateLeadLabelRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -278,6 +322,9 @@ export const LeadLabelsApiFactory = function (configuration?: Configuration, bas addLeadLabel(requestParameters: LeadLabelsApiAddLeadLabelRequest = {}, ): Promise { return localVarFp.addLeadLabel(requestParameters.AddLeadLabelRequest, ).then((request) => request(axios, basePath)); }, + addLeadLabelWithHttpInfo(requestParameters: LeadLabelsApiAddLeadLabelRequest = {}, ): Promise> { + return localVarFp.addLeadLabelWithHttpInfo(requestParameters.AddLeadLabelRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes a specific lead label. * @summary Delete a lead label @@ -288,6 +335,9 @@ export const LeadLabelsApiFactory = function (configuration?: Configuration, bas deleteLeadLabel(requestParameters: LeadLabelsApiDeleteLeadLabelRequest, ): Promise { return localVarFp.deleteLeadLabel(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteLeadLabelWithHttpInfo(requestParameters: LeadLabelsApiDeleteLeadLabelRequest, ): Promise> { + return localVarFp.deleteLeadLabelWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns details of all lead labels. This endpoint does not support pagination and all labels are always returned. * @summary Get all lead labels @@ -297,6 +347,9 @@ export const LeadLabelsApiFactory = function (configuration?: Configuration, bas getLeadLabels(): Promise { return localVarFp.getLeadLabels().then((request) => request(axios, basePath)); }, + getLeadLabelsWithHttpInfo(): Promise> { + return localVarFp.getLeadLabelsWithHttpInfo().then((request) => request(axios, basePath)); + }, /** * Updates one or more properties of a lead label. Only properties included in the request will be updated. * @summary Update a lead label @@ -307,6 +360,9 @@ export const LeadLabelsApiFactory = function (configuration?: Configuration, bas updateLeadLabel(requestParameters: LeadLabelsApiUpdateLeadLabelRequest, ): Promise { return localVarFp.updateLeadLabel(requestParameters.id, requestParameters.UpdateLeadLabelRequest, ).then((request) => request(axios, basePath)); }, + updateLeadLabelWithHttpInfo(requestParameters: LeadLabelsApiUpdateLeadLabelRequest, ): Promise> { + return localVarFp.updateLeadLabelWithHttpInfo(requestParameters.id, requestParameters.UpdateLeadLabelRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -378,6 +434,18 @@ export class LeadLabelsApi extends BaseAPI { return LeadLabelsApiFp(this.configuration).addLeadLabel(requestParameters.AddLeadLabelRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addLeadLabel`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadLabelsApiAddLeadLabelRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadLabelsApi + */ + public addLeadLabelWithHttpInfo(requestParameters: LeadLabelsApiAddLeadLabelRequest = {}, ) { + return LeadLabelsApiFp(this.configuration).addLeadLabelWithHttpInfo(requestParameters.AddLeadLabelRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a specific lead label. * @summary Delete a lead label @@ -390,6 +458,18 @@ export class LeadLabelsApi extends BaseAPI { return LeadLabelsApiFp(this.configuration).deleteLeadLabel(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteLeadLabel`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadLabelsApiDeleteLeadLabelRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadLabelsApi + */ + public deleteLeadLabelWithHttpInfo(requestParameters: LeadLabelsApiDeleteLeadLabelRequest, ) { + return LeadLabelsApiFp(this.configuration).deleteLeadLabelWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns details of all lead labels. This endpoint does not support pagination and all labels are always returned. * @summary Get all lead labels @@ -401,6 +481,17 @@ export class LeadLabelsApi extends BaseAPI { return LeadLabelsApiFp(this.configuration).getLeadLabels().then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getLeadLabels`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof LeadLabelsApi + */ + public getLeadLabelsWithHttpInfo() { + return LeadLabelsApiFp(this.configuration).getLeadLabelsWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } + /** * Updates one or more properties of a lead label. Only properties included in the request will be updated. * @summary Update a lead label @@ -412,4 +503,16 @@ export class LeadLabelsApi extends BaseAPI { public updateLeadLabel(requestParameters: LeadLabelsApiUpdateLeadLabelRequest, ) { return LeadLabelsApiFp(this.configuration).updateLeadLabel(requestParameters.id, requestParameters.UpdateLeadLabelRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateLeadLabel`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadLabelsApiUpdateLeadLabelRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadLabelsApi + */ + public updateLeadLabelWithHttpInfo(requestParameters: LeadLabelsApiUpdateLeadLabelRequest, ) { + return LeadLabelsApiFp(this.configuration).updateLeadLabelWithHttpInfo(requestParameters.id, requestParameters.UpdateLeadLabelRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/lead-sources-api.ts b/src/versions/v1/api/lead-sources-api.ts index 5731a61e..10f7d641 100644 --- a/src/versions/v1/api/lead-sources-api.ts +++ b/src/versions/v1/api/lead-sources-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetLeadsSourceResponse } from '../models'; /** @@ -87,6 +87,16 @@ export const LeadSourcesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadSources(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getLeadSources`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all lead sources + + * @throws {RequiredError} + */ + async getLeadSourcesWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadSources(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -106,6 +116,9 @@ export const LeadSourcesApiFactory = function (configuration?: Configuration, ba getLeadSources(): Promise { return localVarFp.getLeadSources().then((request) => request(axios, basePath)); }, + getLeadSourcesWithHttpInfo(): Promise> { + return localVarFp.getLeadSourcesWithHttpInfo().then((request) => request(axios, basePath)); + }, }; }; @@ -126,4 +139,15 @@ export class LeadSourcesApi extends BaseAPI { public getLeadSources() { return LeadSourcesApiFp(this.configuration).getLeadSources().then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getLeadSources`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof LeadSourcesApi + */ + public getLeadSourcesWithHttpInfo() { + return LeadSourcesApiFp(this.configuration).getLeadSourcesWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/leads-api.ts b/src/versions/v1/api/leads-api.ts index 5e76bead..1b2f2b98 100644 --- a/src/versions/v1/api/leads-api.ts +++ b/src/versions/v1/api/leads-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddLeadRequest } from '../models'; // @ts-ignore @@ -502,6 +502,17 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addLead(AddLeadRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addLead`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a lead + * @param {AddLeadRequest} [AddLeadRequest] + + * @throws {RequiredError} + */ + async addLeadWithHttpInfo(AddLeadRequest?: AddLeadRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addLead(AddLeadRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a specific lead. * @summary Delete a lead @@ -513,6 +524,17 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteLead(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteLead`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a lead + * @param {string} id The ID of the lead + + * @throws {RequiredError} + */ + async deleteLeadWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteLead(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns multiple archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all archived leads @@ -530,6 +552,23 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedLeads(limit, start, owner_id, person_id, organization_id, filter_id, sort, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getArchivedLeads`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all archived leads + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. + * @param {number} [start] For pagination, the position that represents the first result for the page + * @param {number} [owner_id] If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. + * @param {number} [person_id] If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. + * @param {number} [organization_id] If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. + * @param {number} [filter_id] The ID of the filter to use + * @param {'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time'} [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). + + * @throws {RequiredError} + */ + async getArchivedLeadsWithHttpInfo(limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, sort?: 'id' | 'title' | 'owner_id' | 'creator_id' | 'was_seen' | 'expected_close_date' | 'next_activity_id' | 'add_time' | 'update_time', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedLeads(limit, start, owner_id, person_id, organization_id, filter_id, sort, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns details of a specific lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. * @summary Get one lead @@ -541,6 +580,17 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getLead(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getLead`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one lead + * @param {string} id The ID of the lead + + * @throws {RequiredError} + */ + async getLeadWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLead(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the users permitted to access a lead. * @summary List permitted users @@ -552,6 +602,17 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadUsers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getLeadUsers`, but resolves with the response body together with the HTTP status and headers. + * @summary List permitted users + * @param {string} id The ID of the lead + + * @throws {RequiredError} + */ + async getLeadUsersWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadUsers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns multiple not archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all leads @@ -570,6 +631,24 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getLeads(limit, start, owner_id, person_id, organization_id, filter_id, updated_since, sort, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getLeads`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all leads + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. + * @param {number} [start] For pagination, the position that represents the first result for the page + * @param {number} [owner_id] If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. + * @param {number} [person_id] If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. + * @param {number} [organization_id] If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. + * @param {number} [filter_id] The ID of the filter to use + * @param {string} [updated_since] If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. + * @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, title, owner_id, creator_id, label_ids, value, source_name, was_seen, expected_close_date, next_activity_id, add_time, update_time, visible_to, and custom fields. + + * @throws {RequiredError} + */ + async getLeadsWithHttpInfo(limit?: number, start?: number, owner_id?: number, person_id?: number, organization_id?: number, filter_id?: number, updated_since?: string, sort?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeads(limit, start, owner_id, person_id, organization_id, filter_id, updated_since, sort, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads @@ -588,6 +667,24 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchLeads`, but resolves with the response body together with the HTTP status and headers. + * @summary Search leads + * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. + * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. + * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. + * @param {Set<'lead.was_seen'>} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {number} [start] Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async searchLeadsWithHttpInfo(term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: Set<'lead.was_seen'>, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates one or more properties of a lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. See an example given in the updating custom fields’ values tutorial. * @summary Update a lead @@ -600,6 +697,18 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateLead(id, UpdateLeadRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateLead`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a lead + * @param {string} id The ID of the lead + * @param {UpdateLeadRequest} [UpdateLeadRequest] + + * @throws {RequiredError} + */ + async updateLeadWithHttpInfo(id: string, UpdateLeadRequest?: UpdateLeadRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateLead(id, UpdateLeadRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -620,6 +729,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath addLead(requestParameters: LeadsApiAddLeadRequest = {}, ): Promise { return localVarFp.addLead(requestParameters.AddLeadRequest, ).then((request) => request(axios, basePath)); }, + addLeadWithHttpInfo(requestParameters: LeadsApiAddLeadRequest = {}, ): Promise> { + return localVarFp.addLeadWithHttpInfo(requestParameters.AddLeadRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes a specific lead. * @summary Delete a lead @@ -630,6 +742,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath deleteLead(requestParameters: LeadsApiDeleteLeadRequest, ): Promise { return localVarFp.deleteLead(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteLeadWithHttpInfo(requestParameters: LeadsApiDeleteLeadRequest, ): Promise> { + return localVarFp.deleteLeadWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns multiple archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all archived leads @@ -640,6 +755,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath getArchivedLeads(requestParameters: LeadsApiGetArchivedLeadsRequest = {}, ): Promise { return localVarFp.getArchivedLeads(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.sort, ).then((request) => request(axios, basePath)); }, + getArchivedLeadsWithHttpInfo(requestParameters: LeadsApiGetArchivedLeadsRequest = {}, ): Promise> { + return localVarFp.getArchivedLeadsWithHttpInfo(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.sort, ).then((request) => request(axios, basePath)); + }, /** * Returns details of a specific lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. * @summary Get one lead @@ -650,6 +768,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath getLead(requestParameters: LeadsApiGetLeadRequest, ): Promise { return localVarFp.getLead(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getLeadWithHttpInfo(requestParameters: LeadsApiGetLeadRequest, ): Promise> { + return localVarFp.getLeadWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists the users permitted to access a lead. * @summary List permitted users @@ -660,6 +781,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath getLeadUsers(requestParameters: LeadsApiGetLeadUsersRequest, ): Promise { return localVarFp.getLeadUsers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getLeadUsersWithHttpInfo(requestParameters: LeadsApiGetLeadUsersRequest, ): Promise> { + return localVarFp.getLeadUsersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns multiple not archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all leads @@ -670,6 +794,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath getLeads(requestParameters: LeadsApiGetLeadsRequest = {}, ): Promise { return localVarFp.getLeads(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.updated_since, requestParameters.sort, ).then((request) => request(axios, basePath)); }, + getLeadsWithHttpInfo(requestParameters: LeadsApiGetLeadsRequest = {}, ): Promise> { + return localVarFp.getLeadsWithHttpInfo(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.updated_since, requestParameters.sort, ).then((request) => request(axios, basePath)); + }, /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads @@ -680,6 +807,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath searchLeads(requestParameters: LeadsApiSearchLeadsRequest, ): Promise { return localVarFp.searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + searchLeadsWithHttpInfo(requestParameters: LeadsApiSearchLeadsRequest, ): Promise> { + return localVarFp.searchLeadsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Updates one or more properties of a lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. See an example given in the updating custom fields’ values tutorial. * @summary Update a lead @@ -690,6 +820,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath updateLead(requestParameters: LeadsApiUpdateLeadRequest, ): Promise { return localVarFp.updateLead(requestParameters.id, requestParameters.UpdateLeadRequest, ).then((request) => request(axios, basePath)); }, + updateLeadWithHttpInfo(requestParameters: LeadsApiUpdateLeadRequest, ): Promise> { + return localVarFp.updateLeadWithHttpInfo(requestParameters.id, requestParameters.UpdateLeadRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -971,6 +1104,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).addLead(requestParameters.AddLeadRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addLead`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiAddLeadRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public addLeadWithHttpInfo(requestParameters: LeadsApiAddLeadRequest = {}, ) { + return LeadsApiFp(this.configuration).addLeadWithHttpInfo(requestParameters.AddLeadRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a specific lead. * @summary Delete a lead @@ -983,6 +1128,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).deleteLead(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteLead`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiDeleteLeadRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public deleteLeadWithHttpInfo(requestParameters: LeadsApiDeleteLeadRequest, ) { + return LeadsApiFp(this.configuration).deleteLeadWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns multiple archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all archived leads @@ -995,6 +1152,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).getArchivedLeads(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getArchivedLeads`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiGetArchivedLeadsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public getArchivedLeadsWithHttpInfo(requestParameters: LeadsApiGetArchivedLeadsRequest = {}, ) { + return LeadsApiFp(this.configuration).getArchivedLeadsWithHttpInfo(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns details of a specific lead. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. * @summary Get one lead @@ -1007,6 +1176,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).getLead(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getLead`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiGetLeadRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public getLeadWithHttpInfo(requestParameters: LeadsApiGetLeadRequest, ) { + return LeadsApiFp(this.configuration).getLeadWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the users permitted to access a lead. * @summary List permitted users @@ -1019,6 +1200,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).getLeadUsers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getLeadUsers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiGetLeadUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public getLeadUsersWithHttpInfo(requestParameters: LeadsApiGetLeadUsersRequest, ) { + return LeadsApiFp(this.configuration).getLeadUsersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns multiple not archived leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields\' structure from deals. * @summary Get all leads @@ -1031,6 +1224,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).getLeads(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.updated_since, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getLeads`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiGetLeadsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public getLeadsWithHttpInfo(requestParameters: LeadsApiGetLeadsRequest = {}, ) { + return LeadsApiFp(this.configuration).getLeadsWithHttpInfo(requestParameters.limit, requestParameters.start, requestParameters.owner_id, requestParameters.person_id, requestParameters.organization_id, requestParameters.filter_id, requestParameters.updated_since, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); + } + /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads @@ -1043,6 +1248,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `searchLeads`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiSearchLeadsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public searchLeadsWithHttpInfo(requestParameters: LeadsApiSearchLeadsRequest, ) { + return LeadsApiFp(this.configuration).searchLeadsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates one or more properties of a lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a lead contains custom fields, the fields\' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field\'s value hasn\'t been set for the lead, it won\'t appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. See an example given in the updating custom fields’ values tutorial. * @summary Update a lead @@ -1054,4 +1271,16 @@ export class LeadsApi extends BaseAPI { public updateLead(requestParameters: LeadsApiUpdateLeadRequest, ) { return LeadsApiFp(this.configuration).updateLead(requestParameters.id, requestParameters.UpdateLeadRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateLead`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiUpdateLeadRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public updateLeadWithHttpInfo(requestParameters: LeadsApiUpdateLeadRequest, ) { + return LeadsApiFp(this.configuration).updateLeadWithHttpInfo(requestParameters.id, requestParameters.UpdateLeadRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/legacy-teams-api.ts b/src/versions/v1/api/legacy-teams-api.ts index 485d086d..022b170e 100644 --- a/src/versions/v1/api/legacy-teams-api.ts +++ b/src/versions/v1/api/legacy-teams-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddTeamRequest1 } from '../models'; // @ts-ignore @@ -426,6 +426,17 @@ export const LegacyTeamsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addTeam(AddTeamRequest1, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addTeam`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new team + * @param {AddTeamRequest1} [AddTeamRequest1] + + * @throws {RequiredError} + */ + async addTeamWithHttpInfo(AddTeamRequest1?: AddTeamRequest1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addTeam(AddTeamRequest1, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds users to an existing team. * @summary Add users to a team @@ -438,6 +449,18 @@ export const LegacyTeamsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addTeamUser(id, AddTeamUserRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addTeamUser`, but resolves with the response body together with the HTTP status and headers. + * @summary Add users to a team + * @param {number} id The ID of the team + * @param {AddTeamUserRequest} [AddTeamUserRequest] + + * @throws {RequiredError} + */ + async addTeamUserWithHttpInfo(id: number, AddTeamUserRequest?: AddTeamUserRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addTeamUser(id, AddTeamUserRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes users from an existing team. * @summary Delete users from a team @@ -450,6 +473,18 @@ export const LegacyTeamsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTeamUser(id, DeleteTeamUserRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteTeamUser`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete users from a team + * @param {number} id The ID of the team + * @param {DeleteTeamUserRequest} [DeleteTeamUserRequest] + + * @throws {RequiredError} + */ + async deleteTeamUserWithHttpInfo(id: number, DeleteTeamUserRequest?: DeleteTeamUserRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTeamUser(id, DeleteTeamUserRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific team. * @summary Get a single team @@ -462,6 +497,18 @@ export const LegacyTeamsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getTeam(id, skip_users, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getTeam`, but resolves with the response body together with the HTTP status and headers. + * @summary Get a single team + * @param {number} id The ID of the team + * @param {0 | 1} [skip_users] When enabled, the teams will not include IDs of member users + + * @throws {RequiredError} + */ + async getTeamWithHttpInfo(id: number, skip_users?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTeam(id, skip_users, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns a list of all user IDs within a team. * @summary Get all users in a team @@ -473,6 +520,17 @@ export const LegacyTeamsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getTeamUsers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getTeamUsers`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all users in a team + * @param {number} id The ID of the team + + * @throws {RequiredError} + */ + async getTeamUsersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTeamUsers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about teams within the company. * @summary Get all teams @@ -485,6 +543,18 @@ export const LegacyTeamsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getTeams(order_by, skip_users, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getTeams`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all teams + * @param {'id' | 'name' | 'manager_id' | 'active_flag'} [order_by] The field name to sort returned teams by + * @param {0 | 1} [skip_users] When enabled, the teams will not include IDs of member users + + * @throws {RequiredError} + */ + async getTeamsWithHttpInfo(order_by?: 'id' | 'name' | 'manager_id' | 'active_flag', skip_users?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTeams(order_by, skip_users, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all teams which have the specified user as a member. * @summary Get all teams of a user @@ -498,6 +568,19 @@ export const LegacyTeamsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserTeams(id, order_by, skip_users, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserTeams`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all teams of a user + * @param {number} id The ID of the user + * @param {'id' | 'name' | 'manager_id' | 'active_flag'} [order_by] The field name to sort returned teams by + * @param {0 | 1} [skip_users] When enabled, the teams will not include IDs of member users + + * @throws {RequiredError} + */ + async getUserTeamsWithHttpInfo(id: number, order_by?: 'id' | 'name' | 'manager_id' | 'active_flag', skip_users?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserTeams(id, order_by, skip_users, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates an existing team and returns the updated object. * @summary Update a team @@ -510,6 +593,18 @@ export const LegacyTeamsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateTeam(id, UpdateTeamRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateTeam`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a team + * @param {number} id The ID of the team + * @param {UpdateTeamRequest} [UpdateTeamRequest] + + * @throws {RequiredError} + */ + async updateTeamWithHttpInfo(id: number, UpdateTeamRequest?: UpdateTeamRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateTeam(id, UpdateTeamRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -530,6 +625,9 @@ export const LegacyTeamsApiFactory = function (configuration?: Configuration, ba addTeam(requestParameters: LegacyTeamsApiAddTeamRequest = {}, ): Promise { return localVarFp.addTeam(requestParameters.AddTeamRequest1, ).then((request) => request(axios, basePath)); }, + addTeamWithHttpInfo(requestParameters: LegacyTeamsApiAddTeamRequest = {}, ): Promise> { + return localVarFp.addTeamWithHttpInfo(requestParameters.AddTeamRequest1, ).then((request) => request(axios, basePath)); + }, /** * Adds users to an existing team. * @summary Add users to a team @@ -540,6 +638,9 @@ export const LegacyTeamsApiFactory = function (configuration?: Configuration, ba addTeamUser(requestParameters: LegacyTeamsApiAddTeamUserRequest, ): Promise { return localVarFp.addTeamUser(requestParameters.id, requestParameters.AddTeamUserRequest, ).then((request) => request(axios, basePath)); }, + addTeamUserWithHttpInfo(requestParameters: LegacyTeamsApiAddTeamUserRequest, ): Promise> { + return localVarFp.addTeamUserWithHttpInfo(requestParameters.id, requestParameters.AddTeamUserRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes users from an existing team. * @summary Delete users from a team @@ -550,6 +651,9 @@ export const LegacyTeamsApiFactory = function (configuration?: Configuration, ba deleteTeamUser(requestParameters: LegacyTeamsApiDeleteTeamUserRequest, ): Promise { return localVarFp.deleteTeamUser(requestParameters.id, requestParameters.DeleteTeamUserRequest, ).then((request) => request(axios, basePath)); }, + deleteTeamUserWithHttpInfo(requestParameters: LegacyTeamsApiDeleteTeamUserRequest, ): Promise> { + return localVarFp.deleteTeamUserWithHttpInfo(requestParameters.id, requestParameters.DeleteTeamUserRequest, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific team. * @summary Get a single team @@ -560,6 +664,9 @@ export const LegacyTeamsApiFactory = function (configuration?: Configuration, ba getTeam(requestParameters: LegacyTeamsApiGetTeamRequest, ): Promise { return localVarFp.getTeam(requestParameters.id, requestParameters.skip_users, ).then((request) => request(axios, basePath)); }, + getTeamWithHttpInfo(requestParameters: LegacyTeamsApiGetTeamRequest, ): Promise> { + return localVarFp.getTeamWithHttpInfo(requestParameters.id, requestParameters.skip_users, ).then((request) => request(axios, basePath)); + }, /** * Returns a list of all user IDs within a team. * @summary Get all users in a team @@ -570,6 +677,9 @@ export const LegacyTeamsApiFactory = function (configuration?: Configuration, ba getTeamUsers(requestParameters: LegacyTeamsApiGetTeamUsersRequest, ): Promise { return localVarFp.getTeamUsers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getTeamUsersWithHttpInfo(requestParameters: LegacyTeamsApiGetTeamUsersRequest, ): Promise> { + return localVarFp.getTeamUsersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about teams within the company. * @summary Get all teams @@ -580,6 +690,9 @@ export const LegacyTeamsApiFactory = function (configuration?: Configuration, ba getTeams(requestParameters: LegacyTeamsApiGetTeamsRequest = {}, ): Promise { return localVarFp.getTeams(requestParameters.order_by, requestParameters.skip_users, ).then((request) => request(axios, basePath)); }, + getTeamsWithHttpInfo(requestParameters: LegacyTeamsApiGetTeamsRequest = {}, ): Promise> { + return localVarFp.getTeamsWithHttpInfo(requestParameters.order_by, requestParameters.skip_users, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all teams which have the specified user as a member. * @summary Get all teams of a user @@ -590,6 +703,9 @@ export const LegacyTeamsApiFactory = function (configuration?: Configuration, ba getUserTeams(requestParameters: LegacyTeamsApiGetUserTeamsRequest, ): Promise { return localVarFp.getUserTeams(requestParameters.id, requestParameters.order_by, requestParameters.skip_users, ).then((request) => request(axios, basePath)); }, + getUserTeamsWithHttpInfo(requestParameters: LegacyTeamsApiGetUserTeamsRequest, ): Promise> { + return localVarFp.getUserTeamsWithHttpInfo(requestParameters.id, requestParameters.order_by, requestParameters.skip_users, ).then((request) => request(axios, basePath)); + }, /** * Updates an existing team and returns the updated object. * @summary Update a team @@ -600,6 +716,9 @@ export const LegacyTeamsApiFactory = function (configuration?: Configuration, ba updateTeam(requestParameters: LegacyTeamsApiUpdateTeamRequest, ): Promise { return localVarFp.updateTeam(requestParameters.id, requestParameters.UpdateTeamRequest, ).then((request) => request(axios, basePath)); }, + updateTeamWithHttpInfo(requestParameters: LegacyTeamsApiUpdateTeamRequest, ): Promise> { + return localVarFp.updateTeamWithHttpInfo(requestParameters.id, requestParameters.UpdateTeamRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -783,6 +902,18 @@ export class LegacyTeamsApi extends BaseAPI { return LegacyTeamsApiFp(this.configuration).addTeam(requestParameters.AddTeamRequest1, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addTeam`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LegacyTeamsApiAddTeamRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LegacyTeamsApi + */ + public addTeamWithHttpInfo(requestParameters: LegacyTeamsApiAddTeamRequest = {}, ) { + return LegacyTeamsApiFp(this.configuration).addTeamWithHttpInfo(requestParameters.AddTeamRequest1, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds users to an existing team. * @summary Add users to a team @@ -795,6 +926,18 @@ export class LegacyTeamsApi extends BaseAPI { return LegacyTeamsApiFp(this.configuration).addTeamUser(requestParameters.id, requestParameters.AddTeamUserRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addTeamUser`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LegacyTeamsApiAddTeamUserRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LegacyTeamsApi + */ + public addTeamUserWithHttpInfo(requestParameters: LegacyTeamsApiAddTeamUserRequest, ) { + return LegacyTeamsApiFp(this.configuration).addTeamUserWithHttpInfo(requestParameters.id, requestParameters.AddTeamUserRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes users from an existing team. * @summary Delete users from a team @@ -807,6 +950,18 @@ export class LegacyTeamsApi extends BaseAPI { return LegacyTeamsApiFp(this.configuration).deleteTeamUser(requestParameters.id, requestParameters.DeleteTeamUserRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteTeamUser`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LegacyTeamsApiDeleteTeamUserRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LegacyTeamsApi + */ + public deleteTeamUserWithHttpInfo(requestParameters: LegacyTeamsApiDeleteTeamUserRequest, ) { + return LegacyTeamsApiFp(this.configuration).deleteTeamUserWithHttpInfo(requestParameters.id, requestParameters.DeleteTeamUserRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific team. * @summary Get a single team @@ -819,6 +974,18 @@ export class LegacyTeamsApi extends BaseAPI { return LegacyTeamsApiFp(this.configuration).getTeam(requestParameters.id, requestParameters.skip_users, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getTeam`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LegacyTeamsApiGetTeamRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LegacyTeamsApi + */ + public getTeamWithHttpInfo(requestParameters: LegacyTeamsApiGetTeamRequest, ) { + return LegacyTeamsApiFp(this.configuration).getTeamWithHttpInfo(requestParameters.id, requestParameters.skip_users, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns a list of all user IDs within a team. * @summary Get all users in a team @@ -831,6 +998,18 @@ export class LegacyTeamsApi extends BaseAPI { return LegacyTeamsApiFp(this.configuration).getTeamUsers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getTeamUsers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LegacyTeamsApiGetTeamUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LegacyTeamsApi + */ + public getTeamUsersWithHttpInfo(requestParameters: LegacyTeamsApiGetTeamUsersRequest, ) { + return LegacyTeamsApiFp(this.configuration).getTeamUsersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about teams within the company. * @summary Get all teams @@ -843,6 +1022,18 @@ export class LegacyTeamsApi extends BaseAPI { return LegacyTeamsApiFp(this.configuration).getTeams(requestParameters.order_by, requestParameters.skip_users, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getTeams`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LegacyTeamsApiGetTeamsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LegacyTeamsApi + */ + public getTeamsWithHttpInfo(requestParameters: LegacyTeamsApiGetTeamsRequest = {}, ) { + return LegacyTeamsApiFp(this.configuration).getTeamsWithHttpInfo(requestParameters.order_by, requestParameters.skip_users, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all teams which have the specified user as a member. * @summary Get all teams of a user @@ -855,6 +1046,18 @@ export class LegacyTeamsApi extends BaseAPI { return LegacyTeamsApiFp(this.configuration).getUserTeams(requestParameters.id, requestParameters.order_by, requestParameters.skip_users, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getUserTeams`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LegacyTeamsApiGetUserTeamsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LegacyTeamsApi + */ + public getUserTeamsWithHttpInfo(requestParameters: LegacyTeamsApiGetUserTeamsRequest, ) { + return LegacyTeamsApiFp(this.configuration).getUserTeamsWithHttpInfo(requestParameters.id, requestParameters.order_by, requestParameters.skip_users, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates an existing team and returns the updated object. * @summary Update a team @@ -866,4 +1069,16 @@ export class LegacyTeamsApi extends BaseAPI { public updateTeam(requestParameters: LegacyTeamsApiUpdateTeamRequest, ) { return LegacyTeamsApiFp(this.configuration).updateTeam(requestParameters.id, requestParameters.UpdateTeamRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateTeam`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LegacyTeamsApiUpdateTeamRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LegacyTeamsApi + */ + public updateTeamWithHttpInfo(requestParameters: LegacyTeamsApiUpdateTeamRequest, ) { + return LegacyTeamsApiFp(this.configuration).updateTeamWithHttpInfo(requestParameters.id, requestParameters.UpdateTeamRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/mailbox-api.ts b/src/versions/v1/api/mailbox-api.ts index 19421bab..b3c793f2 100644 --- a/src/versions/v1/api/mailbox-api.ts +++ b/src/versions/v1/api/mailbox-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { DeleteMailThreadResponse } from '../models'; // @ts-ignore @@ -354,6 +354,17 @@ export const MailboxApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMailThread(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteMailThread`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete mail thread + * @param {number} id The ID of the mail thread + + * @throws {RequiredError} + */ + async deleteMailThreadWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMailThread(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific mail message. * @summary Get one mail message @@ -366,6 +377,18 @@ export const MailboxApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getMailMessage(id, include_body, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getMailMessage`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one mail message + * @param {number} id The ID of the mail message to fetch + * @param {0 | 1} [include_body] Whether to include the full message body or not. `0` = Don\'t include, `1` = Include. + + * @throws {RequiredError} + */ + async getMailMessageWithHttpInfo(id: number, include_body?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMailMessage(id, include_body, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns a specific mail thread. * @summary Get one mail thread @@ -377,6 +400,17 @@ export const MailboxApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getMailThread(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getMailThread`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one mail thread + * @param {number} id The ID of the mail thread + + * @throws {RequiredError} + */ + async getMailThreadWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMailThread(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all the mail messages inside a specified mail thread. * @summary Get all mail messages of mail thread @@ -388,6 +422,17 @@ export const MailboxApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getMailThreadMessages(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getMailThreadMessages`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all mail messages of mail thread + * @param {number} id The ID of the mail thread + + * @throws {RequiredError} + */ + async getMailThreadMessagesWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMailThreadMessages(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns mail threads in a specified folder ordered by the most recent message within. * @summary Get mail threads @@ -401,6 +446,19 @@ export const MailboxApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getMailThreads(folder, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getMailThreads`, but resolves with the response body together with the HTTP status and headers. + * @summary Get mail threads + * @param {'inbox' | 'drafts' | 'sent' | 'archive'} folder The type of folder to fetch + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getMailThreadsWithHttpInfo(folder: 'inbox' | 'drafts' | 'sent' | 'archive', start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMailThreads(folder, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a mail thread. * @summary Update mail thread details @@ -417,6 +475,22 @@ export const MailboxApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateMailThreadDetails(id, deal_id, lead_id, shared_flag, read_flag, archived_flag, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateMailThreadDetails`, but resolves with the response body together with the HTTP status and headers. + * @summary Update mail thread details + * @param {number} id The ID of the mail thread + * @param {number} [deal_id] The ID of the deal this thread is associated with + * @param {string} [lead_id] The ID of the lead this thread is associated with + * @param {number} [shared_flag] + * @param {number} [read_flag] + * @param {number} [archived_flag] + + * @throws {RequiredError} + */ + async updateMailThreadDetailsWithHttpInfo(id: number, deal_id?: number, lead_id?: string, shared_flag?: number, read_flag?: number, archived_flag?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateMailThreadDetails(id, deal_id, lead_id, shared_flag, read_flag, archived_flag, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -437,6 +511,9 @@ export const MailboxApiFactory = function (configuration?: Configuration, basePa deleteMailThread(requestParameters: MailboxApiDeleteMailThreadRequest, ): Promise { return localVarFp.deleteMailThread(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteMailThreadWithHttpInfo(requestParameters: MailboxApiDeleteMailThreadRequest, ): Promise> { + return localVarFp.deleteMailThreadWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific mail message. * @summary Get one mail message @@ -447,6 +524,9 @@ export const MailboxApiFactory = function (configuration?: Configuration, basePa getMailMessage(requestParameters: MailboxApiGetMailMessageRequest, ): Promise { return localVarFp.getMailMessage(requestParameters.id, requestParameters.include_body, ).then((request) => request(axios, basePath)); }, + getMailMessageWithHttpInfo(requestParameters: MailboxApiGetMailMessageRequest, ): Promise> { + return localVarFp.getMailMessageWithHttpInfo(requestParameters.id, requestParameters.include_body, ).then((request) => request(axios, basePath)); + }, /** * Returns a specific mail thread. * @summary Get one mail thread @@ -457,6 +537,9 @@ export const MailboxApiFactory = function (configuration?: Configuration, basePa getMailThread(requestParameters: MailboxApiGetMailThreadRequest, ): Promise { return localVarFp.getMailThread(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getMailThreadWithHttpInfo(requestParameters: MailboxApiGetMailThreadRequest, ): Promise> { + return localVarFp.getMailThreadWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all the mail messages inside a specified mail thread. * @summary Get all mail messages of mail thread @@ -467,6 +550,9 @@ export const MailboxApiFactory = function (configuration?: Configuration, basePa getMailThreadMessages(requestParameters: MailboxApiGetMailThreadMessagesRequest, ): Promise { return localVarFp.getMailThreadMessages(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getMailThreadMessagesWithHttpInfo(requestParameters: MailboxApiGetMailThreadMessagesRequest, ): Promise> { + return localVarFp.getMailThreadMessagesWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns mail threads in a specified folder ordered by the most recent message within. * @summary Get mail threads @@ -477,6 +563,9 @@ export const MailboxApiFactory = function (configuration?: Configuration, basePa getMailThreads(requestParameters: MailboxApiGetMailThreadsRequest, ): Promise { return localVarFp.getMailThreads(requestParameters.folder, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getMailThreadsWithHttpInfo(requestParameters: MailboxApiGetMailThreadsRequest, ): Promise> { + return localVarFp.getMailThreadsWithHttpInfo(requestParameters.folder, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a mail thread. * @summary Update mail thread details @@ -487,6 +576,9 @@ export const MailboxApiFactory = function (configuration?: Configuration, basePa updateMailThreadDetails(requestParameters: MailboxApiUpdateMailThreadDetailsRequest, ): Promise { return localVarFp.updateMailThreadDetails(requestParameters.id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.shared_flag, requestParameters.read_flag, requestParameters.archived_flag, ).then((request) => request(axios, basePath)); }, + updateMailThreadDetailsWithHttpInfo(requestParameters: MailboxApiUpdateMailThreadDetailsRequest, ): Promise> { + return localVarFp.updateMailThreadDetailsWithHttpInfo(requestParameters.id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.shared_flag, requestParameters.read_flag, requestParameters.archived_flag, ).then((request) => request(axios, basePath)); + }, }; }; @@ -649,6 +741,18 @@ export class MailboxApi extends BaseAPI { return MailboxApiFp(this.configuration).deleteMailThread(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteMailThread`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {MailboxApiDeleteMailThreadRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof MailboxApi + */ + public deleteMailThreadWithHttpInfo(requestParameters: MailboxApiDeleteMailThreadRequest, ) { + return MailboxApiFp(this.configuration).deleteMailThreadWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific mail message. * @summary Get one mail message @@ -661,6 +765,18 @@ export class MailboxApi extends BaseAPI { return MailboxApiFp(this.configuration).getMailMessage(requestParameters.id, requestParameters.include_body, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getMailMessage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {MailboxApiGetMailMessageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof MailboxApi + */ + public getMailMessageWithHttpInfo(requestParameters: MailboxApiGetMailMessageRequest, ) { + return MailboxApiFp(this.configuration).getMailMessageWithHttpInfo(requestParameters.id, requestParameters.include_body, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns a specific mail thread. * @summary Get one mail thread @@ -673,6 +789,18 @@ export class MailboxApi extends BaseAPI { return MailboxApiFp(this.configuration).getMailThread(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getMailThread`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {MailboxApiGetMailThreadRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof MailboxApi + */ + public getMailThreadWithHttpInfo(requestParameters: MailboxApiGetMailThreadRequest, ) { + return MailboxApiFp(this.configuration).getMailThreadWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all the mail messages inside a specified mail thread. * @summary Get all mail messages of mail thread @@ -685,6 +813,18 @@ export class MailboxApi extends BaseAPI { return MailboxApiFp(this.configuration).getMailThreadMessages(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getMailThreadMessages`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {MailboxApiGetMailThreadMessagesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof MailboxApi + */ + public getMailThreadMessagesWithHttpInfo(requestParameters: MailboxApiGetMailThreadMessagesRequest, ) { + return MailboxApiFp(this.configuration).getMailThreadMessagesWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns mail threads in a specified folder ordered by the most recent message within. * @summary Get mail threads @@ -697,6 +837,18 @@ export class MailboxApi extends BaseAPI { return MailboxApiFp(this.configuration).getMailThreads(requestParameters.folder, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getMailThreads`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {MailboxApiGetMailThreadsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof MailboxApi + */ + public getMailThreadsWithHttpInfo(requestParameters: MailboxApiGetMailThreadsRequest, ) { + return MailboxApiFp(this.configuration).getMailThreadsWithHttpInfo(requestParameters.folder, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a mail thread. * @summary Update mail thread details @@ -708,4 +860,16 @@ export class MailboxApi extends BaseAPI { public updateMailThreadDetails(requestParameters: MailboxApiUpdateMailThreadDetailsRequest, ) { return MailboxApiFp(this.configuration).updateMailThreadDetails(requestParameters.id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.shared_flag, requestParameters.read_flag, requestParameters.archived_flag, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateMailThreadDetails`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {MailboxApiUpdateMailThreadDetailsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof MailboxApi + */ + public updateMailThreadDetailsWithHttpInfo(requestParameters: MailboxApiUpdateMailThreadDetailsRequest, ) { + return MailboxApiFp(this.configuration).updateMailThreadDetailsWithHttpInfo(requestParameters.id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.shared_flag, requestParameters.read_flag, requestParameters.archived_flag, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/meetings-api.ts b/src/versions/v1/api/meetings-api.ts index 00825f17..e87a01ca 100644 --- a/src/versions/v1/api/meetings-api.ts +++ b/src/versions/v1/api/meetings-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddUserProviderLinkRequest } from '../models'; // @ts-ignore @@ -137,6 +137,17 @@ export const MeetingsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUserProviderLink(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteUserProviderLink`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete the link between a user and the installed video call integration + * @param {string} id Unique identifier linking a user to the installed integration + + * @throws {RequiredError} + */ + async deleteUserProviderLinkWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUserProviderLink(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * A video calling provider must call this endpoint after a user has installed the video calling app so that the new user\'s information is sent. * @summary Link a user with the installed video call integration @@ -148,6 +159,17 @@ export const MeetingsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.saveUserProviderLink(AddUserProviderLinkRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `saveUserProviderLink`, but resolves with the response body together with the HTTP status and headers. + * @summary Link a user with the installed video call integration + * @param {AddUserProviderLinkRequest} [AddUserProviderLinkRequest] + + * @throws {RequiredError} + */ + async saveUserProviderLinkWithHttpInfo(AddUserProviderLinkRequest?: AddUserProviderLinkRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.saveUserProviderLink(AddUserProviderLinkRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -168,6 +190,9 @@ export const MeetingsApiFactory = function (configuration?: Configuration, baseP deleteUserProviderLink(requestParameters: MeetingsApiDeleteUserProviderLinkRequest, ): Promise { return localVarFp.deleteUserProviderLink(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteUserProviderLinkWithHttpInfo(requestParameters: MeetingsApiDeleteUserProviderLinkRequest, ): Promise> { + return localVarFp.deleteUserProviderLinkWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * A video calling provider must call this endpoint after a user has installed the video calling app so that the new user\'s information is sent. * @summary Link a user with the installed video call integration @@ -178,6 +203,9 @@ export const MeetingsApiFactory = function (configuration?: Configuration, baseP saveUserProviderLink(requestParameters: MeetingsApiSaveUserProviderLinkRequest = {}, ): Promise { return localVarFp.saveUserProviderLink(requestParameters.AddUserProviderLinkRequest, ).then((request) => request(axios, basePath)); }, + saveUserProviderLinkWithHttpInfo(requestParameters: MeetingsApiSaveUserProviderLinkRequest = {}, ): Promise> { + return localVarFp.saveUserProviderLinkWithHttpInfo(requestParameters.AddUserProviderLinkRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -228,6 +256,18 @@ export class MeetingsApi extends BaseAPI { return MeetingsApiFp(this.configuration).deleteUserProviderLink(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteUserProviderLink`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {MeetingsApiDeleteUserProviderLinkRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof MeetingsApi + */ + public deleteUserProviderLinkWithHttpInfo(requestParameters: MeetingsApiDeleteUserProviderLinkRequest, ) { + return MeetingsApiFp(this.configuration).deleteUserProviderLinkWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * A video calling provider must call this endpoint after a user has installed the video calling app so that the new user\'s information is sent. * @summary Link a user with the installed video call integration @@ -239,4 +279,16 @@ export class MeetingsApi extends BaseAPI { public saveUserProviderLink(requestParameters: MeetingsApiSaveUserProviderLinkRequest = {}, ) { return MeetingsApiFp(this.configuration).saveUserProviderLink(requestParameters.AddUserProviderLinkRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `saveUserProviderLink`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {MeetingsApiSaveUserProviderLinkRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof MeetingsApi + */ + public saveUserProviderLinkWithHttpInfo(requestParameters: MeetingsApiSaveUserProviderLinkRequest = {}, ) { + return MeetingsApiFp(this.configuration).saveUserProviderLinkWithHttpInfo(requestParameters.AddUserProviderLinkRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/note-fields-api.ts b/src/versions/v1/api/note-fields-api.ts index 12142423..e469fdd3 100644 --- a/src/versions/v1/api/note-fields-api.ts +++ b/src/versions/v1/api/note-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetNoteFieldsResponse } from '../models'; /** @@ -87,6 +87,16 @@ export const NoteFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getNoteFields(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getNoteFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all note fields + + * @throws {RequiredError} + */ + async getNoteFieldsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getNoteFields(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -106,6 +116,9 @@ export const NoteFieldsApiFactory = function (configuration?: Configuration, bas getNoteFields(): Promise { return localVarFp.getNoteFields().then((request) => request(axios, basePath)); }, + getNoteFieldsWithHttpInfo(): Promise> { + return localVarFp.getNoteFieldsWithHttpInfo().then((request) => request(axios, basePath)); + }, }; }; @@ -126,4 +139,15 @@ export class NoteFieldsApi extends BaseAPI { public getNoteFields() { return NoteFieldsApiFp(this.configuration).getNoteFields().then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getNoteFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof NoteFieldsApi + */ + public getNoteFieldsWithHttpInfo() { + return NoteFieldsApiFp(this.configuration).getNoteFieldsWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/notes-api.ts b/src/versions/v1/api/notes-api.ts index 3baf1091..0ff8ab02 100644 --- a/src/versions/v1/api/notes-api.ts +++ b/src/versions/v1/api/notes-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddNoteRequest } from '../models'; // @ts-ignore @@ -608,6 +608,17 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addNote(AddNoteRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addNote`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a note + * @param {AddNoteRequest} [AddNoteRequest] + + * @throws {RequiredError} + */ + async addNoteWithHttpInfo(AddNoteRequest?: AddNoteRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addNote(AddNoteRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a new comment to a note. * @summary Add a comment to a note @@ -620,6 +631,18 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addNoteComment(id, CommentPostPutObject, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addNoteComment`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a comment to a note + * @param {number} id The ID of the note + * @param {CommentPostPutObject} [CommentPostPutObject] + + * @throws {RequiredError} + */ + async addNoteCommentWithHttpInfo(id: number, CommentPostPutObject?: CommentPostPutObject, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addNoteComment(id, CommentPostPutObject, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a comment. * @summary Delete a comment related to a note @@ -632,6 +655,18 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteComment(id, commentId, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteComment`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a comment related to a note + * @param {number} id The ID of the note + * @param {string} commentId The ID of the comment + + * @throws {RequiredError} + */ + async deleteCommentWithHttpInfo(id: number, commentId: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteComment(id, commentId, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a specific note. * @summary Delete a note @@ -643,6 +678,17 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteNote(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteNote`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a note + * @param {number} id The ID of the note + + * @throws {RequiredError} + */ + async deleteNoteWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteNote(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a comment. * @summary Get one comment @@ -655,6 +701,18 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getComment(id, commentId, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getComment`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one comment + * @param {number} id The ID of the note + * @param {string} commentId The ID of the comment + + * @throws {RequiredError} + */ + async getCommentWithHttpInfo(id: number, commentId: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getComment(id, commentId, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns details about a specific note. * @summary Get one note @@ -666,6 +724,17 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getNote(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getNote`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one note + * @param {number} id The ID of the note + + * @throws {RequiredError} + */ + async getNoteWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getNote(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all comments associated with a note. * @summary Get all comments for a note @@ -679,6 +748,19 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getNoteComments(id, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getNoteComments`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all comments for a note + * @param {number} id The ID of the note + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getNoteCommentsWithHttpInfo(id: number, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getNoteComments(id, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all notes. * @summary Get all notes @@ -708,6 +790,35 @@ export const NotesApiFp = function(configuration?: Configuration) { 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); }, + /** + * Same as `getNotes`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all notes + * @param {number} [user_id] The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. + * @param {string} [lead_id] The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. + * @param {number} [deal_id] The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. + * @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`. + * @param {string} [start_date] The date in format of YYYY-MM-DD from which notes to fetch + * @param {string} [end_date] The date in format of YYYY-MM-DD until which notes to fetch to + * @param {string} [updated_since] If set, only notes with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {0 | 1} [pinned_to_lead_flag] If set, the results are filtered by note to lead pinning state + * @param {0 | 1} [pinned_to_deal_flag] If set, the results are filtered by note to deal pinning state + * @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 getNotesWithHttpInfo(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, true); + }, /** * Updates a comment related to a note. * @summary Update a comment related to a note @@ -721,6 +832,19 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateCommentForNote(id, commentId, CommentPostPutObject, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateCommentForNote`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a comment related to a note + * @param {number} id The ID of the note + * @param {string} commentId The ID of the comment + * @param {CommentPostPutObject} [CommentPostPutObject] + + * @throws {RequiredError} + */ + async updateCommentForNoteWithHttpInfo(id: number, commentId: string, CommentPostPutObject?: CommentPostPutObject, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateCommentForNote(id, commentId, CommentPostPutObject, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a note. * @summary Update a note @@ -733,6 +857,18 @@ export const NotesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateNote(id, NoteRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateNote`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a note + * @param {number} id The ID of the note + * @param {NoteRequest} [NoteRequest] + + * @throws {RequiredError} + */ + async updateNoteWithHttpInfo(id: number, NoteRequest?: NoteRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateNote(id, NoteRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -753,6 +889,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath addNote(requestParameters: NotesApiAddNoteRequest = {}, ): Promise { return localVarFp.addNote(requestParameters.AddNoteRequest, ).then((request) => request(axios, basePath)); }, + addNoteWithHttpInfo(requestParameters: NotesApiAddNoteRequest = {}, ): Promise> { + return localVarFp.addNoteWithHttpInfo(requestParameters.AddNoteRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a new comment to a note. * @summary Add a comment to a note @@ -763,6 +902,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath addNoteComment(requestParameters: NotesApiAddNoteCommentRequest, ): Promise { return localVarFp.addNoteComment(requestParameters.id, requestParameters.CommentPostPutObject, ).then((request) => request(axios, basePath)); }, + addNoteCommentWithHttpInfo(requestParameters: NotesApiAddNoteCommentRequest, ): Promise> { + return localVarFp.addNoteCommentWithHttpInfo(requestParameters.id, requestParameters.CommentPostPutObject, ).then((request) => request(axios, basePath)); + }, /** * Deletes a comment. * @summary Delete a comment related to a note @@ -773,6 +915,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath deleteComment(requestParameters: NotesApiDeleteCommentRequest, ): Promise { return localVarFp.deleteComment(requestParameters.id, requestParameters.commentId, ).then((request) => request(axios, basePath)); }, + deleteCommentWithHttpInfo(requestParameters: NotesApiDeleteCommentRequest, ): Promise> { + return localVarFp.deleteCommentWithHttpInfo(requestParameters.id, requestParameters.commentId, ).then((request) => request(axios, basePath)); + }, /** * Deletes a specific note. * @summary Delete a note @@ -783,6 +928,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath deleteNote(requestParameters: NotesApiDeleteNoteRequest, ): Promise { return localVarFp.deleteNote(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteNoteWithHttpInfo(requestParameters: NotesApiDeleteNoteRequest, ): Promise> { + return localVarFp.deleteNoteWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a comment. * @summary Get one comment @@ -793,6 +941,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath getComment(requestParameters: NotesApiGetCommentRequest, ): Promise { return localVarFp.getComment(requestParameters.id, requestParameters.commentId, ).then((request) => request(axios, basePath)); }, + getCommentWithHttpInfo(requestParameters: NotesApiGetCommentRequest, ): Promise> { + return localVarFp.getCommentWithHttpInfo(requestParameters.id, requestParameters.commentId, ).then((request) => request(axios, basePath)); + }, /** * Returns details about a specific note. * @summary Get one note @@ -803,6 +954,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath getNote(requestParameters: NotesApiGetNoteRequest, ): Promise { return localVarFp.getNote(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getNoteWithHttpInfo(requestParameters: NotesApiGetNoteRequest, ): Promise> { + return localVarFp.getNoteWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all comments associated with a note. * @summary Get all comments for a note @@ -813,6 +967,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath getNoteComments(requestParameters: NotesApiGetNoteCommentsRequest, ): Promise { return localVarFp.getNoteComments(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getNoteCommentsWithHttpInfo(requestParameters: NotesApiGetNoteCommentsRequest, ): Promise> { + return localVarFp.getNoteCommentsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Returns all notes. * @summary Get all notes @@ -823,6 +980,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath 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.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)); }, + getNotesWithHttpInfo(requestParameters: NotesApiGetNotesRequest = {}, ): Promise> { + return localVarFp.getNotesWithHttpInfo(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. * @summary Update a comment related to a note @@ -833,6 +993,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath updateCommentForNote(requestParameters: NotesApiUpdateCommentForNoteRequest, ): Promise { return localVarFp.updateCommentForNote(requestParameters.id, requestParameters.commentId, requestParameters.CommentPostPutObject, ).then((request) => request(axios, basePath)); }, + updateCommentForNoteWithHttpInfo(requestParameters: NotesApiUpdateCommentForNoteRequest, ): Promise> { + return localVarFp.updateCommentForNoteWithHttpInfo(requestParameters.id, requestParameters.commentId, requestParameters.CommentPostPutObject, ).then((request) => request(axios, basePath)); + }, /** * Updates a note. * @summary Update a note @@ -843,6 +1006,9 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath updateNote(requestParameters: NotesApiUpdateNoteRequest, ): Promise { return localVarFp.updateNote(requestParameters.id, requestParameters.NoteRequest, ).then((request) => request(axios, basePath)); }, + updateNoteWithHttpInfo(requestParameters: NotesApiUpdateNoteRequest, ): Promise> { + return localVarFp.updateNoteWithHttpInfo(requestParameters.id, requestParameters.NoteRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -1187,6 +1353,18 @@ export class NotesApi extends BaseAPI { return NotesApiFp(this.configuration).addNote(requestParameters.AddNoteRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addNote`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiAddNoteRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public addNoteWithHttpInfo(requestParameters: NotesApiAddNoteRequest = {}, ) { + return NotesApiFp(this.configuration).addNoteWithHttpInfo(requestParameters.AddNoteRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a new comment to a note. * @summary Add a comment to a note @@ -1199,6 +1377,18 @@ export class NotesApi extends BaseAPI { return NotesApiFp(this.configuration).addNoteComment(requestParameters.id, requestParameters.CommentPostPutObject, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addNoteComment`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiAddNoteCommentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public addNoteCommentWithHttpInfo(requestParameters: NotesApiAddNoteCommentRequest, ) { + return NotesApiFp(this.configuration).addNoteCommentWithHttpInfo(requestParameters.id, requestParameters.CommentPostPutObject, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a comment. * @summary Delete a comment related to a note @@ -1211,6 +1401,18 @@ export class NotesApi extends BaseAPI { return NotesApiFp(this.configuration).deleteComment(requestParameters.id, requestParameters.commentId, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteComment`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiDeleteCommentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public deleteCommentWithHttpInfo(requestParameters: NotesApiDeleteCommentRequest, ) { + return NotesApiFp(this.configuration).deleteCommentWithHttpInfo(requestParameters.id, requestParameters.commentId, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a specific note. * @summary Delete a note @@ -1223,6 +1425,18 @@ export class NotesApi extends BaseAPI { return NotesApiFp(this.configuration).deleteNote(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteNote`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiDeleteNoteRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public deleteNoteWithHttpInfo(requestParameters: NotesApiDeleteNoteRequest, ) { + return NotesApiFp(this.configuration).deleteNoteWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a comment. * @summary Get one comment @@ -1235,6 +1449,18 @@ export class NotesApi extends BaseAPI { return NotesApiFp(this.configuration).getComment(requestParameters.id, requestParameters.commentId, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getComment`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiGetCommentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public getCommentWithHttpInfo(requestParameters: NotesApiGetCommentRequest, ) { + return NotesApiFp(this.configuration).getCommentWithHttpInfo(requestParameters.id, requestParameters.commentId, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns details about a specific note. * @summary Get one note @@ -1247,6 +1473,18 @@ export class NotesApi extends BaseAPI { return NotesApiFp(this.configuration).getNote(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getNote`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiGetNoteRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public getNoteWithHttpInfo(requestParameters: NotesApiGetNoteRequest, ) { + return NotesApiFp(this.configuration).getNoteWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all comments associated with a note. * @summary Get all comments for a note @@ -1259,6 +1497,18 @@ export class NotesApi extends BaseAPI { return NotesApiFp(this.configuration).getNoteComments(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getNoteComments`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiGetNoteCommentsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public getNoteCommentsWithHttpInfo(requestParameters: NotesApiGetNoteCommentsRequest, ) { + return NotesApiFp(this.configuration).getNoteCommentsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all notes. * @summary Get all notes @@ -1271,6 +1521,18 @@ export class NotesApi extends BaseAPI { 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)); } + /** + * Same as `getNotes`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiGetNotesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public getNotesWithHttpInfo(requestParameters: NotesApiGetNotesRequest = {}, ) { + return NotesApiFp(this.configuration).getNotesWithHttpInfo(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)); + } + /** * Updates a comment related to a note. * @summary Update a comment related to a note @@ -1283,6 +1545,18 @@ export class NotesApi extends BaseAPI { return NotesApiFp(this.configuration).updateCommentForNote(requestParameters.id, requestParameters.commentId, requestParameters.CommentPostPutObject, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateCommentForNote`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiUpdateCommentForNoteRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public updateCommentForNoteWithHttpInfo(requestParameters: NotesApiUpdateCommentForNoteRequest, ) { + return NotesApiFp(this.configuration).updateCommentForNoteWithHttpInfo(requestParameters.id, requestParameters.commentId, requestParameters.CommentPostPutObject, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a note. * @summary Update a note @@ -1294,4 +1568,16 @@ export class NotesApi extends BaseAPI { public updateNote(requestParameters: NotesApiUpdateNoteRequest, ) { return NotesApiFp(this.configuration).updateNote(requestParameters.id, requestParameters.NoteRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateNote`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {NotesApiUpdateNoteRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof NotesApi + */ + public updateNoteWithHttpInfo(requestParameters: NotesApiUpdateNoteRequest, ) { + return NotesApiFp(this.configuration).updateNoteWithHttpInfo(requestParameters.id, requestParameters.NoteRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/organization-fields-api.ts b/src/versions/v1/api/organization-fields-api.ts index 35b1cfd5..79170c0b 100644 --- a/src/versions/v1/api/organization-fields-api.ts +++ b/src/versions/v1/api/organization-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { CreateFieldRequest } from '../models'; // @ts-ignore @@ -320,6 +320,17 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationField(CreateFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new organization field + * @param {CreateFieldRequest} [CreateFieldRequest] + + * @throws {RequiredError} + */ + async addOrganizationFieldWithHttpInfo(CreateFieldRequest?: CreateFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationField(CreateFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete an organization field @@ -331,6 +342,17 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationField(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete an organization field + * @param {number} id The ID of the field + + * @throws {RequiredError} + */ + async deleteOrganizationFieldWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationField(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks multiple fields as deleted. * @summary Delete multiple organization fields in bulk @@ -342,6 +364,17 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFields(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteOrganizationFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete multiple organization fields in bulk + * @param {Set} ids The comma-separated field IDs to delete + + * @throws {RequiredError} + */ + async deleteOrganizationFieldsWithHttpInfo(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFields(ids, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific organization field. * @summary Get one organization field @@ -353,6 +386,17 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationField(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one organization field + * @param {number} id The ID of the field + + * @throws {RequiredError} + */ + async getOrganizationFieldWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationField(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all organization fields. * @summary Get all organization fields @@ -365,6 +409,18 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFields(start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all organization fields + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getOrganizationFieldsWithHttpInfo(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFields(start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates an organization field. For more information, see the tutorial for updating custom fields\' values. * @summary Update an organization field @@ -377,6 +433,18 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationField(id, UpdateFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update an organization field + * @param {number} id The ID of the field + * @param {UpdateFieldRequest} [UpdateFieldRequest] + + * @throws {RequiredError} + */ + async updateOrganizationFieldWithHttpInfo(id: number, UpdateFieldRequest?: UpdateFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationField(id, UpdateFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -397,6 +465,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat addOrganizationField(requestParameters: OrganizationFieldsApiAddOrganizationFieldRequest = {}, ): Promise { return localVarFp.addOrganizationField(requestParameters.CreateFieldRequest, ).then((request) => request(axios, basePath)); }, + addOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiAddOrganizationFieldRequest = {}, ): Promise> { + return localVarFp.addOrganizationFieldWithHttpInfo(requestParameters.CreateFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete an organization field @@ -407,6 +478,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat deleteOrganizationField(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldRequest, ): Promise { return localVarFp.deleteOrganizationField(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldRequest, ): Promise> { + return localVarFp.deleteOrganizationFieldWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Marks multiple fields as deleted. * @summary Delete multiple organization fields in bulk @@ -417,6 +491,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat deleteOrganizationFields(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldsRequest, ): Promise { return localVarFp.deleteOrganizationFields(requestParameters.ids, ).then((request) => request(axios, basePath)); }, + deleteOrganizationFieldsWithHttpInfo(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldsRequest, ): Promise> { + return localVarFp.deleteOrganizationFieldsWithHttpInfo(requestParameters.ids, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific organization field. * @summary Get one organization field @@ -427,6 +504,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat getOrganizationField(requestParameters: OrganizationFieldsApiGetOrganizationFieldRequest, ): Promise { return localVarFp.getOrganizationField(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiGetOrganizationFieldRequest, ): Promise> { + return localVarFp.getOrganizationFieldWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all organization fields. * @summary Get all organization fields @@ -437,6 +517,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat getOrganizationFields(requestParameters: OrganizationFieldsApiGetOrganizationFieldsRequest = {}, ): Promise { return localVarFp.getOrganizationFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getOrganizationFieldsWithHttpInfo(requestParameters: OrganizationFieldsApiGetOrganizationFieldsRequest = {}, ): Promise> { + return localVarFp.getOrganizationFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Updates an organization field. For more information, see the tutorial for updating custom fields\' values. * @summary Update an organization field @@ -447,6 +530,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat updateOrganizationField(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldRequest, ): Promise { return localVarFp.updateOrganizationField(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(axios, basePath)); }, + updateOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldRequest, ): Promise> { + return localVarFp.updateOrganizationFieldWithHttpInfo(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -567,6 +653,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).addOrganizationField(requestParameters.CreateFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiAddOrganizationFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public addOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiAddOrganizationFieldRequest = {}, ) { + return OrganizationFieldsApiFp(this.configuration).addOrganizationFieldWithHttpInfo(requestParameters.CreateFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete an organization field @@ -579,6 +677,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).deleteOrganizationField(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiDeleteOrganizationFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public deleteOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldRequest, ) { + return OrganizationFieldsApiFp(this.configuration).deleteOrganizationFieldWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks multiple fields as deleted. * @summary Delete multiple organization fields in bulk @@ -591,6 +701,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).deleteOrganizationFields(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteOrganizationFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiDeleteOrganizationFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public deleteOrganizationFieldsWithHttpInfo(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldsRequest, ) { + return OrganizationFieldsApiFp(this.configuration).deleteOrganizationFieldsWithHttpInfo(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific organization field. * @summary Get one organization field @@ -603,6 +725,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).getOrganizationField(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiGetOrganizationFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public getOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiGetOrganizationFieldRequest, ) { + return OrganizationFieldsApiFp(this.configuration).getOrganizationFieldWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all organization fields. * @summary Get all organization fields @@ -615,6 +749,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).getOrganizationFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiGetOrganizationFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public getOrganizationFieldsWithHttpInfo(requestParameters: OrganizationFieldsApiGetOrganizationFieldsRequest = {}, ) { + return OrganizationFieldsApiFp(this.configuration).getOrganizationFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates an organization field. For more information, see the tutorial for updating custom fields\' values. * @summary Update an organization field @@ -626,4 +772,16 @@ export class OrganizationFieldsApi extends BaseAPI { public updateOrganizationField(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldRequest, ) { return OrganizationFieldsApiFp(this.configuration).updateOrganizationField(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiUpdateOrganizationFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public updateOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldRequest, ) { + return OrganizationFieldsApiFp(this.configuration).updateOrganizationFieldWithHttpInfo(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/organization-relationships-api.ts b/src/versions/v1/api/organization-relationships-api.ts index 34c53e57..ce87b081 100644 --- a/src/versions/v1/api/organization-relationships-api.ts +++ b/src/versions/v1/api/organization-relationships-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddOrganizationRelationshipRequest } from '../models'; // @ts-ignore @@ -280,6 +280,17 @@ export const OrganizationRelationshipsApiFp = function(configuration?: Configura const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationRelationship(AddOrganizationRelationshipRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addOrganizationRelationship`, but resolves with the response body together with the HTTP status and headers. + * @summary Create an organization relationship + * @param {AddOrganizationRelationshipRequest} [AddOrganizationRelationshipRequest] + + * @throws {RequiredError} + */ + async addOrganizationRelationshipWithHttpInfo(AddOrganizationRelationshipRequest?: AddOrganizationRelationshipRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationRelationship(AddOrganizationRelationshipRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes an organization relationship and returns the deleted ID. * @summary Delete an organization relationship @@ -291,6 +302,17 @@ export const OrganizationRelationshipsApiFp = function(configuration?: Configura const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationRelationship(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteOrganizationRelationship`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete an organization relationship + * @param {number} id The ID of the organization relationship + + * @throws {RequiredError} + */ + async deleteOrganizationRelationshipWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationRelationship(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Finds and returns an organization relationship from its ID. * @summary Get one organization relationship @@ -303,6 +325,18 @@ export const OrganizationRelationshipsApiFp = function(configuration?: Configura const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationRelationship(id, org_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationRelationship`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one organization relationship + * @param {number} id The ID of the organization relationship + * @param {number} [org_id] The ID of the base organization for the returned calculated values + + * @throws {RequiredError} + */ + async getOrganizationRelationshipWithHttpInfo(id: number, org_id?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationRelationship(id, org_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Gets all of the relationships for a supplied organization ID. * @summary Get all relationships for organization @@ -314,6 +348,17 @@ export const OrganizationRelationshipsApiFp = function(configuration?: Configura const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationRelationships(org_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationRelationships`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all relationships for organization + * @param {number} org_id The ID of the organization to get relationships for + + * @throws {RequiredError} + */ + async getOrganizationRelationshipsWithHttpInfo(org_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationRelationships(org_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates and returns an organization relationship. * @summary Update an organization relationship @@ -326,6 +371,18 @@ export const OrganizationRelationshipsApiFp = function(configuration?: Configura const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationRelationship(id, OrganizationRelationship, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateOrganizationRelationship`, but resolves with the response body together with the HTTP status and headers. + * @summary Update an organization relationship + * @param {number} id The ID of the organization relationship + * @param {OrganizationRelationship} [OrganizationRelationship] + + * @throws {RequiredError} + */ + async updateOrganizationRelationshipWithHttpInfo(id: number, OrganizationRelationship?: OrganizationRelationship, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationRelationship(id, OrganizationRelationship, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -346,6 +403,9 @@ export const OrganizationRelationshipsApiFactory = function (configuration?: Con addOrganizationRelationship(requestParameters: OrganizationRelationshipsApiAddOrganizationRelationshipRequest = {}, ): Promise { return localVarFp.addOrganizationRelationship(requestParameters.AddOrganizationRelationshipRequest, ).then((request) => request(axios, basePath)); }, + addOrganizationRelationshipWithHttpInfo(requestParameters: OrganizationRelationshipsApiAddOrganizationRelationshipRequest = {}, ): Promise> { + return localVarFp.addOrganizationRelationshipWithHttpInfo(requestParameters.AddOrganizationRelationshipRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes an organization relationship and returns the deleted ID. * @summary Delete an organization relationship @@ -356,6 +416,9 @@ export const OrganizationRelationshipsApiFactory = function (configuration?: Con deleteOrganizationRelationship(requestParameters: OrganizationRelationshipsApiDeleteOrganizationRelationshipRequest, ): Promise { return localVarFp.deleteOrganizationRelationship(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteOrganizationRelationshipWithHttpInfo(requestParameters: OrganizationRelationshipsApiDeleteOrganizationRelationshipRequest, ): Promise> { + return localVarFp.deleteOrganizationRelationshipWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Finds and returns an organization relationship from its ID. * @summary Get one organization relationship @@ -366,6 +429,9 @@ export const OrganizationRelationshipsApiFactory = function (configuration?: Con getOrganizationRelationship(requestParameters: OrganizationRelationshipsApiGetOrganizationRelationshipRequest, ): Promise { return localVarFp.getOrganizationRelationship(requestParameters.id, requestParameters.org_id, ).then((request) => request(axios, basePath)); }, + getOrganizationRelationshipWithHttpInfo(requestParameters: OrganizationRelationshipsApiGetOrganizationRelationshipRequest, ): Promise> { + return localVarFp.getOrganizationRelationshipWithHttpInfo(requestParameters.id, requestParameters.org_id, ).then((request) => request(axios, basePath)); + }, /** * Gets all of the relationships for a supplied organization ID. * @summary Get all relationships for organization @@ -376,6 +442,9 @@ export const OrganizationRelationshipsApiFactory = function (configuration?: Con getOrganizationRelationships(requestParameters: OrganizationRelationshipsApiGetOrganizationRelationshipsRequest, ): Promise { return localVarFp.getOrganizationRelationships(requestParameters.org_id, ).then((request) => request(axios, basePath)); }, + getOrganizationRelationshipsWithHttpInfo(requestParameters: OrganizationRelationshipsApiGetOrganizationRelationshipsRequest, ): Promise> { + return localVarFp.getOrganizationRelationshipsWithHttpInfo(requestParameters.org_id, ).then((request) => request(axios, basePath)); + }, /** * Updates and returns an organization relationship. * @summary Update an organization relationship @@ -386,6 +455,9 @@ export const OrganizationRelationshipsApiFactory = function (configuration?: Con updateOrganizationRelationship(requestParameters: OrganizationRelationshipsApiUpdateOrganizationRelationshipRequest, ): Promise { return localVarFp.updateOrganizationRelationship(requestParameters.id, requestParameters.OrganizationRelationship, ).then((request) => request(axios, basePath)); }, + updateOrganizationRelationshipWithHttpInfo(requestParameters: OrganizationRelationshipsApiUpdateOrganizationRelationshipRequest, ): Promise> { + return localVarFp.updateOrganizationRelationshipWithHttpInfo(requestParameters.id, requestParameters.OrganizationRelationship, ).then((request) => request(axios, basePath)); + }, }; }; @@ -492,6 +564,18 @@ export class OrganizationRelationshipsApi extends BaseAPI { return OrganizationRelationshipsApiFp(this.configuration).addOrganizationRelationship(requestParameters.AddOrganizationRelationshipRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addOrganizationRelationship`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationRelationshipsApiAddOrganizationRelationshipRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationRelationshipsApi + */ + public addOrganizationRelationshipWithHttpInfo(requestParameters: OrganizationRelationshipsApiAddOrganizationRelationshipRequest = {}, ) { + return OrganizationRelationshipsApiFp(this.configuration).addOrganizationRelationshipWithHttpInfo(requestParameters.AddOrganizationRelationshipRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes an organization relationship and returns the deleted ID. * @summary Delete an organization relationship @@ -504,6 +588,18 @@ export class OrganizationRelationshipsApi extends BaseAPI { return OrganizationRelationshipsApiFp(this.configuration).deleteOrganizationRelationship(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteOrganizationRelationship`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationRelationshipsApiDeleteOrganizationRelationshipRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationRelationshipsApi + */ + public deleteOrganizationRelationshipWithHttpInfo(requestParameters: OrganizationRelationshipsApiDeleteOrganizationRelationshipRequest, ) { + return OrganizationRelationshipsApiFp(this.configuration).deleteOrganizationRelationshipWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Finds and returns an organization relationship from its ID. * @summary Get one organization relationship @@ -516,6 +612,18 @@ export class OrganizationRelationshipsApi extends BaseAPI { return OrganizationRelationshipsApiFp(this.configuration).getOrganizationRelationship(requestParameters.id, requestParameters.org_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationRelationship`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationRelationshipsApiGetOrganizationRelationshipRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationRelationshipsApi + */ + public getOrganizationRelationshipWithHttpInfo(requestParameters: OrganizationRelationshipsApiGetOrganizationRelationshipRequest, ) { + return OrganizationRelationshipsApiFp(this.configuration).getOrganizationRelationshipWithHttpInfo(requestParameters.id, requestParameters.org_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Gets all of the relationships for a supplied organization ID. * @summary Get all relationships for organization @@ -528,6 +636,18 @@ export class OrganizationRelationshipsApi extends BaseAPI { return OrganizationRelationshipsApiFp(this.configuration).getOrganizationRelationships(requestParameters.org_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationRelationships`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationRelationshipsApiGetOrganizationRelationshipsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationRelationshipsApi + */ + public getOrganizationRelationshipsWithHttpInfo(requestParameters: OrganizationRelationshipsApiGetOrganizationRelationshipsRequest, ) { + return OrganizationRelationshipsApiFp(this.configuration).getOrganizationRelationshipsWithHttpInfo(requestParameters.org_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates and returns an organization relationship. * @summary Update an organization relationship @@ -539,4 +659,16 @@ export class OrganizationRelationshipsApi extends BaseAPI { public updateOrganizationRelationship(requestParameters: OrganizationRelationshipsApiUpdateOrganizationRelationshipRequest, ) { return OrganizationRelationshipsApiFp(this.configuration).updateOrganizationRelationship(requestParameters.id, requestParameters.OrganizationRelationship, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateOrganizationRelationship`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationRelationshipsApiUpdateOrganizationRelationshipRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationRelationshipsApi + */ + public updateOrganizationRelationshipWithHttpInfo(requestParameters: OrganizationRelationshipsApiUpdateOrganizationRelationshipRequest, ) { + return OrganizationRelationshipsApiFp(this.configuration).updateOrganizationRelationshipWithHttpInfo(requestParameters.id, requestParameters.OrganizationRelationship, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/organizations-api.ts b/src/versions/v1/api/organizations-api.ts index 12a58f7a..482e21b1 100644 --- a/src/versions/v1/api/organizations-api.ts +++ b/src/versions/v1/api/organizations-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddOrganizationFollowerRequest } from '../models'; // @ts-ignore @@ -513,6 +513,18 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationFollower(id, AddOrganizationFollowerRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addOrganizationFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a follower to an organization + * @param {number} id The ID of the organization + * @param {AddOrganizationFollowerRequest} [AddOrganizationFollowerRequest] + + * @throws {RequiredError} + */ + async addOrganizationFollowerWithHttpInfo(id: number, AddOrganizationFollowerRequest?: AddOrganizationFollowerRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationFollower(id, AddOrganizationFollowerRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a follower from an organization. You can retrieve the `follower_id` from the List followers of an organization endpoint. * @summary Delete a follower from an organization @@ -525,6 +537,18 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFollower(id, follower_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteOrganizationFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a follower from an organization + * @param {number} id The ID of the organization + * @param {number} follower_id The ID of the relationship between the follower and the organization + + * @throws {RequiredError} + */ + async deleteOrganizationFollowerWithHttpInfo(id: number, follower_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFollower(id, follower_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists updates about field values of an organization. * @summary List updates about organization field values @@ -538,6 +562,19 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationChangelog(id, cursor, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationChangelog`, but resolves with the response body together with the HTTP status and headers. + * @summary List updates about organization field values + * @param {number} id The ID of the organization + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getOrganizationChangelogWithHttpInfo(id: number, cursor?: string, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationChangelog(id, cursor, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists files associated with an organization. * @summary List files attached to an organization @@ -552,6 +589,20 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFiles(id, start, limit, sort, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationFiles`, but resolves with the response body together with the HTTP status and headers. + * @summary List files attached to an organization + * @param {number} id The ID of the organization + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page. Please note that a maximum value of 100 is allowed. + * @param {string} [sort] Supported fields: `id`, `update_time` + + * @throws {RequiredError} + */ + async getOrganizationFilesWithHttpInfo(id: number, start?: number, limit?: number, sort?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFiles(id, start, limit, sort, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the followers of an organization. * @summary List followers of an organization @@ -563,6 +614,17 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFollowers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of an organization + * @param {number} id The ID of the organization + + * @throws {RequiredError} + */ + async getOrganizationFollowersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFollowers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists mail messages associated with an organization. * @summary List mail messages associated with an organization @@ -577,6 +639,20 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationMailMessages(id, start, limit, include_body, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationMailMessages`, but resolves with the response body together with the HTTP status and headers. + * @summary List mail messages associated with an organization + * @param {number} id The ID of the organization + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @param {0 | 1} [include_body] Whether to include the mail message body content in the response. `0` = Don\'t include, `1` = Include. + + * @throws {RequiredError} + */ + async getOrganizationMailMessagesWithHttpInfo(id: number, start?: number, limit?: number, include_body?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationMailMessages(id, start, limit, include_body, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists updates about an organization. * @summary List updates about an organization @@ -592,6 +668,21 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationUpdates(id, start, limit, all_changes, items, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationUpdates`, but resolves with the response body together with the HTTP status and headers. + * @summary List updates about an organization + * @param {number} id The ID of the organization + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document). + + * @throws {RequiredError} + */ + async getOrganizationUpdatesWithHttpInfo(id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationUpdates(id, start, limit, all_changes, items, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * List users permitted to access an organization. * @summary List permitted users @@ -603,6 +694,17 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationUsers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationUsers`, but resolves with the response body together with the HTTP status and headers. + * @summary List permitted users + * @param {number} id The ID of the organization + + * @throws {RequiredError} + */ + async getOrganizationUsersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationUsers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Merges an organization with another organization. For more information, see the tutorial for merging two organizations. * @summary Merge two organizations @@ -615,6 +717,18 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.mergeOrganizations(id, MergeOrganizationsRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `mergeOrganizations`, but resolves with the response body together with the HTTP status and headers. + * @summary Merge two organizations + * @param {number} id The ID of the organization + * @param {MergeOrganizationsRequest} [MergeOrganizationsRequest] + + * @throws {RequiredError} + */ + async mergeOrganizationsWithHttpInfo(id: number, MergeOrganizationsRequest?: MergeOrganizationsRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.mergeOrganizations(id, MergeOrganizationsRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -635,6 +749,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, addOrganizationFollower(requestParameters: OrganizationsApiAddOrganizationFollowerRequest, ): Promise { return localVarFp.addOrganizationFollower(requestParameters.id, requestParameters.AddOrganizationFollowerRequest, ).then((request) => request(axios, basePath)); }, + addOrganizationFollowerWithHttpInfo(requestParameters: OrganizationsApiAddOrganizationFollowerRequest, ): Promise> { + return localVarFp.addOrganizationFollowerWithHttpInfo(requestParameters.id, requestParameters.AddOrganizationFollowerRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes a follower from an organization. You can retrieve the `follower_id` from the List followers of an organization endpoint. * @summary Delete a follower from an organization @@ -645,6 +762,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, deleteOrganizationFollower(requestParameters: OrganizationsApiDeleteOrganizationFollowerRequest, ): Promise { return localVarFp.deleteOrganizationFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); }, + deleteOrganizationFollowerWithHttpInfo(requestParameters: OrganizationsApiDeleteOrganizationFollowerRequest, ): Promise> { + return localVarFp.deleteOrganizationFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); + }, /** * Lists updates about field values of an organization. * @summary List updates about organization field values @@ -655,6 +775,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganizationChangelog(requestParameters: OrganizationsApiGetOrganizationChangelogRequest, ): Promise { return localVarFp.getOrganizationChangelog(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getOrganizationChangelogWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationChangelogRequest, ): Promise> { + return localVarFp.getOrganizationChangelogWithHttpInfo(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Lists files associated with an organization. * @summary List files attached to an organization @@ -665,6 +788,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganizationFiles(requestParameters: OrganizationsApiGetOrganizationFilesRequest, ): Promise { return localVarFp.getOrganizationFiles(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); }, + getOrganizationFilesWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationFilesRequest, ): Promise> { + return localVarFp.getOrganizationFilesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); + }, /** * Lists the followers of an organization. * @summary List followers of an organization @@ -675,6 +801,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganizationFollowers(requestParameters: OrganizationsApiGetOrganizationFollowersRequest, ): Promise { return localVarFp.getOrganizationFollowers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getOrganizationFollowersWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationFollowersRequest, ): Promise> { + return localVarFp.getOrganizationFollowersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists mail messages associated with an organization. * @summary List mail messages associated with an organization @@ -685,6 +814,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganizationMailMessages(requestParameters: OrganizationsApiGetOrganizationMailMessagesRequest, ): Promise { return localVarFp.getOrganizationMailMessages(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(axios, basePath)); }, + getOrganizationMailMessagesWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationMailMessagesRequest, ): Promise> { + return localVarFp.getOrganizationMailMessagesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(axios, basePath)); + }, /** * Lists updates about an organization. * @summary List updates about an organization @@ -695,6 +827,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganizationUpdates(requestParameters: OrganizationsApiGetOrganizationUpdatesRequest, ): Promise { return localVarFp.getOrganizationUpdates(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(axios, basePath)); }, + getOrganizationUpdatesWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationUpdatesRequest, ): Promise> { + return localVarFp.getOrganizationUpdatesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(axios, basePath)); + }, /** * List users permitted to access an organization. * @summary List permitted users @@ -705,6 +840,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganizationUsers(requestParameters: OrganizationsApiGetOrganizationUsersRequest, ): Promise { return localVarFp.getOrganizationUsers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getOrganizationUsersWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationUsersRequest, ): Promise> { + return localVarFp.getOrganizationUsersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Merges an organization with another organization. For more information, see the tutorial for merging two organizations. * @summary Merge two organizations @@ -715,6 +853,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, mergeOrganizations(requestParameters: OrganizationsApiMergeOrganizationsRequest, ): Promise { return localVarFp.mergeOrganizations(requestParameters.id, requestParameters.MergeOrganizationsRequest, ).then((request) => request(axios, basePath)); }, + mergeOrganizationsWithHttpInfo(requestParameters: OrganizationsApiMergeOrganizationsRequest, ): Promise> { + return localVarFp.mergeOrganizationsWithHttpInfo(requestParameters.id, requestParameters.MergeOrganizationsRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -968,6 +1109,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).addOrganizationFollower(requestParameters.id, requestParameters.AddOrganizationFollowerRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addOrganizationFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiAddOrganizationFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public addOrganizationFollowerWithHttpInfo(requestParameters: OrganizationsApiAddOrganizationFollowerRequest, ) { + return OrganizationsApiFp(this.configuration).addOrganizationFollowerWithHttpInfo(requestParameters.id, requestParameters.AddOrganizationFollowerRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a follower from an organization. You can retrieve the `follower_id` from the List followers of an organization endpoint. * @summary Delete a follower from an organization @@ -980,6 +1133,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).deleteOrganizationFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteOrganizationFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiDeleteOrganizationFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public deleteOrganizationFollowerWithHttpInfo(requestParameters: OrganizationsApiDeleteOrganizationFollowerRequest, ) { + return OrganizationsApiFp(this.configuration).deleteOrganizationFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists updates about field values of an organization. * @summary List updates about organization field values @@ -992,6 +1157,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).getOrganizationChangelog(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationChangelogWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationChangelogRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationChangelogWithHttpInfo(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists files associated with an organization. * @summary List files attached to an organization @@ -1004,6 +1181,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).getOrganizationFiles(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationFiles`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationFilesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationFilesWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationFilesRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationFilesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the followers of an organization. * @summary List followers of an organization @@ -1016,6 +1205,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).getOrganizationFollowers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationFollowersWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationFollowersRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationFollowersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists mail messages associated with an organization. * @summary List mail messages associated with an organization @@ -1028,6 +1229,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).getOrganizationMailMessages(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationMailMessages`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationMailMessagesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationMailMessagesWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationMailMessagesRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationMailMessagesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists updates about an organization. * @summary List updates about an organization @@ -1040,6 +1253,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).getOrganizationUpdates(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationUpdates`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationUpdatesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationUpdatesWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationUpdatesRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationUpdatesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(this.axios, this.basePath)); + } + /** * List users permitted to access an organization. * @summary List permitted users @@ -1052,6 +1277,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).getOrganizationUsers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationUsers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationUsersWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationUsersRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationUsersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Merges an organization with another organization. For more information, see the tutorial for merging two organizations. * @summary Merge two organizations @@ -1063,4 +1300,16 @@ export class OrganizationsApi extends BaseAPI { public mergeOrganizations(requestParameters: OrganizationsApiMergeOrganizationsRequest, ) { return OrganizationsApiFp(this.configuration).mergeOrganizations(requestParameters.id, requestParameters.MergeOrganizationsRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `mergeOrganizations`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiMergeOrganizationsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public mergeOrganizationsWithHttpInfo(requestParameters: OrganizationsApiMergeOrganizationsRequest, ) { + return OrganizationsApiFp(this.configuration).mergeOrganizationsWithHttpInfo(requestParameters.id, requestParameters.MergeOrganizationsRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/permission-sets-api.ts b/src/versions/v1/api/permission-sets-api.ts index 57e541c8..8a80f62c 100644 --- a/src/versions/v1/api/permission-sets-api.ts +++ b/src/versions/v1/api/permission-sets-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetPermissionSetResponse } from '../models'; // @ts-ignore @@ -189,6 +189,17 @@ export const PermissionSetsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissionSet(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPermissionSet`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one permission set + * @param {string} id The ID of the permission set + + * @throws {RequiredError} + */ + async getPermissionSetWithHttpInfo(id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissionSet(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the list of assignments for a permission set. * @summary List permission set assignments @@ -202,6 +213,19 @@ export const PermissionSetsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissionSetAssignments(id, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPermissionSetAssignments`, but resolves with the response body together with the HTTP status and headers. + * @summary List permission set assignments + * @param {string} id The ID of the permission set + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getPermissionSetAssignmentsWithHttpInfo(id: string, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissionSetAssignments(id, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all permission sets. * @summary Get all permission sets @@ -213,6 +237,17 @@ export const PermissionSetsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissionSets(app, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPermissionSets`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all permission sets + * @param {'sales' | 'projects' | 'campaigns' | 'global' | 'account_settings' | 'partnership' | 'nova'} [app] The app to filter the permission sets by + + * @throws {RequiredError} + */ + async getPermissionSetsWithHttpInfo(app?: 'sales' | 'projects' | 'campaigns' | 'global' | 'account_settings' | 'partnership' | 'nova', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissionSets(app, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -233,6 +268,9 @@ export const PermissionSetsApiFactory = function (configuration?: Configuration, getPermissionSet(requestParameters: PermissionSetsApiGetPermissionSetRequest, ): Promise { return localVarFp.getPermissionSet(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getPermissionSetWithHttpInfo(requestParameters: PermissionSetsApiGetPermissionSetRequest, ): Promise> { + return localVarFp.getPermissionSetWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns the list of assignments for a permission set. * @summary List permission set assignments @@ -243,6 +281,9 @@ export const PermissionSetsApiFactory = function (configuration?: Configuration, getPermissionSetAssignments(requestParameters: PermissionSetsApiGetPermissionSetAssignmentsRequest, ): Promise { return localVarFp.getPermissionSetAssignments(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getPermissionSetAssignmentsWithHttpInfo(requestParameters: PermissionSetsApiGetPermissionSetAssignmentsRequest, ): Promise> { + return localVarFp.getPermissionSetAssignmentsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all permission sets. * @summary Get all permission sets @@ -253,6 +294,9 @@ export const PermissionSetsApiFactory = function (configuration?: Configuration, getPermissionSets(requestParameters: PermissionSetsApiGetPermissionSetsRequest = {}, ): Promise { return localVarFp.getPermissionSets(requestParameters.app, ).then((request) => request(axios, basePath)); }, + getPermissionSetsWithHttpInfo(requestParameters: PermissionSetsApiGetPermissionSetsRequest = {}, ): Promise> { + return localVarFp.getPermissionSetsWithHttpInfo(requestParameters.app, ).then((request) => request(axios, basePath)); + }, }; }; @@ -331,6 +375,18 @@ export class PermissionSetsApi extends BaseAPI { return PermissionSetsApiFp(this.configuration).getPermissionSet(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPermissionSet`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PermissionSetsApiGetPermissionSetRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PermissionSetsApi + */ + public getPermissionSetWithHttpInfo(requestParameters: PermissionSetsApiGetPermissionSetRequest, ) { + return PermissionSetsApiFp(this.configuration).getPermissionSetWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the list of assignments for a permission set. * @summary List permission set assignments @@ -343,6 +399,18 @@ export class PermissionSetsApi extends BaseAPI { return PermissionSetsApiFp(this.configuration).getPermissionSetAssignments(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPermissionSetAssignments`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PermissionSetsApiGetPermissionSetAssignmentsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PermissionSetsApi + */ + public getPermissionSetAssignmentsWithHttpInfo(requestParameters: PermissionSetsApiGetPermissionSetAssignmentsRequest, ) { + return PermissionSetsApiFp(this.configuration).getPermissionSetAssignmentsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all permission sets. * @summary Get all permission sets @@ -354,4 +422,16 @@ export class PermissionSetsApi extends BaseAPI { public getPermissionSets(requestParameters: PermissionSetsApiGetPermissionSetsRequest = {}, ) { return PermissionSetsApiFp(this.configuration).getPermissionSets(requestParameters.app, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getPermissionSets`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PermissionSetsApiGetPermissionSetsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PermissionSetsApi + */ + public getPermissionSetsWithHttpInfo(requestParameters: PermissionSetsApiGetPermissionSetsRequest = {}, ) { + return PermissionSetsApiFp(this.configuration).getPermissionSetsWithHttpInfo(requestParameters.app, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/person-fields-api.ts b/src/versions/v1/api/person-fields-api.ts index 3d301997..f77b429e 100644 --- a/src/versions/v1/api/person-fields-api.ts +++ b/src/versions/v1/api/person-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { CreateFieldRequest } from '../models'; // @ts-ignore @@ -320,6 +320,17 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonField(CreateFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addPersonField`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new person field + * @param {CreateFieldRequest} [CreateFieldRequest] + + * @throws {RequiredError} + */ + async addPersonFieldWithHttpInfo(CreateFieldRequest?: CreateFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonField(CreateFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a person field @@ -331,6 +342,17 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonField(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePersonField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a person field + * @param {number} id The ID of the field + + * @throws {RequiredError} + */ + async deletePersonFieldWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonField(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks multiple fields as deleted. * @summary Delete multiple person fields in bulk @@ -342,6 +364,17 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFields(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePersonFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete multiple person fields in bulk + * @param {Set} ids The comma-separated field IDs to delete + + * @throws {RequiredError} + */ + async deletePersonFieldsWithHttpInfo(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFields(ids, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific person field. * @summary Get one person field @@ -353,6 +386,17 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonField(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one person field + * @param {number} id The ID of the field + + * @throws {RequiredError} + */ + async getPersonFieldWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonField(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all person fields.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. * @summary Get all person fields @@ -365,6 +409,18 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFields(start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all person fields + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getPersonFieldsWithHttpInfo(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFields(start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a person field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a person field @@ -377,6 +433,18 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updatePersonField(id, UpdateFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updatePersonField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a person field + * @param {number} id The ID of the field + * @param {UpdateFieldRequest} [UpdateFieldRequest] + + * @throws {RequiredError} + */ + async updatePersonFieldWithHttpInfo(id: number, UpdateFieldRequest?: UpdateFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePersonField(id, UpdateFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -397,6 +465,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b addPersonField(requestParameters: PersonFieldsApiAddPersonFieldRequest = {}, ): Promise { return localVarFp.addPersonField(requestParameters.CreateFieldRequest, ).then((request) => request(axios, basePath)); }, + addPersonFieldWithHttpInfo(requestParameters: PersonFieldsApiAddPersonFieldRequest = {}, ): Promise> { + return localVarFp.addPersonFieldWithHttpInfo(requestParameters.CreateFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a person field @@ -407,6 +478,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b deletePersonField(requestParameters: PersonFieldsApiDeletePersonFieldRequest, ): Promise { return localVarFp.deletePersonField(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deletePersonFieldWithHttpInfo(requestParameters: PersonFieldsApiDeletePersonFieldRequest, ): Promise> { + return localVarFp.deletePersonFieldWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Marks multiple fields as deleted. * @summary Delete multiple person fields in bulk @@ -417,6 +491,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b deletePersonFields(requestParameters: PersonFieldsApiDeletePersonFieldsRequest, ): Promise { return localVarFp.deletePersonFields(requestParameters.ids, ).then((request) => request(axios, basePath)); }, + deletePersonFieldsWithHttpInfo(requestParameters: PersonFieldsApiDeletePersonFieldsRequest, ): Promise> { + return localVarFp.deletePersonFieldsWithHttpInfo(requestParameters.ids, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific person field. * @summary Get one person field @@ -427,6 +504,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b getPersonField(requestParameters: PersonFieldsApiGetPersonFieldRequest, ): Promise { return localVarFp.getPersonField(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getPersonFieldWithHttpInfo(requestParameters: PersonFieldsApiGetPersonFieldRequest, ): Promise> { + return localVarFp.getPersonFieldWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all person fields.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. * @summary Get all person fields @@ -437,6 +517,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b getPersonFields(requestParameters: PersonFieldsApiGetPersonFieldsRequest = {}, ): Promise { return localVarFp.getPersonFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getPersonFieldsWithHttpInfo(requestParameters: PersonFieldsApiGetPersonFieldsRequest = {}, ): Promise> { + return localVarFp.getPersonFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Updates a person field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a person field @@ -447,6 +530,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b updatePersonField(requestParameters: PersonFieldsApiUpdatePersonFieldRequest, ): Promise { return localVarFp.updatePersonField(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(axios, basePath)); }, + updatePersonFieldWithHttpInfo(requestParameters: PersonFieldsApiUpdatePersonFieldRequest, ): Promise> { + return localVarFp.updatePersonFieldWithHttpInfo(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -567,6 +653,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).addPersonField(requestParameters.CreateFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addPersonField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiAddPersonFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public addPersonFieldWithHttpInfo(requestParameters: PersonFieldsApiAddPersonFieldRequest = {}, ) { + return PersonFieldsApiFp(this.configuration).addPersonFieldWithHttpInfo(requestParameters.CreateFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a person field @@ -579,6 +677,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).deletePersonField(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePersonField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiDeletePersonFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public deletePersonFieldWithHttpInfo(requestParameters: PersonFieldsApiDeletePersonFieldRequest, ) { + return PersonFieldsApiFp(this.configuration).deletePersonFieldWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks multiple fields as deleted. * @summary Delete multiple person fields in bulk @@ -591,6 +701,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).deletePersonFields(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePersonFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiDeletePersonFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public deletePersonFieldsWithHttpInfo(requestParameters: PersonFieldsApiDeletePersonFieldsRequest, ) { + return PersonFieldsApiFp(this.configuration).deletePersonFieldsWithHttpInfo(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific person field. * @summary Get one person field @@ -603,6 +725,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).getPersonField(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiGetPersonFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public getPersonFieldWithHttpInfo(requestParameters: PersonFieldsApiGetPersonFieldRequest, ) { + return PersonFieldsApiFp(this.configuration).getPersonFieldWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all person fields.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. * @summary Get all person fields @@ -615,6 +749,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).getPersonFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiGetPersonFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public getPersonFieldsWithHttpInfo(requestParameters: PersonFieldsApiGetPersonFieldsRequest = {}, ) { + return PersonFieldsApiFp(this.configuration).getPersonFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a person field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a person field @@ -626,4 +772,16 @@ export class PersonFieldsApi extends BaseAPI { public updatePersonField(requestParameters: PersonFieldsApiUpdatePersonFieldRequest, ) { return PersonFieldsApiFp(this.configuration).updatePersonField(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updatePersonField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiUpdatePersonFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public updatePersonFieldWithHttpInfo(requestParameters: PersonFieldsApiUpdatePersonFieldRequest, ) { + return PersonFieldsApiFp(this.configuration).updatePersonFieldWithHttpInfo(requestParameters.id, requestParameters.UpdateFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/persons-api.ts b/src/versions/v1/api/persons-api.ts index 89be0cc0..b879c49d 100644 --- a/src/versions/v1/api/persons-api.ts +++ b/src/versions/v1/api/persons-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddPersonFollowerRequest } from '../models'; // @ts-ignore @@ -56,7 +56,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Adds a follower to a person. * @summary Add a follower to a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {AddPersonFollowerRequest} [AddPersonFollowerRequest] * @throws {RequiredError} @@ -101,7 +101,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Adds a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares. * @summary Add person picture - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {File} file One image supplied in the multipart/form-data encoding * @param {number} [crop_x] X coordinate to where start cropping form (in pixels) * @param {number} [crop_y] Y coordinate to where start cropping form (in pixels) @@ -173,7 +173,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Deletes a follower from a person. * @summary Delete a follower from a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} follower_id The ID of the relationship between the follower and the person * @throws {RequiredError} @@ -218,7 +218,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Deletes a person’s picture. * @summary Delete person picture - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @throws {RequiredError} */ @@ -259,7 +259,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Lists updates about field values of a person. * @summary List updates about person field values - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @param {number} [limit] Items shown per page @@ -310,7 +310,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Lists files associated with a person. * @summary List files attached to a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page. Please note that a maximum value of 100 is allowed. * @param {string} [sort] Supported fields: `id`, `update_time` @@ -366,7 +366,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Lists the followers of a person. * @summary List followers of a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @throws {RequiredError} */ @@ -407,7 +407,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Lists mail messages associated with a person. * @summary List mail messages associated with a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {0 | 1} [include_body] Whether to include the mail message body content in the response. `0` = Don\'t include, `1` = Include. @@ -463,7 +463,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Lists products associated with a person. * @summary List products associated with a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page @@ -514,7 +514,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Lists updates about a person.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint\'s response will also include updates for the `marketing_status` field. * @summary List updates about a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. @@ -575,7 +575,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * List users permitted to access a person. * @summary List permitted users - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @throws {RequiredError} */ @@ -616,7 +616,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati /** * Merges a person with another person. For more information, see the tutorial for merging two persons. * @summary Merge two persons - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {MergePersonsRequest} [MergePersonsRequest] * @throws {RequiredError} @@ -672,7 +672,7 @@ export const PersonsApiFp = function(configuration?: Configuration) { /** * Adds a follower to a person. * @summary Add a follower to a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {AddPersonFollowerRequest} [AddPersonFollowerRequest] * @throws {RequiredError} @@ -681,10 +681,22 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonFollower(id, AddPersonFollowerRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addPersonFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a follower to a person + * @param {number} id The unique ID of the person + * @param {AddPersonFollowerRequest} [AddPersonFollowerRequest] + + * @throws {RequiredError} + */ + async addPersonFollowerWithHttpInfo(id: number, AddPersonFollowerRequest?: AddPersonFollowerRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonFollower(id, AddPersonFollowerRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares. * @summary Add person picture - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {File} file One image supplied in the multipart/form-data encoding * @param {number} [crop_x] X coordinate to where start cropping form (in pixels) * @param {number} [crop_y] Y coordinate to where start cropping form (in pixels) @@ -697,10 +709,26 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonPicture(id, file, crop_x, crop_y, crop_width, crop_height, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addPersonPicture`, but resolves with the response body together with the HTTP status and headers. + * @summary Add person picture + * @param {number} id The unique ID of the person + * @param {File} file One image supplied in the multipart/form-data encoding + * @param {number} [crop_x] X coordinate to where start cropping form (in pixels) + * @param {number} [crop_y] Y coordinate to where start cropping form (in pixels) + * @param {number} [crop_width] The width of the cropping area (in pixels) + * @param {number} [crop_height] The height of the cropping area (in pixels) + + * @throws {RequiredError} + */ + async addPersonPictureWithHttpInfo(id: number, file: File, crop_x?: number, crop_y?: number, crop_width?: number, crop_height?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonPicture(id, file, crop_x, crop_y, crop_width, crop_height, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a follower from a person. * @summary Delete a follower from a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} follower_id The ID of the relationship between the follower and the person * @throws {RequiredError} @@ -709,10 +737,22 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFollower(id, follower_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePersonFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a follower from a person + * @param {number} id The unique ID of the person + * @param {number} follower_id The ID of the relationship between the follower and the person + + * @throws {RequiredError} + */ + async deletePersonFollowerWithHttpInfo(id: number, follower_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFollower(id, follower_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a person’s picture. * @summary Delete person picture - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @throws {RequiredError} */ @@ -720,10 +760,21 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonPicture(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePersonPicture`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete person picture + * @param {number} id The unique ID of the person + + * @throws {RequiredError} + */ + async deletePersonPictureWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonPicture(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists updates about field values of a person. * @summary List updates about person field values - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page * @param {number} [limit] Items shown per page @@ -733,10 +784,23 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonChangelog(id, cursor, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonChangelog`, but resolves with the response body together with the HTTP status and headers. + * @summary List updates about person field values + * @param {number} id The unique ID of the person + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getPersonChangelogWithHttpInfo(id: number, cursor?: string, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonChangelog(id, cursor, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists files associated with a person. * @summary List files attached to a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page. Please note that a maximum value of 100 is allowed. * @param {string} [sort] Supported fields: `id`, `update_time` @@ -747,10 +811,24 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFiles(id, start, limit, sort, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonFiles`, but resolves with the response body together with the HTTP status and headers. + * @summary List files attached to a person + * @param {number} id The unique ID of the person + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page. Please note that a maximum value of 100 is allowed. + * @param {string} [sort] Supported fields: `id`, `update_time` + + * @throws {RequiredError} + */ + async getPersonFilesWithHttpInfo(id: number, start?: number, limit?: number, sort?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFiles(id, start, limit, sort, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the followers of a person. * @summary List followers of a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @throws {RequiredError} */ @@ -758,10 +836,21 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFollowers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of a person + * @param {number} id The unique ID of the person + + * @throws {RequiredError} + */ + async getPersonFollowersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFollowers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists mail messages associated with a person. * @summary List mail messages associated with a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {0 | 1} [include_body] Whether to include the mail message body content in the response. `0` = Don\'t include, `1` = Include. @@ -772,10 +861,24 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonMailMessages(id, start, limit, include_body, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonMailMessages`, but resolves with the response body together with the HTTP status and headers. + * @summary List mail messages associated with a person + * @param {number} id The unique ID of the person + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @param {0 | 1} [include_body] Whether to include the mail message body content in the response. `0` = Don\'t include, `1` = Include. + + * @throws {RequiredError} + */ + async getPersonMailMessagesWithHttpInfo(id: number, start?: number, limit?: number, include_body?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonMailMessages(id, start, limit, include_body, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists products associated with a person. * @summary List products associated with a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page @@ -785,10 +888,23 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonProducts(id, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonProducts`, but resolves with the response body together with the HTTP status and headers. + * @summary List products associated with a person + * @param {number} id The unique ID of the person + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getPersonProductsWithHttpInfo(id: number, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonProducts(id, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists updates about a person.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint\'s response will also include updates for the `marketing_status` field. * @summary List updates about a person - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {number} [start] Pagination start * @param {number} [limit] Items shown per page * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. @@ -800,10 +916,25 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonUpdates(id, start, limit, all_changes, items, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonUpdates`, but resolves with the response body together with the HTTP status and headers. + * @summary List updates about a person + * @param {number} id The unique ID of the person + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @param {string} [all_changes] Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. + * @param {Set} [items] A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change). + + * @throws {RequiredError} + */ + async getPersonUpdatesWithHttpInfo(id: number, start?: number, limit?: number, all_changes?: string, items?: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonUpdates(id, start, limit, all_changes, items, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * List users permitted to access a person. * @summary List permitted users - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @throws {RequiredError} */ @@ -811,10 +942,21 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonUsers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonUsers`, but resolves with the response body together with the HTTP status and headers. + * @summary List permitted users + * @param {number} id The unique ID of the person + + * @throws {RequiredError} + */ + async getPersonUsersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonUsers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Merges a person with another person. For more information, see the tutorial for merging two persons. * @summary Merge two persons - * @param {number} id The ID of the person + * @param {number} id The unique ID of the person * @param {MergePersonsRequest} [MergePersonsRequest] * @throws {RequiredError} @@ -823,6 +965,18 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.mergePersons(id, MergePersonsRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `mergePersons`, but resolves with the response body together with the HTTP status and headers. + * @summary Merge two persons + * @param {number} id The unique ID of the person + * @param {MergePersonsRequest} [MergePersonsRequest] + + * @throws {RequiredError} + */ + async mergePersonsWithHttpInfo(id: number, MergePersonsRequest?: MergePersonsRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.mergePersons(id, MergePersonsRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -843,6 +997,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa addPersonFollower(requestParameters: PersonsApiAddPersonFollowerRequest, ): Promise { return localVarFp.addPersonFollower(requestParameters.id, requestParameters.AddPersonFollowerRequest, ).then((request) => request(axios, basePath)); }, + addPersonFollowerWithHttpInfo(requestParameters: PersonsApiAddPersonFollowerRequest, ): Promise> { + return localVarFp.addPersonFollowerWithHttpInfo(requestParameters.id, requestParameters.AddPersonFollowerRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares. * @summary Add person picture @@ -853,6 +1010,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa addPersonPicture(requestParameters: PersonsApiAddPersonPictureRequest, ): Promise { return localVarFp.addPersonPicture(requestParameters.id, requestParameters.file, requestParameters.crop_x, requestParameters.crop_y, requestParameters.crop_width, requestParameters.crop_height, ).then((request) => request(axios, basePath)); }, + addPersonPictureWithHttpInfo(requestParameters: PersonsApiAddPersonPictureRequest, ): Promise> { + return localVarFp.addPersonPictureWithHttpInfo(requestParameters.id, requestParameters.file, requestParameters.crop_x, requestParameters.crop_y, requestParameters.crop_width, requestParameters.crop_height, ).then((request) => request(axios, basePath)); + }, /** * Deletes a follower from a person. * @summary Delete a follower from a person @@ -863,6 +1023,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa deletePersonFollower(requestParameters: PersonsApiDeletePersonFollowerRequest, ): Promise { return localVarFp.deletePersonFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); }, + deletePersonFollowerWithHttpInfo(requestParameters: PersonsApiDeletePersonFollowerRequest, ): Promise> { + return localVarFp.deletePersonFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); + }, /** * Deletes a person’s picture. * @summary Delete person picture @@ -873,6 +1036,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa deletePersonPicture(requestParameters: PersonsApiDeletePersonPictureRequest, ): Promise { return localVarFp.deletePersonPicture(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deletePersonPictureWithHttpInfo(requestParameters: PersonsApiDeletePersonPictureRequest, ): Promise> { + return localVarFp.deletePersonPictureWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists updates about field values of a person. * @summary List updates about person field values @@ -883,6 +1049,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonChangelog(requestParameters: PersonsApiGetPersonChangelogRequest, ): Promise { return localVarFp.getPersonChangelog(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getPersonChangelogWithHttpInfo(requestParameters: PersonsApiGetPersonChangelogRequest, ): Promise> { + return localVarFp.getPersonChangelogWithHttpInfo(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Lists files associated with a person. * @summary List files attached to a person @@ -893,6 +1062,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonFiles(requestParameters: PersonsApiGetPersonFilesRequest, ): Promise { return localVarFp.getPersonFiles(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); }, + getPersonFilesWithHttpInfo(requestParameters: PersonsApiGetPersonFilesRequest, ): Promise> { + return localVarFp.getPersonFilesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); + }, /** * Lists the followers of a person. * @summary List followers of a person @@ -903,6 +1075,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonFollowers(requestParameters: PersonsApiGetPersonFollowersRequest, ): Promise { return localVarFp.getPersonFollowers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getPersonFollowersWithHttpInfo(requestParameters: PersonsApiGetPersonFollowersRequest, ): Promise> { + return localVarFp.getPersonFollowersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists mail messages associated with a person. * @summary List mail messages associated with a person @@ -913,6 +1088,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonMailMessages(requestParameters: PersonsApiGetPersonMailMessagesRequest, ): Promise { return localVarFp.getPersonMailMessages(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(axios, basePath)); }, + getPersonMailMessagesWithHttpInfo(requestParameters: PersonsApiGetPersonMailMessagesRequest, ): Promise> { + return localVarFp.getPersonMailMessagesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(axios, basePath)); + }, /** * Lists products associated with a person. * @summary List products associated with a person @@ -923,6 +1101,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonProducts(requestParameters: PersonsApiGetPersonProductsRequest, ): Promise { return localVarFp.getPersonProducts(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getPersonProductsWithHttpInfo(requestParameters: PersonsApiGetPersonProductsRequest, ): Promise> { + return localVarFp.getPersonProductsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Lists updates about a person.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint\'s response will also include updates for the `marketing_status` field. * @summary List updates about a person @@ -933,6 +1114,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonUpdates(requestParameters: PersonsApiGetPersonUpdatesRequest, ): Promise { return localVarFp.getPersonUpdates(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(axios, basePath)); }, + getPersonUpdatesWithHttpInfo(requestParameters: PersonsApiGetPersonUpdatesRequest, ): Promise> { + return localVarFp.getPersonUpdatesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(axios, basePath)); + }, /** * List users permitted to access a person. * @summary List permitted users @@ -943,6 +1127,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonUsers(requestParameters: PersonsApiGetPersonUsersRequest, ): Promise { return localVarFp.getPersonUsers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getPersonUsersWithHttpInfo(requestParameters: PersonsApiGetPersonUsersRequest, ): Promise> { + return localVarFp.getPersonUsersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Merges a person with another person. For more information, see the tutorial for merging two persons. * @summary Merge two persons @@ -953,6 +1140,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa mergePersons(requestParameters: PersonsApiMergePersonsRequest, ): Promise { return localVarFp.mergePersons(requestParameters.id, requestParameters.MergePersonsRequest, ).then((request) => request(axios, basePath)); }, + mergePersonsWithHttpInfo(requestParameters: PersonsApiMergePersonsRequest, ): Promise> { + return localVarFp.mergePersonsWithHttpInfo(requestParameters.id, requestParameters.MergePersonsRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -963,7 +1153,7 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa */ export interface PersonsApiAddPersonFollowerRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiAddPersonFollower */ @@ -984,7 +1174,7 @@ export interface PersonsApiAddPersonFollowerRequest { */ export interface PersonsApiAddPersonPictureRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiAddPersonPicture */ @@ -1033,7 +1223,7 @@ export interface PersonsApiAddPersonPictureRequest { */ export interface PersonsApiDeletePersonFollowerRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiDeletePersonFollower */ @@ -1054,7 +1244,7 @@ export interface PersonsApiDeletePersonFollowerRequest { */ export interface PersonsApiDeletePersonPictureRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiDeletePersonPicture */ @@ -1068,7 +1258,7 @@ export interface PersonsApiDeletePersonPictureRequest { */ export interface PersonsApiGetPersonChangelogRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiGetPersonChangelog */ @@ -1096,7 +1286,7 @@ export interface PersonsApiGetPersonChangelogRequest { */ export interface PersonsApiGetPersonFilesRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiGetPersonFiles */ @@ -1131,7 +1321,7 @@ export interface PersonsApiGetPersonFilesRequest { */ export interface PersonsApiGetPersonFollowersRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiGetPersonFollowers */ @@ -1145,7 +1335,7 @@ export interface PersonsApiGetPersonFollowersRequest { */ export interface PersonsApiGetPersonMailMessagesRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiGetPersonMailMessages */ @@ -1180,7 +1370,7 @@ export interface PersonsApiGetPersonMailMessagesRequest { */ export interface PersonsApiGetPersonProductsRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiGetPersonProducts */ @@ -1208,7 +1398,7 @@ export interface PersonsApiGetPersonProductsRequest { */ export interface PersonsApiGetPersonUpdatesRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiGetPersonUpdates */ @@ -1250,7 +1440,7 @@ export interface PersonsApiGetPersonUpdatesRequest { */ export interface PersonsApiGetPersonUsersRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiGetPersonUsers */ @@ -1264,7 +1454,7 @@ export interface PersonsApiGetPersonUsersRequest { */ export interface PersonsApiMergePersonsRequest { /** - * The ID of the person + * The unique ID of the person * @type {number} * @memberof PersonsApiMergePersons */ @@ -1297,6 +1487,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).addPersonFollower(requestParameters.id, requestParameters.AddPersonFollowerRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addPersonFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiAddPersonFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public addPersonFollowerWithHttpInfo(requestParameters: PersonsApiAddPersonFollowerRequest, ) { + return PersonsApiFp(this.configuration).addPersonFollowerWithHttpInfo(requestParameters.id, requestParameters.AddPersonFollowerRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares. * @summary Add person picture @@ -1309,6 +1511,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).addPersonPicture(requestParameters.id, requestParameters.file, requestParameters.crop_x, requestParameters.crop_y, requestParameters.crop_width, requestParameters.crop_height, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addPersonPicture`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiAddPersonPictureRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public addPersonPictureWithHttpInfo(requestParameters: PersonsApiAddPersonPictureRequest, ) { + return PersonsApiFp(this.configuration).addPersonPictureWithHttpInfo(requestParameters.id, requestParameters.file, requestParameters.crop_x, requestParameters.crop_y, requestParameters.crop_width, requestParameters.crop_height, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a follower from a person. * @summary Delete a follower from a person @@ -1321,6 +1535,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).deletePersonFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePersonFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiDeletePersonFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public deletePersonFollowerWithHttpInfo(requestParameters: PersonsApiDeletePersonFollowerRequest, ) { + return PersonsApiFp(this.configuration).deletePersonFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a person’s picture. * @summary Delete person picture @@ -1333,6 +1559,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).deletePersonPicture(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePersonPicture`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiDeletePersonPictureRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public deletePersonPictureWithHttpInfo(requestParameters: PersonsApiDeletePersonPictureRequest, ) { + return PersonsApiFp(this.configuration).deletePersonPictureWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists updates about field values of a person. * @summary List updates about person field values @@ -1345,6 +1583,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonChangelog(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonChangelogWithHttpInfo(requestParameters: PersonsApiGetPersonChangelogRequest, ) { + return PersonsApiFp(this.configuration).getPersonChangelogWithHttpInfo(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists files associated with a person. * @summary List files attached to a person @@ -1357,6 +1607,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonFiles(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonFiles`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonFilesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonFilesWithHttpInfo(requestParameters: PersonsApiGetPersonFilesRequest, ) { + return PersonsApiFp(this.configuration).getPersonFilesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the followers of a person. * @summary List followers of a person @@ -1369,6 +1631,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonFollowers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonFollowersWithHttpInfo(requestParameters: PersonsApiGetPersonFollowersRequest, ) { + return PersonsApiFp(this.configuration).getPersonFollowersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists mail messages associated with a person. * @summary List mail messages associated with a person @@ -1381,6 +1655,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonMailMessages(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonMailMessages`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonMailMessagesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonMailMessagesWithHttpInfo(requestParameters: PersonsApiGetPersonMailMessagesRequest, ) { + return PersonsApiFp(this.configuration).getPersonMailMessagesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.include_body, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists products associated with a person. * @summary List products associated with a person @@ -1393,6 +1679,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonProducts(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonProducts`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonProductsWithHttpInfo(requestParameters: PersonsApiGetPersonProductsRequest, ) { + return PersonsApiFp(this.configuration).getPersonProductsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists updates about a person.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint\'s response will also include updates for the `marketing_status` field. * @summary List updates about a person @@ -1405,6 +1703,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonUpdates(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonUpdates`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonUpdatesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonUpdatesWithHttpInfo(requestParameters: PersonsApiGetPersonUpdatesRequest, ) { + return PersonsApiFp(this.configuration).getPersonUpdatesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.all_changes, requestParameters.items, ).then((request) => request(this.axios, this.basePath)); + } + /** * List users permitted to access a person. * @summary List permitted users @@ -1417,6 +1727,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonUsers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonUsers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonUsersWithHttpInfo(requestParameters: PersonsApiGetPersonUsersRequest, ) { + return PersonsApiFp(this.configuration).getPersonUsersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Merges a person with another person. For more information, see the tutorial for merging two persons. * @summary Merge two persons @@ -1428,4 +1750,16 @@ export class PersonsApi extends BaseAPI { public mergePersons(requestParameters: PersonsApiMergePersonsRequest, ) { return PersonsApiFp(this.configuration).mergePersons(requestParameters.id, requestParameters.MergePersonsRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `mergePersons`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiMergePersonsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public mergePersonsWithHttpInfo(requestParameters: PersonsApiMergePersonsRequest, ) { + return PersonsApiFp(this.configuration).mergePersonsWithHttpInfo(requestParameters.id, requestParameters.MergePersonsRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/pipelines-api.ts b/src/versions/v1/api/pipelines-api.ts index 68a32558..5d910b57 100644 --- a/src/versions/v1/api/pipelines-api.ts +++ b/src/versions/v1/api/pipelines-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetPipelineDealsConversionRatesInResponse } from '../models'; // @ts-ignore @@ -267,6 +267,20 @@ export const PipelinesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPipelineConversionStatistics(id, start_date, end_date, user_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPipelineConversionStatistics`, but resolves with the response body together with the HTTP status and headers. + * @summary Get deals conversion rates in pipeline + * @param {number} id The ID of the pipeline + * @param {string} start_date The start of the period. Date in format of YYYY-MM-DD. + * @param {string} end_date The end of the period. Date in format of YYYY-MM-DD. + * @param {number} [user_id] The ID of the user who\'s pipeline metrics statistics to fetch. If omitted, the authorized user will be used. + + * @throws {RequiredError} + */ + async getPipelineConversionStatisticsWithHttpInfo(id: number, start_date: string, end_date: string, user_id?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPipelineConversionStatistics(id, start_date, end_date, user_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists deals in a specific pipeline across all its stages. If no parameters are provided open deals owned by the authorized user will be returned.
This endpoint has been deprecated. Please use GET /api/v2/deals?pipeline_id={id} instead. * @summary Get deals in a pipeline @@ -286,6 +300,25 @@ export const PipelinesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPipelineDeals(id, filter_id, user_id, everyone, stage_id, start, limit, get_summary, totals_convert_currency, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPipelineDeals`, but resolves with the response body together with the HTTP status and headers. + * @summary Get deals in a pipeline + * @param {number} id The ID of the pipeline + * @param {number} [filter_id] If supplied, only deals matching the given filter will be returned + * @param {number} [user_id] If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. + * @param {0 | 1} [everyone] If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned + * @param {number} [stage_id] If supplied, only deals within the given stage will be returned + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @param {0 | 1} [get_summary] Whether to include a summary of the pipeline in the `additional_data` or not + * @param {string} [totals_convert_currency] The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned inside `deals_summary` inside `additional_data` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. Only works when `get_summary` parameter flag is enabled. + * @deprecated + * @throws {RequiredError} + */ + async getPipelineDealsWithHttpInfo(id: number, filter_id?: number, user_id?: number, everyone?: 0 | 1, stage_id?: number, start?: number, limit?: number, get_summary?: 0 | 1, totals_convert_currency?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPipelineDeals(id, filter_id, user_id, everyone, stage_id, start, limit, get_summary, totals_convert_currency, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns statistics for deals movements for the given time period. * @summary Get deals movements in pipeline @@ -300,6 +333,20 @@ export const PipelinesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPipelineMovementStatistics(id, start_date, end_date, user_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPipelineMovementStatistics`, but resolves with the response body together with the HTTP status and headers. + * @summary Get deals movements in pipeline + * @param {number} id The ID of the pipeline + * @param {string} start_date The start of the period. Date in format of YYYY-MM-DD. + * @param {string} end_date The end of the period. Date in format of YYYY-MM-DD. + * @param {number} [user_id] The ID of the user who\'s pipeline statistics to fetch. If omitted, the authorized user will be used. + + * @throws {RequiredError} + */ + async getPipelineMovementStatisticsWithHttpInfo(id: number, start_date: string, end_date: string, user_id?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPipelineMovementStatistics(id, start_date, end_date, user_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -320,6 +367,9 @@ export const PipelinesApiFactory = function (configuration?: Configuration, base getPipelineConversionStatistics(requestParameters: PipelinesApiGetPipelineConversionStatisticsRequest, ): Promise { return localVarFp.getPipelineConversionStatistics(requestParameters.id, requestParameters.start_date, requestParameters.end_date, requestParameters.user_id, ).then((request) => request(axios, basePath)); }, + getPipelineConversionStatisticsWithHttpInfo(requestParameters: PipelinesApiGetPipelineConversionStatisticsRequest, ): Promise> { + return localVarFp.getPipelineConversionStatisticsWithHttpInfo(requestParameters.id, requestParameters.start_date, requestParameters.end_date, requestParameters.user_id, ).then((request) => request(axios, basePath)); + }, /** * Lists deals in a specific pipeline across all its stages. If no parameters are provided open deals owned by the authorized user will be returned.
This endpoint has been deprecated. Please use GET /api/v2/deals?pipeline_id={id} instead. * @summary Get deals in a pipeline @@ -330,6 +380,9 @@ export const PipelinesApiFactory = function (configuration?: Configuration, base getPipelineDeals(requestParameters: PipelinesApiGetPipelineDealsRequest, ): Promise { return localVarFp.getPipelineDeals(requestParameters.id, requestParameters.filter_id, requestParameters.user_id, requestParameters.everyone, requestParameters.stage_id, requestParameters.start, requestParameters.limit, requestParameters.get_summary, requestParameters.totals_convert_currency, ).then((request) => request(axios, basePath)); }, + getPipelineDealsWithHttpInfo(requestParameters: PipelinesApiGetPipelineDealsRequest, ): Promise> { + return localVarFp.getPipelineDealsWithHttpInfo(requestParameters.id, requestParameters.filter_id, requestParameters.user_id, requestParameters.everyone, requestParameters.stage_id, requestParameters.start, requestParameters.limit, requestParameters.get_summary, requestParameters.totals_convert_currency, ).then((request) => request(axios, basePath)); + }, /** * Returns statistics for deals movements for the given time period. * @summary Get deals movements in pipeline @@ -340,6 +393,9 @@ export const PipelinesApiFactory = function (configuration?: Configuration, base getPipelineMovementStatistics(requestParameters: PipelinesApiGetPipelineMovementStatisticsRequest, ): Promise { return localVarFp.getPipelineMovementStatistics(requestParameters.id, requestParameters.start_date, requestParameters.end_date, requestParameters.user_id, ).then((request) => request(axios, basePath)); }, + getPipelineMovementStatisticsWithHttpInfo(requestParameters: PipelinesApiGetPipelineMovementStatisticsRequest, ): Promise> { + return localVarFp.getPipelineMovementStatisticsWithHttpInfo(requestParameters.id, requestParameters.start_date, requestParameters.end_date, requestParameters.user_id, ).then((request) => request(axios, basePath)); + }, }; }; @@ -502,6 +558,18 @@ export class PipelinesApi extends BaseAPI { return PipelinesApiFp(this.configuration).getPipelineConversionStatistics(requestParameters.id, requestParameters.start_date, requestParameters.end_date, requestParameters.user_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPipelineConversionStatistics`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PipelinesApiGetPipelineConversionStatisticsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PipelinesApi + */ + public getPipelineConversionStatisticsWithHttpInfo(requestParameters: PipelinesApiGetPipelineConversionStatisticsRequest, ) { + return PipelinesApiFp(this.configuration).getPipelineConversionStatisticsWithHttpInfo(requestParameters.id, requestParameters.start_date, requestParameters.end_date, requestParameters.user_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists deals in a specific pipeline across all its stages. If no parameters are provided open deals owned by the authorized user will be returned.
This endpoint has been deprecated. Please use GET /api/v2/deals?pipeline_id={id} instead. * @summary Get deals in a pipeline @@ -514,6 +582,18 @@ export class PipelinesApi extends BaseAPI { return PipelinesApiFp(this.configuration).getPipelineDeals(requestParameters.id, requestParameters.filter_id, requestParameters.user_id, requestParameters.everyone, requestParameters.stage_id, requestParameters.start, requestParameters.limit, requestParameters.get_summary, requestParameters.totals_convert_currency, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPipelineDeals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PipelinesApiGetPipelineDealsRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof PipelinesApi + */ + public getPipelineDealsWithHttpInfo(requestParameters: PipelinesApiGetPipelineDealsRequest, ) { + return PipelinesApiFp(this.configuration).getPipelineDealsWithHttpInfo(requestParameters.id, requestParameters.filter_id, requestParameters.user_id, requestParameters.everyone, requestParameters.stage_id, requestParameters.start, requestParameters.limit, requestParameters.get_summary, requestParameters.totals_convert_currency, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns statistics for deals movements for the given time period. * @summary Get deals movements in pipeline @@ -525,4 +605,16 @@ export class PipelinesApi extends BaseAPI { public getPipelineMovementStatistics(requestParameters: PipelinesApiGetPipelineMovementStatisticsRequest, ) { return PipelinesApiFp(this.configuration).getPipelineMovementStatistics(requestParameters.id, requestParameters.start_date, requestParameters.end_date, requestParameters.user_id, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getPipelineMovementStatistics`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PipelinesApiGetPipelineMovementStatisticsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PipelinesApi + */ + public getPipelineMovementStatisticsWithHttpInfo(requestParameters: PipelinesApiGetPipelineMovementStatisticsRequest, ) { + return PipelinesApiFp(this.configuration).getPipelineMovementStatisticsWithHttpInfo(requestParameters.id, requestParameters.start_date, requestParameters.end_date, requestParameters.user_id, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/product-fields-api.ts b/src/versions/v1/api/product-fields-api.ts index 453bee1a..f8931ad1 100644 --- a/src/versions/v1/api/product-fields-api.ts +++ b/src/versions/v1/api/product-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { DeleteProductFieldResponse } from '../models'; // @ts-ignore @@ -322,6 +322,17 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProductField(ProductFieldAllOf, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProductField`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new product field + * @param {ProductFieldAllOf} [ProductFieldAllOf] + + * @throws {RequiredError} + */ + async addProductFieldWithHttpInfo(ProductFieldAllOf?: ProductFieldAllOf, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProductField(ProductFieldAllOf, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a product field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a product field @@ -333,6 +344,17 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductField(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProductField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a product field + * @param {number} id The ID of the product field + + * @throws {RequiredError} + */ + async deleteProductFieldWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductField(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks multiple fields as deleted. * @summary Delete multiple product fields in bulk @@ -344,6 +366,17 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFields(ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProductFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete multiple product fields in bulk + * @param {Set} ids The comma-separated field IDs to delete + + * @throws {RequiredError} + */ + async deleteProductFieldsWithHttpInfo(ids: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFields(ids, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific product field. * @summary Get one product field @@ -355,6 +388,17 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductField(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one product field + * @param {number} id The ID of the product field + + * @throws {RequiredError} + */ + async getProductFieldWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductField(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all product fields. * @summary Get all product fields @@ -367,6 +411,18 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFields(start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all product fields + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getProductFieldsWithHttpInfo(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFields(start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a product field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a product field @@ -379,6 +435,18 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductField(id, UpdateProductFieldResponse, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProductField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a product field + * @param {number} id The ID of the product field + * @param {UpdateProductFieldResponse} [UpdateProductFieldResponse] + + * @throws {RequiredError} + */ + async updateProductFieldWithHttpInfo(id: number, UpdateProductFieldResponse?: UpdateProductFieldResponse, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductField(id, UpdateProductFieldResponse, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -399,6 +467,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, addProductField(requestParameters: ProductFieldsApiAddProductFieldRequest = {}, ): Promise { return localVarFp.addProductField(requestParameters.ProductFieldAllOf, ).then((request) => request(axios, basePath)); }, + addProductFieldWithHttpInfo(requestParameters: ProductFieldsApiAddProductFieldRequest = {}, ): Promise> { + return localVarFp.addProductFieldWithHttpInfo(requestParameters.ProductFieldAllOf, ).then((request) => request(axios, basePath)); + }, /** * Marks a product field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a product field @@ -409,6 +480,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, deleteProductField(requestParameters: ProductFieldsApiDeleteProductFieldRequest, ): Promise { return localVarFp.deleteProductField(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProductFieldWithHttpInfo(requestParameters: ProductFieldsApiDeleteProductFieldRequest, ): Promise> { + return localVarFp.deleteProductFieldWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Marks multiple fields as deleted. * @summary Delete multiple product fields in bulk @@ -419,6 +493,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, deleteProductFields(requestParameters: ProductFieldsApiDeleteProductFieldsRequest, ): Promise { return localVarFp.deleteProductFields(requestParameters.ids, ).then((request) => request(axios, basePath)); }, + deleteProductFieldsWithHttpInfo(requestParameters: ProductFieldsApiDeleteProductFieldsRequest, ): Promise> { + return localVarFp.deleteProductFieldsWithHttpInfo(requestParameters.ids, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific product field. * @summary Get one product field @@ -429,6 +506,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, getProductField(requestParameters: ProductFieldsApiGetProductFieldRequest, ): Promise { return localVarFp.getProductField(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProductFieldWithHttpInfo(requestParameters: ProductFieldsApiGetProductFieldRequest, ): Promise> { + return localVarFp.getProductFieldWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all product fields. * @summary Get all product fields @@ -439,6 +519,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, getProductFields(requestParameters: ProductFieldsApiGetProductFieldsRequest = {}, ): Promise { return localVarFp.getProductFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getProductFieldsWithHttpInfo(requestParameters: ProductFieldsApiGetProductFieldsRequest = {}, ): Promise> { + return localVarFp.getProductFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Updates a product field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a product field @@ -449,6 +532,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, updateProductField(requestParameters: ProductFieldsApiUpdateProductFieldRequest, ): Promise { return localVarFp.updateProductField(requestParameters.id, requestParameters.UpdateProductFieldResponse, ).then((request) => request(axios, basePath)); }, + updateProductFieldWithHttpInfo(requestParameters: ProductFieldsApiUpdateProductFieldRequest, ): Promise> { + return localVarFp.updateProductFieldWithHttpInfo(requestParameters.id, requestParameters.UpdateProductFieldResponse, ).then((request) => request(axios, basePath)); + }, }; }; @@ -569,6 +655,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).addProductField(requestParameters.ProductFieldAllOf, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProductField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiAddProductFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public addProductFieldWithHttpInfo(requestParameters: ProductFieldsApiAddProductFieldRequest = {}, ) { + return ProductFieldsApiFp(this.configuration).addProductFieldWithHttpInfo(requestParameters.ProductFieldAllOf, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a product field as deleted. For more information, see the tutorial for deleting a custom field. * @summary Delete a product field @@ -581,6 +679,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).deleteProductField(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProductField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiDeleteProductFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public deleteProductFieldWithHttpInfo(requestParameters: ProductFieldsApiDeleteProductFieldRequest, ) { + return ProductFieldsApiFp(this.configuration).deleteProductFieldWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks multiple fields as deleted. * @summary Delete multiple product fields in bulk @@ -593,6 +703,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).deleteProductFields(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProductFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiDeleteProductFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public deleteProductFieldsWithHttpInfo(requestParameters: ProductFieldsApiDeleteProductFieldsRequest, ) { + return ProductFieldsApiFp(this.configuration).deleteProductFieldsWithHttpInfo(requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific product field. * @summary Get one product field @@ -605,6 +727,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).getProductField(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiGetProductFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public getProductFieldWithHttpInfo(requestParameters: ProductFieldsApiGetProductFieldRequest, ) { + return ProductFieldsApiFp(this.configuration).getProductFieldWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all product fields. * @summary Get all product fields @@ -617,6 +751,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).getProductFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiGetProductFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public getProductFieldsWithHttpInfo(requestParameters: ProductFieldsApiGetProductFieldsRequest = {}, ) { + return ProductFieldsApiFp(this.configuration).getProductFieldsWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a product field. For more information, see the tutorial for updating custom fields\' values. * @summary Update a product field @@ -628,4 +774,16 @@ export class ProductFieldsApi extends BaseAPI { public updateProductField(requestParameters: ProductFieldsApiUpdateProductFieldRequest, ) { return ProductFieldsApiFp(this.configuration).updateProductField(requestParameters.id, requestParameters.UpdateProductFieldResponse, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateProductField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiUpdateProductFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public updateProductFieldWithHttpInfo(requestParameters: ProductFieldsApiUpdateProductFieldRequest, ) { + return ProductFieldsApiFp(this.configuration).updateProductFieldWithHttpInfo(requestParameters.id, requestParameters.UpdateProductFieldResponse, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/products-api.ts b/src/versions/v1/api/products-api.ts index c2f64b54..0ba7cd05 100644 --- a/src/versions/v1/api/products-api.ts +++ b/src/versions/v1/api/products-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddNewFollowerResponse } from '../models'; // @ts-ignore @@ -358,6 +358,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProductFollower(id, AddProductFollowerRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProductFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a follower to a product + * @param {number} id The ID of the product + * @param {AddProductFollowerRequest} [AddProductFollowerRequest] + + * @throws {RequiredError} + */ + async addProductFollowerWithHttpInfo(id: number, AddProductFollowerRequest?: AddProductFollowerRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProductFollower(id, AddProductFollowerRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a follower from a product. * @summary Delete a follower from a product @@ -370,6 +382,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFollower(id, follower_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProductFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a follower from a product + * @param {number} id The ID of the product + * @param {number} follower_id The ID of the relationship between the follower and the product + + * @throws {RequiredError} + */ + async deleteProductFollowerWithHttpInfo(id: number, follower_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFollower(id, follower_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about deals that have a product attached to it. * @summary Get deals where a product is attached to @@ -384,6 +408,20 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductDeals(id, start, limit, status, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductDeals`, but resolves with the response body together with the HTTP status and headers. + * @summary Get deals where a product is attached to + * @param {number} id The ID of the product + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @param {'open' | 'won' | 'lost' | 'deleted' | 'all_not_deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. + + * @throws {RequiredError} + */ + async getProductDealsWithHttpInfo(id: number, start?: number, limit?: number, status?: 'open' | 'won' | 'lost' | 'deleted' | 'all_not_deleted', ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductDeals(id, start, limit, status, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists files associated with a product. * @summary List files attached to a product @@ -398,6 +436,20 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFiles(id, start, limit, sort, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductFiles`, but resolves with the response body together with the HTTP status and headers. + * @summary List files attached to a product + * @param {number} id The ID of the product + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page. Please note that a maximum value of 100 is allowed. + * @param {string} [sort] Supported fields: `id`, `update_time` + + * @throws {RequiredError} + */ + async getProductFilesWithHttpInfo(id: number, start?: number, limit?: number, sort?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFiles(id, start, limit, sort, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the followers of a product. * @summary List followers of a product @@ -411,6 +463,19 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFollowers(id, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of a product + * @param {number} id The ID of the product + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getProductFollowersWithHttpInfo(id: number, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFollowers(id, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists users permitted to access a product. * @summary List permitted users @@ -422,6 +487,17 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductUsers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductUsers`, but resolves with the response body together with the HTTP status and headers. + * @summary List permitted users + * @param {number} id The ID of the product + + * @throws {RequiredError} + */ + async getProductUsersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductUsers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -442,6 +518,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP addProductFollower(requestParameters: ProductsApiAddProductFollowerRequest, ): Promise { return localVarFp.addProductFollower(requestParameters.id, requestParameters.AddProductFollowerRequest, ).then((request) => request(axios, basePath)); }, + addProductFollowerWithHttpInfo(requestParameters: ProductsApiAddProductFollowerRequest, ): Promise> { + return localVarFp.addProductFollowerWithHttpInfo(requestParameters.id, requestParameters.AddProductFollowerRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes a follower from a product. * @summary Delete a follower from a product @@ -452,6 +531,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP deleteProductFollower(requestParameters: ProductsApiDeleteProductFollowerRequest, ): Promise { return localVarFp.deleteProductFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); }, + deleteProductFollowerWithHttpInfo(requestParameters: ProductsApiDeleteProductFollowerRequest, ): Promise> { + return localVarFp.deleteProductFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about deals that have a product attached to it. * @summary Get deals where a product is attached to @@ -462,6 +544,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProductDeals(requestParameters: ProductsApiGetProductDealsRequest, ): Promise { return localVarFp.getProductDeals(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.status, ).then((request) => request(axios, basePath)); }, + getProductDealsWithHttpInfo(requestParameters: ProductsApiGetProductDealsRequest, ): Promise> { + return localVarFp.getProductDealsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.status, ).then((request) => request(axios, basePath)); + }, /** * Lists files associated with a product. * @summary List files attached to a product @@ -472,6 +557,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProductFiles(requestParameters: ProductsApiGetProductFilesRequest, ): Promise { return localVarFp.getProductFiles(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); }, + getProductFilesWithHttpInfo(requestParameters: ProductsApiGetProductFilesRequest, ): Promise> { + return localVarFp.getProductFilesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(axios, basePath)); + }, /** * Lists the followers of a product. * @summary List followers of a product @@ -482,6 +570,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProductFollowers(requestParameters: ProductsApiGetProductFollowersRequest, ): Promise { return localVarFp.getProductFollowers(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getProductFollowersWithHttpInfo(requestParameters: ProductsApiGetProductFollowersRequest, ): Promise> { + return localVarFp.getProductFollowersWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Lists users permitted to access a product. * @summary List permitted users @@ -492,6 +583,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProductUsers(requestParameters: ProductsApiGetProductUsersRequest, ): Promise { return localVarFp.getProductUsers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProductUsersWithHttpInfo(requestParameters: ProductsApiGetProductUsersRequest, ): Promise> { + return localVarFp.getProductUsersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, }; }; @@ -668,6 +762,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).addProductFollower(requestParameters.id, requestParameters.AddProductFollowerRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProductFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiAddProductFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public addProductFollowerWithHttpInfo(requestParameters: ProductsApiAddProductFollowerRequest, ) { + return ProductsApiFp(this.configuration).addProductFollowerWithHttpInfo(requestParameters.id, requestParameters.AddProductFollowerRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a follower from a product. * @summary Delete a follower from a product @@ -680,6 +786,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).deleteProductFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProductFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiDeleteProductFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public deleteProductFollowerWithHttpInfo(requestParameters: ProductsApiDeleteProductFollowerRequest, ) { + return ProductsApiFp(this.configuration).deleteProductFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about deals that have a product attached to it. * @summary Get deals where a product is attached to @@ -692,6 +810,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProductDeals(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.status, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductDeals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductDealsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductDealsWithHttpInfo(requestParameters: ProductsApiGetProductDealsRequest, ) { + return ProductsApiFp(this.configuration).getProductDealsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.status, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists files associated with a product. * @summary List files attached to a product @@ -704,6 +834,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProductFiles(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductFiles`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductFilesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductFilesWithHttpInfo(requestParameters: ProductsApiGetProductFilesRequest, ) { + return ProductsApiFp(this.configuration).getProductFilesWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, requestParameters.sort, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the followers of a product. * @summary List followers of a product @@ -716,6 +858,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProductFollowers(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductFollowersWithHttpInfo(requestParameters: ProductsApiGetProductFollowersRequest, ) { + return ProductsApiFp(this.configuration).getProductFollowersWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists users permitted to access a product. * @summary List permitted users @@ -727,4 +881,16 @@ export class ProductsApi extends BaseAPI { public getProductUsers(requestParameters: ProductsApiGetProductUsersRequest, ) { return ProductsApiFp(this.configuration).getProductUsers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getProductUsers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductUsersWithHttpInfo(requestParameters: ProductsApiGetProductUsersRequest, ) { + return ProductsApiFp(this.configuration).getProductUsersWithHttpInfo(requestParameters.id, ).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 index 0b22b4ea..bf384663 100644 --- a/src/versions/v1/api/project-boards-api.ts +++ b/src/versions/v1/api/project-boards-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetProjectBoardResponse } from '../models'; // @ts-ignore @@ -131,6 +131,17 @@ export const ProjectBoardsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async getProjectsBoardWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all projects boards that are not deleted. * @summary Get all project boards @@ -141,6 +152,16 @@ export const ProjectBoardsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsBoards`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all project boards + + * @throws {RequiredError} + */ + async getProjectsBoardsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -161,6 +182,9 @@ export const ProjectBoardsApiFactory = function (configuration?: Configuration, getProjectsBoard(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ): Promise { return localVarFp.getProjectsBoard(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectsBoardWithHttpInfo(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ): Promise> { + return localVarFp.getProjectsBoardWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all projects boards that are not deleted. * @summary Get all project boards @@ -170,6 +194,9 @@ export const ProjectBoardsApiFactory = function (configuration?: Configuration, getProjectsBoards(): Promise { return localVarFp.getProjectsBoards().then((request) => request(axios, basePath)); }, + getProjectsBoardsWithHttpInfo(): Promise> { + return localVarFp.getProjectsBoardsWithHttpInfo().then((request) => request(axios, basePath)); + }, }; }; @@ -206,6 +233,18 @@ export class ProjectBoardsApi extends BaseAPI { return ProjectBoardsApiFp(this.configuration).getProjectsBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectBoardsApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public getProjectsBoardWithHttpInfo(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).getProjectsBoardWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all projects boards that are not deleted. * @summary Get all project boards @@ -216,4 +255,15 @@ export class ProjectBoardsApi extends BaseAPI { public getProjectsBoards() { return ProjectBoardsApiFp(this.configuration).getProjectsBoards().then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getProjectsBoards`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public getProjectsBoardsWithHttpInfo() { + return ProjectBoardsApiFp(this.configuration).getProjectsBoardsWithHttpInfo().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 index 69e2e33a..9e254516 100644 --- a/src/versions/v1/api/project-phases-api.ts +++ b/src/versions/v1/api/project-phases-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetProjectPhaseResponse } from '../models'; // @ts-ignore @@ -138,6 +138,17 @@ export const ProjectPhasesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async getProjectsPhaseWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -149,6 +160,17 @@ export const ProjectPhasesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsPhases`, but resolves with the response body together with the HTTP status and headers. + * @summary Get project phases + * @param {number} board_id ID of the board for which phases are requested + + * @throws {RequiredError} + */ + async getProjectsPhasesWithHttpInfo(board_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -169,6 +191,9 @@ export const ProjectPhasesApiFactory = function (configuration?: Configuration, getProjectsPhase(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ): Promise { return localVarFp.getProjectsPhase(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectsPhaseWithHttpInfo(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ): Promise> { + return localVarFp.getProjectsPhaseWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -179,6 +204,9 @@ export const ProjectPhasesApiFactory = function (configuration?: Configuration, getProjectsPhases(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ): Promise { return localVarFp.getProjectsPhases(requestParameters.board_id, ).then((request) => request(axios, basePath)); }, + getProjectsPhasesWithHttpInfo(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ): Promise> { + return localVarFp.getProjectsPhasesWithHttpInfo(requestParameters.board_id, ).then((request) => request(axios, basePath)); + }, }; }; @@ -229,6 +257,18 @@ export class ProjectPhasesApi extends BaseAPI { return ProjectPhasesApiFp(this.configuration).getProjectsPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectPhasesApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public getProjectsPhaseWithHttpInfo(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).getProjectsPhaseWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -240,4 +280,16 @@ export class ProjectPhasesApi extends BaseAPI { public getProjectsPhases(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ) { return ProjectPhasesApiFp(this.configuration).getProjectsPhases(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getProjectsPhases`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectPhasesApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public getProjectsPhasesWithHttpInfo(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ) { + return ProjectPhasesApiFp(this.configuration).getProjectsPhasesWithHttpInfo(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 337d1ffc..f7fb187d 100644 --- a/src/versions/v1/api/project-templates-api.ts +++ b/src/versions/v1/api/project-templates-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetProjectTemplateResponse } from '../models'; // @ts-ignore @@ -141,6 +141,17 @@ export const ProjectTemplatesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplate(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectTemplate`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a template + * @param {number} id The ID of the project template + + * @throws {RequiredError} + */ + async getProjectTemplateWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplate(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all not deleted project templates. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all project templates @@ -153,6 +164,18 @@ export const ProjectTemplatesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplates(cursor, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectTemplates`, but resolves with the response body together with the HTTP status and headers. + * @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, up to 500 items will be returned. + + * @throws {RequiredError} + */ + async getProjectTemplatesWithHttpInfo(cursor?: string, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplates(cursor, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -173,6 +196,9 @@ export const ProjectTemplatesApiFactory = function (configuration?: Configuratio getProjectTemplate(requestParameters: ProjectTemplatesApiGetProjectTemplateRequest, ): Promise { return localVarFp.getProjectTemplate(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectTemplateWithHttpInfo(requestParameters: ProjectTemplatesApiGetProjectTemplateRequest, ): Promise> { + return localVarFp.getProjectTemplateWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all not deleted project templates. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all project templates @@ -183,6 +209,9 @@ export const ProjectTemplatesApiFactory = function (configuration?: Configuratio getProjectTemplates(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ): Promise { return localVarFp.getProjectTemplates(requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getProjectTemplatesWithHttpInfo(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ): Promise> { + return localVarFp.getProjectTemplatesWithHttpInfo(requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, }; }; @@ -240,6 +269,18 @@ export class ProjectTemplatesApi extends BaseAPI { return ProjectTemplatesApiFp(this.configuration).getProjectTemplate(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectTemplate`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectTemplatesApiGetProjectTemplateRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectTemplatesApi + */ + public getProjectTemplateWithHttpInfo(requestParameters: ProjectTemplatesApiGetProjectTemplateRequest, ) { + return ProjectTemplatesApiFp(this.configuration).getProjectTemplateWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all not deleted project templates. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all project templates @@ -251,4 +292,16 @@ 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)); } + + /** + * Same as `getProjectTemplates`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectTemplatesApiGetProjectTemplatesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectTemplatesApi + */ + public getProjectTemplatesWithHttpInfo(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ) { + return ProjectTemplatesApiFp(this.configuration).getProjectTemplatesWithHttpInfo(requestParameters.cursor, requestParameters.limit, ).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 5db29c16..0ce80212 100644 --- a/src/versions/v1/api/projects-api.ts +++ b/src/versions/v1/api/projects-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddProjectRequest } from '../models'; // @ts-ignore @@ -615,6 +615,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProject(AddProjectRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a project + * @param {AddProjectRequest} [AddProjectRequest] + + * @throws {RequiredError} + */ + async addProjectWithHttpInfo(AddProjectRequest?: AddProjectRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProject(AddProjectRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Archives a project. * @summary Archive a project @@ -626,6 +637,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.archiveProject(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `archiveProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Archive a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async archiveProjectWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.archiveProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a project as deleted. * @summary Delete a project @@ -637,6 +659,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProject(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async deleteProjectWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific project. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of project fields. * @summary Get details of a project @@ -648,6 +681,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProject(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProjectWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns activities linked to a specific project. * @summary Returns project activities @@ -659,6 +703,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectActivities(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectActivities`, but resolves with the response body together with the HTTP status and headers. + * @summary Returns project activities + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProjectActivitiesWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectActivities(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all active groups under a specific project. * @summary Returns project groups @@ -670,6 +725,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectGroups(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectGroups`, but resolves with the response body together with the HTTP status and headers. + * @summary Returns project groups + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProjectGroupsWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectGroups(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns information about items in a project plan. Items consists of tasks and activities and are linked to specific project phase and group. * @summary Returns project plan @@ -681,6 +747,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectPlan(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectPlan`, but resolves with the response body together with the HTTP status and headers. + * @summary Returns project plan + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProjectPlanWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectPlan(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns tasks linked to a specific project. * @summary Returns project tasks @@ -692,6 +769,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTasks(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectTasks`, but resolves with the response body together with the HTTP status and headers. + * @summary Returns project tasks + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProjectTasksWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTasks(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all projects. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all projects @@ -708,6 +796,22 @@ 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); }, + /** + * Same as `getProjects`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all projects + * @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. + * @param {number} [filter_id] The ID of the filter to use + * @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 specified phase are returned + * @param {boolean} [include_archived] If supplied with `true` then archived projects are also included in the response. By default only not archived projects are returned. + + * @throws {RequiredError} + */ + async getProjectsWithHttpInfo(cursor?: string, limit?: number, filter_id?: number, status?: string, phase_id?: number, include_archived?: boolean, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjects(cursor, limit, filter_id, status, phase_id, include_archived, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates an activity phase or group in a project. * @summary Update activity in project plan @@ -721,6 +825,19 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.putProjectPlanActivity(id, activityId, ProjectPutPlanItemBodyObject, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `putProjectPlanActivity`, but resolves with the response body together with the HTTP status and headers. + * @summary Update activity in project plan + * @param {number} id The ID of the project + * @param {number} activityId The ID of the activity + * @param {ProjectPutPlanItemBodyObject} [ProjectPutPlanItemBodyObject] + + * @throws {RequiredError} + */ + async putProjectPlanActivityWithHttpInfo(id: number, activityId: number, ProjectPutPlanItemBodyObject?: ProjectPutPlanItemBodyObject, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.putProjectPlanActivity(id, activityId, ProjectPutPlanItemBodyObject, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a task phase or group in a project. * @summary Update task in project plan @@ -734,6 +851,19 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.putProjectPlanTask(id, taskId, ProjectPutPlanItemBodyObject, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `putProjectPlanTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Update task in project plan + * @param {number} id The ID of the project + * @param {number} taskId The ID of the task + * @param {ProjectPutPlanItemBodyObject} [ProjectPutPlanItemBodyObject] + + * @throws {RequiredError} + */ + async putProjectPlanTaskWithHttpInfo(id: number, taskId: number, ProjectPutPlanItemBodyObject?: ProjectPutPlanItemBodyObject, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.putProjectPlanTask(id, taskId, ProjectPutPlanItemBodyObject, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a project. * @summary Update a project @@ -746,6 +876,18 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProject(id, UpdateProjectRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a project + * @param {number} id The ID of the project + * @param {UpdateProjectRequest} [UpdateProjectRequest] + + * @throws {RequiredError} + */ + async updateProjectWithHttpInfo(id: number, UpdateProjectRequest?: UpdateProjectRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProject(id, UpdateProjectRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -766,6 +908,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP addProject(requestParameters: ProjectsApiAddProjectRequest = {}, ): Promise { return localVarFp.addProject(requestParameters.AddProjectRequest, ).then((request) => request(axios, basePath)); }, + addProjectWithHttpInfo(requestParameters: ProjectsApiAddProjectRequest = {}, ): Promise> { + return localVarFp.addProjectWithHttpInfo(requestParameters.AddProjectRequest, ).then((request) => request(axios, basePath)); + }, /** * Archives a project. * @summary Archive a project @@ -776,6 +921,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP archiveProject(requestParameters: ProjectsApiArchiveProjectRequest, ): Promise { return localVarFp.archiveProject(requestParameters.id, ).then((request) => request(axios, basePath)); }, + archiveProjectWithHttpInfo(requestParameters: ProjectsApiArchiveProjectRequest, ): Promise> { + return localVarFp.archiveProjectWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Marks a project as deleted. * @summary Delete a project @@ -786,6 +934,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP deleteProject(requestParameters: ProjectsApiDeleteProjectRequest, ): Promise { return localVarFp.deleteProject(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProjectWithHttpInfo(requestParameters: ProjectsApiDeleteProjectRequest, ): Promise> { + return localVarFp.deleteProjectWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific project. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of project fields. * @summary Get details of a project @@ -796,6 +947,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProject(requestParameters: ProjectsApiGetProjectRequest, ): Promise { return localVarFp.getProject(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectWithHttpInfo(requestParameters: ProjectsApiGetProjectRequest, ): Promise> { + return localVarFp.getProjectWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns activities linked to a specific project. * @summary Returns project activities @@ -806,6 +960,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProjectActivities(requestParameters: ProjectsApiGetProjectActivitiesRequest, ): Promise { return localVarFp.getProjectActivities(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectActivitiesWithHttpInfo(requestParameters: ProjectsApiGetProjectActivitiesRequest, ): Promise> { + return localVarFp.getProjectActivitiesWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all active groups under a specific project. * @summary Returns project groups @@ -816,6 +973,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProjectGroups(requestParameters: ProjectsApiGetProjectGroupsRequest, ): Promise { return localVarFp.getProjectGroups(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectGroupsWithHttpInfo(requestParameters: ProjectsApiGetProjectGroupsRequest, ): Promise> { + return localVarFp.getProjectGroupsWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns information about items in a project plan. Items consists of tasks and activities and are linked to specific project phase and group. * @summary Returns project plan @@ -826,6 +986,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProjectPlan(requestParameters: ProjectsApiGetProjectPlanRequest, ): Promise { return localVarFp.getProjectPlan(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectPlanWithHttpInfo(requestParameters: ProjectsApiGetProjectPlanRequest, ): Promise> { + return localVarFp.getProjectPlanWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns tasks linked to a specific project. * @summary Returns project tasks @@ -836,6 +999,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProjectTasks(requestParameters: ProjectsApiGetProjectTasksRequest, ): Promise { return localVarFp.getProjectTasks(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectTasksWithHttpInfo(requestParameters: ProjectsApiGetProjectTasksRequest, ): Promise> { + return localVarFp.getProjectTasksWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all projects. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all projects @@ -846,6 +1012,9 @@ 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)); }, + getProjectsWithHttpInfo(requestParameters: ProjectsApiGetProjectsRequest = {}, ): Promise> { + return localVarFp.getProjectsWithHttpInfo(requestParameters.cursor, requestParameters.limit, requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.include_archived, ).then((request) => request(axios, basePath)); + }, /** * Updates an activity phase or group in a project. * @summary Update activity in project plan @@ -856,6 +1025,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP putProjectPlanActivity(requestParameters: ProjectsApiPutProjectPlanActivityRequest, ): Promise { return localVarFp.putProjectPlanActivity(requestParameters.id, requestParameters.activityId, requestParameters.ProjectPutPlanItemBodyObject, ).then((request) => request(axios, basePath)); }, + putProjectPlanActivityWithHttpInfo(requestParameters: ProjectsApiPutProjectPlanActivityRequest, ): Promise> { + return localVarFp.putProjectPlanActivityWithHttpInfo(requestParameters.id, requestParameters.activityId, requestParameters.ProjectPutPlanItemBodyObject, ).then((request) => request(axios, basePath)); + }, /** * Updates a task phase or group in a project. * @summary Update task in project plan @@ -866,6 +1038,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP putProjectPlanTask(requestParameters: ProjectsApiPutProjectPlanTaskRequest, ): Promise { return localVarFp.putProjectPlanTask(requestParameters.id, requestParameters.taskId, requestParameters.ProjectPutPlanItemBodyObject, ).then((request) => request(axios, basePath)); }, + putProjectPlanTaskWithHttpInfo(requestParameters: ProjectsApiPutProjectPlanTaskRequest, ): Promise> { + return localVarFp.putProjectPlanTaskWithHttpInfo(requestParameters.id, requestParameters.taskId, requestParameters.ProjectPutPlanItemBodyObject, ).then((request) => request(axios, basePath)); + }, /** * Updates a project. * @summary Update a project @@ -876,6 +1051,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP updateProject(requestParameters: ProjectsApiUpdateProjectRequest, ): Promise { return localVarFp.updateProject(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(axios, basePath)); }, + updateProjectWithHttpInfo(requestParameters: ProjectsApiUpdateProjectRequest, ): Promise> { + return localVarFp.updateProjectWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -1136,6 +1314,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).addProject(requestParameters.AddProjectRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiAddProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public addProjectWithHttpInfo(requestParameters: ProjectsApiAddProjectRequest = {}, ) { + return ProjectsApiFp(this.configuration).addProjectWithHttpInfo(requestParameters.AddProjectRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Archives a project. * @summary Archive a project @@ -1148,6 +1338,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).archiveProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `archiveProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiArchiveProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public archiveProjectWithHttpInfo(requestParameters: ProjectsApiArchiveProjectRequest, ) { + return ProjectsApiFp(this.configuration).archiveProjectWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a project as deleted. * @summary Delete a project @@ -1160,6 +1362,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).deleteProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiDeleteProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public deleteProjectWithHttpInfo(requestParameters: ProjectsApiDeleteProjectRequest, ) { + return ProjectsApiFp(this.configuration).deleteProjectWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific project. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of project fields. * @summary Get details of a project @@ -1172,6 +1386,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectWithHttpInfo(requestParameters: ProjectsApiGetProjectRequest, ) { + return ProjectsApiFp(this.configuration).getProjectWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns activities linked to a specific project. * @summary Returns project activities @@ -1184,6 +1410,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProjectActivities(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectActivities`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectActivitiesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectActivitiesWithHttpInfo(requestParameters: ProjectsApiGetProjectActivitiesRequest, ) { + return ProjectsApiFp(this.configuration).getProjectActivitiesWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all active groups under a specific project. * @summary Returns project groups @@ -1196,6 +1434,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProjectGroups(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectGroups`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectGroupsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectGroupsWithHttpInfo(requestParameters: ProjectsApiGetProjectGroupsRequest, ) { + return ProjectsApiFp(this.configuration).getProjectGroupsWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns information about items in a project plan. Items consists of tasks and activities and are linked to specific project phase and group. * @summary Returns project plan @@ -1208,6 +1458,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProjectPlan(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectPlan`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectPlanRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectPlanWithHttpInfo(requestParameters: ProjectsApiGetProjectPlanRequest, ) { + return ProjectsApiFp(this.configuration).getProjectPlanWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns tasks linked to a specific project. * @summary Returns project tasks @@ -1220,6 +1482,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProjectTasks(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectTasks`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectTasksRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectTasksWithHttpInfo(requestParameters: ProjectsApiGetProjectTasksRequest, ) { + return ProjectsApiFp(this.configuration).getProjectTasksWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all projects. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all projects @@ -1232,6 +1506,18 @@ 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)); } + /** + * Same as `getProjects`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectsWithHttpInfo(requestParameters: ProjectsApiGetProjectsRequest = {}, ) { + return ProjectsApiFp(this.configuration).getProjectsWithHttpInfo(requestParameters.cursor, requestParameters.limit, requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.include_archived, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates an activity phase or group in a project. * @summary Update activity in project plan @@ -1244,6 +1530,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).putProjectPlanActivity(requestParameters.id, requestParameters.activityId, requestParameters.ProjectPutPlanItemBodyObject, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `putProjectPlanActivity`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiPutProjectPlanActivityRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public putProjectPlanActivityWithHttpInfo(requestParameters: ProjectsApiPutProjectPlanActivityRequest, ) { + return ProjectsApiFp(this.configuration).putProjectPlanActivityWithHttpInfo(requestParameters.id, requestParameters.activityId, requestParameters.ProjectPutPlanItemBodyObject, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a task phase or group in a project. * @summary Update task in project plan @@ -1256,6 +1554,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).putProjectPlanTask(requestParameters.id, requestParameters.taskId, requestParameters.ProjectPutPlanItemBodyObject, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `putProjectPlanTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiPutProjectPlanTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public putProjectPlanTaskWithHttpInfo(requestParameters: ProjectsApiPutProjectPlanTaskRequest, ) { + return ProjectsApiFp(this.configuration).putProjectPlanTaskWithHttpInfo(requestParameters.id, requestParameters.taskId, requestParameters.ProjectPutPlanItemBodyObject, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a project. * @summary Update a project @@ -1267,4 +1577,16 @@ export class ProjectsApi extends BaseAPI { public updateProject(requestParameters: ProjectsApiUpdateProjectRequest, ) { return ProjectsApiFp(this.configuration).updateProject(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiUpdateProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public updateProjectWithHttpInfo(requestParameters: ProjectsApiUpdateProjectRequest, ) { + return ProjectsApiFp(this.configuration).updateProjectWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/recents-api.ts b/src/versions/v1/api/recents-api.ts index f988d017..1537f1f6 100644 --- a/src/versions/v1/api/recents-api.ts +++ b/src/versions/v1/api/recents-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetRecentsResponse } from '../models'; /** @@ -113,6 +113,20 @@ export const RecentsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getRecents(since_timestamp, items, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getRecents`, but resolves with the response body together with the HTTP status and headers. + * @summary Get recents + * @param {string} since_timestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS. + * @param {'activity' | 'activityType' | 'deal' | 'file' | 'filter' | 'note' | 'person' | 'organization' | 'pipeline' | 'product' | 'stage' | 'user'} [items] Multiple selection of item types to include in the query (optional) + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getRecentsWithHttpInfo(since_timestamp: string, items?: 'activity' | 'activityType' | 'deal' | 'file' | 'filter' | 'note' | 'person' | 'organization' | 'pipeline' | 'product' | 'stage' | 'user', start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRecents(since_timestamp, items, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -133,6 +147,9 @@ export const RecentsApiFactory = function (configuration?: Configuration, basePa getRecents(requestParameters: RecentsApiGetRecentsRequest, ): Promise { return localVarFp.getRecents(requestParameters.since_timestamp, requestParameters.items, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getRecentsWithHttpInfo(requestParameters: RecentsApiGetRecentsRequest, ): Promise> { + return localVarFp.getRecentsWithHttpInfo(requestParameters.since_timestamp, requestParameters.items, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, }; }; @@ -189,4 +206,16 @@ export class RecentsApi extends BaseAPI { public getRecents(requestParameters: RecentsApiGetRecentsRequest, ) { return RecentsApiFp(this.configuration).getRecents(requestParameters.since_timestamp, requestParameters.items, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getRecents`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RecentsApiGetRecentsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RecentsApi + */ + public getRecentsWithHttpInfo(requestParameters: RecentsApiGetRecentsRequest, ) { + return RecentsApiFp(this.configuration).getRecentsWithHttpInfo(requestParameters.since_timestamp, requestParameters.items, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/roles-api.ts b/src/versions/v1/api/roles-api.ts index 1bfeef3a..dabc659d 100644 --- a/src/versions/v1/api/roles-api.ts +++ b/src/versions/v1/api/roles-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddOrUpdateRoleSettingRequest } from '../models'; // @ts-ignore @@ -617,6 +617,18 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addOrUpdateRoleSetting(id, AddOrUpdateRoleSettingRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addOrUpdateRoleSetting`, but resolves with the response body together with the HTTP status and headers. + * @summary Add or update role setting + * @param {number} id The ID of the role + * @param {AddOrUpdateRoleSettingRequest} [AddOrUpdateRoleSettingRequest] + + * @throws {RequiredError} + */ + async addOrUpdateRoleSettingWithHttpInfo(id: number, AddOrUpdateRoleSettingRequest?: AddOrUpdateRoleSettingRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addOrUpdateRoleSetting(id, AddOrUpdateRoleSettingRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a new role. * @summary Add a role @@ -628,6 +640,17 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addRole(AddRoleRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addRole`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a role + * @param {AddRoleRequest} [AddRoleRequest] + + * @throws {RequiredError} + */ + async addRoleWithHttpInfo(AddRoleRequest?: AddRoleRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addRole(AddRoleRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Assigns a user to a role. * @summary Add role assignment @@ -640,6 +663,18 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addRoleAssignment(id, AddRoleAssignmentRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addRoleAssignment`, but resolves with the response body together with the HTTP status and headers. + * @summary Add role assignment + * @param {number} id The ID of the role + * @param {AddRoleAssignmentRequest} [AddRoleAssignmentRequest] + + * @throws {RequiredError} + */ + async addRoleAssignmentWithHttpInfo(id: number, AddRoleAssignmentRequest?: AddRoleAssignmentRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addRoleAssignment(id, AddRoleAssignmentRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a role as deleted. * @summary Delete a role @@ -651,6 +686,17 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRole(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteRole`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a role + * @param {number} id The ID of the role + + * @throws {RequiredError} + */ + async deleteRoleWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRole(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Removes the assigned user from a role and adds to the default role. * @summary Delete a role assignment @@ -663,6 +709,18 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRoleAssignment(id, DeleteRoleAssignmentRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteRoleAssignment`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a role assignment + * @param {number} id The ID of the role + * @param {DeleteRoleAssignmentRequest} [DeleteRoleAssignmentRequest] + + * @throws {RequiredError} + */ + async deleteRoleAssignmentWithHttpInfo(id: number, DeleteRoleAssignmentRequest?: DeleteRoleAssignmentRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRoleAssignment(id, DeleteRoleAssignmentRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific role. * @summary Get one role @@ -674,6 +732,17 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getRole(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getRole`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one role + * @param {number} id The ID of the role + + * @throws {RequiredError} + */ + async getRoleWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRole(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all users assigned to a role. * @summary List role assignments @@ -687,6 +756,19 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getRoleAssignments(id, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getRoleAssignments`, but resolves with the response body together with the HTTP status and headers. + * @summary List role assignments + * @param {number} id The ID of the role + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getRoleAssignmentsWithHttpInfo(id: number, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRoleAssignments(id, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the list of either visible or hidden pipeline IDs for a specific role. For more information on pipeline visibility, please refer to the Visibility groups article. * @summary List pipeline visibility for a role @@ -699,6 +781,18 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getRolePipelines(id, visible, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getRolePipelines`, but resolves with the response body together with the HTTP status and headers. + * @summary List pipeline visibility for a role + * @param {number} id The ID of the role + * @param {boolean} [visible] Whether to return the visible or hidden pipelines for the role + + * @throws {RequiredError} + */ + async getRolePipelinesWithHttpInfo(id: number, visible?: boolean, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRolePipelines(id, visible, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the visibility settings of a specific role. * @summary List role settings @@ -710,6 +804,17 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getRoleSettings(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getRoleSettings`, but resolves with the response body together with the HTTP status and headers. + * @summary List role settings + * @param {number} id The ID of the role + + * @throws {RequiredError} + */ + async getRoleSettingsWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRoleSettings(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all the roles within the company. * @summary Get all roles @@ -722,6 +827,18 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getRoles(start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getRoles`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all roles + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getRolesWithHttpInfo(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRoles(start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the parent role and/or the name of a specific role. * @summary Update role details @@ -734,6 +851,18 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateRole(id, BaseRoleRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateRole`, but resolves with the response body together with the HTTP status and headers. + * @summary Update role details + * @param {number} id The ID of the role + * @param {BaseRoleRequest} [BaseRoleRequest] + + * @throws {RequiredError} + */ + async updateRoleWithHttpInfo(id: number, BaseRoleRequest?: BaseRoleRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateRole(id, BaseRoleRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the specified pipelines to be visible and/or hidden for a specific role. For more information on pipeline visibility, please refer to the Visibility groups article. * @summary Update pipeline visibility for a role @@ -746,6 +875,18 @@ export const RolesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateRolePipelines(id, PutRolePipelinesBody, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateRolePipelines`, but resolves with the response body together with the HTTP status and headers. + * @summary Update pipeline visibility for a role + * @param {number} id The ID of the role + * @param {PutRolePipelinesBody} [PutRolePipelinesBody] + + * @throws {RequiredError} + */ + async updateRolePipelinesWithHttpInfo(id: number, PutRolePipelinesBody?: PutRolePipelinesBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateRolePipelines(id, PutRolePipelinesBody, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -766,6 +907,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath addOrUpdateRoleSetting(requestParameters: RolesApiAddOrUpdateRoleSettingRequest, ): Promise { return localVarFp.addOrUpdateRoleSetting(requestParameters.id, requestParameters.AddOrUpdateRoleSettingRequest, ).then((request) => request(axios, basePath)); }, + addOrUpdateRoleSettingWithHttpInfo(requestParameters: RolesApiAddOrUpdateRoleSettingRequest, ): Promise> { + return localVarFp.addOrUpdateRoleSettingWithHttpInfo(requestParameters.id, requestParameters.AddOrUpdateRoleSettingRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a new role. * @summary Add a role @@ -776,6 +920,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath addRole(requestParameters: RolesApiAddRoleRequest = {}, ): Promise { return localVarFp.addRole(requestParameters.AddRoleRequest, ).then((request) => request(axios, basePath)); }, + addRoleWithHttpInfo(requestParameters: RolesApiAddRoleRequest = {}, ): Promise> { + return localVarFp.addRoleWithHttpInfo(requestParameters.AddRoleRequest, ).then((request) => request(axios, basePath)); + }, /** * Assigns a user to a role. * @summary Add role assignment @@ -786,6 +933,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath addRoleAssignment(requestParameters: RolesApiAddRoleAssignmentRequest, ): Promise { return localVarFp.addRoleAssignment(requestParameters.id, requestParameters.AddRoleAssignmentRequest, ).then((request) => request(axios, basePath)); }, + addRoleAssignmentWithHttpInfo(requestParameters: RolesApiAddRoleAssignmentRequest, ): Promise> { + return localVarFp.addRoleAssignmentWithHttpInfo(requestParameters.id, requestParameters.AddRoleAssignmentRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a role as deleted. * @summary Delete a role @@ -796,6 +946,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath deleteRole(requestParameters: RolesApiDeleteRoleRequest, ): Promise { return localVarFp.deleteRole(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteRoleWithHttpInfo(requestParameters: RolesApiDeleteRoleRequest, ): Promise> { + return localVarFp.deleteRoleWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Removes the assigned user from a role and adds to the default role. * @summary Delete a role assignment @@ -806,6 +959,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath deleteRoleAssignment(requestParameters: RolesApiDeleteRoleAssignmentRequest, ): Promise { return localVarFp.deleteRoleAssignment(requestParameters.id, requestParameters.DeleteRoleAssignmentRequest, ).then((request) => request(axios, basePath)); }, + deleteRoleAssignmentWithHttpInfo(requestParameters: RolesApiDeleteRoleAssignmentRequest, ): Promise> { + return localVarFp.deleteRoleAssignmentWithHttpInfo(requestParameters.id, requestParameters.DeleteRoleAssignmentRequest, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific role. * @summary Get one role @@ -816,6 +972,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath getRole(requestParameters: RolesApiGetRoleRequest, ): Promise { return localVarFp.getRole(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getRoleWithHttpInfo(requestParameters: RolesApiGetRoleRequest, ): Promise> { + return localVarFp.getRoleWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all users assigned to a role. * @summary List role assignments @@ -826,6 +985,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath getRoleAssignments(requestParameters: RolesApiGetRoleAssignmentsRequest, ): Promise { return localVarFp.getRoleAssignments(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getRoleAssignmentsWithHttpInfo(requestParameters: RolesApiGetRoleAssignmentsRequest, ): Promise> { + return localVarFp.getRoleAssignmentsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Returns the list of either visible or hidden pipeline IDs for a specific role. For more information on pipeline visibility, please refer to the Visibility groups article. * @summary List pipeline visibility for a role @@ -836,6 +998,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath getRolePipelines(requestParameters: RolesApiGetRolePipelinesRequest, ): Promise { return localVarFp.getRolePipelines(requestParameters.id, requestParameters.visible, ).then((request) => request(axios, basePath)); }, + getRolePipelinesWithHttpInfo(requestParameters: RolesApiGetRolePipelinesRequest, ): Promise> { + return localVarFp.getRolePipelinesWithHttpInfo(requestParameters.id, requestParameters.visible, ).then((request) => request(axios, basePath)); + }, /** * Returns the visibility settings of a specific role. * @summary List role settings @@ -846,6 +1011,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath getRoleSettings(requestParameters: RolesApiGetRoleSettingsRequest, ): Promise { return localVarFp.getRoleSettings(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getRoleSettingsWithHttpInfo(requestParameters: RolesApiGetRoleSettingsRequest, ): Promise> { + return localVarFp.getRoleSettingsWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all the roles within the company. * @summary Get all roles @@ -856,6 +1024,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath getRoles(requestParameters: RolesApiGetRolesRequest = {}, ): Promise { return localVarFp.getRoles(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getRolesWithHttpInfo(requestParameters: RolesApiGetRolesRequest = {}, ): Promise> { + return localVarFp.getRolesWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Updates the parent role and/or the name of a specific role. * @summary Update role details @@ -866,6 +1037,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath updateRole(requestParameters: RolesApiUpdateRoleRequest, ): Promise { return localVarFp.updateRole(requestParameters.id, requestParameters.BaseRoleRequest, ).then((request) => request(axios, basePath)); }, + updateRoleWithHttpInfo(requestParameters: RolesApiUpdateRoleRequest, ): Promise> { + return localVarFp.updateRoleWithHttpInfo(requestParameters.id, requestParameters.BaseRoleRequest, ).then((request) => request(axios, basePath)); + }, /** * Updates the specified pipelines to be visible and/or hidden for a specific role. For more information on pipeline visibility, please refer to the Visibility groups article. * @summary Update pipeline visibility for a role @@ -876,6 +1050,9 @@ export const RolesApiFactory = function (configuration?: Configuration, basePath updateRolePipelines(requestParameters: RolesApiUpdateRolePipelinesRequest, ): Promise { return localVarFp.updateRolePipelines(requestParameters.id, requestParameters.PutRolePipelinesBody, ).then((request) => request(axios, basePath)); }, + updateRolePipelinesWithHttpInfo(requestParameters: RolesApiUpdateRolePipelinesRequest, ): Promise> { + return localVarFp.updateRolePipelinesWithHttpInfo(requestParameters.id, requestParameters.PutRolePipelinesBody, ).then((request) => request(axios, basePath)); + }, }; }; @@ -1129,6 +1306,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).addOrUpdateRoleSetting(requestParameters.id, requestParameters.AddOrUpdateRoleSettingRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addOrUpdateRoleSetting`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiAddOrUpdateRoleSettingRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public addOrUpdateRoleSettingWithHttpInfo(requestParameters: RolesApiAddOrUpdateRoleSettingRequest, ) { + return RolesApiFp(this.configuration).addOrUpdateRoleSettingWithHttpInfo(requestParameters.id, requestParameters.AddOrUpdateRoleSettingRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a new role. * @summary Add a role @@ -1141,6 +1330,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).addRole(requestParameters.AddRoleRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addRole`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiAddRoleRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public addRoleWithHttpInfo(requestParameters: RolesApiAddRoleRequest = {}, ) { + return RolesApiFp(this.configuration).addRoleWithHttpInfo(requestParameters.AddRoleRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Assigns a user to a role. * @summary Add role assignment @@ -1153,6 +1354,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).addRoleAssignment(requestParameters.id, requestParameters.AddRoleAssignmentRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addRoleAssignment`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiAddRoleAssignmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public addRoleAssignmentWithHttpInfo(requestParameters: RolesApiAddRoleAssignmentRequest, ) { + return RolesApiFp(this.configuration).addRoleAssignmentWithHttpInfo(requestParameters.id, requestParameters.AddRoleAssignmentRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a role as deleted. * @summary Delete a role @@ -1165,6 +1378,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).deleteRole(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteRole`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiDeleteRoleRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public deleteRoleWithHttpInfo(requestParameters: RolesApiDeleteRoleRequest, ) { + return RolesApiFp(this.configuration).deleteRoleWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Removes the assigned user from a role and adds to the default role. * @summary Delete a role assignment @@ -1177,6 +1402,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).deleteRoleAssignment(requestParameters.id, requestParameters.DeleteRoleAssignmentRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteRoleAssignment`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiDeleteRoleAssignmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public deleteRoleAssignmentWithHttpInfo(requestParameters: RolesApiDeleteRoleAssignmentRequest, ) { + return RolesApiFp(this.configuration).deleteRoleAssignmentWithHttpInfo(requestParameters.id, requestParameters.DeleteRoleAssignmentRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific role. * @summary Get one role @@ -1189,6 +1426,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).getRole(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getRole`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiGetRoleRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public getRoleWithHttpInfo(requestParameters: RolesApiGetRoleRequest, ) { + return RolesApiFp(this.configuration).getRoleWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all users assigned to a role. * @summary List role assignments @@ -1201,6 +1450,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).getRoleAssignments(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getRoleAssignments`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiGetRoleAssignmentsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public getRoleAssignmentsWithHttpInfo(requestParameters: RolesApiGetRoleAssignmentsRequest, ) { + return RolesApiFp(this.configuration).getRoleAssignmentsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the list of either visible or hidden pipeline IDs for a specific role. For more information on pipeline visibility, please refer to the Visibility groups article. * @summary List pipeline visibility for a role @@ -1213,6 +1474,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).getRolePipelines(requestParameters.id, requestParameters.visible, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getRolePipelines`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiGetRolePipelinesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public getRolePipelinesWithHttpInfo(requestParameters: RolesApiGetRolePipelinesRequest, ) { + return RolesApiFp(this.configuration).getRolePipelinesWithHttpInfo(requestParameters.id, requestParameters.visible, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the visibility settings of a specific role. * @summary List role settings @@ -1225,6 +1498,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).getRoleSettings(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getRoleSettings`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiGetRoleSettingsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public getRoleSettingsWithHttpInfo(requestParameters: RolesApiGetRoleSettingsRequest, ) { + return RolesApiFp(this.configuration).getRoleSettingsWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all the roles within the company. * @summary Get all roles @@ -1237,6 +1522,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).getRoles(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getRoles`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiGetRolesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public getRolesWithHttpInfo(requestParameters: RolesApiGetRolesRequest = {}, ) { + return RolesApiFp(this.configuration).getRolesWithHttpInfo(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the parent role and/or the name of a specific role. * @summary Update role details @@ -1249,6 +1546,18 @@ export class RolesApi extends BaseAPI { return RolesApiFp(this.configuration).updateRole(requestParameters.id, requestParameters.BaseRoleRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateRole`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiUpdateRoleRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public updateRoleWithHttpInfo(requestParameters: RolesApiUpdateRoleRequest, ) { + return RolesApiFp(this.configuration).updateRoleWithHttpInfo(requestParameters.id, requestParameters.BaseRoleRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the specified pipelines to be visible and/or hidden for a specific role. For more information on pipeline visibility, please refer to the Visibility groups article. * @summary Update pipeline visibility for a role @@ -1260,4 +1569,16 @@ export class RolesApi extends BaseAPI { public updateRolePipelines(requestParameters: RolesApiUpdateRolePipelinesRequest, ) { return RolesApiFp(this.configuration).updateRolePipelines(requestParameters.id, requestParameters.PutRolePipelinesBody, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateRolePipelines`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {RolesApiUpdateRolePipelinesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof RolesApi + */ + public updateRolePipelinesWithHttpInfo(requestParameters: RolesApiUpdateRolePipelinesRequest, ) { + return RolesApiFp(this.configuration).updateRolePipelinesWithHttpInfo(requestParameters.id, requestParameters.PutRolePipelinesBody, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/stages-api.ts b/src/versions/v1/api/stages-api.ts index b30497e6..1f588be0 100644 --- a/src/versions/v1/api/stages-api.ts +++ b/src/versions/v1/api/stages-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetStageDealsResponse } from '../models'; /** @@ -122,6 +122,22 @@ export const StagesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getStageDeals(id, filter_id, user_id, everyone, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getStageDeals`, but resolves with the response body together with the HTTP status and headers. + * @summary Get deals in a stage + * @param {number} id The ID of the stage + * @param {number} [filter_id] If supplied, only deals matching the given filter will be returned + * @param {number} [user_id] If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. + * @param {0 | 1} [everyone] If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + * @deprecated + * @throws {RequiredError} + */ + async getStageDealsWithHttpInfo(id: number, filter_id?: number, user_id?: number, everyone?: 0 | 1, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getStageDeals(id, filter_id, user_id, everyone, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -142,6 +158,9 @@ export const StagesApiFactory = function (configuration?: Configuration, basePat getStageDeals(requestParameters: StagesApiGetStageDealsRequest, ): Promise { return localVarFp.getStageDeals(requestParameters.id, requestParameters.filter_id, requestParameters.user_id, requestParameters.everyone, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getStageDealsWithHttpInfo(requestParameters: StagesApiGetStageDealsRequest, ): Promise> { + return localVarFp.getStageDealsWithHttpInfo(requestParameters.id, requestParameters.filter_id, requestParameters.user_id, requestParameters.everyone, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, }; }; @@ -212,4 +231,16 @@ export class StagesApi extends BaseAPI { public getStageDeals(requestParameters: StagesApiGetStageDealsRequest, ) { return StagesApiFp(this.configuration).getStageDeals(requestParameters.id, requestParameters.filter_id, requestParameters.user_id, requestParameters.everyone, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getStageDeals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {StagesApiGetStageDealsRequest} requestParameters Request parameters. + * @deprecated + * @throws {RequiredError} + * @memberof StagesApi + */ + public getStageDealsWithHttpInfo(requestParameters: StagesApiGetStageDealsRequest, ) { + return StagesApiFp(this.configuration).getStageDealsWithHttpInfo(requestParameters.id, requestParameters.filter_id, requestParameters.user_id, requestParameters.everyone, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/tasks-api.ts b/src/versions/v1/api/tasks-api.ts index 9c900abd..749d6f98 100644 --- a/src/versions/v1/api/tasks-api.ts +++ b/src/versions/v1/api/tasks-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddTaskRequest } from '../models'; // @ts-ignore @@ -298,6 +298,17 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addTask(AddTaskRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a task + * @param {AddTaskRequest} [AddTaskRequest] + + * @throws {RequiredError} + */ + async addTaskWithHttpInfo(AddTaskRequest?: AddTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addTask(AddTaskRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a task as deleted. If the task has subtasks then those will also be deleted. * @summary Delete a task @@ -309,6 +320,17 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTask(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async deleteTaskWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific task. * @summary Get details of a task @@ -320,6 +342,17 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async getTaskWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all tasks. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all tasks @@ -336,6 +369,22 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getTasks(cursor, limit, assignee_id, project_id, parent_task_id, done, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getTasks`, but resolves with the response body together with the HTTP status and headers. + * @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, up to 500 items will be returned. + * @param {number} [assignee_id] If supplied, only tasks that are assigned to this user are returned + * @param {number} [project_id] If supplied, only tasks that are assigned to this project are returned + * @param {number} [parent_task_id] If `null` is supplied then only parent tasks are returned. If integer is supplied then only subtasks of a specific task are returned. By default all tasks are returned. + * @param {0 | 1} [done] Whether the task is done or not. `0` = Not done, `1` = Done. If not omitted then returns both done and not done tasks. + + * @throws {RequiredError} + */ + async getTasksWithHttpInfo(cursor?: string, limit?: number, assignee_id?: number, project_id?: number, parent_task_id?: number, done?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTasks(cursor, limit, assignee_id, project_id, parent_task_id, done, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a task. * @summary Update a task @@ -348,6 +397,18 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateTask(id, UpdateProjectRequest2, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a task + * @param {number} id The ID of the task + * @param {UpdateProjectRequest2} [UpdateProjectRequest2] + + * @throws {RequiredError} + */ + async updateTaskWithHttpInfo(id: number, UpdateProjectRequest2?: UpdateProjectRequest2, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateTask(id, UpdateProjectRequest2, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -368,6 +429,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath addTask(requestParameters: TasksApiAddTaskRequest = {}, ): Promise { return localVarFp.addTask(requestParameters.AddTaskRequest, ).then((request) => request(axios, basePath)); }, + addTaskWithHttpInfo(requestParameters: TasksApiAddTaskRequest = {}, ): Promise> { + return localVarFp.addTaskWithHttpInfo(requestParameters.AddTaskRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a task as deleted. If the task has subtasks then those will also be deleted. * @summary Delete a task @@ -378,6 +442,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath deleteTask(requestParameters: TasksApiDeleteTaskRequest, ): Promise { return localVarFp.deleteTask(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteTaskWithHttpInfo(requestParameters: TasksApiDeleteTaskRequest, ): Promise> { + return localVarFp.deleteTaskWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific task. * @summary Get details of a task @@ -388,6 +455,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath getTask(requestParameters: TasksApiGetTaskRequest, ): Promise { return localVarFp.getTask(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getTaskWithHttpInfo(requestParameters: TasksApiGetTaskRequest, ): Promise> { + return localVarFp.getTaskWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all tasks. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all tasks @@ -398,6 +468,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath getTasks(requestParameters: TasksApiGetTasksRequest = {}, ): Promise { return localVarFp.getTasks(requestParameters.cursor, requestParameters.limit, requestParameters.assignee_id, requestParameters.project_id, requestParameters.parent_task_id, requestParameters.done, ).then((request) => request(axios, basePath)); }, + getTasksWithHttpInfo(requestParameters: TasksApiGetTasksRequest = {}, ): Promise> { + return localVarFp.getTasksWithHttpInfo(requestParameters.cursor, requestParameters.limit, requestParameters.assignee_id, requestParameters.project_id, requestParameters.parent_task_id, requestParameters.done, ).then((request) => request(axios, basePath)); + }, /** * Updates a task. * @summary Update a task @@ -408,6 +481,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath updateTask(requestParameters: TasksApiUpdateTaskRequest, ): Promise { return localVarFp.updateTask(requestParameters.id, requestParameters.UpdateProjectRequest2, ).then((request) => request(axios, basePath)); }, + updateTaskWithHttpInfo(requestParameters: TasksApiUpdateTaskRequest, ): Promise> { + return localVarFp.updateTaskWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectRequest2, ).then((request) => request(axios, basePath)); + }, }; }; @@ -542,6 +618,18 @@ export class TasksApi extends BaseAPI { return TasksApiFp(this.configuration).addTask(requestParameters.AddTaskRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiAddTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public addTaskWithHttpInfo(requestParameters: TasksApiAddTaskRequest = {}, ) { + return TasksApiFp(this.configuration).addTaskWithHttpInfo(requestParameters.AddTaskRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a task as deleted. If the task has subtasks then those will also be deleted. * @summary Delete a task @@ -554,6 +642,18 @@ export class TasksApi extends BaseAPI { return TasksApiFp(this.configuration).deleteTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiDeleteTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public deleteTaskWithHttpInfo(requestParameters: TasksApiDeleteTaskRequest, ) { + return TasksApiFp(this.configuration).deleteTaskWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific task. * @summary Get details of a task @@ -566,6 +666,18 @@ export class TasksApi extends BaseAPI { return TasksApiFp(this.configuration).getTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiGetTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public getTaskWithHttpInfo(requestParameters: TasksApiGetTaskRequest, ) { + return TasksApiFp(this.configuration).getTaskWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all tasks. This is a cursor-paginated endpoint. For more information, please refer to our documentation on pagination. * @summary Get all tasks @@ -578,6 +690,18 @@ export class TasksApi extends BaseAPI { return TasksApiFp(this.configuration).getTasks(requestParameters.cursor, requestParameters.limit, requestParameters.assignee_id, requestParameters.project_id, requestParameters.parent_task_id, requestParameters.done, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getTasks`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiGetTasksRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public getTasksWithHttpInfo(requestParameters: TasksApiGetTasksRequest = {}, ) { + return TasksApiFp(this.configuration).getTasksWithHttpInfo(requestParameters.cursor, requestParameters.limit, requestParameters.assignee_id, requestParameters.project_id, requestParameters.parent_task_id, requestParameters.done, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a task. * @summary Update a task @@ -589,4 +713,16 @@ export class TasksApi extends BaseAPI { public updateTask(requestParameters: TasksApiUpdateTaskRequest, ) { return TasksApiFp(this.configuration).updateTask(requestParameters.id, requestParameters.UpdateProjectRequest2, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiUpdateTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public updateTaskWithHttpInfo(requestParameters: TasksApiUpdateTaskRequest, ) { + return TasksApiFp(this.configuration).updateTaskWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectRequest2, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/user-connections-api.ts b/src/versions/v1/api/user-connections-api.ts index 023bce87..1878e4fe 100644 --- a/src/versions/v1/api/user-connections-api.ts +++ b/src/versions/v1/api/user-connections-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetUserConnectionsResponse } from '../models'; // @ts-ignore @@ -89,6 +89,16 @@ export const UserConnectionsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserConnections(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserConnections`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all user connections + + * @throws {RequiredError} + */ + async getUserConnectionsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserConnections(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -108,6 +118,9 @@ export const UserConnectionsApiFactory = function (configuration?: Configuration getUserConnections(): Promise { return localVarFp.getUserConnections().then((request) => request(axios, basePath)); }, + getUserConnectionsWithHttpInfo(): Promise> { + return localVarFp.getUserConnectionsWithHttpInfo().then((request) => request(axios, basePath)); + }, }; }; @@ -128,4 +141,15 @@ export class UserConnectionsApi extends BaseAPI { public getUserConnections() { return UserConnectionsApiFp(this.configuration).getUserConnections().then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getUserConnections`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof UserConnectionsApi + */ + public getUserConnectionsWithHttpInfo() { + return UserConnectionsApiFp(this.configuration).getUserConnectionsWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/user-settings-api.ts b/src/versions/v1/api/user-settings-api.ts index 8f256d60..3a3af841 100644 --- a/src/versions/v1/api/user-settings-api.ts +++ b/src/versions/v1/api/user-settings-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetUserSettingsResponse } from '../models'; // @ts-ignore @@ -89,6 +89,16 @@ export const UserSettingsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserSettings(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserSettings`, but resolves with the response body together with the HTTP status and headers. + * @summary List settings of an authorized user + + * @throws {RequiredError} + */ + async getUserSettingsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserSettings(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -108,6 +118,9 @@ export const UserSettingsApiFactory = function (configuration?: Configuration, b getUserSettings(): Promise { return localVarFp.getUserSettings().then((request) => request(axios, basePath)); }, + getUserSettingsWithHttpInfo(): Promise> { + return localVarFp.getUserSettingsWithHttpInfo().then((request) => request(axios, basePath)); + }, }; }; @@ -128,4 +141,15 @@ export class UserSettingsApi extends BaseAPI { public getUserSettings() { return UserSettingsApiFp(this.configuration).getUserSettings().then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getUserSettings`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof UserSettingsApi + */ + public getUserSettingsWithHttpInfo() { + return UserSettingsApiFp(this.configuration).getUserSettingsWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/users-api.ts b/src/versions/v1/api/users-api.ts index bab34b02..41675104 100644 --- a/src/versions/v1/api/users-api.ts +++ b/src/versions/v1/api/users-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddUserRequest } from '../models'; // @ts-ignore @@ -495,6 +495,17 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addUser(AddUserRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addUser`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new user + * @param {AddUserRequest} [AddUserRequest] + + * @throws {RequiredError} + */ + async addUserWithHttpInfo(AddUserRequest?: AddUserRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addUser(AddUserRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Finds users by their name. * @summary Find users by name @@ -507,6 +518,18 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.findUsersByName(term, search_by_email, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `findUsersByName`, but resolves with the response body together with the HTTP status and headers. + * @summary Find users by name + * @param {string} term The search term to look for + * @param {0 | 1} [search_by_email] When enabled, the term will only be matched against email addresses of users. Default: `false`. + + * @throws {RequiredError} + */ + async findUsersByNameWithHttpInfo(term: string, search_by_email?: 0 | 1, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.findUsersByName(term, search_by_email, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the `locale` property means \'Date/number format\' in the Pipedrive account settings, not the chosen language. * @summary Get current user data @@ -517,6 +540,16 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getCurrentUser(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getCurrentUser`, but resolves with the response body together with the HTTP status and headers. + * @summary Get current user data + + * @throws {RequiredError} + */ + async getCurrentUserWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCurrentUser(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific user within the company. * @summary Get one user @@ -528,6 +561,17 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUser(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUser`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one user + * @param {number} id The ID of the user + + * @throws {RequiredError} + */ + async getUserWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUser(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the followers of a specific user. * @summary List followers of a user @@ -539,6 +583,17 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserFollowers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of a user + * @param {number} id The ID of the user + + * @throws {RequiredError} + */ + async getUserFollowersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserFollowers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists aggregated permissions over all assigned permission sets for a user. * @summary List user permissions @@ -550,6 +605,17 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserPermissions(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserPermissions`, but resolves with the response body together with the HTTP status and headers. + * @summary List user permissions + * @param {number} id The ID of the user + + * @throws {RequiredError} + */ + async getUserPermissionsWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserPermissions(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists role assignments for a user. * @summary List role assignments @@ -563,6 +629,19 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserRoleAssignments(id, start, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserRoleAssignments`, but resolves with the response body together with the HTTP status and headers. + * @summary List role assignments + * @param {number} id The ID of the user + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getUserRoleAssignmentsWithHttpInfo(id: number, start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserRoleAssignments(id, start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists the settings of user\'s assigned role. * @summary List user role settings @@ -574,6 +653,17 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserRoleSettings(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserRoleSettings`, but resolves with the response body together with the HTTP status and headers. + * @summary List user role settings + * @param {number} id The ID of the user + + * @throws {RequiredError} + */ + async getUserRoleSettingsWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserRoleSettings(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all users within the company. * @summary Get all users @@ -584,6 +674,16 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUsers(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUsers`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all users + + * @throws {RequiredError} + */ + async getUsersWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUsers(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a user. Currently, only `active_flag` can be updated. * @summary Update user details @@ -596,6 +696,18 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(id, UpdateUserRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateUser`, but resolves with the response body together with the HTTP status and headers. + * @summary Update user details + * @param {number} id The ID of the user + * @param {UpdateUserRequest} [UpdateUserRequest] + + * @throws {RequiredError} + */ + async updateUserWithHttpInfo(id: number, UpdateUserRequest?: UpdateUserRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(id, UpdateUserRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -616,6 +728,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath addUser(requestParameters: UsersApiAddUserRequest = {}, ): Promise { return localVarFp.addUser(requestParameters.AddUserRequest, ).then((request) => request(axios, basePath)); }, + addUserWithHttpInfo(requestParameters: UsersApiAddUserRequest = {}, ): Promise> { + return localVarFp.addUserWithHttpInfo(requestParameters.AddUserRequest, ).then((request) => request(axios, basePath)); + }, /** * Finds users by their name. * @summary Find users by name @@ -626,6 +741,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath findUsersByName(requestParameters: UsersApiFindUsersByNameRequest, ): Promise { return localVarFp.findUsersByName(requestParameters.term, requestParameters.search_by_email, ).then((request) => request(axios, basePath)); }, + findUsersByNameWithHttpInfo(requestParameters: UsersApiFindUsersByNameRequest, ): Promise> { + return localVarFp.findUsersByNameWithHttpInfo(requestParameters.term, requestParameters.search_by_email, ).then((request) => request(axios, basePath)); + }, /** * Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the `locale` property means \'Date/number format\' in the Pipedrive account settings, not the chosen language. * @summary Get current user data @@ -635,6 +753,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getCurrentUser(): Promise { return localVarFp.getCurrentUser().then((request) => request(axios, basePath)); }, + getCurrentUserWithHttpInfo(): Promise> { + return localVarFp.getCurrentUserWithHttpInfo().then((request) => request(axios, basePath)); + }, /** * Returns data about a specific user within the company. * @summary Get one user @@ -645,6 +766,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getUser(requestParameters: UsersApiGetUserRequest, ): Promise { return localVarFp.getUser(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getUserWithHttpInfo(requestParameters: UsersApiGetUserRequest, ): Promise> { + return localVarFp.getUserWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists the followers of a specific user. * @summary List followers of a user @@ -655,6 +779,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getUserFollowers(requestParameters: UsersApiGetUserFollowersRequest, ): Promise { return localVarFp.getUserFollowers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getUserFollowersWithHttpInfo(requestParameters: UsersApiGetUserFollowersRequest, ): Promise> { + return localVarFp.getUserFollowersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists aggregated permissions over all assigned permission sets for a user. * @summary List user permissions @@ -665,6 +792,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getUserPermissions(requestParameters: UsersApiGetUserPermissionsRequest, ): Promise { return localVarFp.getUserPermissions(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getUserPermissionsWithHttpInfo(requestParameters: UsersApiGetUserPermissionsRequest, ): Promise> { + return localVarFp.getUserPermissionsWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists role assignments for a user. * @summary List role assignments @@ -675,6 +805,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getUserRoleAssignments(requestParameters: UsersApiGetUserRoleAssignmentsRequest, ): Promise { return localVarFp.getUserRoleAssignments(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getUserRoleAssignmentsWithHttpInfo(requestParameters: UsersApiGetUserRoleAssignmentsRequest, ): Promise> { + return localVarFp.getUserRoleAssignmentsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Lists the settings of user\'s assigned role. * @summary List user role settings @@ -685,6 +818,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getUserRoleSettings(requestParameters: UsersApiGetUserRoleSettingsRequest, ): Promise { return localVarFp.getUserRoleSettings(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getUserRoleSettingsWithHttpInfo(requestParameters: UsersApiGetUserRoleSettingsRequest, ): Promise> { + return localVarFp.getUserRoleSettingsWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all users within the company. * @summary Get all users @@ -694,6 +830,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getUsers(): Promise { return localVarFp.getUsers().then((request) => request(axios, basePath)); }, + getUsersWithHttpInfo(): Promise> { + return localVarFp.getUsersWithHttpInfo().then((request) => request(axios, basePath)); + }, /** * Updates the properties of a user. Currently, only `active_flag` can be updated. * @summary Update user details @@ -704,6 +843,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath updateUser(requestParameters: UsersApiUpdateUserRequest, ): Promise { return localVarFp.updateUser(requestParameters.id, requestParameters.UpdateUserRequest, ).then((request) => request(axios, basePath)); }, + updateUserWithHttpInfo(requestParameters: UsersApiUpdateUserRequest, ): Promise> { + return localVarFp.updateUserWithHttpInfo(requestParameters.id, requestParameters.UpdateUserRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -866,6 +1008,18 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).addUser(requestParameters.AddUserRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addUser`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiAddUserRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public addUserWithHttpInfo(requestParameters: UsersApiAddUserRequest = {}, ) { + return UsersApiFp(this.configuration).addUserWithHttpInfo(requestParameters.AddUserRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Finds users by their name. * @summary Find users by name @@ -878,6 +1032,18 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).findUsersByName(requestParameters.term, requestParameters.search_by_email, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `findUsersByName`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiFindUsersByNameRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public findUsersByNameWithHttpInfo(requestParameters: UsersApiFindUsersByNameRequest, ) { + return UsersApiFp(this.configuration).findUsersByNameWithHttpInfo(requestParameters.term, requestParameters.search_by_email, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the `locale` property means \'Date/number format\' in the Pipedrive account settings, not the chosen language. * @summary Get current user data @@ -889,6 +1055,17 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).getCurrentUser().then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getCurrentUser`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public getCurrentUserWithHttpInfo() { + return UsersApiFp(this.configuration).getCurrentUserWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific user within the company. * @summary Get one user @@ -901,6 +1078,18 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).getUser(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getUser`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiGetUserRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public getUserWithHttpInfo(requestParameters: UsersApiGetUserRequest, ) { + return UsersApiFp(this.configuration).getUserWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the followers of a specific user. * @summary List followers of a user @@ -913,6 +1102,18 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).getUserFollowers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getUserFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiGetUserFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public getUserFollowersWithHttpInfo(requestParameters: UsersApiGetUserFollowersRequest, ) { + return UsersApiFp(this.configuration).getUserFollowersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists aggregated permissions over all assigned permission sets for a user. * @summary List user permissions @@ -925,6 +1126,18 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).getUserPermissions(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getUserPermissions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiGetUserPermissionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public getUserPermissionsWithHttpInfo(requestParameters: UsersApiGetUserPermissionsRequest, ) { + return UsersApiFp(this.configuration).getUserPermissionsWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists role assignments for a user. * @summary List role assignments @@ -937,6 +1150,18 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).getUserRoleAssignments(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getUserRoleAssignments`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiGetUserRoleAssignmentsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public getUserRoleAssignmentsWithHttpInfo(requestParameters: UsersApiGetUserRoleAssignmentsRequest, ) { + return UsersApiFp(this.configuration).getUserRoleAssignmentsWithHttpInfo(requestParameters.id, requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists the settings of user\'s assigned role. * @summary List user role settings @@ -949,6 +1174,18 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).getUserRoleSettings(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getUserRoleSettings`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiGetUserRoleSettingsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public getUserRoleSettingsWithHttpInfo(requestParameters: UsersApiGetUserRoleSettingsRequest, ) { + return UsersApiFp(this.configuration).getUserRoleSettingsWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all users within the company. * @summary Get all users @@ -960,6 +1197,17 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).getUsers().then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getUsers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public getUsersWithHttpInfo() { + return UsersApiFp(this.configuration).getUsersWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a user. Currently, only `active_flag` can be updated. * @summary Update user details @@ -971,4 +1219,16 @@ export class UsersApi extends BaseAPI { public updateUser(requestParameters: UsersApiUpdateUserRequest, ) { return UsersApiFp(this.configuration).updateUser(requestParameters.id, requestParameters.UpdateUserRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateUser`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiUpdateUserRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public updateUserWithHttpInfo(requestParameters: UsersApiUpdateUserRequest, ) { + return UsersApiFp(this.configuration).updateUserWithHttpInfo(requestParameters.id, requestParameters.UpdateUserRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/api/webhooks-api.ts b/src/versions/v1/api/webhooks-api.ts index 2cd5d8ef..93ee724b 100644 --- a/src/versions/v1/api/webhooks-api.ts +++ b/src/versions/v1/api/webhooks-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddWebhookRequest } from '../models'; // @ts-ignore @@ -182,6 +182,17 @@ export const WebhooksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addWebhook(AddWebhookRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addWebhook`, but resolves with the response body together with the HTTP status and headers. + * @summary Create a new Webhook + * @param {AddWebhookRequest} [AddWebhookRequest] + + * @throws {RequiredError} + */ + async addWebhookWithHttpInfo(AddWebhookRequest?: AddWebhookRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addWebhook(AddWebhookRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes the specified Webhook. * @summary Delete existing Webhook @@ -193,6 +204,17 @@ export const WebhooksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhook(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteWebhook`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete existing Webhook + * @param {number} id The ID of the Webhook to delete + + * @throws {RequiredError} + */ + async deleteWebhookWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhook(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all the Webhooks of a company. * @summary Get all Webhooks @@ -203,6 +225,16 @@ export const WebhooksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhooks(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getWebhooks`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all Webhooks + + * @throws {RequiredError} + */ + async getWebhooksWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhooks(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -223,6 +255,9 @@ export const WebhooksApiFactory = function (configuration?: Configuration, baseP addWebhook(requestParameters: WebhooksApiAddWebhookRequest = {}, ): Promise { return localVarFp.addWebhook(requestParameters.AddWebhookRequest, ).then((request) => request(axios, basePath)); }, + addWebhookWithHttpInfo(requestParameters: WebhooksApiAddWebhookRequest = {}, ): Promise> { + return localVarFp.addWebhookWithHttpInfo(requestParameters.AddWebhookRequest, ).then((request) => request(axios, basePath)); + }, /** * Deletes the specified Webhook. * @summary Delete existing Webhook @@ -233,6 +268,9 @@ export const WebhooksApiFactory = function (configuration?: Configuration, baseP deleteWebhook(requestParameters: WebhooksApiDeleteWebhookRequest, ): Promise { return localVarFp.deleteWebhook(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteWebhookWithHttpInfo(requestParameters: WebhooksApiDeleteWebhookRequest, ): Promise> { + return localVarFp.deleteWebhookWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all the Webhooks of a company. * @summary Get all Webhooks @@ -242,6 +280,9 @@ export const WebhooksApiFactory = function (configuration?: Configuration, baseP getWebhooks(): Promise { return localVarFp.getWebhooks().then((request) => request(axios, basePath)); }, + getWebhooksWithHttpInfo(): Promise> { + return localVarFp.getWebhooksWithHttpInfo().then((request) => request(axios, basePath)); + }, }; }; @@ -292,6 +333,18 @@ export class WebhooksApi extends BaseAPI { return WebhooksApiFp(this.configuration).addWebhook(requestParameters.AddWebhookRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addWebhook`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {WebhooksApiAddWebhookRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof WebhooksApi + */ + public addWebhookWithHttpInfo(requestParameters: WebhooksApiAddWebhookRequest = {}, ) { + return WebhooksApiFp(this.configuration).addWebhookWithHttpInfo(requestParameters.AddWebhookRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes the specified Webhook. * @summary Delete existing Webhook @@ -304,6 +357,18 @@ export class WebhooksApi extends BaseAPI { return WebhooksApiFp(this.configuration).deleteWebhook(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteWebhook`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {WebhooksApiDeleteWebhookRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof WebhooksApi + */ + public deleteWebhookWithHttpInfo(requestParameters: WebhooksApiDeleteWebhookRequest, ) { + return WebhooksApiFp(this.configuration).deleteWebhookWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all the Webhooks of a company. * @summary Get all Webhooks @@ -314,4 +379,15 @@ export class WebhooksApi extends BaseAPI { public getWebhooks() { return WebhooksApiFp(this.configuration).getWebhooks().then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getWebhooks`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof WebhooksApi + */ + public getWebhooksWithHttpInfo() { + return WebhooksApiFp(this.configuration).getWebhooksWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v1/base.ts b/src/versions/v1/base.ts index 13c520a4..649f285a 100644 --- a/src/versions/v1/base.ts +++ b/src/versions/v1/base.ts @@ -49,11 +49,47 @@ export const versionInterceptor = async (config:InternalAxiosRequestConfig) => { return config; } +/** + * Response returned by the `*WithHttpInfo` methods: the parsed body together with the HTTP metadata. + * + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + data: T; + status: number; + headers: AxiosResponse['headers']; +} + +// Set by the `*WithHttpInfo` methods to keep status and headers instead of returning only the body. +const wantsFullResponse = (config?: AxiosRequestConfig) => !!(config as { fullResponse?: boolean } | undefined)?.fullResponse; + export const responseInterceptor = (response: AxiosResponse) => { + if (wantsFullResponse(response?.config)) { + return { data: response.data, status: response.status, headers: response.headers }; + } return response?.data ? response.data: response; }; +/** + * Turns a raw AxiosError into the rejection used by the `*WithHttpInfo` methods: the error body fields (if any) + * plus `$response: { status, headers }`. Values that are not AxiosErrors with a response, including errors that + * were already normalized, are returned unchanged. + */ +export const toFullResponseError = (error: any) => { + if (!error?.isAxiosError || !error.response) { + return error; + } + const { data, status, headers } = error.response; + const body = data && typeof data === 'object' ? data : data ? { data } : {}; + return { ...body, $response: { status, headers } }; +}; + export const errorInterceptor = (error: AxiosError) => { + if (error.response && wantsFullResponse(error.config)) { + // Applies to empty error bodies too, so headers such as Retry-After are not lost. + return Promise.reject(toFullResponseError(error)); + } if (error.response && error.response.data) { return Promise.reject(error.response.data); } diff --git a/src/versions/v1/common.ts b/src/versions/v1/common.ts index 022f2745..bea3feac 100644 --- a/src/versions/v1/common.ts +++ b/src/versions/v1/common.ts @@ -14,7 +14,7 @@ import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; +import { RequiredError, RequestArgs, toFullResponseError } from "./base"; import type { AxiosInstance, AxiosResponse } from 'axios'; /** @@ -140,11 +140,14 @@ export const toPathString = function (url: URL) { * * @export */ -export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration, fullResponse: boolean = false) { // Explicit return type + cast avoid inferring axios's internal AxiosResponseResult type, // which references a module-private `unique symbol` and breaks `tsc --declaration` (TS2742). return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise => { - const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs) as Promise; + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url, ...(fullResponse ? { fullResponse } : {})}; + const request = axios.request(axiosRequestArgs) as Promise; + // Instances without the SDK's interceptors (e.g. the default global axios used by Fp and Factory calls) + // reject with a raw AxiosError, so give full-response errors the same shape as the class API. + return fullResponse ? request.catch((error) => Promise.reject(toFullResponseError(error))) : request; }; } diff --git a/src/versions/v2/api/activities-api.ts b/src/versions/v2/api/activities-api.ts index 3c789ae6..6ff0387c 100644 --- a/src/versions/v2/api/activities-api.ts +++ b/src/versions/v2/api/activities-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddActivityRequest } from '../models'; // @ts-ignore @@ -342,6 +342,17 @@ export const ActivitiesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addActivity(AddActivityRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addActivity`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new activity + * @param {AddActivityRequest} [AddActivityRequest] + + * @throws {RequiredError} + */ + async addActivityWithHttpInfo(AddActivityRequest?: AddActivityRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addActivity(AddActivityRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks an activity as deleted. After 30 days, the activity will be permanently deleted. * @summary Delete an activity @@ -353,6 +364,17 @@ export const ActivitiesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteActivity(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteActivity`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete an activity + * @param {number} id The ID of the activity + + * @throws {RequiredError} + */ + async deleteActivityWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteActivity(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all activities. * @summary Get all activities @@ -378,6 +400,31 @@ export const ActivitiesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getActivities(filter_id, ids, owner_id, deal_id, lead_id, person_id, org_id, done, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getActivities`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all activities + * @param {number} [filter_id] If supplied, only activities matching the specified filter are returned + * @param {Set} [ids] Optional comma separated array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. + * @param {number} [owner_id] If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored. + * @param {number} [deal_id] If supplied, only activities linked to the specified deal are returned. If filter_id is provided, this is ignored. + * @param {string} [lead_id] If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored. + * @param {number} [person_id] If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored. + * @param {number} [org_id] If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored. + * @param {boolean} [done] If supplied, only activities with specified \'done\' flag value are returned + * @param {string} [updated_since] If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {string} [updated_until] If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {'id' | 'update_time' | 'add_time' | 'due_date'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. + * @param {Set<'attendees'>} [include_fields] Optional comma separated string array of additional fields to include + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async getActivitiesWithHttpInfo(filter_id?: number, ids?: Set, owner_id?: number, deal_id?: number, lead_id?: string, person_id?: number, org_id?: number, done?: boolean, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time' | 'due_date', sort_direction?: 'asc' | 'desc', include_fields?: Set<'attendees'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getActivities(filter_id, ids, owner_id, deal_id, lead_id, person_id, org_id, done, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific activity. * @summary Get details of an activity @@ -390,6 +437,18 @@ export const ActivitiesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getActivity(id, include_fields, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getActivity`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of an activity + * @param {number} id The ID of the activity + * @param {Set<'attendees'>} [include_fields] Optional comma separated string array of additional fields to include + + * @throws {RequiredError} + */ + async getActivityWithHttpInfo(id: number, include_fields?: Set<'attendees'>, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getActivity(id, include_fields, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of an activity. * @summary Update an activity @@ -402,6 +461,18 @@ export const ActivitiesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateActivity(id, AddActivityRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateActivity`, but resolves with the response body together with the HTTP status and headers. + * @summary Update an activity + * @param {number} id The ID of the activity + * @param {AddActivityRequest} [AddActivityRequest] + + * @throws {RequiredError} + */ + async updateActivityWithHttpInfo(id: number, AddActivityRequest?: AddActivityRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateActivity(id, AddActivityRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -422,6 +493,9 @@ export const ActivitiesApiFactory = function (configuration?: Configuration, bas addActivity(requestParameters: ActivitiesApiAddActivityRequest = {}, ): Promise { return localVarFp.addActivity(requestParameters.AddActivityRequest, ).then((request) => request(axios, basePath)); }, + addActivityWithHttpInfo(requestParameters: ActivitiesApiAddActivityRequest = {}, ): Promise> { + return localVarFp.addActivityWithHttpInfo(requestParameters.AddActivityRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks an activity as deleted. After 30 days, the activity will be permanently deleted. * @summary Delete an activity @@ -432,6 +506,9 @@ export const ActivitiesApiFactory = function (configuration?: Configuration, bas deleteActivity(requestParameters: ActivitiesApiDeleteActivityRequest, ): Promise { return localVarFp.deleteActivity(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteActivityWithHttpInfo(requestParameters: ActivitiesApiDeleteActivityRequest, ): Promise> { + return localVarFp.deleteActivityWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all activities. * @summary Get all activities @@ -442,6 +519,9 @@ export const ActivitiesApiFactory = function (configuration?: Configuration, bas getActivities(requestParameters: ActivitiesApiGetActivitiesRequest = {}, ): Promise { return localVarFp.getActivities(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.person_id, requestParameters.org_id, requestParameters.done, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getActivitiesWithHttpInfo(requestParameters: ActivitiesApiGetActivitiesRequest = {}, ): Promise> { + return localVarFp.getActivitiesWithHttpInfo(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.person_id, requestParameters.org_id, requestParameters.done, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific activity. * @summary Get details of an activity @@ -452,6 +532,9 @@ export const ActivitiesApiFactory = function (configuration?: Configuration, bas getActivity(requestParameters: ActivitiesApiGetActivityRequest, ): Promise { return localVarFp.getActivity(requestParameters.id, requestParameters.include_fields, ).then((request) => request(axios, basePath)); }, + getActivityWithHttpInfo(requestParameters: ActivitiesApiGetActivityRequest, ): Promise> { + return localVarFp.getActivityWithHttpInfo(requestParameters.id, requestParameters.include_fields, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of an activity. * @summary Update an activity @@ -462,6 +545,9 @@ export const ActivitiesApiFactory = function (configuration?: Configuration, bas updateActivity(requestParameters: ActivitiesApiUpdateActivityRequest, ): Promise { return localVarFp.updateActivity(requestParameters.id, requestParameters.AddActivityRequest, ).then((request) => request(axios, basePath)); }, + updateActivityWithHttpInfo(requestParameters: ActivitiesApiUpdateActivityRequest, ): Promise> { + return localVarFp.updateActivityWithHttpInfo(requestParameters.id, requestParameters.AddActivityRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -666,6 +752,18 @@ export class ActivitiesApi extends BaseAPI { return ActivitiesApiFp(this.configuration).addActivity(requestParameters.AddActivityRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addActivity`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivitiesApiAddActivityRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivitiesApi + */ + public addActivityWithHttpInfo(requestParameters: ActivitiesApiAddActivityRequest = {}, ) { + return ActivitiesApiFp(this.configuration).addActivityWithHttpInfo(requestParameters.AddActivityRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks an activity as deleted. After 30 days, the activity will be permanently deleted. * @summary Delete an activity @@ -678,6 +776,18 @@ export class ActivitiesApi extends BaseAPI { return ActivitiesApiFp(this.configuration).deleteActivity(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteActivity`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivitiesApiDeleteActivityRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivitiesApi + */ + public deleteActivityWithHttpInfo(requestParameters: ActivitiesApiDeleteActivityRequest, ) { + return ActivitiesApiFp(this.configuration).deleteActivityWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all activities. * @summary Get all activities @@ -690,6 +800,18 @@ export class ActivitiesApi extends BaseAPI { return ActivitiesApiFp(this.configuration).getActivities(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.person_id, requestParameters.org_id, requestParameters.done, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getActivities`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivitiesApiGetActivitiesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivitiesApi + */ + public getActivitiesWithHttpInfo(requestParameters: ActivitiesApiGetActivitiesRequest = {}, ) { + return ActivitiesApiFp(this.configuration).getActivitiesWithHttpInfo(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.deal_id, requestParameters.lead_id, requestParameters.person_id, requestParameters.org_id, requestParameters.done, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific activity. * @summary Get details of an activity @@ -702,6 +824,18 @@ export class ActivitiesApi extends BaseAPI { return ActivitiesApiFp(this.configuration).getActivity(requestParameters.id, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getActivity`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivitiesApiGetActivityRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivitiesApi + */ + public getActivityWithHttpInfo(requestParameters: ActivitiesApiGetActivityRequest, ) { + return ActivitiesApiFp(this.configuration).getActivityWithHttpInfo(requestParameters.id, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of an activity. * @summary Update an activity @@ -713,4 +847,16 @@ export class ActivitiesApi extends BaseAPI { public updateActivity(requestParameters: ActivitiesApiUpdateActivityRequest, ) { return ActivitiesApiFp(this.configuration).updateActivity(requestParameters.id, requestParameters.AddActivityRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateActivity`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivitiesApiUpdateActivityRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivitiesApi + */ + public updateActivityWithHttpInfo(requestParameters: ActivitiesApiUpdateActivityRequest, ) { + return ActivitiesApiFp(this.configuration).updateActivityWithHttpInfo(requestParameters.id, requestParameters.AddActivityRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/activity-fields-api.ts b/src/versions/v2/api/activity-fields-api.ts index 72b93b4b..520d1ac8 100644 --- a/src/versions/v2/api/activity-fields-api.ts +++ b/src/versions/v2/api/activity-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetActivityField200Response } from '../models'; // @ts-ignore @@ -152,6 +152,18 @@ export const ActivityFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityField(field_code, include_fields, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getActivityField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one activity field + * @param {string} field_code The unique code identifying the field + * @param {Set<'ui_visibility'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + + * @throws {RequiredError} + */ + async getActivityFieldWithHttpInfo(field_code: string, include_fields?: Set<'ui_visibility'>, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityField(field_code, include_fields, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about all activity fields in the company. * @summary Get all activity fields @@ -165,6 +177,19 @@ export const ActivityFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityFields(include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getActivityFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all activity fields + * @param {Set<'ui_visibility'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + * @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 getActivityFieldsWithHttpInfo(include_fields?: Set<'ui_visibility'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getActivityFields(include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -185,6 +210,9 @@ export const ActivityFieldsApiFactory = function (configuration?: Configuration, getActivityField(requestParameters: ActivityFieldsApiGetActivityFieldRequest, ): Promise { return localVarFp.getActivityField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); }, + getActivityFieldWithHttpInfo(requestParameters: ActivityFieldsApiGetActivityFieldRequest, ): Promise> { + return localVarFp.getActivityFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about all activity fields in the company. * @summary Get all activity fields @@ -195,6 +223,9 @@ export const ActivityFieldsApiFactory = function (configuration?: Configuration, getActivityFields(requestParameters: ActivityFieldsApiGetActivityFieldsRequest = {}, ): Promise { return localVarFp.getActivityFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getActivityFieldsWithHttpInfo(requestParameters: ActivityFieldsApiGetActivityFieldsRequest = {}, ): Promise> { + return localVarFp.getActivityFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, }; }; @@ -266,6 +297,18 @@ export class ActivityFieldsApi extends BaseAPI { return ActivityFieldsApiFp(this.configuration).getActivityField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getActivityField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivityFieldsApiGetActivityFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivityFieldsApi + */ + public getActivityFieldWithHttpInfo(requestParameters: ActivityFieldsApiGetActivityFieldRequest, ) { + return ActivityFieldsApiFp(this.configuration).getActivityFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about all activity fields in the company. * @summary Get all activity fields @@ -277,4 +320,16 @@ export class ActivityFieldsApi extends BaseAPI { public getActivityFields(requestParameters: ActivityFieldsApiGetActivityFieldsRequest = {}, ) { return ActivityFieldsApiFp(this.configuration).getActivityFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getActivityFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ActivityFieldsApiGetActivityFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ActivityFieldsApi + */ + public getActivityFieldsWithHttpInfo(requestParameters: ActivityFieldsApiGetActivityFieldsRequest = {}, ) { + return ActivityFieldsApiFp(this.configuration).getActivityFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/beta-api.ts b/src/versions/v2/api/beta-api.ts index 3fb4fc19..53ca0fbb 100644 --- a/src/versions/v2/api/beta-api.ts +++ b/src/versions/v2/api/beta-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFieldOptions200Response } from '../models'; // @ts-ignore @@ -1200,6 +1200,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectBoard(AddProjectBoardRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a project board + * @param {AddProjectBoardRequest} AddProjectBoardRequest + + * @throws {RequiredError} + */ + async addProjectBoardWithHttpInfo(AddProjectBoardRequest: AddProjectBoardRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectBoard(AddProjectBoardRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Creates a new project custom field. * @summary Create one project field @@ -1211,6 +1222,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectField(AddProjectFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProjectField`, but resolves with the response body together with the HTTP status and headers. + * @summary Create one project field + * @param {AddProjectFieldRequest} AddProjectFieldRequest + + * @throws {RequiredError} + */ + async addProjectFieldWithHttpInfo(AddProjectFieldRequest: AddProjectFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectField(AddProjectFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -1223,6 +1245,18 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Add project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async addProjectFieldOptionsWithHttpInfo(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, true); + }, /** * Adds a new project phase to a board. * @summary Add a project phase @@ -1234,6 +1268,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectPhase(AddProjectPhaseRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a project phase + * @param {AddProjectPhaseRequest} AddProjectPhaseRequest + + * @throws {RequiredError} + */ + async addProjectPhaseWithHttpInfo(AddProjectPhaseRequest: AddProjectPhaseRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectPhase(AddProjectPhaseRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a new task. * @summary Add a task @@ -1245,6 +1290,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addTask(AddTaskRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a task + * @param {AddTaskRequest} AddTaskRequest + + * @throws {RequiredError} + */ + async addTaskWithHttpInfo(AddTaskRequest: AddTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addTask(AddTaskRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a project board as deleted. * @summary Delete a project board @@ -1256,6 +1312,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectBoard(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async deleteProjectBoardWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a custom field as deleted. * @summary Delete one project field @@ -1267,6 +1334,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectField(field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProjectField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async deleteProjectFieldWithHttpInfo(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -1279,6 +1357,18 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async deleteProjectFieldOptionsWithHttpInfo(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, true); + }, /** * Marks a project phase as deleted. * @summary Delete a project phase @@ -1290,6 +1380,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectPhase(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async deleteProjectPhaseWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a task as deleted. If the task has subtasks, those will also be deleted. * @summary Delete a task @@ -1301,6 +1402,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTask(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async deleteTaskWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about a specific project field. * @summary Get one project field @@ -1312,6 +1424,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectField(field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async getProjectFieldWithHttpInfo(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about all project fields in the company. * @summary Get all project fields @@ -1324,6 +1447,18 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectFields(limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectFields`, but resolves with the response body together with the HTTP status and headers. + * @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 getProjectFieldsWithHttpInfo(limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectFields(limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific project board. * @summary Get details of a project board @@ -1335,6 +1470,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async getProjectsBoardWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all active project boards. * @summary Get all project boards @@ -1345,6 +1491,16 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsBoards`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all project boards + + * @throws {RequiredError} + */ + async getProjectsBoardsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific project phase. * @summary Get details of a project phase @@ -1356,6 +1512,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async getProjectsPhaseWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -1367,6 +1534,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsPhases`, but resolves with the response body together with the HTTP status and headers. + * @summary Get project phases + * @param {number} board_id The ID of the board for which phases are requested + + * @throws {RequiredError} + */ + async getProjectsPhasesWithHttpInfo(board_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific task. * @summary Get details of a task @@ -1378,6 +1556,17 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async getTaskWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all tasks. * @summary Get all tasks @@ -1395,6 +1584,23 @@ export const BetaApiFp = function(configuration?: Configuration) { 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); }, + /** + * Same as `getTasks`, but resolves with the response body together with the HTTP status and headers. + * @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 getTasksWithHttpInfo(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, true); + }, /** * 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 @@ -1412,6 +1618,23 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchProjects(term, fields, exact_match, person_id, organization_id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchProjects`, but resolves with the response body together with the HTTP status and headers. + * @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 {Set<'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 100 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchProjectsWithHttpInfo(term: string, fields?: Set<'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, true); + }, /** * Updates the properties of a project board. * @summary Update a project board @@ -1424,6 +1647,18 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectBoard(id, UpdateProjectBoardRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a project board + * @param {number} id The ID of the project board + * @param {UpdateProjectBoardRequest} [UpdateProjectBoardRequest] + + * @throws {RequiredError} + */ + async updateProjectBoardWithHttpInfo(id: number, UpdateProjectBoardRequest?: UpdateProjectBoardRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectBoard(id, UpdateProjectBoardRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -1436,6 +1671,18 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectField(field_code, UpdateProjectFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProjectField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update one project field + * @param {string} field_code The unique code identifying the field + * @param {UpdateProjectFieldRequest} UpdateProjectFieldRequest + + * @throws {RequiredError} + */ + async updateProjectFieldWithHttpInfo(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, true); + }, /** * 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 @@ -1448,6 +1695,18 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Update project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async updateProjectFieldOptionsWithHttpInfo(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, true); + }, /** * Updates the properties of a project phase. * @summary Update a project phase @@ -1460,6 +1719,18 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectPhase(id, UpdateProjectPhaseRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a project phase + * @param {number} id The ID of the project phase + * @param {UpdateProjectPhaseRequest} [UpdateProjectPhaseRequest] + + * @throws {RequiredError} + */ + async updateProjectPhaseWithHttpInfo(id: number, UpdateProjectPhaseRequest?: UpdateProjectPhaseRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectPhase(id, UpdateProjectPhaseRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a task. * @summary Update a task @@ -1472,6 +1743,18 @@ export const BetaApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateTask(id, UpdateTaskRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a task + * @param {number} id The ID of the task + * @param {UpdateTaskRequest} [UpdateTaskRequest] + + * @throws {RequiredError} + */ + async updateTaskWithHttpInfo(id: number, UpdateTaskRequest?: UpdateTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateTask(id, UpdateTaskRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -1492,6 +1775,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? addProjectBoard(requestParameters: BetaApiAddProjectBoardRequest, ): Promise { return localVarFp.addProjectBoard(requestParameters.AddProjectBoardRequest, ).then((request) => request(axios, basePath)); }, + addProjectBoardWithHttpInfo(requestParameters: BetaApiAddProjectBoardRequest, ): Promise> { + return localVarFp.addProjectBoardWithHttpInfo(requestParameters.AddProjectBoardRequest, ).then((request) => request(axios, basePath)); + }, /** * Creates a new project custom field. * @summary Create one project field @@ -1502,6 +1788,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? addProjectField(requestParameters: BetaApiAddProjectFieldRequest, ): Promise { return localVarFp.addProjectField(requestParameters.AddProjectFieldRequest, ).then((request) => request(axios, basePath)); }, + addProjectFieldWithHttpInfo(requestParameters: BetaApiAddProjectFieldRequest, ): Promise> { + return localVarFp.addProjectFieldWithHttpInfo(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 @@ -1512,6 +1801,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? addProjectFieldOptions(requestParameters: BetaApiAddProjectFieldOptionsRequest, ): Promise { return localVarFp.addProjectFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + addProjectFieldOptionsWithHttpInfo(requestParameters: BetaApiAddProjectFieldOptionsRequest, ): Promise> { + return localVarFp.addProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Adds a new project phase to a board. * @summary Add a project phase @@ -1522,6 +1814,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? addProjectPhase(requestParameters: BetaApiAddProjectPhaseRequest, ): Promise { return localVarFp.addProjectPhase(requestParameters.AddProjectPhaseRequest, ).then((request) => request(axios, basePath)); }, + addProjectPhaseWithHttpInfo(requestParameters: BetaApiAddProjectPhaseRequest, ): Promise> { + return localVarFp.addProjectPhaseWithHttpInfo(requestParameters.AddProjectPhaseRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a new task. * @summary Add a task @@ -1532,6 +1827,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? addTask(requestParameters: BetaApiAddTaskRequest, ): Promise { return localVarFp.addTask(requestParameters.AddTaskRequest, ).then((request) => request(axios, basePath)); }, + addTaskWithHttpInfo(requestParameters: BetaApiAddTaskRequest, ): Promise> { + return localVarFp.addTaskWithHttpInfo(requestParameters.AddTaskRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a project board as deleted. * @summary Delete a project board @@ -1542,6 +1840,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? deleteProjectBoard(requestParameters: BetaApiDeleteProjectBoardRequest, ): Promise { return localVarFp.deleteProjectBoard(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProjectBoardWithHttpInfo(requestParameters: BetaApiDeleteProjectBoardRequest, ): Promise> { + return localVarFp.deleteProjectBoardWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Marks a custom field as deleted. * @summary Delete one project field @@ -1552,6 +1853,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? deleteProjectField(requestParameters: BetaApiDeleteProjectFieldRequest, ): Promise { return localVarFp.deleteProjectField(requestParameters.field_code, ).then((request) => request(axios, basePath)); }, + deleteProjectFieldWithHttpInfo(requestParameters: BetaApiDeleteProjectFieldRequest, ): Promise> { + return localVarFp.deleteProjectFieldWithHttpInfo(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 @@ -1562,6 +1866,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? deleteProjectFieldOptions(requestParameters: BetaApiDeleteProjectFieldOptionsRequest, ): Promise { return localVarFp.deleteProjectFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + deleteProjectFieldOptionsWithHttpInfo(requestParameters: BetaApiDeleteProjectFieldOptionsRequest, ): Promise> { + return localVarFp.deleteProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Marks a project phase as deleted. * @summary Delete a project phase @@ -1572,6 +1879,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? deleteProjectPhase(requestParameters: BetaApiDeleteProjectPhaseRequest, ): Promise { return localVarFp.deleteProjectPhase(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProjectPhaseWithHttpInfo(requestParameters: BetaApiDeleteProjectPhaseRequest, ): Promise> { + return localVarFp.deleteProjectPhaseWithHttpInfo(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 @@ -1582,6 +1892,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? deleteTask(requestParameters: BetaApiDeleteTaskRequest, ): Promise { return localVarFp.deleteTask(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteTaskWithHttpInfo(requestParameters: BetaApiDeleteTaskRequest, ): Promise> { + return localVarFp.deleteTaskWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about a specific project field. * @summary Get one project field @@ -1592,6 +1905,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? getProjectField(requestParameters: BetaApiGetProjectFieldRequest, ): Promise { return localVarFp.getProjectField(requestParameters.field_code, ).then((request) => request(axios, basePath)); }, + getProjectFieldWithHttpInfo(requestParameters: BetaApiGetProjectFieldRequest, ): Promise> { + return localVarFp.getProjectFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about all project fields in the company. * @summary Get all project fields @@ -1602,6 +1918,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? getProjectFields(requestParameters: BetaApiGetProjectFieldsRequest = {}, ): Promise { return localVarFp.getProjectFields(requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getProjectFieldsWithHttpInfo(requestParameters: BetaApiGetProjectFieldsRequest = {}, ): Promise> { + return localVarFp.getProjectFieldsWithHttpInfo(requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific project board. * @summary Get details of a project board @@ -1612,6 +1931,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? getProjectsBoard(requestParameters: BetaApiGetProjectsBoardRequest, ): Promise { return localVarFp.getProjectsBoard(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectsBoardWithHttpInfo(requestParameters: BetaApiGetProjectsBoardRequest, ): Promise> { + return localVarFp.getProjectsBoardWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all active project boards. * @summary Get all project boards @@ -1621,6 +1943,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? getProjectsBoards(): Promise { return localVarFp.getProjectsBoards().then((request) => request(axios, basePath)); }, + getProjectsBoardsWithHttpInfo(): Promise> { + return localVarFp.getProjectsBoardsWithHttpInfo().then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific project phase. * @summary Get details of a project phase @@ -1631,6 +1956,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? getProjectsPhase(requestParameters: BetaApiGetProjectsPhaseRequest, ): Promise { return localVarFp.getProjectsPhase(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectsPhaseWithHttpInfo(requestParameters: BetaApiGetProjectsPhaseRequest, ): Promise> { + return localVarFp.getProjectsPhaseWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -1641,6 +1969,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? getProjectsPhases(requestParameters: BetaApiGetProjectsPhasesRequest, ): Promise { return localVarFp.getProjectsPhases(requestParameters.board_id, ).then((request) => request(axios, basePath)); }, + getProjectsPhasesWithHttpInfo(requestParameters: BetaApiGetProjectsPhasesRequest, ): Promise> { + return localVarFp.getProjectsPhasesWithHttpInfo(requestParameters.board_id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific task. * @summary Get details of a task @@ -1651,6 +1982,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? getTask(requestParameters: BetaApiGetTaskRequest, ): Promise { return localVarFp.getTask(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getTaskWithHttpInfo(requestParameters: BetaApiGetTaskRequest, ): Promise> { + return localVarFp.getTaskWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all tasks. * @summary Get all tasks @@ -1661,6 +1995,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? 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)); }, + getTasksWithHttpInfo(requestParameters: BetaApiGetTasksRequest = {}, ): Promise> { + return localVarFp.getTasksWithHttpInfo(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 @@ -1671,6 +2008,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? 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)); }, + searchProjectsWithHttpInfo(requestParameters: BetaApiSearchProjectsRequest, ): Promise> { + return localVarFp.searchProjectsWithHttpInfo(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 @@ -1681,6 +2021,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? updateProjectBoard(requestParameters: BetaApiUpdateProjectBoardRequest, ): Promise { return localVarFp.updateProjectBoard(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(axios, basePath)); }, + updateProjectBoardWithHttpInfo(requestParameters: BetaApiUpdateProjectBoardRequest, ): Promise> { + return localVarFp.updateProjectBoardWithHttpInfo(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 @@ -1691,6 +2034,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? updateProjectField(requestParameters: BetaApiUpdateProjectFieldRequest, ): Promise { return localVarFp.updateProjectField(requestParameters.field_code, requestParameters.UpdateProjectFieldRequest, ).then((request) => request(axios, basePath)); }, + updateProjectFieldWithHttpInfo(requestParameters: BetaApiUpdateProjectFieldRequest, ): Promise> { + return localVarFp.updateProjectFieldWithHttpInfo(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 @@ -1701,6 +2047,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? updateProjectFieldOptions(requestParameters: BetaApiUpdateProjectFieldOptionsRequest, ): Promise { return localVarFp.updateProjectFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + updateProjectFieldOptionsWithHttpInfo(requestParameters: BetaApiUpdateProjectFieldOptionsRequest, ): Promise> { + return localVarFp.updateProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a project phase. * @summary Update a project phase @@ -1711,6 +2060,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? updateProjectPhase(requestParameters: BetaApiUpdateProjectPhaseRequest, ): Promise { return localVarFp.updateProjectPhase(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(axios, basePath)); }, + updateProjectPhaseWithHttpInfo(requestParameters: BetaApiUpdateProjectPhaseRequest, ): Promise> { + return localVarFp.updateProjectPhaseWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(axios, basePath)); + }, /** * Updates a task. * @summary Update a task @@ -1721,6 +2073,9 @@ export const BetaApiFactory = function (configuration?: Configuration, basePath? updateTask(requestParameters: BetaApiUpdateTaskRequest, ): Promise { return localVarFp.updateTask(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(axios, basePath)); }, + updateTaskWithHttpInfo(requestParameters: BetaApiUpdateTaskRequest, ): Promise> { + return localVarFp.updateTaskWithHttpInfo(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -2205,6 +2560,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).addProjectBoard(requestParameters.AddProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiAddProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addProjectBoardWithHttpInfo(requestParameters: BetaApiAddProjectBoardRequest, ) { + return BetaApiFp(this.configuration).addProjectBoardWithHttpInfo(requestParameters.AddProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Creates a new project custom field. * @summary Create one project field @@ -2217,6 +2584,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).addProjectField(requestParameters.AddProjectFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProjectField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiAddProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addProjectFieldWithHttpInfo(requestParameters: BetaApiAddProjectFieldRequest, ) { + return BetaApiFp(this.configuration).addProjectFieldWithHttpInfo(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 @@ -2229,6 +2608,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).addProjectFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiAddProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addProjectFieldOptionsWithHttpInfo(requestParameters: BetaApiAddProjectFieldOptionsRequest, ) { + return BetaApiFp(this.configuration).addProjectFieldOptionsWithHttpInfo(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 @@ -2241,6 +2632,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).addProjectPhase(requestParameters.AddProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiAddProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addProjectPhaseWithHttpInfo(requestParameters: BetaApiAddProjectPhaseRequest, ) { + return BetaApiFp(this.configuration).addProjectPhaseWithHttpInfo(requestParameters.AddProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a new task. * @summary Add a task @@ -2253,6 +2656,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).addTask(requestParameters.AddTaskRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiAddTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public addTaskWithHttpInfo(requestParameters: BetaApiAddTaskRequest, ) { + return BetaApiFp(this.configuration).addTaskWithHttpInfo(requestParameters.AddTaskRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a project board as deleted. * @summary Delete a project board @@ -2265,6 +2680,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).deleteProjectBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiDeleteProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteProjectBoardWithHttpInfo(requestParameters: BetaApiDeleteProjectBoardRequest, ) { + return BetaApiFp(this.configuration).deleteProjectBoardWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a custom field as deleted. * @summary Delete one project field @@ -2277,6 +2704,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).deleteProjectField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProjectField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiDeleteProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteProjectFieldWithHttpInfo(requestParameters: BetaApiDeleteProjectFieldRequest, ) { + return BetaApiFp(this.configuration).deleteProjectFieldWithHttpInfo(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 @@ -2289,6 +2728,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).deleteProjectFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiDeleteProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteProjectFieldOptionsWithHttpInfo(requestParameters: BetaApiDeleteProjectFieldOptionsRequest, ) { + return BetaApiFp(this.configuration).deleteProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a project phase as deleted. * @summary Delete a project phase @@ -2301,6 +2752,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).deleteProjectPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiDeleteProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteProjectPhaseWithHttpInfo(requestParameters: BetaApiDeleteProjectPhaseRequest, ) { + return BetaApiFp(this.configuration).deleteProjectPhaseWithHttpInfo(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 @@ -2313,6 +2776,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).deleteTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiDeleteTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public deleteTaskWithHttpInfo(requestParameters: BetaApiDeleteTaskRequest, ) { + return BetaApiFp(this.configuration).deleteTaskWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about a specific project field. * @summary Get one project field @@ -2325,6 +2800,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).getProjectField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiGetProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectFieldWithHttpInfo(requestParameters: BetaApiGetProjectFieldRequest, ) { + return BetaApiFp(this.configuration).getProjectFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about all project fields in the company. * @summary Get all project fields @@ -2337,6 +2824,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).getProjectFields(requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiGetProjectFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectFieldsWithHttpInfo(requestParameters: BetaApiGetProjectFieldsRequest = {}, ) { + return BetaApiFp(this.configuration).getProjectFieldsWithHttpInfo(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 @@ -2349,6 +2848,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).getProjectsBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectsBoardWithHttpInfo(requestParameters: BetaApiGetProjectsBoardRequest, ) { + return BetaApiFp(this.configuration).getProjectsBoardWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all active project boards. * @summary Get all project boards @@ -2360,6 +2871,17 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).getProjectsBoards().then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsBoards`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectsBoardsWithHttpInfo() { + return BetaApiFp(this.configuration).getProjectsBoardsWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific project phase. * @summary Get details of a project phase @@ -2372,6 +2894,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).getProjectsPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectsPhaseWithHttpInfo(requestParameters: BetaApiGetProjectsPhaseRequest, ) { + return BetaApiFp(this.configuration).getProjectsPhaseWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -2384,6 +2918,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).getProjectsPhases(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsPhases`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getProjectsPhasesWithHttpInfo(requestParameters: BetaApiGetProjectsPhasesRequest, ) { + return BetaApiFp(this.configuration).getProjectsPhasesWithHttpInfo(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific task. * @summary Get details of a task @@ -2396,6 +2942,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).getTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiGetTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getTaskWithHttpInfo(requestParameters: BetaApiGetTaskRequest, ) { + return BetaApiFp(this.configuration).getTaskWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all tasks. * @summary Get all tasks @@ -2408,6 +2966,18 @@ export class BetaApi extends BaseAPI { 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)); } + /** + * Same as `getTasks`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiGetTasksRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public getTasksWithHttpInfo(requestParameters: BetaApiGetTasksRequest = {}, ) { + return BetaApiFp(this.configuration).getTasksWithHttpInfo(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 @@ -2420,6 +2990,18 @@ export class BetaApi extends BaseAPI { 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)); } + /** + * Same as `searchProjects`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiSearchProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public searchProjectsWithHttpInfo(requestParameters: BetaApiSearchProjectsRequest, ) { + return BetaApiFp(this.configuration).searchProjectsWithHttpInfo(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 @@ -2432,6 +3014,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).updateProjectBoard(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiUpdateProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateProjectBoardWithHttpInfo(requestParameters: BetaApiUpdateProjectBoardRequest, ) { + return BetaApiFp(this.configuration).updateProjectBoardWithHttpInfo(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 @@ -2444,6 +3038,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).updateProjectField(requestParameters.field_code, requestParameters.UpdateProjectFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProjectField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiUpdateProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateProjectFieldWithHttpInfo(requestParameters: BetaApiUpdateProjectFieldRequest, ) { + return BetaApiFp(this.configuration).updateProjectFieldWithHttpInfo(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 @@ -2456,6 +3062,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).updateProjectFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiUpdateProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateProjectFieldOptionsWithHttpInfo(requestParameters: BetaApiUpdateProjectFieldOptionsRequest, ) { + return BetaApiFp(this.configuration).updateProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a project phase. * @summary Update a project phase @@ -2468,6 +3086,18 @@ export class BetaApi extends BaseAPI { return BetaApiFp(this.configuration).updateProjectPhase(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiUpdateProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateProjectPhaseWithHttpInfo(requestParameters: BetaApiUpdateProjectPhaseRequest, ) { + return BetaApiFp(this.configuration).updateProjectPhaseWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a task. * @summary Update a task @@ -2479,4 +3109,16 @@ export class BetaApi extends BaseAPI { public updateTask(requestParameters: BetaApiUpdateTaskRequest, ) { return BetaApiFp(this.configuration).updateTask(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {BetaApiUpdateTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof BetaApi + */ + public updateTaskWithHttpInfo(requestParameters: BetaApiUpdateTaskRequest, ) { + return BetaApiFp(this.configuration).updateTaskWithHttpInfo(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/deal-fields-api.ts b/src/versions/v2/api/deal-fields-api.ts index 5079b5a4..5ab4edbc 100644 --- a/src/versions/v2/api/deal-fields-api.ts +++ b/src/versions/v2/api/deal-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealField200Response } from '../models'; // @ts-ignore @@ -437,6 +437,17 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealField(AddDealFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addDealField`, but resolves with the response body together with the HTTP status and headers. + * @summary Create one deal field + * @param {AddDealFieldRequest} AddDealFieldRequest + + * @throws {RequiredError} + */ + async addDealFieldWithHttpInfo(AddDealFieldRequest: AddDealFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addDealField(AddDealFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds new options to a deal 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 deal field options in bulk @@ -449,6 +460,18 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addDealFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Add deal field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async addDealFieldOptionsWithHttpInfo(field_code: string, AddDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addDealFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a custom field as deleted. * @summary Delete one deal field @@ -460,6 +483,17 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealField(field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDealField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete one deal field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async deleteDealFieldWithHttpInfo(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Removes existing options from a deal 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 deal field options in bulk @@ -472,6 +506,18 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDealFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete deal field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async deleteDealFieldOptionsWithHttpInfo(field_code: string, DeleteDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about a specific deal field. * @summary Get one deal field @@ -484,6 +530,18 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealField(field_code, include_fields, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one deal field + * @param {string} field_code The unique code identifying the field + * @param {Set<'ui_visibility' | 'important_fields' | 'required_fields'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + + * @throws {RequiredError} + */ + async getDealFieldWithHttpInfo(field_code: string, include_fields?: Set<'ui_visibility' | 'important_fields' | 'required_fields'>, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealField(field_code, include_fields, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about all deal fields in the company. * @summary Get all deal fields @@ -497,6 +555,19 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFields(include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all deal fields + * @param {Set<'ui_visibility' | 'important_fields' | 'required_fields'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + * @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 getDealFieldsWithHttpInfo(include_fields?: Set<'ui_visibility' | 'important_fields' | 'required_fields'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFields(include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a deal 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 deal field @@ -509,6 +580,18 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateDealField(field_code, UpdateDealFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateDealField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update one deal field + * @param {string} field_code The unique code identifying the field + * @param {UpdateDealFieldRequest} UpdateDealFieldRequest + + * @throws {RequiredError} + */ + async updateDealFieldWithHttpInfo(field_code: string, UpdateDealFieldRequest: UpdateDealFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateDealField(field_code, UpdateDealFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates existing options for a deal 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 deal field options in bulk @@ -521,6 +604,18 @@ export const DealFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateDealFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateDealFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Update deal field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async updateDealFieldOptionsWithHttpInfo(field_code: string, UpdateDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateDealFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -541,6 +636,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas addDealField(requestParameters: DealFieldsApiAddDealFieldRequest, ): Promise { return localVarFp.addDealField(requestParameters.AddDealFieldRequest, ).then((request) => request(axios, basePath)); }, + addDealFieldWithHttpInfo(requestParameters: DealFieldsApiAddDealFieldRequest, ): Promise> { + return localVarFp.addDealFieldWithHttpInfo(requestParameters.AddDealFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds new options to a deal 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 deal field options in bulk @@ -551,6 +649,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas addDealFieldOptions(requestParameters: DealFieldsApiAddDealFieldOptionsRequest, ): Promise { return localVarFp.addDealFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + addDealFieldOptionsWithHttpInfo(requestParameters: DealFieldsApiAddDealFieldOptionsRequest, ): Promise> { + return localVarFp.addDealFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Marks a custom field as deleted. * @summary Delete one deal field @@ -561,6 +662,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas deleteDealField(requestParameters: DealFieldsApiDeleteDealFieldRequest, ): Promise { return localVarFp.deleteDealField(requestParameters.field_code, ).then((request) => request(axios, basePath)); }, + deleteDealFieldWithHttpInfo(requestParameters: DealFieldsApiDeleteDealFieldRequest, ): Promise> { + return localVarFp.deleteDealFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, /** * Removes existing options from a deal 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 deal field options in bulk @@ -571,6 +675,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas deleteDealFieldOptions(requestParameters: DealFieldsApiDeleteDealFieldOptionsRequest, ): Promise { return localVarFp.deleteDealFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + deleteDealFieldOptionsWithHttpInfo(requestParameters: DealFieldsApiDeleteDealFieldOptionsRequest, ): Promise> { + return localVarFp.deleteDealFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about a specific deal field. * @summary Get one deal field @@ -581,6 +688,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas getDealField(requestParameters: DealFieldsApiGetDealFieldRequest, ): Promise { return localVarFp.getDealField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); }, + getDealFieldWithHttpInfo(requestParameters: DealFieldsApiGetDealFieldRequest, ): Promise> { + return localVarFp.getDealFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about all deal fields in the company. * @summary Get all deal fields @@ -591,6 +701,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas getDealFields(requestParameters: DealFieldsApiGetDealFieldsRequest = {}, ): Promise { return localVarFp.getDealFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getDealFieldsWithHttpInfo(requestParameters: DealFieldsApiGetDealFieldsRequest = {}, ): Promise> { + return localVarFp.getDealFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates a deal 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 deal field @@ -601,6 +714,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas updateDealField(requestParameters: DealFieldsApiUpdateDealFieldRequest, ): Promise { return localVarFp.updateDealField(requestParameters.field_code, requestParameters.UpdateDealFieldRequest, ).then((request) => request(axios, basePath)); }, + updateDealFieldWithHttpInfo(requestParameters: DealFieldsApiUpdateDealFieldRequest, ): Promise> { + return localVarFp.updateDealFieldWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Updates existing options for a deal 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 deal field options in bulk @@ -611,6 +727,9 @@ export const DealFieldsApiFactory = function (configuration?: Configuration, bas updateDealFieldOptions(requestParameters: DealFieldsApiUpdateDealFieldOptionsRequest, ): Promise { return localVarFp.updateDealFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + updateDealFieldOptionsWithHttpInfo(requestParameters: DealFieldsApiUpdateDealFieldOptionsRequest, ): Promise> { + return localVarFp.updateDealFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, }; }; @@ -794,6 +913,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).addDealField(requestParameters.AddDealFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addDealField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiAddDealFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public addDealFieldWithHttpInfo(requestParameters: DealFieldsApiAddDealFieldRequest, ) { + return DealFieldsApiFp(this.configuration).addDealFieldWithHttpInfo(requestParameters.AddDealFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds new options to a deal 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 deal field options in bulk @@ -806,6 +937,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).addDealFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addDealFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiAddDealFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public addDealFieldOptionsWithHttpInfo(requestParameters: DealFieldsApiAddDealFieldOptionsRequest, ) { + return DealFieldsApiFp(this.configuration).addDealFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a custom field as deleted. * @summary Delete one deal field @@ -818,6 +961,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).deleteDealField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDealField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiDeleteDealFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public deleteDealFieldWithHttpInfo(requestParameters: DealFieldsApiDeleteDealFieldRequest, ) { + return DealFieldsApiFp(this.configuration).deleteDealFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + /** * Removes existing options from a deal 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 deal field options in bulk @@ -830,6 +985,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).deleteDealFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDealFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiDeleteDealFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public deleteDealFieldOptionsWithHttpInfo(requestParameters: DealFieldsApiDeleteDealFieldOptionsRequest, ) { + return DealFieldsApiFp(this.configuration).deleteDealFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about a specific deal field. * @summary Get one deal field @@ -842,6 +1009,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).getDealField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiGetDealFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public getDealFieldWithHttpInfo(requestParameters: DealFieldsApiGetDealFieldRequest, ) { + return DealFieldsApiFp(this.configuration).getDealFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about all deal fields in the company. * @summary Get all deal fields @@ -854,6 +1033,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).getDealFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiGetDealFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public getDealFieldsWithHttpInfo(requestParameters: DealFieldsApiGetDealFieldsRequest = {}, ) { + return DealFieldsApiFp(this.configuration).getDealFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a deal 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 deal field @@ -866,6 +1057,18 @@ export class DealFieldsApi extends BaseAPI { return DealFieldsApiFp(this.configuration).updateDealField(requestParameters.field_code, requestParameters.UpdateDealFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateDealField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiUpdateDealFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public updateDealFieldWithHttpInfo(requestParameters: DealFieldsApiUpdateDealFieldRequest, ) { + return DealFieldsApiFp(this.configuration).updateDealFieldWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates existing options for a deal 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 deal field options in bulk @@ -877,4 +1080,16 @@ export class DealFieldsApi extends BaseAPI { public updateDealFieldOptions(requestParameters: DealFieldsApiUpdateDealFieldOptionsRequest, ) { return DealFieldsApiFp(this.configuration).updateDealFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateDealFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealFieldsApiUpdateDealFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealFieldsApi + */ + public updateDealFieldOptionsWithHttpInfo(requestParameters: DealFieldsApiUpdateDealFieldOptionsRequest, ) { + return DealFieldsApiFp(this.configuration).updateDealFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).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 index 28405dbf..658730ee 100644 --- a/src/versions/v2/api/deal-installments-api.ts +++ b/src/versions/v2/api/deal-installments-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddAInstallmentResponse } from '../models'; // @ts-ignore @@ -265,6 +265,18 @@ export const DealInstallmentsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInstallment(id, installment_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteInstallment`, but resolves with the response body together with the HTTP status and headers. + * @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 deleteInstallmentWithHttpInfo(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, true); + }, /** * Lists installments attached to a list of deals. Only available in Growth and above plans. * @summary List installments added to a list of deals @@ -280,6 +292,21 @@ export const DealInstallmentsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getInstallments(deal_ids, cursor, limit, sort_by, sort_direction, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getInstallments`, but resolves with the response body together with the HTTP status and headers. + * @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 getInstallmentsWithHttpInfo(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, true); + }, /** * 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 @@ -292,6 +319,18 @@ export const DealInstallmentsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.postInstallment(id, AddInstallmentRequestBody, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `postInstallment`, but resolves with the response body together with the HTTP status and headers. + * @summary Add an installment to a deal + * @param {number} id The ID of the deal + * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody] + + * @throws {RequiredError} + */ + async postInstallmentWithHttpInfo(id: number, AddInstallmentRequestBody?: AddInstallmentRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postInstallment(id, AddInstallmentRequestBody, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Edits an installment added to a deal. Only available in Growth and above plans. * @summary Update an installment added to a deal @@ -305,6 +344,19 @@ export const DealInstallmentsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateInstallment(id, installment_id, UpdateInstallmentRequestBody, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateInstallment`, but resolves with the response body together with the HTTP status and headers. + * @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 updateInstallmentWithHttpInfo(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, true); + }, } }; @@ -325,6 +377,9 @@ export const DealInstallmentsApiFactory = function (configuration?: Configuratio deleteInstallment(requestParameters: DealInstallmentsApiDeleteInstallmentRequest, ): Promise { return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(axios, basePath)); }, + deleteInstallmentWithHttpInfo(requestParameters: DealInstallmentsApiDeleteInstallmentRequest, ): Promise> { + return localVarFp.deleteInstallmentWithHttpInfo(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 @@ -335,6 +390,9 @@ export const DealInstallmentsApiFactory = function (configuration?: Configuratio 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)); }, + getInstallmentsWithHttpInfo(requestParameters: DealInstallmentsApiGetInstallmentsRequest, ): Promise> { + return localVarFp.getInstallmentsWithHttpInfo(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 @@ -345,6 +403,9 @@ export const DealInstallmentsApiFactory = function (configuration?: Configuratio postInstallment(requestParameters: DealInstallmentsApiPostInstallmentRequest, ): Promise { return localVarFp.postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody, ).then((request) => request(axios, basePath)); }, + postInstallmentWithHttpInfo(requestParameters: DealInstallmentsApiPostInstallmentRequest, ): Promise> { + return localVarFp.postInstallmentWithHttpInfo(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 @@ -355,6 +416,9 @@ export const DealInstallmentsApiFactory = function (configuration?: Configuratio updateInstallment(requestParameters: DealInstallmentsApiUpdateInstallmentRequest, ): Promise { return localVarFp.updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(axios, basePath)); }, + updateInstallmentWithHttpInfo(requestParameters: DealInstallmentsApiUpdateInstallmentRequest, ): Promise> { + return localVarFp.updateInstallmentWithHttpInfo(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(axios, basePath)); + }, }; }; @@ -489,6 +553,18 @@ export class DealInstallmentsApi extends BaseAPI { return DealInstallmentsApiFp(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteInstallment`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealInstallmentsApiDeleteInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealInstallmentsApi + */ + public deleteInstallmentWithHttpInfo(requestParameters: DealInstallmentsApiDeleteInstallmentRequest, ) { + return DealInstallmentsApiFp(this.configuration).deleteInstallmentWithHttpInfo(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 @@ -501,6 +577,18 @@ export class DealInstallmentsApi extends BaseAPI { 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)); } + /** + * Same as `getInstallments`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealInstallmentsApiGetInstallmentsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealInstallmentsApi + */ + public getInstallmentsWithHttpInfo(requestParameters: DealInstallmentsApiGetInstallmentsRequest, ) { + return DealInstallmentsApiFp(this.configuration).getInstallmentsWithHttpInfo(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 @@ -513,6 +601,18 @@ export class DealInstallmentsApi extends BaseAPI { return DealInstallmentsApiFp(this.configuration).postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `postInstallment`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealInstallmentsApiPostInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealInstallmentsApi + */ + public postInstallmentWithHttpInfo(requestParameters: DealInstallmentsApiPostInstallmentRequest, ) { + return DealInstallmentsApiFp(this.configuration).postInstallmentWithHttpInfo(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 @@ -524,4 +624,16 @@ export class DealInstallmentsApi extends BaseAPI { public updateInstallment(requestParameters: DealInstallmentsApiUpdateInstallmentRequest, ) { return DealInstallmentsApiFp(this.configuration).updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateInstallment`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealInstallmentsApiUpdateInstallmentRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealInstallmentsApi + */ + public updateInstallmentWithHttpInfo(requestParameters: DealInstallmentsApiUpdateInstallmentRequest, ) { + return DealInstallmentsApiFp(this.configuration).updateInstallmentWithHttpInfo(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 index 08ef08e7..51eed93c 100644 --- a/src/versions/v2/api/deal-products-api.ts +++ b/src/versions/v2/api/deal-products-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealProductRequest } from '../models'; // @ts-ignore @@ -421,6 +421,18 @@ export const DealProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealProduct(id, AddDealProductRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addDealProduct`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a product to a deal + * @param {number} id The ID of the deal + * @param {AddDealProductRequest} [AddDealProductRequest] + + * @throws {RequiredError} + */ + async addDealProductWithHttpInfo(id: number, AddDealProductRequest?: AddDealProductRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addDealProduct(id, AddDealProductRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds multiple products to a deal in a single request. Maximum of 100 products allowed per request. * @summary Add multiple products to a deal @@ -433,6 +445,18 @@ export const DealProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addManyDealProducts(id, CreateManyDealProductRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addManyDealProducts`, but resolves with the response body together with the HTTP status and headers. + * @summary Add multiple products to a deal + * @param {number} id The ID of the deal + * @param {CreateManyDealProductRequest} [CreateManyDealProductRequest] + + * @throws {RequiredError} + */ + async addManyDealProductsWithHttpInfo(id: number, CreateManyDealProductRequest?: CreateManyDealProductRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addManyDealProducts(id, CreateManyDealProductRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a product attachment from a deal, using the `product_attachment_id`. * @summary Delete an attached product from a deal @@ -445,6 +469,18 @@ export const DealProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealProduct(id, product_attachment_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDealProduct`, but resolves with the response body together with the HTTP status and headers. + * @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 deleteDealProductWithHttpInfo(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, true); + }, /** * 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 @@ -457,6 +493,18 @@ export const DealProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteManyDealProducts(id, ids, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteManyDealProducts`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete many products from a deal + * @param {number} id The ID of the deal + * @param {Set} [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 deleteManyDealProductsWithHttpInfo(id: number, ids?: Set, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteManyDealProducts(id, ids, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists products attached to a deal. * @summary List products attached to a deal @@ -472,6 +520,21 @@ export const DealProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealProducts(id, cursor, limit, sort_by, sort_direction, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealProducts`, but resolves with the response body together with the HTTP status and headers. + * @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 getDealProductsWithHttpInfo(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, true); + }, /** * Returns data about products attached to deals * @summary Get deal products of several deals @@ -487,6 +550,21 @@ export const DealProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealsProducts(deal_ids, cursor, limit, sort_by, sort_direction, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealsProducts`, but resolves with the response body together with the HTTP status and headers. + * @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 getDealsProductsWithHttpInfo(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, true); + }, /** * Updates the details of the product that has been attached to a deal. * @summary Update the product attached to a deal @@ -500,6 +578,19 @@ export const DealProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateDealProduct(id, product_attachment_id, UpdateDealProductRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateDealProduct`, but resolves with the response body together with the HTTP status and headers. + * @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 updateDealProductWithHttpInfo(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, true); + }, } }; @@ -520,6 +611,9 @@ export const DealProductsApiFactory = function (configuration?: Configuration, b addDealProduct(requestParameters: DealProductsApiAddDealProductRequest, ): Promise { return localVarFp.addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest, ).then((request) => request(axios, basePath)); }, + addDealProductWithHttpInfo(requestParameters: DealProductsApiAddDealProductRequest, ): Promise> { + return localVarFp.addDealProductWithHttpInfo(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 @@ -530,6 +624,9 @@ export const DealProductsApiFactory = function (configuration?: Configuration, b addManyDealProducts(requestParameters: DealProductsApiAddManyDealProductsRequest, ): Promise { return localVarFp.addManyDealProducts(requestParameters.id, requestParameters.CreateManyDealProductRequest, ).then((request) => request(axios, basePath)); }, + addManyDealProductsWithHttpInfo(requestParameters: DealProductsApiAddManyDealProductsRequest, ): Promise> { + return localVarFp.addManyDealProductsWithHttpInfo(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 @@ -540,6 +637,9 @@ export const DealProductsApiFactory = function (configuration?: Configuration, b deleteDealProduct(requestParameters: DealProductsApiDeleteDealProductRequest, ): Promise { return localVarFp.deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id, ).then((request) => request(axios, basePath)); }, + deleteDealProductWithHttpInfo(requestParameters: DealProductsApiDeleteDealProductRequest, ): Promise> { + return localVarFp.deleteDealProductWithHttpInfo(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 @@ -550,6 +650,9 @@ export const DealProductsApiFactory = function (configuration?: Configuration, b deleteManyDealProducts(requestParameters: DealProductsApiDeleteManyDealProductsRequest, ): Promise { return localVarFp.deleteManyDealProducts(requestParameters.id, requestParameters.ids, ).then((request) => request(axios, basePath)); }, + deleteManyDealProductsWithHttpInfo(requestParameters: DealProductsApiDeleteManyDealProductsRequest, ): Promise> { + return localVarFp.deleteManyDealProductsWithHttpInfo(requestParameters.id, requestParameters.ids, ).then((request) => request(axios, basePath)); + }, /** * Lists products attached to a deal. * @summary List products attached to a deal @@ -560,6 +663,9 @@ export const DealProductsApiFactory = function (configuration?: Configuration, b getDealProducts(requestParameters: DealProductsApiGetDealProductsRequest, ): Promise { return localVarFp.getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(axios, basePath)); }, + getDealProductsWithHttpInfo(requestParameters: DealProductsApiGetDealProductsRequest, ): Promise> { + return localVarFp.getDealProductsWithHttpInfo(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 @@ -570,6 +676,9 @@ export const DealProductsApiFactory = function (configuration?: Configuration, b 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)); }, + getDealsProductsWithHttpInfo(requestParameters: DealProductsApiGetDealsProductsRequest, ): Promise> { + return localVarFp.getDealsProductsWithHttpInfo(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 @@ -580,6 +689,9 @@ export const DealProductsApiFactory = function (configuration?: Configuration, b updateDealProduct(requestParameters: DealProductsApiUpdateDealProductRequest, ): Promise { return localVarFp.updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest, ).then((request) => request(axios, basePath)); }, + updateDealProductWithHttpInfo(requestParameters: DealProductsApiUpdateDealProductRequest, ): Promise> { + return localVarFp.updateDealProductWithHttpInfo(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -798,6 +910,18 @@ export class DealProductsApi extends BaseAPI { return DealProductsApiFp(this.configuration).addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addDealProduct`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealProductsApiAddDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public addDealProductWithHttpInfo(requestParameters: DealProductsApiAddDealProductRequest, ) { + return DealProductsApiFp(this.configuration).addDealProductWithHttpInfo(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 @@ -810,6 +934,18 @@ export class DealProductsApi extends BaseAPI { return DealProductsApiFp(this.configuration).addManyDealProducts(requestParameters.id, requestParameters.CreateManyDealProductRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addManyDealProducts`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealProductsApiAddManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public addManyDealProductsWithHttpInfo(requestParameters: DealProductsApiAddManyDealProductsRequest, ) { + return DealProductsApiFp(this.configuration).addManyDealProductsWithHttpInfo(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 @@ -822,6 +958,18 @@ export class DealProductsApi extends BaseAPI { return DealProductsApiFp(this.configuration).deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDealProduct`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealProductsApiDeleteDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public deleteDealProductWithHttpInfo(requestParameters: DealProductsApiDeleteDealProductRequest, ) { + return DealProductsApiFp(this.configuration).deleteDealProductWithHttpInfo(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 @@ -834,6 +982,18 @@ export class DealProductsApi extends BaseAPI { return DealProductsApiFp(this.configuration).deleteManyDealProducts(requestParameters.id, requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteManyDealProducts`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealProductsApiDeleteManyDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public deleteManyDealProductsWithHttpInfo(requestParameters: DealProductsApiDeleteManyDealProductsRequest, ) { + return DealProductsApiFp(this.configuration).deleteManyDealProductsWithHttpInfo(requestParameters.id, requestParameters.ids, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists products attached to a deal. * @summary List products attached to a deal @@ -846,6 +1006,18 @@ export class DealProductsApi extends BaseAPI { return DealProductsApiFp(this.configuration).getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealProducts`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealProductsApiGetDealProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public getDealProductsWithHttpInfo(requestParameters: DealProductsApiGetDealProductsRequest, ) { + return DealProductsApiFp(this.configuration).getDealProductsWithHttpInfo(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 @@ -858,6 +1030,18 @@ export class DealProductsApi extends BaseAPI { 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)); } + /** + * Same as `getDealsProducts`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealProductsApiGetDealsProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public getDealsProductsWithHttpInfo(requestParameters: DealProductsApiGetDealsProductsRequest, ) { + return DealProductsApiFp(this.configuration).getDealsProductsWithHttpInfo(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 @@ -869,4 +1053,16 @@ export class DealProductsApi extends BaseAPI { public updateDealProduct(requestParameters: DealProductsApiUpdateDealProductRequest, ) { return DealProductsApiFp(this.configuration).updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateDealProduct`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealProductsApiUpdateDealProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealProductsApi + */ + public updateDealProductWithHttpInfo(requestParameters: DealProductsApiUpdateDealProductRequest, ) { + return DealProductsApiFp(this.configuration).updateDealProductWithHttpInfo(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 d546848c..dbd79bc4 100644 --- a/src/versions/v2/api/deals-api.ts +++ b/src/versions/v2/api/deals-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddAdditionalDiscountRequestBody } from '../models'; // @ts-ignore @@ -920,7 +920,7 @@ export const DealsApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['organization_id'] = organization_id; } - if (status) { + if (status !== undefined) { localVarQueryParameter['status'] = status; } @@ -1063,6 +1063,17 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDeal(AddDealRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addDeal`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new deal + * @param {AddDealRequest} [AddDealRequest] + + * @throws {RequiredError} + */ + async addDealWithHttpInfo(AddDealRequest?: AddDealRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addDeal(AddDealRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a user as a follower to the deal. * @summary Add a follower to a deal @@ -1075,6 +1086,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addDealFollower(id, AddDealFollowerRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addDealFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a follower to a deal + * @param {number} id The ID of the deal + * @param {AddDealFollowerRequest} [AddDealFollowerRequest] + + * @throws {RequiredError} + */ + async addDealFollowerWithHttpInfo(id: number, AddDealFollowerRequest?: AddDealFollowerRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addDealFollower(id, AddDealFollowerRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -1086,6 +1109,17 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.convertDealToLead(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `convertDealToLead`, but resolves with the response body together with the HTTP status and headers. + * @summary Convert a deal to a lead + * @param {number} id The ID of the deal to convert + + * @throws {RequiredError} + */ + async convertDealToLeadWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.convertDealToLead(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. * @summary Delete a discount from a deal @@ -1098,6 +1132,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAdditionalDiscount(id, discount_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteAdditionalDiscount`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a discount from a deal + * @param {number} id The ID of the deal + * @param {string} discount_id The ID of the discount + + * @throws {RequiredError} + */ + async deleteAdditionalDiscountWithHttpInfo(id: number, discount_id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAdditionalDiscount(id, discount_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. * @summary Delete a deal @@ -1109,6 +1155,17 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDeal(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDeal`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a deal + * @param {number} id The ID of the deal + + * @throws {RequiredError} + */ + async deleteDealWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDeal(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a user follower from the deal. * @summary Delete a follower from a deal @@ -1121,6 +1178,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFollower(id, follower_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteDealFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a follower from a deal + * @param {number} id The ID of the deal + * @param {number} follower_id The ID of the following user + + * @throws {RequiredError} + */ + async deleteDealFollowerWithHttpInfo(id: number, follower_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDealFollower(id, follower_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists discounts attached to a deal. * @summary List discounts added to a deal @@ -1132,6 +1201,17 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getAdditionalDiscounts(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getAdditionalDiscounts`, but resolves with the response body together with the HTTP status and headers. + * @summary List discounts added to a deal + * @param {number} id The ID of the deal + + * @throws {RequiredError} + */ + async getAdditionalDiscountsWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAdditionalDiscounts(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all archived deals. * @summary Get all archived deals @@ -1158,6 +1238,32 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDeals(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); }, + /** + * Same as `getArchivedDeals`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all archived deals + * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned + * @param {Set} [ids] Optional comma separated array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. + * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. + * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. + * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. + * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. + * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. + * @param {Set<'open' | 'won' | 'lost' | 'deleted'>} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. + * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. + * @param {Set<'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 {Set} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async getArchivedDealsWithHttpInfo(filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: Set<'open' | 'won' | 'lost' | 'deleted'>, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'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?: Set, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedDeals(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, true); + }, /** * Returns the details of a specific deal. * @summary Get details of a deal @@ -1173,6 +1279,21 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDeal(id, include_fields, custom_fields, include_option_labels, include_labels, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDeal`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a deal + * @param {number} id The ID of the deal + * @param {Set<'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 {Set} [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 getDealWithHttpInfo(id: number, include_fields?: Set<'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?: Set, 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, true); + }, /** * 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. * @summary Get Deal conversion status @@ -1185,6 +1306,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealConversionStatus(id, conversion_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealConversionStatus`, but resolves with the response body together with the HTTP status and headers. + * @summary Get Deal conversion status + * @param {number} id The ID of a deal + * @param {string} conversion_id The ID of the conversion + + * @throws {RequiredError} + */ + async getDealConversionStatusWithHttpInfo(id: number, conversion_id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealConversionStatus(id, conversion_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists users who are following the deal. * @summary List followers of a deal @@ -1198,6 +1331,19 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFollowers(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of a deal + * @param {number} id The ID of the deal + * @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 getDealFollowersWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFollowers(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists changelogs about users have followed the deal. * @summary List followers changelog of a deal @@ -1211,6 +1357,19 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFollowersChangelog(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getDealFollowersChangelog`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers changelog of a deal + * @param {number} id The ID of the deal + * @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 getDealFollowersChangelogWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDealFollowersChangelog(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all not archived deals. * @summary Get all deals @@ -1239,6 +1398,34 @@ export const DealsApiFp = function(configuration?: Configuration) { 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); }, + /** + * Same as `getDeals`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all deals + * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned + * @param {Set} [ids] Optional comma separated array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. + * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored. + * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored. + * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored. + * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored. + * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored. + * @param {Set<'open' | 'won' | 'lost' | 'deleted'>} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored. + * @param {string} [updated_since] If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {string} [updated_until] If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. + * @param {Set<'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 {Set} [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 getDealsWithHttpInfo(filter_id?: number, ids?: Set, owner_id?: number, person_id?: number, org_id?: number, pipeline_id?: number, stage_id?: number, status?: Set<'open' | 'won' | 'lost' | 'deleted'>, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'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?: Set, 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, true); + }, /** * Adds a discount to a deal, changing the deal value if the deal has one-time products attached. * @summary Add a discount to a deal @@ -1251,6 +1438,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.postAdditionalDiscount(id, AddAdditionalDiscountRequestBody, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `postAdditionalDiscount`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a discount to a deal + * @param {number} id The ID of the deal + * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody] + + * @throws {RequiredError} + */ + async postAdditionalDiscountWithHttpInfo(id: number, AddAdditionalDiscountRequestBody?: AddAdditionalDiscountRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postAdditionalDiscount(id, AddAdditionalDiscountRequestBody, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -1270,6 +1469,25 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchDeals(term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchDeals`, but resolves with the response body together with the HTTP status and headers. + * @summary Search deals + * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. + * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. + * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. + * @param {Set<'deal.cc_email'>} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchDealsWithHttpInfo(term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, status?: 'open' | 'won' | 'lost', include_fields?: Set<'deal.cc_email'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchDeals(term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. * @summary Update a discount added to a deal @@ -1283,6 +1501,19 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateAdditionalDiscount(id, discount_id, UpdateAdditionalDiscountRequestBody, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateAdditionalDiscount`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a discount added to a deal + * @param {number} id The ID of the deal + * @param {string} discount_id The ID of the discount + * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody] + + * @throws {RequiredError} + */ + async updateAdditionalDiscountWithHttpInfo(id: number, discount_id: string, UpdateAdditionalDiscountRequestBody?: UpdateAdditionalDiscountRequestBody, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateAdditionalDiscount(id, discount_id, UpdateAdditionalDiscountRequestBody, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a deal. * @summary Update a deal @@ -1295,6 +1526,18 @@ export const DealsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateDeal(id, UpdateDealRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateDeal`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a deal + * @param {number} id The ID of the deal + * @param {UpdateDealRequest} [UpdateDealRequest] + + * @throws {RequiredError} + */ + async updateDealWithHttpInfo(id: number, UpdateDealRequest?: UpdateDealRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateDeal(id, UpdateDealRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -1315,6 +1558,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath addDeal(requestParameters: DealsApiAddDealRequest = {}, ): Promise { return localVarFp.addDeal(requestParameters.AddDealRequest, ).then((request) => request(axios, basePath)); }, + addDealWithHttpInfo(requestParameters: DealsApiAddDealRequest = {}, ): Promise> { + return localVarFp.addDealWithHttpInfo(requestParameters.AddDealRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a user as a follower to the deal. * @summary Add a follower to a deal @@ -1325,6 +1571,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath addDealFollower(requestParameters: DealsApiAddDealFollowerRequest, ): Promise { return localVarFp.addDealFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); }, + addDealFollowerWithHttpInfo(requestParameters: DealsApiAddDealFollowerRequest, ): Promise> { + return localVarFp.addDealFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).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 @@ -1335,6 +1584,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath convertDealToLead(requestParameters: DealsApiConvertDealToLeadRequest, ): Promise { return localVarFp.convertDealToLead(requestParameters.id, ).then((request) => request(axios, basePath)); }, + convertDealToLeadWithHttpInfo(requestParameters: DealsApiConvertDealToLeadRequest, ): Promise> { + return localVarFp.convertDealToLeadWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. * @summary Delete a discount from a deal @@ -1345,6 +1597,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath deleteAdditionalDiscount(requestParameters: DealsApiDeleteAdditionalDiscountRequest, ): Promise { return localVarFp.deleteAdditionalDiscount(requestParameters.id, requestParameters.discount_id, ).then((request) => request(axios, basePath)); }, + deleteAdditionalDiscountWithHttpInfo(requestParameters: DealsApiDeleteAdditionalDiscountRequest, ): Promise> { + return localVarFp.deleteAdditionalDiscountWithHttpInfo(requestParameters.id, requestParameters.discount_id, ).then((request) => request(axios, basePath)); + }, /** * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. * @summary Delete a deal @@ -1355,6 +1610,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath deleteDeal(requestParameters: DealsApiDeleteDealRequest, ): Promise { return localVarFp.deleteDeal(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteDealWithHttpInfo(requestParameters: DealsApiDeleteDealRequest, ): Promise> { + return localVarFp.deleteDealWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Deletes a user follower from the deal. * @summary Delete a follower from a deal @@ -1365,6 +1623,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath deleteDealFollower(requestParameters: DealsApiDeleteDealFollowerRequest, ): Promise { return localVarFp.deleteDealFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); }, + deleteDealFollowerWithHttpInfo(requestParameters: DealsApiDeleteDealFollowerRequest, ): Promise> { + return localVarFp.deleteDealFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); + }, /** * Lists discounts attached to a deal. * @summary List discounts added to a deal @@ -1375,6 +1636,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getAdditionalDiscounts(requestParameters: DealsApiGetAdditionalDiscountsRequest, ): Promise { return localVarFp.getAdditionalDiscounts(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getAdditionalDiscountsWithHttpInfo(requestParameters: DealsApiGetAdditionalDiscountsRequest, ): Promise> { + return localVarFp.getAdditionalDiscountsWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all archived deals. * @summary Get all archived deals @@ -1385,6 +1649,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getArchivedDeals(requestParameters: DealsApiGetArchivedDealsRequest = {}, ): Promise { return localVarFp.getArchivedDeals(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)); }, + getArchivedDealsWithHttpInfo(requestParameters: DealsApiGetArchivedDealsRequest = {}, ): Promise> { + return localVarFp.getArchivedDealsWithHttpInfo(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 the details of a specific deal. * @summary Get details of a deal @@ -1395,6 +1662,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDeal(requestParameters: DealsApiGetDealRequest, ): Promise { return localVarFp.getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(axios, basePath)); }, + getDealWithHttpInfo(requestParameters: DealsApiGetDealRequest, ): Promise> { + return localVarFp.getDealWithHttpInfo(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. * @summary Get Deal conversion status @@ -1405,6 +1675,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealConversionStatus(requestParameters: DealsApiGetDealConversionStatusRequest, ): Promise { return localVarFp.getDealConversionStatus(requestParameters.id, requestParameters.conversion_id, ).then((request) => request(axios, basePath)); }, + getDealConversionStatusWithHttpInfo(requestParameters: DealsApiGetDealConversionStatusRequest, ): Promise> { + return localVarFp.getDealConversionStatusWithHttpInfo(requestParameters.id, requestParameters.conversion_id, ).then((request) => request(axios, basePath)); + }, /** * Lists users who are following the deal. * @summary List followers of a deal @@ -1415,6 +1688,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath getDealFollowers(requestParameters: DealsApiGetDealFollowersRequest, ): Promise { return localVarFp.getDealFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getDealFollowersWithHttpInfo(requestParameters: DealsApiGetDealFollowersRequest, ): Promise> { + return localVarFp.getDealFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Lists changelogs about users have followed the deal. * @summary List followers changelog of a deal @@ -1425,6 +1701,9 @@ 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)); }, + getDealFollowersChangelogWithHttpInfo(requestParameters: DealsApiGetDealFollowersChangelogRequest, ): Promise> { + return localVarFp.getDealFollowersChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all not archived deals. * @summary Get all deals @@ -1435,6 +1714,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath 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.include_option_labels, requestParameters.include_labels, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getDealsWithHttpInfo(requestParameters: DealsApiGetDealsRequest = {}, ): Promise> { + return localVarFp.getDealsWithHttpInfo(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. * @summary Add a discount to a deal @@ -1445,6 +1727,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath postAdditionalDiscount(requestParameters: DealsApiPostAdditionalDiscountRequest, ): Promise { return localVarFp.postAdditionalDiscount(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody, ).then((request) => request(axios, basePath)); }, + postAdditionalDiscountWithHttpInfo(requestParameters: DealsApiPostAdditionalDiscountRequest, ): Promise> { + return localVarFp.postAdditionalDiscountWithHttpInfo(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody, ).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 @@ -1455,6 +1740,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath searchDeals(requestParameters: DealsApiSearchDealsRequest, ): Promise { return localVarFp.searchDeals(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + searchDealsWithHttpInfo(requestParameters: DealsApiSearchDealsRequest, ): Promise> { + return localVarFp.searchDealsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. * @summary Update a discount added to a deal @@ -1465,6 +1753,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath updateAdditionalDiscount(requestParameters: DealsApiUpdateAdditionalDiscountRequest, ): Promise { return localVarFp.updateAdditionalDiscount(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody, ).then((request) => request(axios, basePath)); }, + updateAdditionalDiscountWithHttpInfo(requestParameters: DealsApiUpdateAdditionalDiscountRequest, ): Promise> { + return localVarFp.updateAdditionalDiscountWithHttpInfo(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a deal. * @summary Update a deal @@ -1475,6 +1766,9 @@ export const DealsApiFactory = function (configuration?: Configuration, basePath updateDeal(requestParameters: DealsApiUpdateDealRequest, ): Promise { return localVarFp.updateDeal(requestParameters.id, requestParameters.UpdateDealRequest, ).then((request) => request(axios, basePath)); }, + updateDealWithHttpInfo(requestParameters: DealsApiUpdateDealRequest, ): Promise> { + return localVarFp.updateDealWithHttpInfo(requestParameters.id, requestParameters.UpdateDealRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -2127,6 +2421,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).addDeal(requestParameters.AddDealRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addDeal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiAddDealRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public addDealWithHttpInfo(requestParameters: DealsApiAddDealRequest = {}, ) { + return DealsApiFp(this.configuration).addDealWithHttpInfo(requestParameters.AddDealRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a user as a follower to the deal. * @summary Add a follower to a deal @@ -2139,6 +2445,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).addDealFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addDealFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiAddDealFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public addDealFollowerWithHttpInfo(requestParameters: DealsApiAddDealFollowerRequest, ) { + return DealsApiFp(this.configuration).addDealFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).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 @@ -2151,6 +2469,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).convertDealToLead(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `convertDealToLead`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiConvertDealToLeadRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public convertDealToLeadWithHttpInfo(requestParameters: DealsApiConvertDealToLeadRequest, ) { + return DealsApiFp(this.configuration).convertDealToLeadWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Removes a discount from a deal, changing the deal value if the deal has one-time products attached. * @summary Delete a discount from a deal @@ -2163,6 +2493,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).deleteAdditionalDiscount(requestParameters.id, requestParameters.discount_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteAdditionalDiscount`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiDeleteAdditionalDiscountRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public deleteAdditionalDiscountWithHttpInfo(requestParameters: DealsApiDeleteAdditionalDiscountRequest, ) { + return DealsApiFp(this.configuration).deleteAdditionalDiscountWithHttpInfo(requestParameters.id, requestParameters.discount_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a deal as deleted. After 30 days, the deal will be permanently deleted. * @summary Delete a deal @@ -2175,6 +2517,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).deleteDeal(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDeal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiDeleteDealRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public deleteDealWithHttpInfo(requestParameters: DealsApiDeleteDealRequest, ) { + return DealsApiFp(this.configuration).deleteDealWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a user follower from the deal. * @summary Delete a follower from a deal @@ -2187,6 +2541,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).deleteDealFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteDealFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiDeleteDealFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public deleteDealFollowerWithHttpInfo(requestParameters: DealsApiDeleteDealFollowerRequest, ) { + return DealsApiFp(this.configuration).deleteDealFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists discounts attached to a deal. * @summary List discounts added to a deal @@ -2199,6 +2565,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getAdditionalDiscounts(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getAdditionalDiscounts`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetAdditionalDiscountsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getAdditionalDiscountsWithHttpInfo(requestParameters: DealsApiGetAdditionalDiscountsRequest, ) { + return DealsApiFp(this.configuration).getAdditionalDiscountsWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all archived deals. * @summary Get all archived deals @@ -2211,6 +2589,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getArchivedDeals(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)); } + /** + * Same as `getArchivedDeals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetArchivedDealsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getArchivedDealsWithHttpInfo(requestParameters: DealsApiGetArchivedDealsRequest = {}, ) { + return DealsApiFp(this.configuration).getArchivedDealsWithHttpInfo(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 the details of a specific deal. * @summary Get details of a deal @@ -2223,6 +2613,18 @@ export class DealsApi extends BaseAPI { 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)); } + /** + * Same as `getDeal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealWithHttpInfo(requestParameters: DealsApiGetDealRequest, ) { + return DealsApiFp(this.configuration).getDealWithHttpInfo(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(this.axios, this.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. * @summary Get Deal conversion status @@ -2235,6 +2637,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealConversionStatus(requestParameters.id, requestParameters.conversion_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealConversionStatus`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealConversionStatusRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealConversionStatusWithHttpInfo(requestParameters: DealsApiGetDealConversionStatusRequest, ) { + return DealsApiFp(this.configuration).getDealConversionStatusWithHttpInfo(requestParameters.id, requestParameters.conversion_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists users who are following the deal. * @summary List followers of a deal @@ -2247,6 +2661,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealFollowersWithHttpInfo(requestParameters: DealsApiGetDealFollowersRequest, ) { + return DealsApiFp(this.configuration).getDealFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists changelogs about users have followed the deal. * @summary List followers changelog of a deal @@ -2259,6 +2685,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).getDealFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getDealFollowersChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealFollowersChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealFollowersChangelogWithHttpInfo(requestParameters: DealsApiGetDealFollowersChangelogRequest, ) { + return DealsApiFp(this.configuration).getDealFollowersChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all not archived deals. * @summary Get all deals @@ -2271,6 +2709,18 @@ export class DealsApi extends BaseAPI { 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)); } + /** + * Same as `getDeals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiGetDealsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public getDealsWithHttpInfo(requestParameters: DealsApiGetDealsRequest = {}, ) { + return DealsApiFp(this.configuration).getDealsWithHttpInfo(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)); + } + /** * Adds a discount to a deal, changing the deal value if the deal has one-time products attached. * @summary Add a discount to a deal @@ -2283,6 +2733,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).postAdditionalDiscount(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `postAdditionalDiscount`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiPostAdditionalDiscountRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public postAdditionalDiscountWithHttpInfo(requestParameters: DealsApiPostAdditionalDiscountRequest, ) { + return DealsApiFp(this.configuration).postAdditionalDiscountWithHttpInfo(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody, ).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 @@ -2295,6 +2757,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).searchDeals(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `searchDeals`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiSearchDealsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public searchDealsWithHttpInfo(requestParameters: DealsApiSearchDealsRequest, ) { + return DealsApiFp(this.configuration).searchDealsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached. * @summary Update a discount added to a deal @@ -2307,6 +2781,18 @@ export class DealsApi extends BaseAPI { return DealsApiFp(this.configuration).updateAdditionalDiscount(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateAdditionalDiscount`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiUpdateAdditionalDiscountRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public updateAdditionalDiscountWithHttpInfo(requestParameters: DealsApiUpdateAdditionalDiscountRequest, ) { + return DealsApiFp(this.configuration).updateAdditionalDiscountWithHttpInfo(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a deal. * @summary Update a deal @@ -2318,4 +2804,16 @@ 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)); } + + /** + * Same as `updateDeal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {DealsApiUpdateDealRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof DealsApi + */ + public updateDealWithHttpInfo(requestParameters: DealsApiUpdateDealRequest, ) { + return DealsApiFp(this.configuration).updateDealWithHttpInfo(requestParameters.id, requestParameters.UpdateDealRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/item-search-api.ts b/src/versions/v2/api/item-search-api.ts index dcabeedb..5c1eb4d3 100644 --- a/src/versions/v2/api/item-search-api.ts +++ b/src/versions/v2/api/item-search-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetItemSearchFieldResponse } from '../models'; // @ts-ignore @@ -212,6 +212,24 @@ export const ItemSearchApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchItem`, but resolves with the response body together with the HTTP status and headers. + * @summary Perform a search from multiple item types + * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + * @param {Set<'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'>} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all. + * @param {Set<'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization + * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @param {Set<'deal.cc_email' | 'person.picture' | 'product.price'>} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default. + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchItemWithHttpInfo(term: string, item_types?: Set<'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'>, fields?: Set<'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'phone' | 'title' | 'description'>, search_for_related_items?: boolean, exact_match?: boolean, include_fields?: Set<'deal.cc_email' | 'person.picture' | 'product.price'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). * @summary Perform a search using a specific field from an item type @@ -228,6 +246,22 @@ export const ItemSearchApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchItemByField(term, entity_type, field, match, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchItemByField`, but resolves with the response body together with the HTTP status and headers. + * @summary Perform a search using a specific field from an item type + * @param {string} term The search term to look for. Minimum 2 characters (or 1 if `match` is `exact`). Please note that the search term has to be URL encoded. + * @param {'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project'} entity_type The type of the field to perform the search from + * @param {string} field The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields\' API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {'exact' | 'beginning' | 'middle'} [match] The type of match used against the term. The search <b>is</b> case sensitive.<br/><br/> E.g. in case of searching for a value `monkey`, <ul> <li>with `exact` match, you will only find it if term is `monkey`</li> <li>with `beginning` match, you will only find it if the term matches the beginning or the whole string, e.g. `monk` and `monkey`</li> <li>with `middle` match, you will find the it if the term matches any substring of the value, e.g. `onk` and `ke`</li> </ul>. + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchItemByFieldWithHttpInfo(term: string, entity_type: 'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project', field: string, match?: 'exact' | 'beginning' | 'middle', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchItemByField(term, entity_type, field, match, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -248,6 +282,9 @@ export const ItemSearchApiFactory = function (configuration?: Configuration, bas searchItem(requestParameters: ItemSearchApiSearchItemRequest, ): Promise { return localVarFp.searchItem(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + searchItemWithHttpInfo(requestParameters: ItemSearchApiSearchItemRequest, ): Promise> { + return localVarFp.searchItemWithHttpInfo(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). * @summary Perform a search using a specific field from an item type @@ -258,6 +295,9 @@ export const ItemSearchApiFactory = function (configuration?: Configuration, bas searchItemByField(requestParameters: ItemSearchApiSearchItemByFieldRequest, ): Promise { return localVarFp.searchItemByField(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + searchItemByFieldWithHttpInfo(requestParameters: ItemSearchApiSearchItemByFieldRequest, ): Promise> { + return localVarFp.searchItemByFieldWithHttpInfo(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, }; }; @@ -392,6 +432,18 @@ export class ItemSearchApi extends BaseAPI { return ItemSearchApiFp(this.configuration).searchItem(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `searchItem`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ItemSearchApiSearchItemRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ItemSearchApi + */ + public searchItemWithHttpInfo(requestParameters: ItemSearchApiSearchItemRequest, ) { + return ItemSearchApiFp(this.configuration).searchItemWithHttpInfo(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). * @summary Perform a search using a specific field from an item type @@ -403,4 +455,16 @@ export class ItemSearchApi extends BaseAPI { public searchItemByField(requestParameters: ItemSearchApiSearchItemByFieldRequest, ) { return ItemSearchApiFp(this.configuration).searchItemByField(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `searchItemByField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ItemSearchApiSearchItemByFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ItemSearchApi + */ + public searchItemByFieldWithHttpInfo(requestParameters: ItemSearchApiSearchItemByFieldRequest, ) { + return ItemSearchApiFp(this.configuration).searchItemByFieldWithHttpInfo(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/leads-api.ts b/src/versions/v2/api/leads-api.ts index 183ca0f0..b2e6160f 100644 --- a/src/versions/v2/api/leads-api.ts +++ b/src/versions/v2/api/leads-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddConvertLeadToDealResponse } from '../models'; // @ts-ignore @@ -229,6 +229,18 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.convertLeadToDeal(id, ConvertLeadToDealRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `convertLeadToDeal`, but resolves with the response body together with the HTTP status and headers. + * @summary Convert a lead to a deal + * @param {string} id The ID of the lead to convert + * @param {ConvertLeadToDealRequest} [ConvertLeadToDealRequest] + + * @throws {RequiredError} + */ + async convertLeadToDealWithHttpInfo(id: string, ConvertLeadToDealRequest?: ConvertLeadToDealRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.convertLeadToDeal(id, ConvertLeadToDealRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. * @summary Get Lead conversion status @@ -241,6 +253,18 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadConversionStatus(id, conversion_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getLeadConversionStatus`, but resolves with the response body together with the HTTP status and headers. + * @summary Get Lead conversion status + * @param {string} id The ID of a lead + * @param {string} conversion_id The ID of the conversion + + * @throws {RequiredError} + */ + async getLeadConversionStatusWithHttpInfo(id: string, conversion_id: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadConversionStatus(id, conversion_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads @@ -259,6 +283,24 @@ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchLeads`, but resolves with the response body together with the HTTP status and headers. + * @summary Search leads + * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + * @param {Set<'custom_fields' | 'notes' | 'title'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. + * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. + * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. + * @param {Set<'lead.was_seen'>} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchLeadsWithHttpInfo(term: string, fields?: Set<'custom_fields' | 'notes' | 'title'>, exact_match?: boolean, person_id?: number, organization_id?: number, include_fields?: Set<'lead.was_seen'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -279,6 +321,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath convertLeadToDeal(requestParameters: LeadsApiConvertLeadToDealRequest, ): Promise { return localVarFp.convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest, ).then((request) => request(axios, basePath)); }, + convertLeadToDealWithHttpInfo(requestParameters: LeadsApiConvertLeadToDealRequest, ): Promise> { + return localVarFp.convertLeadToDealWithHttpInfo(requestParameters.id, requestParameters.ConvertLeadToDealRequest, ).then((request) => request(axios, basePath)); + }, /** * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. * @summary Get Lead conversion status @@ -289,6 +334,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath getLeadConversionStatus(requestParameters: LeadsApiGetLeadConversionStatusRequest, ): Promise { return localVarFp.getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id, ).then((request) => request(axios, basePath)); }, + getLeadConversionStatusWithHttpInfo(requestParameters: LeadsApiGetLeadConversionStatusRequest, ): Promise> { + return localVarFp.getLeadConversionStatusWithHttpInfo(requestParameters.id, requestParameters.conversion_id, ).then((request) => request(axios, basePath)); + }, /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads @@ -299,6 +347,9 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath searchLeads(requestParameters: LeadsApiSearchLeadsRequest, ): Promise { return localVarFp.searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + searchLeadsWithHttpInfo(requestParameters: LeadsApiSearchLeadsRequest, ): Promise> { + return localVarFp.searchLeadsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, }; }; @@ -426,6 +477,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).convertLeadToDeal(requestParameters.id, requestParameters.ConvertLeadToDealRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `convertLeadToDeal`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiConvertLeadToDealRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public convertLeadToDealWithHttpInfo(requestParameters: LeadsApiConvertLeadToDealRequest, ) { + return LeadsApiFp(this.configuration).convertLeadToDealWithHttpInfo(requestParameters.id, requestParameters.ConvertLeadToDealRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days. * @summary Get Lead conversion status @@ -438,6 +501,18 @@ export class LeadsApi extends BaseAPI { return LeadsApiFp(this.configuration).getLeadConversionStatus(requestParameters.id, requestParameters.conversion_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getLeadConversionStatus`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiGetLeadConversionStatusRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public getLeadConversionStatusWithHttpInfo(requestParameters: LeadsApiGetLeadConversionStatusRequest, ) { + return LeadsApiFp(this.configuration).getLeadConversionStatusWithHttpInfo(requestParameters.id, requestParameters.conversion_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. * @summary Search leads @@ -449,4 +524,16 @@ export class LeadsApi extends BaseAPI { public searchLeads(requestParameters: LeadsApiSearchLeadsRequest, ) { return LeadsApiFp(this.configuration).searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `searchLeads`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {LeadsApiSearchLeadsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadsApi + */ + public searchLeadsWithHttpInfo(requestParameters: LeadsApiSearchLeadsRequest, ) { + return LeadsApiFp(this.configuration).searchLeadsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/organization-fields-api.ts b/src/versions/v2/api/organization-fields-api.ts index f4290ab0..bf2d2b7f 100644 --- a/src/versions/v2/api/organization-fields-api.ts +++ b/src/versions/v2/api/organization-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFieldOptions200Response } from '../models'; // @ts-ignore @@ -437,6 +437,17 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationField(AddOrganizationFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * @summary Create one organization field + * @param {AddOrganizationFieldRequest} AddOrganizationFieldRequest + + * @throws {RequiredError} + */ + async addOrganizationFieldWithHttpInfo(AddOrganizationFieldRequest: AddOrganizationFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationField(AddOrganizationFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds new options to an organization 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 organization field options in bulk @@ -449,6 +460,18 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addOrganizationFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Add organization field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async addOrganizationFieldOptionsWithHttpInfo(field_code: string, AddDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a custom field as deleted. * @summary Delete one organization field @@ -460,6 +483,17 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationField(field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete one organization field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async deleteOrganizationFieldWithHttpInfo(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Removes existing options from an organization 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 organization field options in bulk @@ -472,6 +506,18 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteOrganizationFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete organization field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async deleteOrganizationFieldOptionsWithHttpInfo(field_code: string, DeleteDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about a specific organization field. * @summary Get one organization field @@ -484,6 +530,18 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationField(field_code, include_fields, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one organization field + * @param {string} field_code The unique code identifying the field + * @param {Set<'ui_visibility' | 'important_fields' | 'required_fields'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + + * @throws {RequiredError} + */ + async getOrganizationFieldWithHttpInfo(field_code: string, include_fields?: Set<'ui_visibility' | 'important_fields' | 'required_fields'>, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationField(field_code, include_fields, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about all organization fields in the company. * @summary Get all organization fields @@ -497,6 +555,19 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFields(include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all organization fields + * @param {Set<'ui_visibility' | 'important_fields' | 'required_fields'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + * @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 getOrganizationFieldsWithHttpInfo(include_fields?: Set<'ui_visibility' | 'important_fields' | 'required_fields'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFields(include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates an organization 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 organization field @@ -509,6 +580,18 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationField(field_code, UpdateOrganizationFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update one organization field + * @param {string} field_code The unique code identifying the field + * @param {UpdateOrganizationFieldRequest} UpdateOrganizationFieldRequest + + * @throws {RequiredError} + */ + async updateOrganizationFieldWithHttpInfo(field_code: string, UpdateOrganizationFieldRequest: UpdateOrganizationFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationField(field_code, UpdateOrganizationFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates existing options for an organization 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 organization field options in bulk @@ -521,6 +604,18 @@ export const OrganizationFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateOrganizationFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Update organization field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async updateOrganizationFieldOptionsWithHttpInfo(field_code: string, UpdateDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -541,6 +636,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat addOrganizationField(requestParameters: OrganizationFieldsApiAddOrganizationFieldRequest, ): Promise { return localVarFp.addOrganizationField(requestParameters.AddOrganizationFieldRequest, ).then((request) => request(axios, basePath)); }, + addOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiAddOrganizationFieldRequest, ): Promise> { + return localVarFp.addOrganizationFieldWithHttpInfo(requestParameters.AddOrganizationFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds new options to an organization 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 organization field options in bulk @@ -551,6 +649,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat addOrganizationFieldOptions(requestParameters: OrganizationFieldsApiAddOrganizationFieldOptionsRequest, ): Promise { return localVarFp.addOrganizationFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + addOrganizationFieldOptionsWithHttpInfo(requestParameters: OrganizationFieldsApiAddOrganizationFieldOptionsRequest, ): Promise> { + return localVarFp.addOrganizationFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Marks a custom field as deleted. * @summary Delete one organization field @@ -561,6 +662,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat deleteOrganizationField(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldRequest, ): Promise { return localVarFp.deleteOrganizationField(requestParameters.field_code, ).then((request) => request(axios, basePath)); }, + deleteOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldRequest, ): Promise> { + return localVarFp.deleteOrganizationFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, /** * Removes existing options from an organization 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 organization field options in bulk @@ -571,6 +675,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat deleteOrganizationFieldOptions(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldOptionsRequest, ): Promise { return localVarFp.deleteOrganizationFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + deleteOrganizationFieldOptionsWithHttpInfo(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldOptionsRequest, ): Promise> { + return localVarFp.deleteOrganizationFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about a specific organization field. * @summary Get one organization field @@ -581,6 +688,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat getOrganizationField(requestParameters: OrganizationFieldsApiGetOrganizationFieldRequest, ): Promise { return localVarFp.getOrganizationField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); }, + getOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiGetOrganizationFieldRequest, ): Promise> { + return localVarFp.getOrganizationFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about all organization fields in the company. * @summary Get all organization fields @@ -591,6 +701,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat getOrganizationFields(requestParameters: OrganizationFieldsApiGetOrganizationFieldsRequest = {}, ): Promise { return localVarFp.getOrganizationFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getOrganizationFieldsWithHttpInfo(requestParameters: OrganizationFieldsApiGetOrganizationFieldsRequest = {}, ): Promise> { + return localVarFp.getOrganizationFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates an organization 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 organization field @@ -601,6 +714,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat updateOrganizationField(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldRequest, ): Promise { return localVarFp.updateOrganizationField(requestParameters.field_code, requestParameters.UpdateOrganizationFieldRequest, ).then((request) => request(axios, basePath)); }, + updateOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldRequest, ): Promise> { + return localVarFp.updateOrganizationFieldWithHttpInfo(requestParameters.field_code, requestParameters.UpdateOrganizationFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Updates existing options for an organization 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 organization field options in bulk @@ -611,6 +727,9 @@ export const OrganizationFieldsApiFactory = function (configuration?: Configurat updateOrganizationFieldOptions(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldOptionsRequest, ): Promise { return localVarFp.updateOrganizationFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + updateOrganizationFieldOptionsWithHttpInfo(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldOptionsRequest, ): Promise> { + return localVarFp.updateOrganizationFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, }; }; @@ -794,6 +913,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).addOrganizationField(requestParameters.AddOrganizationFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiAddOrganizationFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public addOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiAddOrganizationFieldRequest, ) { + return OrganizationFieldsApiFp(this.configuration).addOrganizationFieldWithHttpInfo(requestParameters.AddOrganizationFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds new options to an organization 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 organization field options in bulk @@ -806,6 +937,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).addOrganizationFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addOrganizationFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiAddOrganizationFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public addOrganizationFieldOptionsWithHttpInfo(requestParameters: OrganizationFieldsApiAddOrganizationFieldOptionsRequest, ) { + return OrganizationFieldsApiFp(this.configuration).addOrganizationFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a custom field as deleted. * @summary Delete one organization field @@ -818,6 +961,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).deleteOrganizationField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiDeleteOrganizationFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public deleteOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldRequest, ) { + return OrganizationFieldsApiFp(this.configuration).deleteOrganizationFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + /** * Removes existing options from an organization 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 organization field options in bulk @@ -830,6 +985,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).deleteOrganizationFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteOrganizationFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiDeleteOrganizationFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public deleteOrganizationFieldOptionsWithHttpInfo(requestParameters: OrganizationFieldsApiDeleteOrganizationFieldOptionsRequest, ) { + return OrganizationFieldsApiFp(this.configuration).deleteOrganizationFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about a specific organization field. * @summary Get one organization field @@ -842,6 +1009,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).getOrganizationField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiGetOrganizationFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public getOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiGetOrganizationFieldRequest, ) { + return OrganizationFieldsApiFp(this.configuration).getOrganizationFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about all organization fields in the company. * @summary Get all organization fields @@ -854,6 +1033,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).getOrganizationFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiGetOrganizationFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public getOrganizationFieldsWithHttpInfo(requestParameters: OrganizationFieldsApiGetOrganizationFieldsRequest = {}, ) { + return OrganizationFieldsApiFp(this.configuration).getOrganizationFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates an organization 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 organization field @@ -866,6 +1057,18 @@ export class OrganizationFieldsApi extends BaseAPI { return OrganizationFieldsApiFp(this.configuration).updateOrganizationField(requestParameters.field_code, requestParameters.UpdateOrganizationFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateOrganizationField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiUpdateOrganizationFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public updateOrganizationFieldWithHttpInfo(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldRequest, ) { + return OrganizationFieldsApiFp(this.configuration).updateOrganizationFieldWithHttpInfo(requestParameters.field_code, requestParameters.UpdateOrganizationFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates existing options for an organization 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 organization field options in bulk @@ -877,4 +1080,16 @@ export class OrganizationFieldsApi extends BaseAPI { public updateOrganizationFieldOptions(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldOptionsRequest, ) { return OrganizationFieldsApiFp(this.configuration).updateOrganizationFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateOrganizationFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationFieldsApiUpdateOrganizationFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationFieldsApi + */ + public updateOrganizationFieldOptionsWithHttpInfo(requestParameters: OrganizationFieldsApiUpdateOrganizationFieldOptionsRequest, ) { + return OrganizationFieldsApiFp(this.configuration).updateOrganizationFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).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 662a1924..9e119876 100644 --- a/src/versions/v2/api/organizations-api.ts +++ b/src/versions/v2/api/organizations-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFollowerRequest } from '../models'; // @ts-ignore @@ -617,6 +617,17 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganization(AddOrganizationRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addOrganization`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new organization + * @param {AddOrganizationRequest} [AddOrganizationRequest] + + * @throws {RequiredError} + */ + async addOrganizationWithHttpInfo(AddOrganizationRequest?: AddOrganizationRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganization(AddOrganizationRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a user as a follower to the organization. * @summary Add a follower to an organization @@ -629,6 +640,18 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationFollower(id, AddDealFollowerRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addOrganizationFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a follower to an organization + * @param {number} id The ID of the organization + * @param {AddDealFollowerRequest} [AddDealFollowerRequest] + + * @throws {RequiredError} + */ + async addOrganizationFollowerWithHttpInfo(id: number, AddDealFollowerRequest?: AddDealFollowerRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addOrganizationFollower(id, AddDealFollowerRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a organization as deleted. After 30 days, the organization will be permanently deleted. * @summary Delete a organization @@ -640,6 +663,17 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganization(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteOrganization`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a organization + * @param {number} id The ID of the organization + + * @throws {RequiredError} + */ + async deleteOrganizationWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganization(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a user follower from the organization. * @summary Delete a follower from an organization @@ -652,6 +686,18 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFollower(id, follower_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteOrganizationFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a follower from an organization + * @param {number} id The ID of the organization + * @param {number} follower_id The ID of the following user + + * @throws {RequiredError} + */ + async deleteOrganizationFollowerWithHttpInfo(id: number, follower_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrganizationFollower(id, follower_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific organization. * @summary Get details of a organization @@ -667,6 +713,21 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganization(id, include_fields, custom_fields, include_option_labels, include_labels, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganization`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a organization + * @param {number} id The ID of the organization + * @param {Set<'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 {Set} [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 getOrganizationWithHttpInfo(id: number, include_fields?: Set<'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?: Set, 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, true); + }, /** * Lists users who are following the organization. * @summary List followers of an organization @@ -680,6 +741,19 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFollowers(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of an organization + * @param {number} id The ID of the organization + * @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 getOrganizationFollowersWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFollowers(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists changelogs about users have followed the organization. * @summary List followers changelog of an organization @@ -693,6 +767,19 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFollowersChangelog(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getOrganizationFollowersChangelog`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers changelog of an organization + * @param {number} id The ID of the organization + * @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 getOrganizationFollowersChangelogWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganizationFollowersChangelog(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all organizations. * @summary Get all organizations @@ -716,6 +803,29 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { 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); }, + /** + * Same as `getOrganizations`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all organizations + * @param {number} [filter_id] If supplied, only organizations matching the specified filter are returned + * @param {Set} [ids] Optional comma separated array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. + * @param {number} [owner_id] If supplied, only organizations owned by the specified user are returned. If filter_id is provided, this is ignored. + * @param {string} [updated_since] If set, only organizations with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {string} [updated_until] If set, only organizations with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. + * @param {Set<'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 {Set} [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 getOrganizationsWithHttpInfo(filter_id?: number, ids?: Set, owner_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: Set<'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?: Set, 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, true); + }, /** * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search organizations @@ -731,6 +841,21 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchOrganization(term, fields, exact_match, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchOrganization`, but resolves with the response body together with the HTTP status and headers. + * @summary Search organizations + * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + * @param {Set<'address' | 'custom_fields' | 'notes' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchOrganizationWithHttpInfo(term: string, fields?: Set<'address' | 'custom_fields' | 'notes' | 'name'>, exact_match?: boolean, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchOrganization(term, fields, exact_match, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a organization. * @summary Update a organization @@ -743,6 +868,18 @@ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganization(id, UpdateOrganizationRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateOrganization`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a organization + * @param {number} id The ID of the organization + * @param {UpdateOrganizationRequest} [UpdateOrganizationRequest] + + * @throws {RequiredError} + */ + async updateOrganizationWithHttpInfo(id: number, UpdateOrganizationRequest?: UpdateOrganizationRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganization(id, UpdateOrganizationRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -763,6 +900,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, addOrganization(requestParameters: OrganizationsApiAddOrganizationRequest = {}, ): Promise { return localVarFp.addOrganization(requestParameters.AddOrganizationRequest, ).then((request) => request(axios, basePath)); }, + addOrganizationWithHttpInfo(requestParameters: OrganizationsApiAddOrganizationRequest = {}, ): Promise> { + return localVarFp.addOrganizationWithHttpInfo(requestParameters.AddOrganizationRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a user as a follower to the organization. * @summary Add a follower to an organization @@ -773,6 +913,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, addOrganizationFollower(requestParameters: OrganizationsApiAddOrganizationFollowerRequest, ): Promise { return localVarFp.addOrganizationFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); }, + addOrganizationFollowerWithHttpInfo(requestParameters: OrganizationsApiAddOrganizationFollowerRequest, ): Promise> { + return localVarFp.addOrganizationFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a organization as deleted. After 30 days, the organization will be permanently deleted. * @summary Delete a organization @@ -783,6 +926,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, deleteOrganization(requestParameters: OrganizationsApiDeleteOrganizationRequest, ): Promise { return localVarFp.deleteOrganization(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteOrganizationWithHttpInfo(requestParameters: OrganizationsApiDeleteOrganizationRequest, ): Promise> { + return localVarFp.deleteOrganizationWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Deletes a user follower from the organization. * @summary Delete a follower from an organization @@ -793,6 +939,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, deleteOrganizationFollower(requestParameters: OrganizationsApiDeleteOrganizationFollowerRequest, ): Promise { return localVarFp.deleteOrganizationFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); }, + deleteOrganizationFollowerWithHttpInfo(requestParameters: OrganizationsApiDeleteOrganizationFollowerRequest, ): Promise> { + return localVarFp.deleteOrganizationFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific organization. * @summary Get details of a organization @@ -803,6 +952,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganization(requestParameters: OrganizationsApiGetOrganizationRequest, ): Promise { return localVarFp.getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(axios, basePath)); }, + getOrganizationWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationRequest, ): Promise> { + return localVarFp.getOrganizationWithHttpInfo(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. * @summary List followers of an organization @@ -813,6 +965,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganizationFollowers(requestParameters: OrganizationsApiGetOrganizationFollowersRequest, ): Promise { return localVarFp.getOrganizationFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getOrganizationFollowersWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationFollowersRequest, ): Promise> { + return localVarFp.getOrganizationFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Lists changelogs about users have followed the organization. * @summary List followers changelog of an organization @@ -823,6 +978,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, getOrganizationFollowersChangelog(requestParameters: OrganizationsApiGetOrganizationFollowersChangelogRequest, ): Promise { return localVarFp.getOrganizationFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getOrganizationFollowersChangelogWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationFollowersChangelogRequest, ): Promise> { + return localVarFp.getOrganizationFollowersChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all organizations. * @summary Get all organizations @@ -833,6 +991,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, 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.include_option_labels, requestParameters.include_labels, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getOrganizationsWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationsRequest = {}, ): Promise> { + return localVarFp.getOrganizationsWithHttpInfo(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. * @summary Search organizations @@ -843,6 +1004,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, searchOrganization(requestParameters: OrganizationsApiSearchOrganizationRequest, ): Promise { return localVarFp.searchOrganization(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + searchOrganizationWithHttpInfo(requestParameters: OrganizationsApiSearchOrganizationRequest, ): Promise> { + return localVarFp.searchOrganizationWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a organization. * @summary Update a organization @@ -853,6 +1017,9 @@ export const OrganizationsApiFactory = function (configuration?: Configuration, updateOrganization(requestParameters: OrganizationsApiUpdateOrganizationRequest, ): Promise { return localVarFp.updateOrganization(requestParameters.id, requestParameters.UpdateOrganizationRequest, ).then((request) => request(axios, basePath)); }, + updateOrganizationWithHttpInfo(requestParameters: OrganizationsApiUpdateOrganizationRequest, ): Promise> { + return localVarFp.updateOrganizationWithHttpInfo(requestParameters.id, requestParameters.UpdateOrganizationRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -1204,6 +1371,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).addOrganization(requestParameters.AddOrganizationRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addOrganization`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiAddOrganizationRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public addOrganizationWithHttpInfo(requestParameters: OrganizationsApiAddOrganizationRequest = {}, ) { + return OrganizationsApiFp(this.configuration).addOrganizationWithHttpInfo(requestParameters.AddOrganizationRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a user as a follower to the organization. * @summary Add a follower to an organization @@ -1216,6 +1395,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).addOrganizationFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addOrganizationFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiAddOrganizationFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public addOrganizationFollowerWithHttpInfo(requestParameters: OrganizationsApiAddOrganizationFollowerRequest, ) { + return OrganizationsApiFp(this.configuration).addOrganizationFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a organization as deleted. After 30 days, the organization will be permanently deleted. * @summary Delete a organization @@ -1228,6 +1419,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).deleteOrganization(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteOrganization`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiDeleteOrganizationRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public deleteOrganizationWithHttpInfo(requestParameters: OrganizationsApiDeleteOrganizationRequest, ) { + return OrganizationsApiFp(this.configuration).deleteOrganizationWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a user follower from the organization. * @summary Delete a follower from an organization @@ -1240,6 +1443,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).deleteOrganizationFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteOrganizationFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiDeleteOrganizationFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public deleteOrganizationFollowerWithHttpInfo(requestParameters: OrganizationsApiDeleteOrganizationFollowerRequest, ) { + return OrganizationsApiFp(this.configuration).deleteOrganizationFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific organization. * @summary Get details of a organization @@ -1252,6 +1467,18 @@ export class OrganizationsApi extends BaseAPI { 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)); } + /** + * Same as `getOrganization`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationWithHttpInfo(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists users who are following the organization. * @summary List followers of an organization @@ -1264,6 +1491,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).getOrganizationFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationFollowersWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationFollowersRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists changelogs about users have followed the organization. * @summary List followers changelog of an organization @@ -1276,6 +1515,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).getOrganizationFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getOrganizationFollowersChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationFollowersChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationFollowersChangelogWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationFollowersChangelogRequest, ) { + return OrganizationsApiFp(this.configuration).getOrganizationFollowersChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all organizations. * @summary Get all organizations @@ -1288,6 +1539,18 @@ export class OrganizationsApi extends BaseAPI { 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)); } + /** + * Same as `getOrganizations`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiGetOrganizationsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrganizationsWithHttpInfo(requestParameters: OrganizationsApiGetOrganizationsRequest = {}, ) { + return OrganizationsApiFp(this.configuration).getOrganizationsWithHttpInfo(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)); + } + /** * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search organizations @@ -1300,6 +1563,18 @@ export class OrganizationsApi extends BaseAPI { return OrganizationsApiFp(this.configuration).searchOrganization(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `searchOrganization`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiSearchOrganizationRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public searchOrganizationWithHttpInfo(requestParameters: OrganizationsApiSearchOrganizationRequest, ) { + return OrganizationsApiFp(this.configuration).searchOrganizationWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a organization. * @summary Update a organization @@ -1311,4 +1586,16 @@ export class OrganizationsApi extends BaseAPI { public updateOrganization(requestParameters: OrganizationsApiUpdateOrganizationRequest, ) { return OrganizationsApiFp(this.configuration).updateOrganization(requestParameters.id, requestParameters.UpdateOrganizationRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateOrganization`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {OrganizationsApiUpdateOrganizationRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public updateOrganizationWithHttpInfo(requestParameters: OrganizationsApiUpdateOrganizationRequest, ) { + return OrganizationsApiFp(this.configuration).updateOrganizationWithHttpInfo(requestParameters.id, requestParameters.UpdateOrganizationRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/person-fields-api.ts b/src/versions/v2/api/person-fields-api.ts index 2571162c..99384826 100644 --- a/src/versions/v2/api/person-fields-api.ts +++ b/src/versions/v2/api/person-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFieldOptions200Response } from '../models'; // @ts-ignore @@ -437,6 +437,17 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonField(AddPersonFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addPersonField`, but resolves with the response body together with the HTTP status and headers. + * @summary Create one person field + * @param {AddPersonFieldRequest} AddPersonFieldRequest + + * @throws {RequiredError} + */ + async addPersonFieldWithHttpInfo(AddPersonFieldRequest: AddPersonFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonField(AddPersonFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds new options to a person 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 person field options in bulk @@ -449,6 +460,18 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addPersonFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Add person field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async addPersonFieldOptionsWithHttpInfo(field_code: string, AddDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a custom field as deleted. * @summary Delete one person field @@ -460,6 +483,17 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonField(field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePersonField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete one person field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async deletePersonFieldWithHttpInfo(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Removes existing options from a person 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 person field options in bulk @@ -472,6 +506,18 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePersonFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete person field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async deletePersonFieldOptionsWithHttpInfo(field_code: string, DeleteDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about a specific person field. * @summary Get one person field @@ -484,6 +530,18 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonField(field_code, include_fields, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one person field + * @param {string} field_code The unique code identifying the field + * @param {Set<'ui_visibility' | 'important_fields' | 'required_fields'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + + * @throws {RequiredError} + */ + async getPersonFieldWithHttpInfo(field_code: string, include_fields?: Set<'ui_visibility' | 'important_fields' | 'required_fields'>, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonField(field_code, include_fields, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about all person fields in the company. * @summary Get all person fields @@ -497,6 +555,19 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFields(include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all person fields + * @param {Set<'ui_visibility' | 'important_fields' | 'required_fields'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + * @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 getPersonFieldsWithHttpInfo(include_fields?: Set<'ui_visibility' | 'important_fields' | 'required_fields'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFields(include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a person 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 person field @@ -509,6 +580,18 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updatePersonField(field_code, UpdatePersonFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updatePersonField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update one person field + * @param {string} field_code The unique code identifying the field + * @param {UpdatePersonFieldRequest} UpdatePersonFieldRequest + + * @throws {RequiredError} + */ + async updatePersonFieldWithHttpInfo(field_code: string, UpdatePersonFieldRequest: UpdatePersonFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePersonField(field_code, UpdatePersonFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates existing options for a person 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 person field options in bulk @@ -521,6 +604,18 @@ export const PersonFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updatePersonFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updatePersonFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Update person field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async updatePersonFieldOptionsWithHttpInfo(field_code: string, UpdateDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePersonFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -541,6 +636,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b addPersonField(requestParameters: PersonFieldsApiAddPersonFieldRequest, ): Promise { return localVarFp.addPersonField(requestParameters.AddPersonFieldRequest, ).then((request) => request(axios, basePath)); }, + addPersonFieldWithHttpInfo(requestParameters: PersonFieldsApiAddPersonFieldRequest, ): Promise> { + return localVarFp.addPersonFieldWithHttpInfo(requestParameters.AddPersonFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds new options to a person 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 person field options in bulk @@ -551,6 +649,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b addPersonFieldOptions(requestParameters: PersonFieldsApiAddPersonFieldOptionsRequest, ): Promise { return localVarFp.addPersonFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + addPersonFieldOptionsWithHttpInfo(requestParameters: PersonFieldsApiAddPersonFieldOptionsRequest, ): Promise> { + return localVarFp.addPersonFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Marks a custom field as deleted. * @summary Delete one person field @@ -561,6 +662,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b deletePersonField(requestParameters: PersonFieldsApiDeletePersonFieldRequest, ): Promise { return localVarFp.deletePersonField(requestParameters.field_code, ).then((request) => request(axios, basePath)); }, + deletePersonFieldWithHttpInfo(requestParameters: PersonFieldsApiDeletePersonFieldRequest, ): Promise> { + return localVarFp.deletePersonFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, /** * Removes existing options from a person 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 person field options in bulk @@ -571,6 +675,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b deletePersonFieldOptions(requestParameters: PersonFieldsApiDeletePersonFieldOptionsRequest, ): Promise { return localVarFp.deletePersonFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + deletePersonFieldOptionsWithHttpInfo(requestParameters: PersonFieldsApiDeletePersonFieldOptionsRequest, ): Promise> { + return localVarFp.deletePersonFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about a specific person field. * @summary Get one person field @@ -581,6 +688,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b getPersonField(requestParameters: PersonFieldsApiGetPersonFieldRequest, ): Promise { return localVarFp.getPersonField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); }, + getPersonFieldWithHttpInfo(requestParameters: PersonFieldsApiGetPersonFieldRequest, ): Promise> { + return localVarFp.getPersonFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about all person fields in the company. * @summary Get all person fields @@ -591,6 +701,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b getPersonFields(requestParameters: PersonFieldsApiGetPersonFieldsRequest = {}, ): Promise { return localVarFp.getPersonFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getPersonFieldsWithHttpInfo(requestParameters: PersonFieldsApiGetPersonFieldsRequest = {}, ): Promise> { + return localVarFp.getPersonFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates a person 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 person field @@ -601,6 +714,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b updatePersonField(requestParameters: PersonFieldsApiUpdatePersonFieldRequest, ): Promise { return localVarFp.updatePersonField(requestParameters.field_code, requestParameters.UpdatePersonFieldRequest, ).then((request) => request(axios, basePath)); }, + updatePersonFieldWithHttpInfo(requestParameters: PersonFieldsApiUpdatePersonFieldRequest, ): Promise> { + return localVarFp.updatePersonFieldWithHttpInfo(requestParameters.field_code, requestParameters.UpdatePersonFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Updates existing options for a person 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 person field options in bulk @@ -611,6 +727,9 @@ export const PersonFieldsApiFactory = function (configuration?: Configuration, b updatePersonFieldOptions(requestParameters: PersonFieldsApiUpdatePersonFieldOptionsRequest, ): Promise { return localVarFp.updatePersonFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + updatePersonFieldOptionsWithHttpInfo(requestParameters: PersonFieldsApiUpdatePersonFieldOptionsRequest, ): Promise> { + return localVarFp.updatePersonFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, }; }; @@ -794,6 +913,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).addPersonField(requestParameters.AddPersonFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addPersonField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiAddPersonFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public addPersonFieldWithHttpInfo(requestParameters: PersonFieldsApiAddPersonFieldRequest, ) { + return PersonFieldsApiFp(this.configuration).addPersonFieldWithHttpInfo(requestParameters.AddPersonFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds new options to a person 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 person field options in bulk @@ -806,6 +937,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).addPersonFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addPersonFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiAddPersonFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public addPersonFieldOptionsWithHttpInfo(requestParameters: PersonFieldsApiAddPersonFieldOptionsRequest, ) { + return PersonFieldsApiFp(this.configuration).addPersonFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a custom field as deleted. * @summary Delete one person field @@ -818,6 +961,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).deletePersonField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePersonField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiDeletePersonFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public deletePersonFieldWithHttpInfo(requestParameters: PersonFieldsApiDeletePersonFieldRequest, ) { + return PersonFieldsApiFp(this.configuration).deletePersonFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + /** * Removes existing options from a person 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 person field options in bulk @@ -830,6 +985,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).deletePersonFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePersonFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiDeletePersonFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public deletePersonFieldOptionsWithHttpInfo(requestParameters: PersonFieldsApiDeletePersonFieldOptionsRequest, ) { + return PersonFieldsApiFp(this.configuration).deletePersonFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about a specific person field. * @summary Get one person field @@ -842,6 +1009,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).getPersonField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiGetPersonFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public getPersonFieldWithHttpInfo(requestParameters: PersonFieldsApiGetPersonFieldRequest, ) { + return PersonFieldsApiFp(this.configuration).getPersonFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about all person fields in the company. * @summary Get all person fields @@ -854,6 +1033,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).getPersonFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiGetPersonFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public getPersonFieldsWithHttpInfo(requestParameters: PersonFieldsApiGetPersonFieldsRequest = {}, ) { + return PersonFieldsApiFp(this.configuration).getPersonFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a person 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 person field @@ -866,6 +1057,18 @@ export class PersonFieldsApi extends BaseAPI { return PersonFieldsApiFp(this.configuration).updatePersonField(requestParameters.field_code, requestParameters.UpdatePersonFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updatePersonField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiUpdatePersonFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public updatePersonFieldWithHttpInfo(requestParameters: PersonFieldsApiUpdatePersonFieldRequest, ) { + return PersonFieldsApiFp(this.configuration).updatePersonFieldWithHttpInfo(requestParameters.field_code, requestParameters.UpdatePersonFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates existing options for a person 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 person field options in bulk @@ -877,4 +1080,16 @@ export class PersonFieldsApi extends BaseAPI { public updatePersonFieldOptions(requestParameters: PersonFieldsApiUpdatePersonFieldOptionsRequest, ) { return PersonFieldsApiFp(this.configuration).updatePersonFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updatePersonFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonFieldsApiUpdatePersonFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonFieldsApi + */ + public updatePersonFieldOptionsWithHttpInfo(requestParameters: PersonFieldsApiUpdatePersonFieldOptionsRequest, ) { + return PersonFieldsApiFp(this.configuration).updatePersonFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).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 b2591c73..fc4ca434 100644 --- a/src/versions/v2/api/persons-api.ts +++ b/src/versions/v2/api/persons-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFollowerRequest } from '../models'; // @ts-ignore @@ -680,6 +680,17 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addPerson(AddPersonRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addPerson`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new person + * @param {AddPersonRequest} [AddPersonRequest] + + * @throws {RequiredError} + */ + async addPersonWithHttpInfo(AddPersonRequest?: AddPersonRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPerson(AddPersonRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a user as a follower to the person. * @summary Add a follower to a person @@ -692,6 +703,18 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonFollower(id, AddDealFollowerRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addPersonFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a follower to a person + * @param {number} id The ID of the person + * @param {AddDealFollowerRequest} [AddDealFollowerRequest] + + * @throws {RequiredError} + */ + async addPersonFollowerWithHttpInfo(id: number, AddDealFollowerRequest?: AddDealFollowerRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPersonFollower(id, AddDealFollowerRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a person as deleted. After 30 days, the person will be permanently deleted. * @summary Delete a person @@ -703,6 +726,17 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePerson(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePerson`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a person + * @param {number} id The ID of the person + + * @throws {RequiredError} + */ + async deletePersonWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePerson(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a user follower from the person. * @summary Delete a follower from a person @@ -715,6 +749,18 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFollower(id, follower_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePersonFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a follower from a person + * @param {number} id The ID of the person + * @param {number} follower_id The ID of the following user + + * @throws {RequiredError} + */ + async deletePersonFollowerWithHttpInfo(id: number, follower_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonFollower(id, follower_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get details of a person @@ -730,6 +776,21 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPerson(id, include_fields, custom_fields, include_option_labels, include_labels, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPerson`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a person + * @param {number} id The ID of the person + * @param {Set<'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 {Set} [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 getPersonWithHttpInfo(id: number, include_fields?: Set<'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?: Set, 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, true); + }, /** * Lists users who are following the person. * @summary List followers of a person @@ -743,6 +804,19 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFollowers(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of a person + * @param {number} id The ID of the person + * @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 getPersonFollowersWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFollowers(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists changelogs about users have followed the person. * @summary List followers changelog of a person @@ -756,6 +830,19 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFollowersChangelog(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonFollowersChangelog`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers changelog of a person + * @param {number} id The ID of the person + * @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 getPersonFollowersChangelogWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFollowersChangelog(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the picture associated with a person. The picture URLs include both 128x128 and 512x512 pixel versions. * @summary Get picture of a person @@ -767,6 +854,17 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonPicture(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPersonPicture`, but resolves with the response body together with the HTTP status and headers. + * @summary Get picture of a person + * @param {number} id The ID of the person + + * @throws {RequiredError} + */ + async getPersonPictureWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonPicture(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get all persons @@ -792,6 +890,31 @@ export const PersonsApiFp = function(configuration?: Configuration) { 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); }, + /** + * Same as `getPersons`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all persons + * @param {number} [filter_id] If supplied, only persons matching the specified filter are returned + * @param {Set} [ids] Optional comma separated array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. + * @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored. + * @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored. + * @param {number} [deal_id] If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored. + * @param {string} [updated_since] If set, only persons with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {string} [updated_until] If set, only persons with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. + * @param {Set<'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 {Set} [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 getPersonsWithHttpInfo(filter_id?: number, ids?: Set, 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?: Set<'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?: Set, 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, true); + }, /** * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. * @summary Search persons @@ -809,6 +932,23 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchPersons(term, fields, exact_match, organization_id, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchPersons`, but resolves with the response body together with the HTTP status and headers. + * @summary Search persons + * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + * @param {Set<'custom_fields' | 'email' | 'notes' | 'phone' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. + * @param {Set<'person.picture'>} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchPersonsWithHttpInfo(term: string, fields?: Set<'custom_fields' | 'email' | 'notes' | 'phone' | 'name'>, exact_match?: boolean, organization_id?: number, include_fields?: Set<'person.picture'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchPersons(term, fields, exact_match, organization_id, include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a person.
If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field.
The `im`, `postal_address`, `notes`, `birthday` and `job_title` fields don\'t exist by default in Pipedrive and are only created when you set up your contact sync — attempting to set any of them without contact sync enabled returns a 403. * @summary Update a person @@ -821,6 +961,18 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updatePerson(id, UpdatePersonRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updatePerson`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a person + * @param {number} id The ID of the person + * @param {UpdatePersonRequest} [UpdatePersonRequest] + + * @throws {RequiredError} + */ + async updatePersonWithHttpInfo(id: number, UpdatePersonRequest?: UpdatePersonRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePerson(id, UpdatePersonRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -841,6 +993,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa addPerson(requestParameters: PersonsApiAddPersonRequest = {}, ): Promise { return localVarFp.addPerson(requestParameters.AddPersonRequest, ).then((request) => request(axios, basePath)); }, + addPersonWithHttpInfo(requestParameters: PersonsApiAddPersonRequest = {}, ): Promise> { + return localVarFp.addPersonWithHttpInfo(requestParameters.AddPersonRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a user as a follower to the person. * @summary Add a follower to a person @@ -851,6 +1006,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa addPersonFollower(requestParameters: PersonsApiAddPersonFollowerRequest, ): Promise { return localVarFp.addPersonFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); }, + addPersonFollowerWithHttpInfo(requestParameters: PersonsApiAddPersonFollowerRequest, ): Promise> { + return localVarFp.addPersonFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a person as deleted. After 30 days, the person will be permanently deleted. * @summary Delete a person @@ -861,6 +1019,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa deletePerson(requestParameters: PersonsApiDeletePersonRequest, ): Promise { return localVarFp.deletePerson(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deletePersonWithHttpInfo(requestParameters: PersonsApiDeletePersonRequest, ): Promise> { + return localVarFp.deletePersonWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Deletes a user follower from the person. * @summary Delete a follower from a person @@ -871,6 +1032,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa deletePersonFollower(requestParameters: PersonsApiDeletePersonFollowerRequest, ): Promise { return localVarFp.deletePersonFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); }, + deletePersonFollowerWithHttpInfo(requestParameters: PersonsApiDeletePersonFollowerRequest, ): Promise> { + return localVarFp.deletePersonFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get details of a person @@ -881,6 +1045,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPerson(requestParameters: PersonsApiGetPersonRequest, ): Promise { return localVarFp.getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(axios, basePath)); }, + getPersonWithHttpInfo(requestParameters: PersonsApiGetPersonRequest, ): Promise> { + return localVarFp.getPersonWithHttpInfo(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. * @summary List followers of a person @@ -891,6 +1058,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonFollowers(requestParameters: PersonsApiGetPersonFollowersRequest, ): Promise { return localVarFp.getPersonFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getPersonFollowersWithHttpInfo(requestParameters: PersonsApiGetPersonFollowersRequest, ): Promise> { + return localVarFp.getPersonFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Lists changelogs about users have followed the person. * @summary List followers changelog of a person @@ -901,6 +1071,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonFollowersChangelog(requestParameters: PersonsApiGetPersonFollowersChangelogRequest, ): Promise { return localVarFp.getPersonFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getPersonFollowersChangelogWithHttpInfo(requestParameters: PersonsApiGetPersonFollowersChangelogRequest, ): Promise> { + return localVarFp.getPersonFollowersChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Returns the picture associated with a person. The picture URLs include both 128x128 and 512x512 pixel versions. * @summary Get picture of a person @@ -911,6 +1084,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonPicture(requestParameters: PersonsApiGetPersonPictureRequest, ): Promise { return localVarFp.getPersonPicture(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getPersonPictureWithHttpInfo(requestParameters: PersonsApiGetPersonPictureRequest, ): Promise> { + return localVarFp.getPersonPictureWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get all persons @@ -921,6 +1097,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa 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.include_option_labels, requestParameters.include_labels, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getPersonsWithHttpInfo(requestParameters: PersonsApiGetPersonsRequest = {}, ): Promise> { + return localVarFp.getPersonsWithHttpInfo(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. * @summary Search persons @@ -931,6 +1110,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa searchPersons(requestParameters: PersonsApiSearchPersonsRequest, ): Promise { return localVarFp.searchPersons(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + searchPersonsWithHttpInfo(requestParameters: PersonsApiSearchPersonsRequest, ): Promise> { + return localVarFp.searchPersonsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a person.
If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field.
The `im`, `postal_address`, `notes`, `birthday` and `job_title` fields don\'t exist by default in Pipedrive and are only created when you set up your contact sync — attempting to set any of them without contact sync enabled returns a 403. * @summary Update a person @@ -941,6 +1123,9 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa updatePerson(requestParameters: PersonsApiUpdatePersonRequest, ): Promise { return localVarFp.updatePerson(requestParameters.id, requestParameters.UpdatePersonRequest, ).then((request) => request(axios, basePath)); }, + updatePersonWithHttpInfo(requestParameters: PersonsApiUpdatePersonRequest, ): Promise> { + return localVarFp.updatePersonWithHttpInfo(requestParameters.id, requestParameters.UpdatePersonRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -1334,6 +1519,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).addPerson(requestParameters.AddPersonRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addPerson`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiAddPersonRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public addPersonWithHttpInfo(requestParameters: PersonsApiAddPersonRequest = {}, ) { + return PersonsApiFp(this.configuration).addPersonWithHttpInfo(requestParameters.AddPersonRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a user as a follower to the person. * @summary Add a follower to a person @@ -1346,6 +1543,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).addPersonFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addPersonFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiAddPersonFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public addPersonFollowerWithHttpInfo(requestParameters: PersonsApiAddPersonFollowerRequest, ) { + return PersonsApiFp(this.configuration).addPersonFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a person as deleted. After 30 days, the person will be permanently deleted. * @summary Delete a person @@ -1358,6 +1567,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).deletePerson(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePerson`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiDeletePersonRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public deletePersonWithHttpInfo(requestParameters: PersonsApiDeletePersonRequest, ) { + return PersonsApiFp(this.configuration).deletePersonWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a user follower from the person. * @summary Delete a follower from a person @@ -1370,6 +1591,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).deletePersonFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePersonFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiDeletePersonFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public deletePersonFollowerWithHttpInfo(requestParameters: PersonsApiDeletePersonFollowerRequest, ) { + return PersonsApiFp(this.configuration).deletePersonFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get details of a person @@ -1382,6 +1615,18 @@ export class PersonsApi extends BaseAPI { 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)); } + /** + * Same as `getPerson`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonWithHttpInfo(requestParameters: PersonsApiGetPersonRequest, ) { + return PersonsApiFp(this.configuration).getPersonWithHttpInfo(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.include_option_labels, requestParameters.include_labels, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists users who are following the person. * @summary List followers of a person @@ -1394,6 +1639,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonFollowersWithHttpInfo(requestParameters: PersonsApiGetPersonFollowersRequest, ) { + return PersonsApiFp(this.configuration).getPersonFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists changelogs about users have followed the person. * @summary List followers changelog of a person @@ -1406,6 +1663,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonFollowersChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonFollowersChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonFollowersChangelogWithHttpInfo(requestParameters: PersonsApiGetPersonFollowersChangelogRequest, ) { + return PersonsApiFp(this.configuration).getPersonFollowersChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the picture associated with a person. The picture URLs include both 128x128 and 512x512 pixel versions. * @summary Get picture of a person @@ -1418,6 +1687,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonPicture(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPersonPicture`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonPictureRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonPictureWithHttpInfo(requestParameters: PersonsApiGetPersonPictureRequest, ) { + return PersonsApiFp(this.configuration).getPersonPictureWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get all persons @@ -1430,6 +1711,18 @@ export class PersonsApi extends BaseAPI { 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)); } + /** + * Same as `getPersons`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiGetPersonsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonsWithHttpInfo(requestParameters: PersonsApiGetPersonsRequest = {}, ) { + return PersonsApiFp(this.configuration).getPersonsWithHttpInfo(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)); + } + /** * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. * @summary Search persons @@ -1442,6 +1735,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).searchPersons(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `searchPersons`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiSearchPersonsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public searchPersonsWithHttpInfo(requestParameters: PersonsApiSearchPersonsRequest, ) { + return PersonsApiFp(this.configuration).searchPersonsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a person.
If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field.
The `im`, `postal_address`, `notes`, `birthday` and `job_title` fields don\'t exist by default in Pipedrive and are only created when you set up your contact sync — attempting to set any of them without contact sync enabled returns a 403. * @summary Update a person @@ -1453,4 +1758,16 @@ export class PersonsApi extends BaseAPI { public updatePerson(requestParameters: PersonsApiUpdatePersonRequest, ) { return PersonsApiFp(this.configuration).updatePerson(requestParameters.id, requestParameters.UpdatePersonRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updatePerson`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PersonsApiUpdatePersonRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public updatePersonWithHttpInfo(requestParameters: PersonsApiUpdatePersonRequest, ) { + return PersonsApiFp(this.configuration).updatePersonWithHttpInfo(requestParameters.id, requestParameters.UpdatePersonRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/pipelines-api.ts b/src/versions/v2/api/pipelines-api.ts index 9f1fc6eb..567f12e9 100644 --- a/src/versions/v2/api/pipelines-api.ts +++ b/src/versions/v2/api/pipelines-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddPipelineRequest } from '../models'; // @ts-ignore @@ -284,6 +284,17 @@ export const PipelinesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addPipeline(AddPipelineRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addPipeline`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new pipeline + * @param {AddPipelineRequest} [AddPipelineRequest] + + * @throws {RequiredError} + */ + async addPipelineWithHttpInfo(AddPipelineRequest?: AddPipelineRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPipeline(AddPipelineRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a pipeline as deleted. * @summary Delete a pipeline @@ -295,6 +306,17 @@ export const PipelinesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePipeline(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deletePipeline`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a pipeline + * @param {number} id The ID of the pipeline + + * @throws {RequiredError} + */ + async deletePipelineWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePipeline(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific pipeline. * @summary Get one pipeline @@ -306,6 +328,17 @@ export const PipelinesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPipeline(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPipeline`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one pipeline + * @param {number} id The ID of the pipeline + + * @throws {RequiredError} + */ + async getPipelineWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPipeline(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all pipelines. * @summary Get all pipelines @@ -320,6 +353,20 @@ export const PipelinesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPipelines(sort_by, sort_direction, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getPipelines`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all pipelines + * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. + * @param {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 getPipelinesWithHttpInfo(sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPipelines(sort_by, sort_direction, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a pipeline. * @summary Update a pipeline @@ -332,6 +379,18 @@ export const PipelinesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updatePipeline(id, UpdatePipelineRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updatePipeline`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a pipeline + * @param {number} id The ID of the pipeline + * @param {UpdatePipelineRequest} [UpdatePipelineRequest] + + * @throws {RequiredError} + */ + async updatePipelineWithHttpInfo(id: number, UpdatePipelineRequest?: UpdatePipelineRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePipeline(id, UpdatePipelineRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -352,6 +411,9 @@ export const PipelinesApiFactory = function (configuration?: Configuration, base addPipeline(requestParameters: PipelinesApiAddPipelineRequest = {}, ): Promise { return localVarFp.addPipeline(requestParameters.AddPipelineRequest, ).then((request) => request(axios, basePath)); }, + addPipelineWithHttpInfo(requestParameters: PipelinesApiAddPipelineRequest = {}, ): Promise> { + return localVarFp.addPipelineWithHttpInfo(requestParameters.AddPipelineRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a pipeline as deleted. * @summary Delete a pipeline @@ -362,6 +424,9 @@ export const PipelinesApiFactory = function (configuration?: Configuration, base deletePipeline(requestParameters: PipelinesApiDeletePipelineRequest, ): Promise { return localVarFp.deletePipeline(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deletePipelineWithHttpInfo(requestParameters: PipelinesApiDeletePipelineRequest, ): Promise> { + return localVarFp.deletePipelineWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific pipeline. * @summary Get one pipeline @@ -372,6 +437,9 @@ export const PipelinesApiFactory = function (configuration?: Configuration, base getPipeline(requestParameters: PipelinesApiGetPipelineRequest, ): Promise { return localVarFp.getPipeline(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getPipelineWithHttpInfo(requestParameters: PipelinesApiGetPipelineRequest, ): Promise> { + return localVarFp.getPipelineWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all pipelines. * @summary Get all pipelines @@ -382,6 +450,9 @@ export const PipelinesApiFactory = function (configuration?: Configuration, base getPipelines(requestParameters: PipelinesApiGetPipelinesRequest = {}, ): Promise { return localVarFp.getPipelines(requestParameters.sort_by, requestParameters.sort_direction, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getPipelinesWithHttpInfo(requestParameters: PipelinesApiGetPipelinesRequest = {}, ): Promise> { + return localVarFp.getPipelinesWithHttpInfo(requestParameters.sort_by, requestParameters.sort_direction, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a pipeline. * @summary Update a pipeline @@ -392,6 +463,9 @@ export const PipelinesApiFactory = function (configuration?: Configuration, base updatePipeline(requestParameters: PipelinesApiUpdatePipelineRequest, ): Promise { return localVarFp.updatePipeline(requestParameters.id, requestParameters.UpdatePipelineRequest, ).then((request) => request(axios, basePath)); }, + updatePipelineWithHttpInfo(requestParameters: PipelinesApiUpdatePipelineRequest, ): Promise> { + return localVarFp.updatePipelineWithHttpInfo(requestParameters.id, requestParameters.UpdatePipelineRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -512,6 +586,18 @@ export class PipelinesApi extends BaseAPI { return PipelinesApiFp(this.configuration).addPipeline(requestParameters.AddPipelineRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addPipeline`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PipelinesApiAddPipelineRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PipelinesApi + */ + public addPipelineWithHttpInfo(requestParameters: PipelinesApiAddPipelineRequest = {}, ) { + return PipelinesApiFp(this.configuration).addPipelineWithHttpInfo(requestParameters.AddPipelineRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a pipeline as deleted. * @summary Delete a pipeline @@ -524,6 +610,18 @@ export class PipelinesApi extends BaseAPI { return PipelinesApiFp(this.configuration).deletePipeline(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deletePipeline`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PipelinesApiDeletePipelineRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PipelinesApi + */ + public deletePipelineWithHttpInfo(requestParameters: PipelinesApiDeletePipelineRequest, ) { + return PipelinesApiFp(this.configuration).deletePipelineWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific pipeline. * @summary Get one pipeline @@ -536,6 +634,18 @@ export class PipelinesApi extends BaseAPI { return PipelinesApiFp(this.configuration).getPipeline(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPipeline`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PipelinesApiGetPipelineRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PipelinesApi + */ + public getPipelineWithHttpInfo(requestParameters: PipelinesApiGetPipelineRequest, ) { + return PipelinesApiFp(this.configuration).getPipelineWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all pipelines. * @summary Get all pipelines @@ -548,6 +658,18 @@ export class PipelinesApi extends BaseAPI { return PipelinesApiFp(this.configuration).getPipelines(requestParameters.sort_by, requestParameters.sort_direction, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getPipelines`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PipelinesApiGetPipelinesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PipelinesApi + */ + public getPipelinesWithHttpInfo(requestParameters: PipelinesApiGetPipelinesRequest = {}, ) { + return PipelinesApiFp(this.configuration).getPipelinesWithHttpInfo(requestParameters.sort_by, requestParameters.sort_direction, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a pipeline. * @summary Update a pipeline @@ -559,4 +681,16 @@ export class PipelinesApi extends BaseAPI { public updatePipeline(requestParameters: PipelinesApiUpdatePipelineRequest, ) { return PipelinesApiFp(this.configuration).updatePipeline(requestParameters.id, requestParameters.UpdatePipelineRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updatePipeline`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {PipelinesApiUpdatePipelineRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PipelinesApi + */ + public updatePipelineWithHttpInfo(requestParameters: PipelinesApiUpdatePipelineRequest, ) { + return PipelinesApiFp(this.configuration).updatePipelineWithHttpInfo(requestParameters.id, requestParameters.UpdatePipelineRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/product-fields-api.ts b/src/versions/v2/api/product-fields-api.ts index 07a8684c..36221edd 100644 --- a/src/versions/v2/api/product-fields-api.ts +++ b/src/versions/v2/api/product-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFieldOptions200Response } from '../models'; // @ts-ignore @@ -437,6 +437,17 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProductField(AddProductFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProductField`, but resolves with the response body together with the HTTP status and headers. + * @summary Create one product field + * @param {AddProductFieldRequest} AddProductFieldRequest + + * @throws {RequiredError} + */ + async addProductFieldWithHttpInfo(AddProductFieldRequest: AddProductFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProductField(AddProductFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds new options to a product 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 product field options in bulk @@ -449,6 +460,18 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProductFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProductFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Add product field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async addProductFieldOptionsWithHttpInfo(field_code: string, AddDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProductFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a custom field as deleted. * @summary Delete one product field @@ -460,6 +483,17 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductField(field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProductField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete one product field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async deleteProductFieldWithHttpInfo(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Removes existing options from a product 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 product field options in bulk @@ -472,6 +506,18 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProductFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete product field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async deleteProductFieldOptionsWithHttpInfo(field_code: string, DeleteDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about a specific product field. * @summary Get one product field @@ -484,6 +530,18 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductField(field_code, include_fields, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one product field + * @param {string} field_code The unique code identifying the field + * @param {Set<'ui_visibility'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + + * @throws {RequiredError} + */ + async getProductFieldWithHttpInfo(field_code: string, include_fields?: Set<'ui_visibility'>, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductField(field_code, include_fields, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about all product fields in the company. * @summary Get all product fields @@ -497,6 +555,19 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFields(include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductFields`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all product fields + * @param {Set<'ui_visibility'>} [include_fields] Optional comma separated string array of additional data namespaces to include in response + * @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 getProductFieldsWithHttpInfo(include_fields?: Set<'ui_visibility'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFields(include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates a product 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 product field @@ -509,6 +580,18 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductField(field_code, UpdateProductFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProductField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update one product field + * @param {string} field_code The unique code identifying the field + * @param {UpdateProductFieldRequest} UpdateProductFieldRequest + + * @throws {RequiredError} + */ + async updateProductFieldWithHttpInfo(field_code: string, UpdateProductFieldRequest: UpdateProductFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductField(field_code, UpdateProductFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates existing options for a product 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 product field options in bulk @@ -521,6 +604,18 @@ export const ProductFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProductFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Update product field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async updateProductFieldOptionsWithHttpInfo(field_code: string, UpdateDealFieldOptionsRequestInner: Array, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -541,6 +636,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, addProductField(requestParameters: ProductFieldsApiAddProductFieldRequest, ): Promise { return localVarFp.addProductField(requestParameters.AddProductFieldRequest, ).then((request) => request(axios, basePath)); }, + addProductFieldWithHttpInfo(requestParameters: ProductFieldsApiAddProductFieldRequest, ): Promise> { + return localVarFp.addProductFieldWithHttpInfo(requestParameters.AddProductFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds new options to a product 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 product field options in bulk @@ -551,6 +649,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, addProductFieldOptions(requestParameters: ProductFieldsApiAddProductFieldOptionsRequest, ): Promise { return localVarFp.addProductFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + addProductFieldOptionsWithHttpInfo(requestParameters: ProductFieldsApiAddProductFieldOptionsRequest, ): Promise> { + return localVarFp.addProductFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Marks a custom field as deleted. * @summary Delete one product field @@ -561,6 +662,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, deleteProductField(requestParameters: ProductFieldsApiDeleteProductFieldRequest, ): Promise { return localVarFp.deleteProductField(requestParameters.field_code, ).then((request) => request(axios, basePath)); }, + deleteProductFieldWithHttpInfo(requestParameters: ProductFieldsApiDeleteProductFieldRequest, ): Promise> { + return localVarFp.deleteProductFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, /** * Removes existing options from a product 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 product field options in bulk @@ -571,6 +675,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, deleteProductFieldOptions(requestParameters: ProductFieldsApiDeleteProductFieldOptionsRequest, ): Promise { return localVarFp.deleteProductFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + deleteProductFieldOptionsWithHttpInfo(requestParameters: ProductFieldsApiDeleteProductFieldOptionsRequest, ): Promise> { + return localVarFp.deleteProductFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about a specific product field. * @summary Get one product field @@ -581,6 +688,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, getProductField(requestParameters: ProductFieldsApiGetProductFieldRequest, ): Promise { return localVarFp.getProductField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); }, + getProductFieldWithHttpInfo(requestParameters: ProductFieldsApiGetProductFieldRequest, ): Promise> { + return localVarFp.getProductFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about all product fields in the company. * @summary Get all product fields @@ -591,6 +701,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, getProductFields(requestParameters: ProductFieldsApiGetProductFieldsRequest = {}, ): Promise { return localVarFp.getProductFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getProductFieldsWithHttpInfo(requestParameters: ProductFieldsApiGetProductFieldsRequest = {}, ): Promise> { + return localVarFp.getProductFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates a product 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 product field @@ -601,6 +714,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, updateProductField(requestParameters: ProductFieldsApiUpdateProductFieldRequest, ): Promise { return localVarFp.updateProductField(requestParameters.field_code, requestParameters.UpdateProductFieldRequest, ).then((request) => request(axios, basePath)); }, + updateProductFieldWithHttpInfo(requestParameters: ProductFieldsApiUpdateProductFieldRequest, ): Promise> { + return localVarFp.updateProductFieldWithHttpInfo(requestParameters.field_code, requestParameters.UpdateProductFieldRequest, ).then((request) => request(axios, basePath)); + }, /** * Updates existing options for a product 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 product field options in bulk @@ -611,6 +727,9 @@ export const ProductFieldsApiFactory = function (configuration?: Configuration, updateProductFieldOptions(requestParameters: ProductFieldsApiUpdateProductFieldOptionsRequest, ): Promise { return localVarFp.updateProductFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + updateProductFieldOptionsWithHttpInfo(requestParameters: ProductFieldsApiUpdateProductFieldOptionsRequest, ): Promise> { + return localVarFp.updateProductFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, }; }; @@ -794,6 +913,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).addProductField(requestParameters.AddProductFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProductField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiAddProductFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public addProductFieldWithHttpInfo(requestParameters: ProductFieldsApiAddProductFieldRequest, ) { + return ProductFieldsApiFp(this.configuration).addProductFieldWithHttpInfo(requestParameters.AddProductFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds new options to a product 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 product field options in bulk @@ -806,6 +937,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).addProductFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProductFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiAddProductFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public addProductFieldOptionsWithHttpInfo(requestParameters: ProductFieldsApiAddProductFieldOptionsRequest, ) { + return ProductFieldsApiFp(this.configuration).addProductFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a custom field as deleted. * @summary Delete one product field @@ -818,6 +961,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).deleteProductField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProductField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiDeleteProductFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public deleteProductFieldWithHttpInfo(requestParameters: ProductFieldsApiDeleteProductFieldRequest, ) { + return ProductFieldsApiFp(this.configuration).deleteProductFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + /** * Removes existing options from a product 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 product field options in bulk @@ -830,6 +985,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).deleteProductFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProductFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiDeleteProductFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public deleteProductFieldOptionsWithHttpInfo(requestParameters: ProductFieldsApiDeleteProductFieldOptionsRequest, ) { + return ProductFieldsApiFp(this.configuration).deleteProductFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about a specific product field. * @summary Get one product field @@ -842,6 +1009,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).getProductField(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiGetProductFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public getProductFieldWithHttpInfo(requestParameters: ProductFieldsApiGetProductFieldRequest, ) { + return ProductFieldsApiFp(this.configuration).getProductFieldWithHttpInfo(requestParameters.field_code, requestParameters.include_fields, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about all product fields in the company. * @summary Get all product fields @@ -854,6 +1033,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).getProductFields(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiGetProductFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public getProductFieldsWithHttpInfo(requestParameters: ProductFieldsApiGetProductFieldsRequest = {}, ) { + return ProductFieldsApiFp(this.configuration).getProductFieldsWithHttpInfo(requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates a product 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 product field @@ -866,6 +1057,18 @@ export class ProductFieldsApi extends BaseAPI { return ProductFieldsApiFp(this.configuration).updateProductField(requestParameters.field_code, requestParameters.UpdateProductFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProductField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiUpdateProductFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public updateProductFieldWithHttpInfo(requestParameters: ProductFieldsApiUpdateProductFieldRequest, ) { + return ProductFieldsApiFp(this.configuration).updateProductFieldWithHttpInfo(requestParameters.field_code, requestParameters.UpdateProductFieldRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates existing options for a product 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 product field options in bulk @@ -877,4 +1080,16 @@ export class ProductFieldsApi extends BaseAPI { public updateProductFieldOptions(requestParameters: ProductFieldsApiUpdateProductFieldOptionsRequest, ) { return ProductFieldsApiFp(this.configuration).updateProductFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateProductFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductFieldsApiUpdateProductFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductFieldsApi + */ + public updateProductFieldOptionsWithHttpInfo(requestParameters: ProductFieldsApiUpdateProductFieldOptionsRequest, ) { + return ProductFieldsApiFp(this.configuration).updateProductFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/products-api.ts b/src/versions/v2/api/products-api.ts index 1e9cdfaa..04b4728f 100644 --- a/src/versions/v2/api/products-api.ts +++ b/src/versions/v2/api/products-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFollowerRequest } from '../models'; // @ts-ignore @@ -1019,6 +1019,17 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProduct(AddProductRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProduct`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a product + * @param {AddProductRequest} [AddProductRequest] + + * @throws {RequiredError} + */ + async addProductWithHttpInfo(AddProductRequest?: AddProductRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProduct(AddProductRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a user as a follower to the product. * @summary Add a follower to a product @@ -1031,6 +1042,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProductFollower(id, AddDealFollowerRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProductFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a follower to a product + * @param {number} id The ID of the product + * @param {AddDealFollowerRequest} [AddDealFollowerRequest] + + * @throws {RequiredError} + */ + async addProductFollowerWithHttpInfo(id: number, AddDealFollowerRequest?: AddDealFollowerRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProductFollower(id, AddDealFollowerRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Adds a new product variation. * @summary Add a product variation @@ -1043,6 +1066,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProductVariation(id, AddProductVariationRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProductVariation`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a product variation + * @param {number} id The ID of the product + * @param {AddProductVariationRequest} [AddProductVariationRequest] + + * @throws {RequiredError} + */ + async addProductVariationWithHttpInfo(id: number, AddProductVariationRequest?: AddProductVariationRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProductVariation(id, AddProductVariationRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a product as deleted. After 30 days, the product will be permanently deleted. * @summary Delete a product @@ -1054,6 +1089,17 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProduct(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProduct`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a product + * @param {number} id The ID of the product + + * @throws {RequiredError} + */ + async deleteProductWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProduct(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a user follower from the product. * @summary Delete a follower from a product @@ -1066,6 +1112,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFollower(id, follower_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProductFollower`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a follower from a product + * @param {number} id The ID of the product + * @param {number} follower_id The ID of the following user + + * @throws {RequiredError} + */ + async deleteProductFollowerWithHttpInfo(id: number, follower_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductFollower(id, follower_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes the image of a product. * @summary Delete an image of a product @@ -1077,6 +1135,17 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductImage(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProductImage`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete an image of a product + * @param {number} id The ID of the product + + * @throws {RequiredError} + */ + async deleteProductImageWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductImage(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Deletes a product variation. * @summary Delete a product variation @@ -1089,6 +1158,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductVariation(id, product_variation_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProductVariation`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a product variation + * @param {number} id The ID of the product + * @param {number} product_variation_id The ID of the product variation + + * @throws {RequiredError} + */ + async deleteProductVariationWithHttpInfo(id: number, product_variation_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductVariation(id, product_variation_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Creates a duplicate of an existing product including all variations, prices, and custom fields. * @summary Duplicate a product @@ -1100,6 +1181,17 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.duplicateProduct(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `duplicateProduct`, but resolves with the response body together with the HTTP status and headers. + * @summary Duplicate a product + * @param {number} id The ID of the product + + * @throws {RequiredError} + */ + async duplicateProductWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.duplicateProduct(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific product. * @summary Get one product @@ -1111,6 +1203,17 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProduct(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProduct`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one product + * @param {number} id The ID of the product + + * @throws {RequiredError} + */ + async getProductWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProduct(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists users who are following the product. * @summary List followers of a product @@ -1124,6 +1227,19 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFollowers(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of a product + * @param {number} id The ID of the product + * @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 getProductFollowersWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFollowers(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists changelogs about users have followed the product. * @summary List followers changelog of a product @@ -1137,6 +1253,19 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFollowersChangelog(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductFollowersChangelog`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers changelog of a product + * @param {number} id The ID of the product + * @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 getProductFollowersChangelogWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductFollowersChangelog(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Retrieves the image of a product. The public URL has a limited lifetime of 7 days. * @summary Get image of a product @@ -1148,6 +1277,17 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductImage(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductImage`, but resolves with the response body together with the HTTP status and headers. + * @summary Get image of a product + * @param {number} id The ID of the product + + * @throws {RequiredError} + */ + async getProductImageWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductImage(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all product variations. * @summary Get all product variations @@ -1161,6 +1301,19 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProductVariations(id, cursor, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProductVariations`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all product variations + * @param {number} id The ID of the product + * @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 getProductVariationsWithHttpInfo(id: number, cursor?: string, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProductVariations(id, cursor, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all products. * @summary Get all products @@ -1180,6 +1333,25 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProducts(owner_id, ids, custom_fields, filter_id, cursor, limit, sort_by, sort_direction, updated_since, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProducts`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all products + * @param {number} [owner_id] If supplied, only products owned by the given user will be returned + * @param {Set} [ids] Optional comma separated array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. + * @param {Set} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.<br/>A maximum of 15 keys is allowed. + * @param {number} [filter_id] The ID of the filter to use + * @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' | 'name' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: `id`, `name`, `add_time`, `update_time`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. + * @param {string} [updated_since] If set, only products with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. + + * @throws {RequiredError} + */ + async getProductsWithHttpInfo(owner_id?: number, ids?: Set, custom_fields?: Set, filter_id?: number, cursor?: string, limit?: number, sort_by?: 'id' | 'name' | 'add_time' | 'update_time', sort_direction?: 'asc' | 'desc', updated_since?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProducts(owner_id, ids, custom_fields, filter_id, cursor, limit, sort_by, sort_direction, updated_since, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Searches all products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search products @@ -1196,6 +1368,22 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchProducts(term, fields, exact_match, include_fields, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchProducts`, but resolves with the response body together with the HTTP status and headers. + * @summary Search products + * @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 {Set<'code' | 'custom_fields' | 'name'>} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields <a href=\"https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>. + * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. + * @param {Set<'product.price'>} [include_fields] Supports including optional fields in the results which are not provided by default + * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 100 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchProductsWithHttpInfo(term: string, fields?: Set<'code' | 'custom_fields' | 'name'>, exact_match?: boolean, include_fields?: Set<'product.price'>, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchProducts(term, fields, exact_match, include_fields, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates product data. * @summary Update a product @@ -1208,6 +1396,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProduct(id, UpdateProductRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProduct`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a product + * @param {number} id The ID of the product + * @param {UpdateProductRequest} [UpdateProductRequest] + + * @throws {RequiredError} + */ + async updateProductWithHttpInfo(id: number, UpdateProductRequest?: UpdateProductRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProduct(id, UpdateProductRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the image of a product. * @summary Update an image for a product @@ -1220,6 +1420,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductImage(id, data, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProductImage`, but resolves with the response body together with the HTTP status and headers. + * @summary Update an image for a product + * @param {number} id The ID of the product + * @param {File} data One image supplied in the multipart/form-data encoding + + * @throws {RequiredError} + */ + async updateProductImageWithHttpInfo(id: number, data: File, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductImage(id, data, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates product variation data. * @summary Update a product variation @@ -1233,6 +1445,19 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductVariation(id, product_variation_id, UpdateProductVariationRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProductVariation`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a product variation + * @param {number} id The ID of the product + * @param {number} product_variation_id The ID of the product variation + * @param {UpdateProductVariationRequest} [UpdateProductVariationRequest] + + * @throws {RequiredError} + */ + async updateProductVariationWithHttpInfo(id: number, product_variation_id: number, UpdateProductVariationRequest?: UpdateProductVariationRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductVariation(id, product_variation_id, UpdateProductVariationRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Uploads an image for a product. * @summary Upload an image for a product @@ -1245,6 +1470,18 @@ export const ProductsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.uploadProductImage(id, data, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `uploadProductImage`, but resolves with the response body together with the HTTP status and headers. + * @summary Upload an image for a product + * @param {number} id The ID of the product + * @param {File} data One image supplied in the multipart/form-data encoding + + * @throws {RequiredError} + */ + async uploadProductImageWithHttpInfo(id: number, data: File, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadProductImage(id, data, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -1265,6 +1502,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP addProduct(requestParameters: ProductsApiAddProductRequest = {}, ): Promise { return localVarFp.addProduct(requestParameters.AddProductRequest, ).then((request) => request(axios, basePath)); }, + addProductWithHttpInfo(requestParameters: ProductsApiAddProductRequest = {}, ): Promise> { + return localVarFp.addProductWithHttpInfo(requestParameters.AddProductRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a user as a follower to the product. * @summary Add a follower to a product @@ -1275,6 +1515,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP addProductFollower(requestParameters: ProductsApiAddProductFollowerRequest, ): Promise { return localVarFp.addProductFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); }, + addProductFollowerWithHttpInfo(requestParameters: ProductsApiAddProductFollowerRequest, ): Promise> { + return localVarFp.addProductFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(axios, basePath)); + }, /** * Adds a new product variation. * @summary Add a product variation @@ -1285,6 +1528,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP addProductVariation(requestParameters: ProductsApiAddProductVariationRequest, ): Promise { return localVarFp.addProductVariation(requestParameters.id, requestParameters.AddProductVariationRequest, ).then((request) => request(axios, basePath)); }, + addProductVariationWithHttpInfo(requestParameters: ProductsApiAddProductVariationRequest, ): Promise> { + return localVarFp.addProductVariationWithHttpInfo(requestParameters.id, requestParameters.AddProductVariationRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a product as deleted. After 30 days, the product will be permanently deleted. * @summary Delete a product @@ -1295,6 +1541,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP deleteProduct(requestParameters: ProductsApiDeleteProductRequest, ): Promise { return localVarFp.deleteProduct(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProductWithHttpInfo(requestParameters: ProductsApiDeleteProductRequest, ): Promise> { + return localVarFp.deleteProductWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Deletes a user follower from the product. * @summary Delete a follower from a product @@ -1305,6 +1554,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP deleteProductFollower(requestParameters: ProductsApiDeleteProductFollowerRequest, ): Promise { return localVarFp.deleteProductFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); }, + deleteProductFollowerWithHttpInfo(requestParameters: ProductsApiDeleteProductFollowerRequest, ): Promise> { + return localVarFp.deleteProductFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(axios, basePath)); + }, /** * Deletes the image of a product. * @summary Delete an image of a product @@ -1315,6 +1567,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP deleteProductImage(requestParameters: ProductsApiDeleteProductImageRequest, ): Promise { return localVarFp.deleteProductImage(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProductImageWithHttpInfo(requestParameters: ProductsApiDeleteProductImageRequest, ): Promise> { + return localVarFp.deleteProductImageWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Deletes a product variation. * @summary Delete a product variation @@ -1325,6 +1580,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP deleteProductVariation(requestParameters: ProductsApiDeleteProductVariationRequest, ): Promise { return localVarFp.deleteProductVariation(requestParameters.id, requestParameters.product_variation_id, ).then((request) => request(axios, basePath)); }, + deleteProductVariationWithHttpInfo(requestParameters: ProductsApiDeleteProductVariationRequest, ): Promise> { + return localVarFp.deleteProductVariationWithHttpInfo(requestParameters.id, requestParameters.product_variation_id, ).then((request) => request(axios, basePath)); + }, /** * Creates a duplicate of an existing product including all variations, prices, and custom fields. * @summary Duplicate a product @@ -1335,6 +1593,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP duplicateProduct(requestParameters: ProductsApiDuplicateProductRequest, ): Promise { return localVarFp.duplicateProduct(requestParameters.id, ).then((request) => request(axios, basePath)); }, + duplicateProductWithHttpInfo(requestParameters: ProductsApiDuplicateProductRequest, ): Promise> { + return localVarFp.duplicateProductWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific product. * @summary Get one product @@ -1345,6 +1606,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProduct(requestParameters: ProductsApiGetProductRequest, ): Promise { return localVarFp.getProduct(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProductWithHttpInfo(requestParameters: ProductsApiGetProductRequest, ): Promise> { + return localVarFp.getProductWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists users who are following the product. * @summary List followers of a product @@ -1355,6 +1619,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProductFollowers(requestParameters: ProductsApiGetProductFollowersRequest, ): Promise { return localVarFp.getProductFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getProductFollowersWithHttpInfo(requestParameters: ProductsApiGetProductFollowersRequest, ): Promise> { + return localVarFp.getProductFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Lists changelogs about users have followed the product. * @summary List followers changelog of a product @@ -1365,6 +1632,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProductFollowersChangelog(requestParameters: ProductsApiGetProductFollowersChangelogRequest, ): Promise { return localVarFp.getProductFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getProductFollowersChangelogWithHttpInfo(requestParameters: ProductsApiGetProductFollowersChangelogRequest, ): Promise> { + return localVarFp.getProductFollowersChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Retrieves the image of a product. The public URL has a limited lifetime of 7 days. * @summary Get image of a product @@ -1375,6 +1645,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProductImage(requestParameters: ProductsApiGetProductImageRequest, ): Promise { return localVarFp.getProductImage(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProductImageWithHttpInfo(requestParameters: ProductsApiGetProductImageRequest, ): Promise> { + return localVarFp.getProductImageWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all product variations. * @summary Get all product variations @@ -1385,6 +1658,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProductVariations(requestParameters: ProductsApiGetProductVariationsRequest, ): Promise { return localVarFp.getProductVariations(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getProductVariationsWithHttpInfo(requestParameters: ProductsApiGetProductVariationsRequest, ): Promise> { + return localVarFp.getProductVariationsWithHttpInfo(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all products. * @summary Get all products @@ -1395,6 +1671,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP getProducts(requestParameters: ProductsApiGetProductsRequest = {}, ): Promise { return localVarFp.getProducts(requestParameters.owner_id, requestParameters.ids, requestParameters.custom_fields, requestParameters.filter_id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.updated_since, ).then((request) => request(axios, basePath)); }, + getProductsWithHttpInfo(requestParameters: ProductsApiGetProductsRequest = {}, ): Promise> { + return localVarFp.getProductsWithHttpInfo(requestParameters.owner_id, requestParameters.ids, requestParameters.custom_fields, requestParameters.filter_id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.updated_since, ).then((request) => request(axios, basePath)); + }, /** * Searches all products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search products @@ -1405,6 +1684,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP searchProducts(requestParameters: ProductsApiSearchProductsRequest, ): Promise { return localVarFp.searchProducts(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + searchProductsWithHttpInfo(requestParameters: ProductsApiSearchProductsRequest, ): Promise> { + return localVarFp.searchProductsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates product data. * @summary Update a product @@ -1415,6 +1697,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP updateProduct(requestParameters: ProductsApiUpdateProductRequest, ): Promise { return localVarFp.updateProduct(requestParameters.id, requestParameters.UpdateProductRequest, ).then((request) => request(axios, basePath)); }, + updateProductWithHttpInfo(requestParameters: ProductsApiUpdateProductRequest, ): Promise> { + return localVarFp.updateProductWithHttpInfo(requestParameters.id, requestParameters.UpdateProductRequest, ).then((request) => request(axios, basePath)); + }, /** * Updates the image of a product. * @summary Update an image for a product @@ -1425,6 +1710,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP updateProductImage(requestParameters: ProductsApiUpdateProductImageRequest, ): Promise { return localVarFp.updateProductImage(requestParameters.id, requestParameters.data, ).then((request) => request(axios, basePath)); }, + updateProductImageWithHttpInfo(requestParameters: ProductsApiUpdateProductImageRequest, ): Promise> { + return localVarFp.updateProductImageWithHttpInfo(requestParameters.id, requestParameters.data, ).then((request) => request(axios, basePath)); + }, /** * Updates product variation data. * @summary Update a product variation @@ -1435,6 +1723,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP updateProductVariation(requestParameters: ProductsApiUpdateProductVariationRequest, ): Promise { return localVarFp.updateProductVariation(requestParameters.id, requestParameters.product_variation_id, requestParameters.UpdateProductVariationRequest, ).then((request) => request(axios, basePath)); }, + updateProductVariationWithHttpInfo(requestParameters: ProductsApiUpdateProductVariationRequest, ): Promise> { + return localVarFp.updateProductVariationWithHttpInfo(requestParameters.id, requestParameters.product_variation_id, requestParameters.UpdateProductVariationRequest, ).then((request) => request(axios, basePath)); + }, /** * Uploads an image for a product. * @summary Upload an image for a product @@ -1445,6 +1736,9 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP uploadProductImage(requestParameters: ProductsApiUploadProductImageRequest, ): Promise { return localVarFp.uploadProductImage(requestParameters.id, requestParameters.data, ).then((request) => request(axios, basePath)); }, + uploadProductImageWithHttpInfo(requestParameters: ProductsApiUploadProductImageRequest, ): Promise> { + return localVarFp.uploadProductImageWithHttpInfo(requestParameters.id, requestParameters.data, ).then((request) => request(axios, basePath)); + }, }; }; @@ -1929,6 +2223,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).addProduct(requestParameters.AddProductRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProduct`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiAddProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public addProductWithHttpInfo(requestParameters: ProductsApiAddProductRequest = {}, ) { + return ProductsApiFp(this.configuration).addProductWithHttpInfo(requestParameters.AddProductRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a user as a follower to the product. * @summary Add a follower to a product @@ -1941,6 +2247,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).addProductFollower(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProductFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiAddProductFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public addProductFollowerWithHttpInfo(requestParameters: ProductsApiAddProductFollowerRequest, ) { + return ProductsApiFp(this.configuration).addProductFollowerWithHttpInfo(requestParameters.id, requestParameters.AddDealFollowerRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Adds a new product variation. * @summary Add a product variation @@ -1953,6 +2271,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).addProductVariation(requestParameters.id, requestParameters.AddProductVariationRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProductVariation`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiAddProductVariationRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public addProductVariationWithHttpInfo(requestParameters: ProductsApiAddProductVariationRequest, ) { + return ProductsApiFp(this.configuration).addProductVariationWithHttpInfo(requestParameters.id, requestParameters.AddProductVariationRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a product as deleted. After 30 days, the product will be permanently deleted. * @summary Delete a product @@ -1965,6 +2295,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).deleteProduct(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProduct`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiDeleteProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public deleteProductWithHttpInfo(requestParameters: ProductsApiDeleteProductRequest, ) { + return ProductsApiFp(this.configuration).deleteProductWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a user follower from the product. * @summary Delete a follower from a product @@ -1977,6 +2319,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).deleteProductFollower(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProductFollower`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiDeleteProductFollowerRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public deleteProductFollowerWithHttpInfo(requestParameters: ProductsApiDeleteProductFollowerRequest, ) { + return ProductsApiFp(this.configuration).deleteProductFollowerWithHttpInfo(requestParameters.id, requestParameters.follower_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes the image of a product. * @summary Delete an image of a product @@ -1989,6 +2343,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).deleteProductImage(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProductImage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiDeleteProductImageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public deleteProductImageWithHttpInfo(requestParameters: ProductsApiDeleteProductImageRequest, ) { + return ProductsApiFp(this.configuration).deleteProductImageWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Deletes a product variation. * @summary Delete a product variation @@ -2001,6 +2367,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).deleteProductVariation(requestParameters.id, requestParameters.product_variation_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProductVariation`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiDeleteProductVariationRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public deleteProductVariationWithHttpInfo(requestParameters: ProductsApiDeleteProductVariationRequest, ) { + return ProductsApiFp(this.configuration).deleteProductVariationWithHttpInfo(requestParameters.id, requestParameters.product_variation_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Creates a duplicate of an existing product including all variations, prices, and custom fields. * @summary Duplicate a product @@ -2013,6 +2391,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).duplicateProduct(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `duplicateProduct`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiDuplicateProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public duplicateProductWithHttpInfo(requestParameters: ProductsApiDuplicateProductRequest, ) { + return ProductsApiFp(this.configuration).duplicateProductWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific product. * @summary Get one product @@ -2025,6 +2415,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProduct(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProduct`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductWithHttpInfo(requestParameters: ProductsApiGetProductRequest, ) { + return ProductsApiFp(this.configuration).getProductWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists users who are following the product. * @summary List followers of a product @@ -2037,6 +2439,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProductFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductFollowersWithHttpInfo(requestParameters: ProductsApiGetProductFollowersRequest, ) { + return ProductsApiFp(this.configuration).getProductFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists changelogs about users have followed the product. * @summary List followers changelog of a product @@ -2049,6 +2463,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProductFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductFollowersChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductFollowersChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductFollowersChangelogWithHttpInfo(requestParameters: ProductsApiGetProductFollowersChangelogRequest, ) { + return ProductsApiFp(this.configuration).getProductFollowersChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Retrieves the image of a product. The public URL has a limited lifetime of 7 days. * @summary Get image of a product @@ -2061,6 +2487,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProductImage(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductImage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductImageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductImageWithHttpInfo(requestParameters: ProductsApiGetProductImageRequest, ) { + return ProductsApiFp(this.configuration).getProductImageWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all product variations. * @summary Get all product variations @@ -2073,6 +2511,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProductVariations(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProductVariations`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductVariationsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductVariationsWithHttpInfo(requestParameters: ProductsApiGetProductVariationsRequest, ) { + return ProductsApiFp(this.configuration).getProductVariationsWithHttpInfo(requestParameters.id, requestParameters.cursor, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all products. * @summary Get all products @@ -2085,6 +2535,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).getProducts(requestParameters.owner_id, requestParameters.ids, requestParameters.custom_fields, requestParameters.filter_id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.updated_since, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProducts`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiGetProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public getProductsWithHttpInfo(requestParameters: ProductsApiGetProductsRequest = {}, ) { + return ProductsApiFp(this.configuration).getProductsWithHttpInfo(requestParameters.owner_id, requestParameters.ids, requestParameters.custom_fields, requestParameters.filter_id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.updated_since, ).then((request) => request(this.axios, this.basePath)); + } + /** * Searches all products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. * @summary Search products @@ -2097,6 +2559,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).searchProducts(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `searchProducts`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiSearchProductsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public searchProductsWithHttpInfo(requestParameters: ProductsApiSearchProductsRequest, ) { + return ProductsApiFp(this.configuration).searchProductsWithHttpInfo(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates product data. * @summary Update a product @@ -2109,6 +2583,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).updateProduct(requestParameters.id, requestParameters.UpdateProductRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProduct`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiUpdateProductRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public updateProductWithHttpInfo(requestParameters: ProductsApiUpdateProductRequest, ) { + return ProductsApiFp(this.configuration).updateProductWithHttpInfo(requestParameters.id, requestParameters.UpdateProductRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the image of a product. * @summary Update an image for a product @@ -2121,6 +2607,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).updateProductImage(requestParameters.id, requestParameters.data, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProductImage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiUpdateProductImageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public updateProductImageWithHttpInfo(requestParameters: ProductsApiUpdateProductImageRequest, ) { + return ProductsApiFp(this.configuration).updateProductImageWithHttpInfo(requestParameters.id, requestParameters.data, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates product variation data. * @summary Update a product variation @@ -2133,6 +2631,18 @@ export class ProductsApi extends BaseAPI { return ProductsApiFp(this.configuration).updateProductVariation(requestParameters.id, requestParameters.product_variation_id, requestParameters.UpdateProductVariationRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProductVariation`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiUpdateProductVariationRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public updateProductVariationWithHttpInfo(requestParameters: ProductsApiUpdateProductVariationRequest, ) { + return ProductsApiFp(this.configuration).updateProductVariationWithHttpInfo(requestParameters.id, requestParameters.product_variation_id, requestParameters.UpdateProductVariationRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Uploads an image for a product. * @summary Upload an image for a product @@ -2144,4 +2654,16 @@ export class ProductsApi extends BaseAPI { public uploadProductImage(requestParameters: ProductsApiUploadProductImageRequest, ) { return ProductsApiFp(this.configuration).uploadProductImage(requestParameters.id, requestParameters.data, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `uploadProductImage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProductsApiUploadProductImageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProductsApi + */ + public uploadProductImageWithHttpInfo(requestParameters: ProductsApiUploadProductImageRequest, ) { + return ProductsApiFp(this.configuration).uploadProductImageWithHttpInfo(requestParameters.id, requestParameters.data, ).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 index 62c220ed..e22ff29e 100644 --- a/src/versions/v2/api/project-boards-api.ts +++ b/src/versions/v2/api/project-boards-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddProjectBoardRequest } from '../models'; // @ts-ignore @@ -266,6 +266,17 @@ export const ProjectBoardsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectBoard(AddProjectBoardRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a project board + * @param {AddProjectBoardRequest} AddProjectBoardRequest + + * @throws {RequiredError} + */ + async addProjectBoardWithHttpInfo(AddProjectBoardRequest: AddProjectBoardRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectBoard(AddProjectBoardRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a project board as deleted. * @summary Delete a project board @@ -277,6 +288,17 @@ export const ProjectBoardsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectBoard(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async deleteProjectBoardWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific project board. * @summary Get details of a project board @@ -288,6 +310,17 @@ export const ProjectBoardsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a project board + * @param {number} id The ID of the project board + + * @throws {RequiredError} + */ + async getProjectsBoardWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoard(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all active project boards. * @summary Get all project boards @@ -298,6 +331,16 @@ export const ProjectBoardsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsBoards`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all project boards + + * @throws {RequiredError} + */ + async getProjectsBoardsWithHttpInfo(): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsBoards(); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a project board. * @summary Update a project board @@ -310,6 +353,18 @@ export const ProjectBoardsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectBoard(id, UpdateProjectBoardRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a project board + * @param {number} id The ID of the project board + * @param {UpdateProjectBoardRequest} [UpdateProjectBoardRequest] + + * @throws {RequiredError} + */ + async updateProjectBoardWithHttpInfo(id: number, UpdateProjectBoardRequest?: UpdateProjectBoardRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectBoard(id, UpdateProjectBoardRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -330,6 +385,9 @@ export const ProjectBoardsApiFactory = function (configuration?: Configuration, addProjectBoard(requestParameters: ProjectBoardsApiAddProjectBoardRequest, ): Promise { return localVarFp.addProjectBoard(requestParameters.AddProjectBoardRequest, ).then((request) => request(axios, basePath)); }, + addProjectBoardWithHttpInfo(requestParameters: ProjectBoardsApiAddProjectBoardRequest, ): Promise> { + return localVarFp.addProjectBoardWithHttpInfo(requestParameters.AddProjectBoardRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a project board as deleted. * @summary Delete a project board @@ -340,6 +398,9 @@ export const ProjectBoardsApiFactory = function (configuration?: Configuration, deleteProjectBoard(requestParameters: ProjectBoardsApiDeleteProjectBoardRequest, ): Promise { return localVarFp.deleteProjectBoard(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProjectBoardWithHttpInfo(requestParameters: ProjectBoardsApiDeleteProjectBoardRequest, ): Promise> { + return localVarFp.deleteProjectBoardWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific project board. * @summary Get details of a project board @@ -350,6 +411,9 @@ export const ProjectBoardsApiFactory = function (configuration?: Configuration, getProjectsBoard(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ): Promise { return localVarFp.getProjectsBoard(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectsBoardWithHttpInfo(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ): Promise> { + return localVarFp.getProjectsBoardWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all active project boards. * @summary Get all project boards @@ -359,6 +423,9 @@ export const ProjectBoardsApiFactory = function (configuration?: Configuration, getProjectsBoards(): Promise { return localVarFp.getProjectsBoards().then((request) => request(axios, basePath)); }, + getProjectsBoardsWithHttpInfo(): Promise> { + return localVarFp.getProjectsBoardsWithHttpInfo().then((request) => request(axios, basePath)); + }, /** * Updates the properties of a project board. * @summary Update a project board @@ -369,6 +436,9 @@ export const ProjectBoardsApiFactory = function (configuration?: Configuration, updateProjectBoard(requestParameters: ProjectBoardsApiUpdateProjectBoardRequest, ): Promise { return localVarFp.updateProjectBoard(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(axios, basePath)); }, + updateProjectBoardWithHttpInfo(requestParameters: ProjectBoardsApiUpdateProjectBoardRequest, ): Promise> { + return localVarFp.updateProjectBoardWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -454,6 +524,18 @@ export class ProjectBoardsApi extends BaseAPI { return ProjectBoardsApiFp(this.configuration).addProjectBoard(requestParameters.AddProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectBoardsApiAddProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public addProjectBoardWithHttpInfo(requestParameters: ProjectBoardsApiAddProjectBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).addProjectBoardWithHttpInfo(requestParameters.AddProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a project board as deleted. * @summary Delete a project board @@ -466,6 +548,18 @@ export class ProjectBoardsApi extends BaseAPI { return ProjectBoardsApiFp(this.configuration).deleteProjectBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectBoardsApiDeleteProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public deleteProjectBoardWithHttpInfo(requestParameters: ProjectBoardsApiDeleteProjectBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).deleteProjectBoardWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific project board. * @summary Get details of a project board @@ -478,6 +572,18 @@ export class ProjectBoardsApi extends BaseAPI { return ProjectBoardsApiFp(this.configuration).getProjectsBoard(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectBoardsApiGetProjectsBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public getProjectsBoardWithHttpInfo(requestParameters: ProjectBoardsApiGetProjectsBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).getProjectsBoardWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all active project boards. * @summary Get all project boards @@ -489,6 +595,17 @@ export class ProjectBoardsApi extends BaseAPI { return ProjectBoardsApiFp(this.configuration).getProjectsBoards().then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsBoards`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public getProjectsBoardsWithHttpInfo() { + return ProjectBoardsApiFp(this.configuration).getProjectsBoardsWithHttpInfo().then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a project board. * @summary Update a project board @@ -500,4 +617,16 @@ export class ProjectBoardsApi extends BaseAPI { public updateProjectBoard(requestParameters: ProjectBoardsApiUpdateProjectBoardRequest, ) { return ProjectBoardsApiFp(this.configuration).updateProjectBoard(requestParameters.id, requestParameters.UpdateProjectBoardRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateProjectBoard`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectBoardsApiUpdateProjectBoardRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectBoardsApi + */ + public updateProjectBoardWithHttpInfo(requestParameters: ProjectBoardsApiUpdateProjectBoardRequest, ) { + return ProjectBoardsApiFp(this.configuration).updateProjectBoardWithHttpInfo(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 index bcbbe7d9..4e4d64b1 100644 --- a/src/versions/v2/api/project-fields-api.ts +++ b/src/versions/v2/api/project-fields-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddDealFieldOptions200Response } from '../models'; // @ts-ignore @@ -427,6 +427,17 @@ export const ProjectFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectField(AddProjectFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProjectField`, but resolves with the response body together with the HTTP status and headers. + * @summary Create one project field + * @param {AddProjectFieldRequest} AddProjectFieldRequest + + * @throws {RequiredError} + */ + async addProjectFieldWithHttpInfo(AddProjectFieldRequest: AddProjectFieldRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectField(AddProjectFieldRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -439,6 +450,18 @@ export const ProjectFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectFieldOptions(field_code, AddDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Add project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} AddDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async addProjectFieldOptionsWithHttpInfo(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, true); + }, /** * Marks a custom field as deleted. * @summary Delete one project field @@ -450,6 +473,17 @@ export const ProjectFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectField(field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProjectField`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async deleteProjectFieldWithHttpInfo(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -462,6 +496,18 @@ export const ProjectFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectFieldOptions(field_code, DeleteDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} DeleteDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async deleteProjectFieldOptionsWithHttpInfo(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, true); + }, /** * Returns metadata about a specific project field. * @summary Get one project field @@ -473,6 +519,17 @@ export const ProjectFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectField(field_code, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectField`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one project field + * @param {string} field_code The unique code identifying the field + + * @throws {RequiredError} + */ + async getProjectFieldWithHttpInfo(field_code: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectField(field_code, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns metadata about all project fields in the company. * @summary Get all project fields @@ -485,6 +542,18 @@ export const ProjectFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectFields(limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectFields`, but resolves with the response body together with the HTTP status and headers. + * @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 getProjectFieldsWithHttpInfo(limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectFields(limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -497,6 +566,18 @@ export const ProjectFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectField(field_code, UpdateProjectFieldRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProjectField`, but resolves with the response body together with the HTTP status and headers. + * @summary Update one project field + * @param {string} field_code The unique code identifying the field + * @param {UpdateProjectFieldRequest} UpdateProjectFieldRequest + + * @throws {RequiredError} + */ + async updateProjectFieldWithHttpInfo(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, true); + }, /** * 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 @@ -509,6 +590,18 @@ export const ProjectFieldsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectFieldOptions(field_code, UpdateDealFieldOptionsRequestInner, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * @summary Update project field options in bulk + * @param {string} field_code The unique code identifying the field + * @param {Array} UpdateDealFieldOptionsRequestInner + + * @throws {RequiredError} + */ + async updateProjectFieldOptionsWithHttpInfo(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, true); + }, } }; @@ -529,6 +622,9 @@ export const ProjectFieldsApiFactory = function (configuration?: Configuration, addProjectField(requestParameters: ProjectFieldsApiAddProjectFieldRequest, ): Promise { return localVarFp.addProjectField(requestParameters.AddProjectFieldRequest, ).then((request) => request(axios, basePath)); }, + addProjectFieldWithHttpInfo(requestParameters: ProjectFieldsApiAddProjectFieldRequest, ): Promise> { + return localVarFp.addProjectFieldWithHttpInfo(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 @@ -539,6 +635,9 @@ export const ProjectFieldsApiFactory = function (configuration?: Configuration, addProjectFieldOptions(requestParameters: ProjectFieldsApiAddProjectFieldOptionsRequest, ): Promise { return localVarFp.addProjectFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + addProjectFieldOptionsWithHttpInfo(requestParameters: ProjectFieldsApiAddProjectFieldOptionsRequest, ): Promise> { + return localVarFp.addProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Marks a custom field as deleted. * @summary Delete one project field @@ -549,6 +648,9 @@ export const ProjectFieldsApiFactory = function (configuration?: Configuration, deleteProjectField(requestParameters: ProjectFieldsApiDeleteProjectFieldRequest, ): Promise { return localVarFp.deleteProjectField(requestParameters.field_code, ).then((request) => request(axios, basePath)); }, + deleteProjectFieldWithHttpInfo(requestParameters: ProjectFieldsApiDeleteProjectFieldRequest, ): Promise> { + return localVarFp.deleteProjectFieldWithHttpInfo(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 @@ -559,6 +661,9 @@ export const ProjectFieldsApiFactory = function (configuration?: Configuration, deleteProjectFieldOptions(requestParameters: ProjectFieldsApiDeleteProjectFieldOptionsRequest, ): Promise { return localVarFp.deleteProjectFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + deleteProjectFieldOptionsWithHttpInfo(requestParameters: ProjectFieldsApiDeleteProjectFieldOptionsRequest, ): Promise> { + return localVarFp.deleteProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about a specific project field. * @summary Get one project field @@ -569,6 +674,9 @@ export const ProjectFieldsApiFactory = function (configuration?: Configuration, getProjectField(requestParameters: ProjectFieldsApiGetProjectFieldRequest, ): Promise { return localVarFp.getProjectField(requestParameters.field_code, ).then((request) => request(axios, basePath)); }, + getProjectFieldWithHttpInfo(requestParameters: ProjectFieldsApiGetProjectFieldRequest, ): Promise> { + return localVarFp.getProjectFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(axios, basePath)); + }, /** * Returns metadata about all project fields in the company. * @summary Get all project fields @@ -579,6 +687,9 @@ export const ProjectFieldsApiFactory = function (configuration?: Configuration, getProjectFields(requestParameters: ProjectFieldsApiGetProjectFieldsRequest = {}, ): Promise { return localVarFp.getProjectFields(requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getProjectFieldsWithHttpInfo(requestParameters: ProjectFieldsApiGetProjectFieldsRequest = {}, ): Promise> { + return localVarFp.getProjectFieldsWithHttpInfo(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 @@ -589,6 +700,9 @@ export const ProjectFieldsApiFactory = function (configuration?: Configuration, updateProjectField(requestParameters: ProjectFieldsApiUpdateProjectFieldRequest, ): Promise { return localVarFp.updateProjectField(requestParameters.field_code, requestParameters.UpdateProjectFieldRequest, ).then((request) => request(axios, basePath)); }, + updateProjectFieldWithHttpInfo(requestParameters: ProjectFieldsApiUpdateProjectFieldRequest, ): Promise> { + return localVarFp.updateProjectFieldWithHttpInfo(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 @@ -599,6 +713,9 @@ export const ProjectFieldsApiFactory = function (configuration?: Configuration, updateProjectFieldOptions(requestParameters: ProjectFieldsApiUpdateProjectFieldOptionsRequest, ): Promise { return localVarFp.updateProjectFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); }, + updateProjectFieldOptionsWithHttpInfo(requestParameters: ProjectFieldsApiUpdateProjectFieldOptionsRequest, ): Promise> { + return localVarFp.updateProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(axios, basePath)); + }, }; }; @@ -768,6 +885,18 @@ export class ProjectFieldsApi extends BaseAPI { return ProjectFieldsApiFp(this.configuration).addProjectField(requestParameters.AddProjectFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProjectField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectFieldsApiAddProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public addProjectFieldWithHttpInfo(requestParameters: ProjectFieldsApiAddProjectFieldRequest, ) { + return ProjectFieldsApiFp(this.configuration).addProjectFieldWithHttpInfo(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 @@ -780,6 +909,18 @@ export class ProjectFieldsApi extends BaseAPI { return ProjectFieldsApiFp(this.configuration).addProjectFieldOptions(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectFieldsApiAddProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public addProjectFieldOptionsWithHttpInfo(requestParameters: ProjectFieldsApiAddProjectFieldOptionsRequest, ) { + return ProjectFieldsApiFp(this.configuration).addProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.AddDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a custom field as deleted. * @summary Delete one project field @@ -792,6 +933,18 @@ export class ProjectFieldsApi extends BaseAPI { return ProjectFieldsApiFp(this.configuration).deleteProjectField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProjectField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectFieldsApiDeleteProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public deleteProjectFieldWithHttpInfo(requestParameters: ProjectFieldsApiDeleteProjectFieldRequest, ) { + return ProjectFieldsApiFp(this.configuration).deleteProjectFieldWithHttpInfo(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 @@ -804,6 +957,18 @@ export class ProjectFieldsApi extends BaseAPI { return ProjectFieldsApiFp(this.configuration).deleteProjectFieldOptions(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectFieldsApiDeleteProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public deleteProjectFieldOptionsWithHttpInfo(requestParameters: ProjectFieldsApiDeleteProjectFieldOptionsRequest, ) { + return ProjectFieldsApiFp(this.configuration).deleteProjectFieldOptionsWithHttpInfo(requestParameters.field_code, requestParameters.DeleteDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about a specific project field. * @summary Get one project field @@ -816,6 +981,18 @@ export class ProjectFieldsApi extends BaseAPI { return ProjectFieldsApiFp(this.configuration).getProjectField(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectFieldsApiGetProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public getProjectFieldWithHttpInfo(requestParameters: ProjectFieldsApiGetProjectFieldRequest, ) { + return ProjectFieldsApiFp(this.configuration).getProjectFieldWithHttpInfo(requestParameters.field_code, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns metadata about all project fields in the company. * @summary Get all project fields @@ -828,6 +1005,18 @@ export class ProjectFieldsApi extends BaseAPI { return ProjectFieldsApiFp(this.configuration).getProjectFields(requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectFields`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectFieldsApiGetProjectFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public getProjectFieldsWithHttpInfo(requestParameters: ProjectFieldsApiGetProjectFieldsRequest = {}, ) { + return ProjectFieldsApiFp(this.configuration).getProjectFieldsWithHttpInfo(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 @@ -840,6 +1029,18 @@ export class ProjectFieldsApi extends BaseAPI { return ProjectFieldsApiFp(this.configuration).updateProjectField(requestParameters.field_code, requestParameters.UpdateProjectFieldRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `updateProjectField`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectFieldsApiUpdateProjectFieldRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public updateProjectFieldWithHttpInfo(requestParameters: ProjectFieldsApiUpdateProjectFieldRequest, ) { + return ProjectFieldsApiFp(this.configuration).updateProjectFieldWithHttpInfo(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 @@ -851,4 +1052,16 @@ export class ProjectFieldsApi extends BaseAPI { public updateProjectFieldOptions(requestParameters: ProjectFieldsApiUpdateProjectFieldOptionsRequest, ) { return ProjectFieldsApiFp(this.configuration).updateProjectFieldOptions(requestParameters.field_code, requestParameters.UpdateDealFieldOptionsRequestInner, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateProjectFieldOptions`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectFieldsApiUpdateProjectFieldOptionsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectFieldsApi + */ + public updateProjectFieldOptionsWithHttpInfo(requestParameters: ProjectFieldsApiUpdateProjectFieldOptionsRequest, ) { + return ProjectFieldsApiFp(this.configuration).updateProjectFieldOptionsWithHttpInfo(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 index 79546a51..c7b7fa36 100644 --- a/src/versions/v2/api/project-phases-api.ts +++ b/src/versions/v2/api/project-phases-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddProjectPhaseRequest } from '../models'; // @ts-ignore @@ -273,6 +273,17 @@ export const ProjectPhasesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectPhase(AddProjectPhaseRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a project phase + * @param {AddProjectPhaseRequest} AddProjectPhaseRequest + + * @throws {RequiredError} + */ + async addProjectPhaseWithHttpInfo(AddProjectPhaseRequest: AddProjectPhaseRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProjectPhase(AddProjectPhaseRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a project phase as deleted. * @summary Delete a project phase @@ -284,6 +295,17 @@ export const ProjectPhasesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectPhase(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async deleteProjectPhaseWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProjectPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific project phase. * @summary Get details of a project phase @@ -295,6 +317,17 @@ export const ProjectPhasesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a project phase + * @param {number} id The ID of the project phase + + * @throws {RequiredError} + */ + async getProjectsPhaseWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhase(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -306,6 +339,17 @@ export const ProjectPhasesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectsPhases`, but resolves with the response body together with the HTTP status and headers. + * @summary Get project phases + * @param {number} board_id The ID of the board for which phases are requested + + * @throws {RequiredError} + */ + async getProjectsPhasesWithHttpInfo(board_id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectsPhases(board_id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a project phase. * @summary Update a project phase @@ -318,6 +362,18 @@ export const ProjectPhasesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectPhase(id, UpdateProjectPhaseRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a project phase + * @param {number} id The ID of the project phase + * @param {UpdateProjectPhaseRequest} [UpdateProjectPhaseRequest] + + * @throws {RequiredError} + */ + async updateProjectPhaseWithHttpInfo(id: number, UpdateProjectPhaseRequest?: UpdateProjectPhaseRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProjectPhase(id, UpdateProjectPhaseRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -338,6 +394,9 @@ export const ProjectPhasesApiFactory = function (configuration?: Configuration, addProjectPhase(requestParameters: ProjectPhasesApiAddProjectPhaseRequest, ): Promise { return localVarFp.addProjectPhase(requestParameters.AddProjectPhaseRequest, ).then((request) => request(axios, basePath)); }, + addProjectPhaseWithHttpInfo(requestParameters: ProjectPhasesApiAddProjectPhaseRequest, ): Promise> { + return localVarFp.addProjectPhaseWithHttpInfo(requestParameters.AddProjectPhaseRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a project phase as deleted. * @summary Delete a project phase @@ -348,6 +407,9 @@ export const ProjectPhasesApiFactory = function (configuration?: Configuration, deleteProjectPhase(requestParameters: ProjectPhasesApiDeleteProjectPhaseRequest, ): Promise { return localVarFp.deleteProjectPhase(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProjectPhaseWithHttpInfo(requestParameters: ProjectPhasesApiDeleteProjectPhaseRequest, ): Promise> { + return localVarFp.deleteProjectPhaseWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific project phase. * @summary Get details of a project phase @@ -358,6 +420,9 @@ export const ProjectPhasesApiFactory = function (configuration?: Configuration, getProjectsPhase(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ): Promise { return localVarFp.getProjectsPhase(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectsPhaseWithHttpInfo(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ): Promise> { + return localVarFp.getProjectsPhaseWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -368,6 +433,9 @@ export const ProjectPhasesApiFactory = function (configuration?: Configuration, getProjectsPhases(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ): Promise { return localVarFp.getProjectsPhases(requestParameters.board_id, ).then((request) => request(axios, basePath)); }, + getProjectsPhasesWithHttpInfo(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ): Promise> { + return localVarFp.getProjectsPhasesWithHttpInfo(requestParameters.board_id, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a project phase. * @summary Update a project phase @@ -378,6 +446,9 @@ export const ProjectPhasesApiFactory = function (configuration?: Configuration, updateProjectPhase(requestParameters: ProjectPhasesApiUpdateProjectPhaseRequest, ): Promise { return localVarFp.updateProjectPhase(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(axios, basePath)); }, + updateProjectPhaseWithHttpInfo(requestParameters: ProjectPhasesApiUpdateProjectPhaseRequest, ): Promise> { + return localVarFp.updateProjectPhaseWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -477,6 +548,18 @@ export class ProjectPhasesApi extends BaseAPI { return ProjectPhasesApiFp(this.configuration).addProjectPhase(requestParameters.AddProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectPhasesApiAddProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public addProjectPhaseWithHttpInfo(requestParameters: ProjectPhasesApiAddProjectPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).addProjectPhaseWithHttpInfo(requestParameters.AddProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a project phase as deleted. * @summary Delete a project phase @@ -489,6 +572,18 @@ export class ProjectPhasesApi extends BaseAPI { return ProjectPhasesApiFp(this.configuration).deleteProjectPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectPhasesApiDeleteProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public deleteProjectPhaseWithHttpInfo(requestParameters: ProjectPhasesApiDeleteProjectPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).deleteProjectPhaseWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific project phase. * @summary Get details of a project phase @@ -501,6 +596,18 @@ export class ProjectPhasesApi extends BaseAPI { return ProjectPhasesApiFp(this.configuration).getProjectsPhase(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectPhasesApiGetProjectsPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public getProjectsPhaseWithHttpInfo(requestParameters: ProjectPhasesApiGetProjectsPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).getProjectsPhaseWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all active project phases under a specific board. * @summary Get project phases @@ -513,6 +620,18 @@ export class ProjectPhasesApi extends BaseAPI { return ProjectPhasesApiFp(this.configuration).getProjectsPhases(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectsPhases`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectPhasesApiGetProjectsPhasesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public getProjectsPhasesWithHttpInfo(requestParameters: ProjectPhasesApiGetProjectsPhasesRequest, ) { + return ProjectPhasesApiFp(this.configuration).getProjectsPhasesWithHttpInfo(requestParameters.board_id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a project phase. * @summary Update a project phase @@ -524,4 +643,16 @@ export class ProjectPhasesApi extends BaseAPI { public updateProjectPhase(requestParameters: ProjectPhasesApiUpdateProjectPhaseRequest, ) { return ProjectPhasesApiFp(this.configuration).updateProjectPhase(requestParameters.id, requestParameters.UpdateProjectPhaseRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateProjectPhase`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectPhasesApiUpdateProjectPhaseRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectPhasesApi + */ + public updateProjectPhaseWithHttpInfo(requestParameters: ProjectPhasesApiUpdateProjectPhaseRequest, ) { + return ProjectPhasesApiFp(this.configuration).updateProjectPhaseWithHttpInfo(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 index a4091a10..a8351fe4 100644 --- a/src/versions/v2/api/project-templates-api.ts +++ b/src/versions/v2/api/project-templates-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetProjectTemplateResponse } from '../models'; // @ts-ignore @@ -141,6 +141,17 @@ export const ProjectTemplatesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplate(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectTemplate`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a template + * @param {number} id The ID of the project template + + * @throws {RequiredError} + */ + async getProjectTemplateWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplate(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all not deleted project templates. * @summary Get all project templates @@ -153,6 +164,18 @@ export const ProjectTemplatesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplates(cursor, limit, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectTemplates`, but resolves with the response body together with the HTTP status and headers. + * @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 getProjectTemplatesWithHttpInfo(cursor?: string, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectTemplates(cursor, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -173,6 +196,9 @@ export const ProjectTemplatesApiFactory = function (configuration?: Configuratio getProjectTemplate(requestParameters: ProjectTemplatesApiGetProjectTemplateRequest, ): Promise { return localVarFp.getProjectTemplate(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectTemplateWithHttpInfo(requestParameters: ProjectTemplatesApiGetProjectTemplateRequest, ): Promise> { + return localVarFp.getProjectTemplateWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all not deleted project templates. * @summary Get all project templates @@ -183,6 +209,9 @@ export const ProjectTemplatesApiFactory = function (configuration?: Configuratio getProjectTemplates(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ): Promise { return localVarFp.getProjectTemplates(requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); }, + getProjectTemplatesWithHttpInfo(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ): Promise> { + return localVarFp.getProjectTemplatesWithHttpInfo(requestParameters.cursor, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, }; }; @@ -240,6 +269,18 @@ export class ProjectTemplatesApi extends BaseAPI { return ProjectTemplatesApiFp(this.configuration).getProjectTemplate(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectTemplate`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectTemplatesApiGetProjectTemplateRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectTemplatesApi + */ + public getProjectTemplateWithHttpInfo(requestParameters: ProjectTemplatesApiGetProjectTemplateRequest, ) { + return ProjectTemplatesApiFp(this.configuration).getProjectTemplateWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all not deleted project templates. * @summary Get all project templates @@ -251,4 +292,16 @@ 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)); } + + /** + * Same as `getProjectTemplates`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectTemplatesApiGetProjectTemplatesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectTemplatesApi + */ + public getProjectTemplatesWithHttpInfo(requestParameters: ProjectTemplatesApiGetProjectTemplatesRequest = {}, ) { + return ProjectTemplatesApiFp(this.configuration).getProjectTemplatesWithHttpInfo(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 index 4aee0b56..536f8e8f 100644 --- a/src/versions/v2/api/projects-api.ts +++ b/src/versions/v2/api/projects-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddProjectRequest } from '../models'; // @ts-ignore @@ -581,6 +581,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addProject(AddProjectRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a project + * @param {AddProjectRequest} AddProjectRequest + + * @throws {RequiredError} + */ + async addProjectWithHttpInfo(AddProjectRequest: AddProjectRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addProject(AddProjectRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Archives a project. * @summary Archive a project @@ -592,6 +603,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.archiveProject(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `archiveProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Archive a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async archiveProjectWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.archiveProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a project as deleted. * @summary Delete a project @@ -603,6 +625,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProject(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async deleteProjectWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all archived projects. * @summary Get all archived projects @@ -618,6 +651,21 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getArchivedProjects(filter_id, status, phase_id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getArchivedProjects`, but resolves with the response body together with the HTTP status and headers. + * @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 getArchivedProjectsWithHttpInfo(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, true); + }, /** * Returns the details of a specific project. Custom fields appear as keys inside the `custom_fields` object. * @summary Get details of a project @@ -629,6 +677,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProject(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a project + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProjectWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProject(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Lists updates about field values of a project. * @summary List updates about project field values @@ -642,6 +701,19 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectChangelog(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectChangelog`, but resolves with the response body together with the HTTP status and headers. + * @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 getProjectChangelogWithHttpInfo(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, true); + }, /** * Lists the users permitted to access a project. * @summary List permitted users @@ -653,6 +725,17 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectUsers(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjectUsers`, but resolves with the response body together with the HTTP status and headers. + * @summary List permitted users + * @param {number} id The ID of the project + + * @throws {RequiredError} + */ + async getProjectUsersWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectUsers(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all non-archived projects. * @summary Get all projects @@ -671,6 +754,24 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getProjects(filter_id, status, phase_id, deal_id, person_id, org_id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getProjects`, but resolves with the response body together with the HTTP status and headers. + * @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} [deal_id] If supplied, only projects associated with the specified deal are returned + * @param {number} [person_id] If supplied, only projects associated with the specified person are returned + * @param {number} [org_id] If supplied, only projects associated with the specified organization 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 getProjectsWithHttpInfo(filter_id?: number, status?: string, phase_id?: number, deal_id?: number, person_id?: number, org_id?: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getProjects(filter_id, status, phase_id, deal_id, person_id, org_id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * 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 @@ -688,6 +789,23 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchProjects(term, fields, exact_match, person_id, organization_id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `searchProjects`, but resolves with the response body together with the HTTP status and headers. + * @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 {Set<'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 100 is allowed. + * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page + + * @throws {RequiredError} + */ + async searchProjectsWithHttpInfo(term: string, fields?: Set<'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, true); + }, /** * Updates the properties of a project. * @summary Update a project @@ -700,6 +818,18 @@ export const ProjectsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProject(id, UpdateProjectRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateProject`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a project + * @param {number} id The ID of the project + * @param {UpdateProjectRequest} [UpdateProjectRequest] + + * @throws {RequiredError} + */ + async updateProjectWithHttpInfo(id: number, UpdateProjectRequest?: UpdateProjectRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateProject(id, UpdateProjectRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -720,6 +850,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP addProject(requestParameters: ProjectsApiAddProjectRequest, ): Promise { return localVarFp.addProject(requestParameters.AddProjectRequest, ).then((request) => request(axios, basePath)); }, + addProjectWithHttpInfo(requestParameters: ProjectsApiAddProjectRequest, ): Promise> { + return localVarFp.addProjectWithHttpInfo(requestParameters.AddProjectRequest, ).then((request) => request(axios, basePath)); + }, /** * Archives a project. * @summary Archive a project @@ -730,6 +863,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP archiveProject(requestParameters: ProjectsApiArchiveProjectRequest, ): Promise { return localVarFp.archiveProject(requestParameters.id, ).then((request) => request(axios, basePath)); }, + archiveProjectWithHttpInfo(requestParameters: ProjectsApiArchiveProjectRequest, ): Promise> { + return localVarFp.archiveProjectWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Marks a project as deleted. * @summary Delete a project @@ -740,6 +876,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP deleteProject(requestParameters: ProjectsApiDeleteProjectRequest, ): Promise { return localVarFp.deleteProject(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteProjectWithHttpInfo(requestParameters: ProjectsApiDeleteProjectRequest, ): Promise> { + return localVarFp.deleteProjectWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all archived projects. * @summary Get all archived projects @@ -750,6 +889,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getArchivedProjects(requestParameters: ProjectsApiGetArchivedProjectsRequest = {}, ): Promise { return localVarFp.getArchivedProjects(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getArchivedProjectsWithHttpInfo(requestParameters: ProjectsApiGetArchivedProjectsRequest = {}, ): Promise> { + return localVarFp.getArchivedProjectsWithHttpInfo(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 @@ -760,6 +902,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProject(requestParameters: ProjectsApiGetProjectRequest, ): Promise { return localVarFp.getProject(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectWithHttpInfo(requestParameters: ProjectsApiGetProjectRequest, ): Promise> { + return localVarFp.getProjectWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Lists updates about field values of a project. * @summary List updates about project field values @@ -770,6 +915,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProjectChangelog(requestParameters: ProjectsApiGetProjectChangelogRequest, ): Promise { return localVarFp.getProjectChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getProjectChangelogWithHttpInfo(requestParameters: ProjectsApiGetProjectChangelogRequest, ): Promise> { + return localVarFp.getProjectChangelogWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Lists the users permitted to access a project. * @summary List permitted users @@ -780,6 +928,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProjectUsers(requestParameters: ProjectsApiGetProjectUsersRequest, ): Promise { return localVarFp.getProjectUsers(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getProjectUsersWithHttpInfo(requestParameters: ProjectsApiGetProjectUsersRequest, ): Promise> { + return localVarFp.getProjectUsersWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all non-archived projects. * @summary Get all projects @@ -790,6 +941,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP getProjects(requestParameters: ProjectsApiGetProjectsRequest = {}, ): Promise { return localVarFp.getProjects(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getProjectsWithHttpInfo(requestParameters: ProjectsApiGetProjectsRequest = {}, ): Promise> { + return localVarFp.getProjectsWithHttpInfo(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_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 @@ -800,6 +954,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP 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)); }, + searchProjectsWithHttpInfo(requestParameters: ProjectsApiSearchProjectsRequest, ): Promise> { + return localVarFp.searchProjectsWithHttpInfo(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 @@ -810,6 +967,9 @@ export const ProjectsApiFactory = function (configuration?: Configuration, baseP updateProject(requestParameters: ProjectsApiUpdateProjectRequest, ): Promise { return localVarFp.updateProject(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(axios, basePath)); }, + updateProjectWithHttpInfo(requestParameters: ProjectsApiUpdateProjectRequest, ): Promise> { + return localVarFp.updateProjectWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -1112,6 +1272,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).addProject(requestParameters.AddProjectRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiAddProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public addProjectWithHttpInfo(requestParameters: ProjectsApiAddProjectRequest, ) { + return ProjectsApiFp(this.configuration).addProjectWithHttpInfo(requestParameters.AddProjectRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Archives a project. * @summary Archive a project @@ -1124,6 +1296,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).archiveProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `archiveProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiArchiveProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public archiveProjectWithHttpInfo(requestParameters: ProjectsApiArchiveProjectRequest, ) { + return ProjectsApiFp(this.configuration).archiveProjectWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a project as deleted. * @summary Delete a project @@ -1136,6 +1320,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).deleteProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiDeleteProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public deleteProjectWithHttpInfo(requestParameters: ProjectsApiDeleteProjectRequest, ) { + return ProjectsApiFp(this.configuration).deleteProjectWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all archived projects. * @summary Get all archived projects @@ -1148,6 +1344,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getArchivedProjects(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getArchivedProjects`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetArchivedProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getArchivedProjectsWithHttpInfo(requestParameters: ProjectsApiGetArchivedProjectsRequest = {}, ) { + return ProjectsApiFp(this.configuration).getArchivedProjectsWithHttpInfo(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 @@ -1160,6 +1368,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProject(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectWithHttpInfo(requestParameters: ProjectsApiGetProjectRequest, ) { + return ProjectsApiFp(this.configuration).getProjectWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Lists updates about field values of a project. * @summary List updates about project field values @@ -1172,6 +1392,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProjectChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectChangelog`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectChangelogRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectChangelogWithHttpInfo(requestParameters: ProjectsApiGetProjectChangelogRequest, ) { + return ProjectsApiFp(this.configuration).getProjectChangelogWithHttpInfo(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 @@ -1184,6 +1416,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProjectUsers(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjectUsers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectUsersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectUsersWithHttpInfo(requestParameters: ProjectsApiGetProjectUsersRequest, ) { + return ProjectsApiFp(this.configuration).getProjectUsersWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all non-archived projects. * @summary Get all projects @@ -1196,6 +1440,18 @@ export class ProjectsApi extends BaseAPI { return ProjectsApiFp(this.configuration).getProjects(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getProjects`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiGetProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public getProjectsWithHttpInfo(requestParameters: ProjectsApiGetProjectsRequest = {}, ) { + return ProjectsApiFp(this.configuration).getProjectsWithHttpInfo(requestParameters.filter_id, requestParameters.status, requestParameters.phase_id, requestParameters.deal_id, requestParameters.person_id, requestParameters.org_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 @@ -1208,6 +1464,18 @@ export class ProjectsApi extends BaseAPI { 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)); } + /** + * Same as `searchProjects`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiSearchProjectsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public searchProjectsWithHttpInfo(requestParameters: ProjectsApiSearchProjectsRequest, ) { + return ProjectsApiFp(this.configuration).searchProjectsWithHttpInfo(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 @@ -1219,4 +1487,16 @@ export class ProjectsApi extends BaseAPI { public updateProject(requestParameters: ProjectsApiUpdateProjectRequest, ) { return ProjectsApiFp(this.configuration).updateProject(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateProject`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {ProjectsApiUpdateProjectRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof ProjectsApi + */ + public updateProjectWithHttpInfo(requestParameters: ProjectsApiUpdateProjectRequest, ) { + return ProjectsApiFp(this.configuration).updateProjectWithHttpInfo(requestParameters.id, requestParameters.UpdateProjectRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/stages-api.ts b/src/versions/v2/api/stages-api.ts index 58f0695a..7bdf6ea3 100644 --- a/src/versions/v2/api/stages-api.ts +++ b/src/versions/v2/api/stages-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddStageRequest } from '../models'; // @ts-ignore @@ -289,6 +289,17 @@ export const StagesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addStage(AddStageRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addStage`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a new stage + * @param {AddStageRequest} [AddStageRequest] + + * @throws {RequiredError} + */ + async addStageWithHttpInfo(AddStageRequest?: AddStageRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addStage(AddStageRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a stage as deleted. * @summary Delete a stage @@ -300,6 +311,17 @@ export const StagesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteStage(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteStage`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a stage + * @param {number} id The ID of the stage + + * @throws {RequiredError} + */ + async deleteStageWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteStage(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about a specific stage. * @summary Get one stage @@ -311,6 +333,17 @@ export const StagesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getStage(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getStage`, but resolves with the response body together with the HTTP status and headers. + * @summary Get one stage + * @param {number} id The ID of the stage + + * @throws {RequiredError} + */ + async getStageWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getStage(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns data about all stages. * @summary Get all stages @@ -326,6 +359,21 @@ export const StagesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getStages(pipeline_id, sort_by, sort_direction, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getStages`, but resolves with the response body together with the HTTP status and headers. + * @summary Get all stages + * @param {number} [pipeline_id] The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. + * @param {'id' | 'update_time' | 'add_time' | 'order_nr'} [sort_by] The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `order_nr`. + * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: `asc`, `desc`. + * @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 getStagesWithHttpInfo(pipeline_id?: number, sort_by?: 'id' | 'update_time' | 'add_time' | 'order_nr', sort_direction?: 'asc' | 'desc', limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getStages(pipeline_id, sort_by, sort_direction, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Updates the properties of a stage. * @summary Update stage details @@ -338,6 +386,18 @@ export const StagesApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateStage(id, UpdateStageRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateStage`, but resolves with the response body together with the HTTP status and headers. + * @summary Update stage details + * @param {number} id The ID of the stage + * @param {UpdateStageRequest} [UpdateStageRequest] + + * @throws {RequiredError} + */ + async updateStageWithHttpInfo(id: number, UpdateStageRequest?: UpdateStageRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateStage(id, UpdateStageRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -358,6 +418,9 @@ export const StagesApiFactory = function (configuration?: Configuration, basePat addStage(requestParameters: StagesApiAddStageRequest = {}, ): Promise { return localVarFp.addStage(requestParameters.AddStageRequest, ).then((request) => request(axios, basePath)); }, + addStageWithHttpInfo(requestParameters: StagesApiAddStageRequest = {}, ): Promise> { + return localVarFp.addStageWithHttpInfo(requestParameters.AddStageRequest, ).then((request) => request(axios, basePath)); + }, /** * Marks a stage as deleted. * @summary Delete a stage @@ -368,6 +431,9 @@ export const StagesApiFactory = function (configuration?: Configuration, basePat deleteStage(requestParameters: StagesApiDeleteStageRequest, ): Promise { return localVarFp.deleteStage(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteStageWithHttpInfo(requestParameters: StagesApiDeleteStageRequest, ): Promise> { + return localVarFp.deleteStageWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about a specific stage. * @summary Get one stage @@ -378,6 +444,9 @@ export const StagesApiFactory = function (configuration?: Configuration, basePat getStage(requestParameters: StagesApiGetStageRequest, ): Promise { return localVarFp.getStage(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getStageWithHttpInfo(requestParameters: StagesApiGetStageRequest, ): Promise> { + return localVarFp.getStageWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all stages. * @summary Get all stages @@ -388,6 +457,9 @@ export const StagesApiFactory = function (configuration?: Configuration, basePat getStages(requestParameters: StagesApiGetStagesRequest = {}, ): Promise { return localVarFp.getStages(requestParameters.pipeline_id, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getStagesWithHttpInfo(requestParameters: StagesApiGetStagesRequest = {}, ): Promise> { + return localVarFp.getStagesWithHttpInfo(requestParameters.pipeline_id, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, /** * Updates the properties of a stage. * @summary Update stage details @@ -398,6 +470,9 @@ export const StagesApiFactory = function (configuration?: Configuration, basePat updateStage(requestParameters: StagesApiUpdateStageRequest, ): Promise { return localVarFp.updateStage(requestParameters.id, requestParameters.UpdateStageRequest, ).then((request) => request(axios, basePath)); }, + updateStageWithHttpInfo(requestParameters: StagesApiUpdateStageRequest, ): Promise> { + return localVarFp.updateStageWithHttpInfo(requestParameters.id, requestParameters.UpdateStageRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -525,6 +600,18 @@ export class StagesApi extends BaseAPI { return StagesApiFp(this.configuration).addStage(requestParameters.AddStageRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addStage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {StagesApiAddStageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof StagesApi + */ + public addStageWithHttpInfo(requestParameters: StagesApiAddStageRequest = {}, ) { + return StagesApiFp(this.configuration).addStageWithHttpInfo(requestParameters.AddStageRequest, ).then((request) => request(this.axios, this.basePath)); + } + /** * Marks a stage as deleted. * @summary Delete a stage @@ -537,6 +624,18 @@ export class StagesApi extends BaseAPI { return StagesApiFp(this.configuration).deleteStage(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteStage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {StagesApiDeleteStageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof StagesApi + */ + public deleteStageWithHttpInfo(requestParameters: StagesApiDeleteStageRequest, ) { + return StagesApiFp(this.configuration).deleteStageWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about a specific stage. * @summary Get one stage @@ -549,6 +648,18 @@ export class StagesApi extends BaseAPI { return StagesApiFp(this.configuration).getStage(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getStage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {StagesApiGetStageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof StagesApi + */ + public getStageWithHttpInfo(requestParameters: StagesApiGetStageRequest, ) { + return StagesApiFp(this.configuration).getStageWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all stages. * @summary Get all stages @@ -561,6 +672,18 @@ export class StagesApi extends BaseAPI { return StagesApiFp(this.configuration).getStages(requestParameters.pipeline_id, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getStages`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {StagesApiGetStagesRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof StagesApi + */ + public getStagesWithHttpInfo(requestParameters: StagesApiGetStagesRequest = {}, ) { + return StagesApiFp(this.configuration).getStagesWithHttpInfo(requestParameters.pipeline_id, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } + /** * Updates the properties of a stage. * @summary Update stage details @@ -572,4 +695,16 @@ export class StagesApi extends BaseAPI { public updateStage(requestParameters: StagesApiUpdateStageRequest, ) { return StagesApiFp(this.configuration).updateStage(requestParameters.id, requestParameters.UpdateStageRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateStage`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {StagesApiUpdateStageRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof StagesApi + */ + public updateStageWithHttpInfo(requestParameters: StagesApiUpdateStageRequest, ) { + return StagesApiFp(this.configuration).updateStageWithHttpInfo(requestParameters.id, requestParameters.UpdateStageRequest, ).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 index e1e39a22..a5e70750 100644 --- a/src/versions/v2/api/tasks-api.ts +++ b/src/versions/v2/api/tasks-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { AddTaskRequest } from '../models'; // @ts-ignore @@ -305,6 +305,17 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.addTask(AddTaskRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `addTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Add a task + * @param {AddTaskRequest} AddTaskRequest + + * @throws {RequiredError} + */ + async addTaskWithHttpInfo(AddTaskRequest: AddTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addTask(AddTaskRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Marks a task as deleted. If the task has subtasks, those will also be deleted. * @summary Delete a task @@ -316,6 +327,17 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTask(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `deleteTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Delete a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async deleteTaskWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns the details of a specific task. * @summary Get details of a task @@ -327,6 +349,17 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(id, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Get details of a task + * @param {number} id The ID of the task + + * @throws {RequiredError} + */ + async getTaskWithHttpInfo(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, /** * Returns all tasks. * @summary Get all tasks @@ -344,6 +377,23 @@ export const TasksApiFp = function(configuration?: Configuration) { 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); }, + /** + * Same as `getTasks`, but resolves with the response body together with the HTTP status and headers. + * @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 getTasksWithHttpInfo(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, true); + }, /** * Updates a task. * @summary Update a task @@ -356,6 +406,18 @@ export const TasksApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateTask(id, UpdateTaskRequest, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `updateTask`, but resolves with the response body together with the HTTP status and headers. + * @summary Update a task + * @param {number} id The ID of the task + * @param {UpdateTaskRequest} [UpdateTaskRequest] + + * @throws {RequiredError} + */ + async updateTaskWithHttpInfo(id: number, UpdateTaskRequest?: UpdateTaskRequest, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateTask(id, UpdateTaskRequest, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -376,6 +438,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath addTask(requestParameters: TasksApiAddTaskRequest, ): Promise { return localVarFp.addTask(requestParameters.AddTaskRequest, ).then((request) => request(axios, basePath)); }, + addTaskWithHttpInfo(requestParameters: TasksApiAddTaskRequest, ): Promise> { + return localVarFp.addTaskWithHttpInfo(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 @@ -386,6 +451,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath deleteTask(requestParameters: TasksApiDeleteTaskRequest, ): Promise { return localVarFp.deleteTask(requestParameters.id, ).then((request) => request(axios, basePath)); }, + deleteTaskWithHttpInfo(requestParameters: TasksApiDeleteTaskRequest, ): Promise> { + return localVarFp.deleteTaskWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns the details of a specific task. * @summary Get details of a task @@ -396,6 +464,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath getTask(requestParameters: TasksApiGetTaskRequest, ): Promise { return localVarFp.getTask(requestParameters.id, ).then((request) => request(axios, basePath)); }, + getTaskWithHttpInfo(requestParameters: TasksApiGetTaskRequest, ): Promise> { + return localVarFp.getTaskWithHttpInfo(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns all tasks. * @summary Get all tasks @@ -406,6 +477,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath 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)); }, + getTasksWithHttpInfo(requestParameters: TasksApiGetTasksRequest = {}, ): Promise> { + return localVarFp.getTasksWithHttpInfo(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 @@ -416,6 +490,9 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath updateTask(requestParameters: TasksApiUpdateTaskRequest, ): Promise { return localVarFp.updateTask(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(axios, basePath)); }, + updateTaskWithHttpInfo(requestParameters: TasksApiUpdateTaskRequest, ): Promise> { + return localVarFp.updateTaskWithHttpInfo(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(axios, basePath)); + }, }; }; @@ -557,6 +634,18 @@ export class TasksApi extends BaseAPI { return TasksApiFp(this.configuration).addTask(requestParameters.AddTaskRequest, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `addTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiAddTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public addTaskWithHttpInfo(requestParameters: TasksApiAddTaskRequest, ) { + return TasksApiFp(this.configuration).addTaskWithHttpInfo(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 @@ -569,6 +658,18 @@ export class TasksApi extends BaseAPI { return TasksApiFp(this.configuration).deleteTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `deleteTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiDeleteTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public deleteTaskWithHttpInfo(requestParameters: TasksApiDeleteTaskRequest, ) { + return TasksApiFp(this.configuration).deleteTaskWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns the details of a specific task. * @summary Get details of a task @@ -581,6 +682,18 @@ export class TasksApi extends BaseAPI { return TasksApiFp(this.configuration).getTask(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); } + /** + * Same as `getTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiGetTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public getTaskWithHttpInfo(requestParameters: TasksApiGetTaskRequest, ) { + return TasksApiFp(this.configuration).getTaskWithHttpInfo(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns all tasks. * @summary Get all tasks @@ -593,6 +706,18 @@ export class TasksApi extends BaseAPI { 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)); } + /** + * Same as `getTasks`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiGetTasksRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public getTasksWithHttpInfo(requestParameters: TasksApiGetTasksRequest = {}, ) { + return TasksApiFp(this.configuration).getTasksWithHttpInfo(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 @@ -604,4 +729,16 @@ export class TasksApi extends BaseAPI { public updateTask(requestParameters: TasksApiUpdateTaskRequest, ) { return TasksApiFp(this.configuration).updateTask(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `updateTask`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {TasksApiUpdateTaskRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof TasksApi + */ + public updateTaskWithHttpInfo(requestParameters: TasksApiUpdateTaskRequest, ) { + return TasksApiFp(this.configuration).updateTaskWithHttpInfo(requestParameters.id, requestParameters.UpdateTaskRequest, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/api/users-api.ts b/src/versions/v2/api/users-api.ts index 6d57d940..6fd52a1a 100644 --- a/src/versions/v2/api/users-api.ts +++ b/src/versions/v2/api/users-api.ts @@ -20,7 +20,7 @@ import globalAxios from 'axios'; // @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'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, ApiResponse } from '../base'; // @ts-ignore import { GetFollowersResponse } from '../models'; /** @@ -104,6 +104,19 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserFollowers(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Same as `getUserFollowers`, but resolves with the response body together with the HTTP status and headers. + * @summary List followers of a user + * @param {number} id The ID of the user + * @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 getUserFollowersWithHttpInfo(id: number, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserFollowers(id, limit, cursor, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration, true); + }, } }; @@ -124,6 +137,9 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath getUserFollowers(requestParameters: UsersApiGetUserFollowersRequest, ): Promise { return localVarFp.getUserFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + getUserFollowersWithHttpInfo(requestParameters: UsersApiGetUserFollowersRequest, ): Promise> { + return localVarFp.getUserFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); + }, }; }; @@ -173,4 +189,16 @@ export class UsersApi extends BaseAPI { public getUserFollowers(requestParameters: UsersApiGetUserFollowersRequest, ) { return UsersApiFp(this.configuration).getUserFollowers(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + + /** + * Same as `getUserFollowers`, but resolves with the response body together with the HTTP status and headers. + * Error rejections keep their usual shape and additionally carry `$response: { status, headers }`. + * @param {UsersApiGetUserFollowersRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof UsersApi + */ + public getUserFollowersWithHttpInfo(requestParameters: UsersApiGetUserFollowersRequest, ) { + return UsersApiFp(this.configuration).getUserFollowersWithHttpInfo(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/versions/v2/base.ts b/src/versions/v2/base.ts index daac1681..b235bd8c 100644 --- a/src/versions/v2/base.ts +++ b/src/versions/v2/base.ts @@ -49,11 +49,47 @@ export const versionInterceptor = async (config:InternalAxiosRequestConfig) => { return config; } +/** + * Response returned by the `*WithHttpInfo` methods: the parsed body together with the HTTP metadata. + * + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + data: T; + status: number; + headers: AxiosResponse['headers']; +} + +// Set by the `*WithHttpInfo` methods to keep status and headers instead of returning only the body. +const wantsFullResponse = (config?: AxiosRequestConfig) => !!(config as { fullResponse?: boolean } | undefined)?.fullResponse; + export const responseInterceptor = (response: AxiosResponse) => { + if (wantsFullResponse(response?.config)) { + return { data: response.data, status: response.status, headers: response.headers }; + } return response?.data ? response.data: response; }; +/** + * Turns a raw AxiosError into the rejection used by the `*WithHttpInfo` methods: the error body fields (if any) + * plus `$response: { status, headers }`. Values that are not AxiosErrors with a response, including errors that + * were already normalized, are returned unchanged. + */ +export const toFullResponseError = (error: any) => { + if (!error?.isAxiosError || !error.response) { + return error; + } + const { data, status, headers } = error.response; + const body = data && typeof data === 'object' ? data : data ? { data } : {}; + return { ...body, $response: { status, headers } }; +}; + export const errorInterceptor = (error: AxiosError) => { + if (error.response && wantsFullResponse(error.config)) { + // Applies to empty error bodies too, so headers such as Retry-After are not lost. + return Promise.reject(toFullResponseError(error)); + } if (error.response && error.response.data) { return Promise.reject(error.response.data); } diff --git a/src/versions/v2/common.ts b/src/versions/v2/common.ts index 2732d86c..f51e1892 100644 --- a/src/versions/v2/common.ts +++ b/src/versions/v2/common.ts @@ -14,7 +14,7 @@ import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; +import { RequiredError, RequestArgs, toFullResponseError } from "./base"; import type { AxiosInstance, AxiosResponse } from 'axios'; /** @@ -140,11 +140,14 @@ export const toPathString = function (url: URL) { * * @export */ -export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration, fullResponse: boolean = false) { // Explicit return type + cast avoid inferring axios's internal AxiosResponseResult type, // which references a module-private `unique symbol` and breaks `tsc --declaration` (TS2742). return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise => { - const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs) as Promise; + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url, ...(fullResponse ? { fullResponse } : {})}; + const request = axios.request(axiosRequestArgs) as Promise; + // Instances without the SDK's interceptors (e.g. the default global axios used by Fp and Factory calls) + // reject with a raw AxiosError, so give full-response errors the same shape as the class API. + return fullResponse ? request.catch((error) => Promise.reject(toFullResponseError(error))) : request; }; }