|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * Pipedrive API v1 |
| 5 | + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 1.0.0 |
| 8 | + * |
| 9 | + * |
| 10 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 11 | + * https://openapi-generator.tech |
| 12 | + * Do not edit the class manually. |
| 13 | + */ |
| 14 | + |
| 15 | + |
| 16 | +import type { Configuration } from '../configuration'; |
| 17 | +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; |
| 18 | +import globalAxios from 'axios'; |
| 19 | +// Some imports not used depending on template conditions |
| 20 | +// @ts-ignore |
| 21 | +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; |
| 22 | +// @ts-ignore |
| 23 | +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; |
| 24 | +// @ts-ignore |
| 25 | +import { GetFieldsResponse } from '../models'; |
| 26 | +/** |
| 27 | + * LeadFieldsApi - axios parameter creator |
| 28 | + * @export |
| 29 | + */ |
| 30 | +export const LeadFieldsApiAxiosParamCreator = function (configuration?: Configuration) { |
| 31 | + return { |
| 32 | + /** |
| 33 | + * Returns data about all lead fields. |
| 34 | + * @summary Get all lead fields |
| 35 | + * @param {number} [start] Pagination start |
| 36 | + * @param {number} [limit] Items shown per page |
| 37 | +
|
| 38 | + * @throws {RequiredError} |
| 39 | + */ |
| 40 | + getLeadFields: async (start?: number, limit?: number, ): Promise<RequestArgs> => { |
| 41 | + const localVarPath = `/leadFields`; |
| 42 | + // use dummy base URL string because the URL constructor only accepts absolute URLs. |
| 43 | + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); |
| 44 | + let baseOptions; |
| 45 | + if (configuration) { |
| 46 | + baseOptions = configuration.baseOptions; |
| 47 | + } |
| 48 | + |
| 49 | + const localVarRequestOptions = { method: 'GET', ...baseOptions }; |
| 50 | + const localVarHeaderParameter = {} as any; |
| 51 | + const localVarQueryParameter = {} as any; |
| 52 | + |
| 53 | + // authentication api_key required |
| 54 | + await setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration) |
| 55 | + |
| 56 | + // authentication oauth2 required |
| 57 | + // oauth required |
| 58 | + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["leads:read", "leads:full", "admin"], configuration) |
| 59 | + |
| 60 | + if (start !== undefined) { |
| 61 | + localVarQueryParameter['start'] = start; |
| 62 | + } |
| 63 | + |
| 64 | + if (limit !== undefined) { |
| 65 | + localVarQueryParameter['limit'] = limit; |
| 66 | + } |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + setSearchParams(localVarUrlObj, localVarQueryParameter); |
| 71 | + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; |
| 72 | + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; |
| 73 | + |
| 74 | + return { |
| 75 | + url: toPathString(localVarUrlObj), |
| 76 | + options: localVarRequestOptions, |
| 77 | + }; |
| 78 | + }, |
| 79 | + } |
| 80 | +}; |
| 81 | + |
| 82 | + |
| 83 | +/** |
| 84 | + * LeadFieldsApi - functional programming interface |
| 85 | + * @export |
| 86 | + */ |
| 87 | +export const LeadFieldsApiFp = function(configuration?: Configuration) { |
| 88 | + const localVarAxiosParamCreator = LeadFieldsApiAxiosParamCreator(configuration) |
| 89 | + return { |
| 90 | + /** |
| 91 | + * Returns data about all lead fields. |
| 92 | + * @summary Get all lead fields |
| 93 | + * @param {number} [start] Pagination start |
| 94 | + * @param {number} [limit] Items shown per page |
| 95 | +
|
| 96 | + * @throws {RequiredError} |
| 97 | + */ |
| 98 | + async getLeadFields(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetFieldsResponse>> { |
| 99 | + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadFields(start, limit, ); |
| 100 | + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); |
| 101 | + }, |
| 102 | + } |
| 103 | +}; |
| 104 | + |
| 105 | +/** |
| 106 | + * LeadFieldsApi - factory interface |
| 107 | + * @export |
| 108 | + */ |
| 109 | +export const LeadFieldsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { |
| 110 | + const localVarFp = LeadFieldsApiFp(configuration) |
| 111 | + return { |
| 112 | + /** |
| 113 | + * Returns data about all lead fields. |
| 114 | + * @summary Get all lead fields |
| 115 | + * @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters. |
| 116 | +
|
| 117 | + * @throws {RequiredError} |
| 118 | + */ |
| 119 | + getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ): Promise<GetFieldsResponse> { |
| 120 | + return localVarFp.getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); |
| 121 | + }, |
| 122 | + }; |
| 123 | +}; |
| 124 | + |
| 125 | +/** |
| 126 | + * Request parameters for getLeadFields operation in LeadFieldsApi. |
| 127 | + * @export |
| 128 | + * @interface LeadFieldsApiGetLeadFieldsRequest |
| 129 | + */ |
| 130 | +export interface LeadFieldsApiGetLeadFieldsRequest { |
| 131 | + /** |
| 132 | + * Pagination start |
| 133 | + * @type {number} |
| 134 | + * @memberof LeadFieldsApiGetLeadFields |
| 135 | + */ |
| 136 | + readonly start?: number |
| 137 | + |
| 138 | + /** |
| 139 | + * Items shown per page |
| 140 | + * @type {number} |
| 141 | + * @memberof LeadFieldsApiGetLeadFields |
| 142 | + */ |
| 143 | + readonly limit?: number |
| 144 | +} |
| 145 | + |
| 146 | +/** |
| 147 | + * LeadFieldsApi - object-oriented interface |
| 148 | + * @export |
| 149 | + * @class LeadFieldsApi |
| 150 | + * @extends {BaseAPI} |
| 151 | + */ |
| 152 | +export class LeadFieldsApi extends BaseAPI { |
| 153 | + /** |
| 154 | + * Returns data about all lead fields. |
| 155 | + * @summary Get all lead fields |
| 156 | + * @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters. |
| 157 | +
|
| 158 | + * @throws {RequiredError} |
| 159 | + * @memberof LeadFieldsApi |
| 160 | + */ |
| 161 | + public getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ) { |
| 162 | + return LeadFieldsApiFp(this.configuration).getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); |
| 163 | + } |
| 164 | +} |
0 commit comments