diff --git a/CHANGELOG.md b/CHANGELOG.md index cc31f360..1ff63512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ 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] + +## 13.3.4 +### Changed +- Updated `PUT /productFields/{id}`: parameter `name` is not + +## 13.3.3 ### Changed - Added babel/runtime to dependencies diff --git a/README.md b/README.md index a5d9b582..e6316327 100644 --- a/README.md +++ b/README.md @@ -620,7 +620,6 @@ Class | Method | HTTP request | Description - [Pipedrive.BasicOrganization](docs/BasicOrganization.md) - [Pipedrive.BasicPerson](docs/BasicPerson.md) - [Pipedrive.BasicPersonEmail](docs/BasicPersonEmail.md) - - [Pipedrive.BasicProductField](docs/BasicProductField.md) - [Pipedrive.BulkDeleteResponse](docs/BulkDeleteResponse.md) - [Pipedrive.BulkDeleteResponseAllOf](docs/BulkDeleteResponseAllOf.md) - [Pipedrive.BulkDeleteResponseAllOfData](docs/BulkDeleteResponseAllOfData.md) @@ -1163,6 +1162,7 @@ Class | Method | HTTP request | Description - [Pipedrive.UpdateLeadLabelRequest](docs/UpdateLeadLabelRequest.md) - [Pipedrive.UpdateLeadRequest](docs/UpdateLeadRequest.md) - [Pipedrive.UpdatePersonResponse](docs/UpdatePersonResponse.md) + - [Pipedrive.UpdateProductField](docs/UpdateProductField.md) - [Pipedrive.UpdateProductRequestBody](docs/UpdateProductRequestBody.md) - [Pipedrive.UpdateProductResponse](docs/UpdateProductResponse.md) - [Pipedrive.UpdateStageRequest](docs/UpdateStageRequest.md) diff --git a/docs/ProductFieldsApi.md b/docs/ProductFieldsApi.md index 72269210..af2ecc68 100644 --- a/docs/ProductFieldsApi.md +++ b/docs/ProductFieldsApi.md @@ -308,7 +308,7 @@ oauth2.accessToken = 'YOUR ACCESS TOKEN'; let apiInstance = new Pipedrive.ProductFieldsApi(); let id = 56; // Number | The ID of the product field -let opts = Pipedrive.BasicProductField.constructFromObject({ +let opts = Pipedrive.UpdateProductField.constructFromObject({ // Properties that you want to update }); apiInstance.updateProductField(id, opts).then((data) => { @@ -325,7 +325,7 @@ apiInstance.updateProductField(id, opts).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **Number**| The ID of the product field | - **basicProductField** | [**BasicProductField**](BasicProductField.md)| | [optional] + **updateProductField** | [**UpdateProductField**](UpdateProductField.md)| | [optional] ### Return type diff --git a/docs/UpdateProductField.md b/docs/UpdateProductField.md new file mode 100644 index 00000000..cbcd08f3 --- /dev/null +++ b/docs/UpdateProductField.md @@ -0,0 +1,10 @@ +# Pipedrive.UpdateProductField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the field | [optional] +**options** | **[Object]** | When `field_type` is either set or enum, possible options on update must be supplied as an array of objects each containing id and label, for example: [{\"id\":1, \"label\":\"red\"},{\"id\":2, \"label\":\"blue\"},{\"id\":3, \"label\":\"lilac\"}] | [optional] + + diff --git a/src/api/ProductFieldsApi.js b/src/api/ProductFieldsApi.js index 34ee4aa4..406042ef 100644 --- a/src/api/ProductFieldsApi.js +++ b/src/api/ProductFieldsApi.js @@ -13,13 +13,13 @@ import ApiClient from "../ApiClient"; -import BasicProductField from '../model/BasicProductField'; import DeleteMultipleProductFieldsResponse from '../model/DeleteMultipleProductFieldsResponse'; import DeleteProductFieldResponse from '../model/DeleteProductFieldResponse'; import FailResponse from '../model/FailResponse'; import GetAllProductFieldsResponse from '../model/GetAllProductFieldsResponse'; import GetProductFieldResponse from '../model/GetProductFieldResponse'; import NewProductField from '../model/NewProductField'; +import UpdateProductField from '../model/UpdateProductField'; /** * ProductFields service. @@ -381,21 +381,18 @@ export default class ProductFieldsApi { * Updates a product field. For more information, see the tutorial for updating custom fields' values. * @param {Number} id The ID of the product field * @param {Object} opts Optional parameters - * @param {module:model/BasicProductField} opts.basicProductField + * @param {module:model/UpdateProductField} opts.updateProductField * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetProductFieldResponse} and HTTP response */ updateProductFieldWithHttpInfo(id, opts) { opts = opts || {}; - let postBody = opts['basicProductField']; + let postBody = opts['updateProductField']; // verify the required parameter 'id' is set if (id === undefined || id === null) { throw new Error("Missing the required parameter 'id' when calling updateProductField"); } - if (opts['name'] === undefined || opts['name'] === null) { - throw new Error("Missing the required parameter 'name' when calling updateProductField"); - } let pathParams = { 'id': id, @@ -439,7 +436,7 @@ export default class ProductFieldsApi { * Updates a product field. For more information, see the tutorial for updating custom fields' values. * @param {Number} id The ID of the product field * @param {Object} opts Optional parameters - * @param {module:model/BasicProductField} opts.basicProductField + * @param {module:model/UpdateProductField} opts.updateProductField * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetProductFieldResponse} */ updateProductField(id, opts) { diff --git a/src/index.js b/src/index.js index 77eb3dbc..d4f56e8d 100644 --- a/src/index.js +++ b/src/index.js @@ -124,7 +124,6 @@ import BasicGoal from './model/BasicGoal'; import BasicOrganization from './model/BasicOrganization'; import BasicPerson from './model/BasicPerson'; import BasicPersonEmail from './model/BasicPersonEmail'; -import BasicProductField from './model/BasicProductField'; import BulkDeleteResponse from './model/BulkDeleteResponse'; import BulkDeleteResponseAllOf from './model/BulkDeleteResponseAllOf'; import BulkDeleteResponseAllOfData from './model/BulkDeleteResponseAllOfData'; @@ -667,6 +666,7 @@ import UpdateFilterRequest from './model/UpdateFilterRequest'; import UpdateLeadLabelRequest from './model/UpdateLeadLabelRequest'; import UpdateLeadRequest from './model/UpdateLeadRequest'; import UpdatePersonResponse from './model/UpdatePersonResponse'; +import UpdateProductField from './model/UpdateProductField'; import UpdateProductRequestBody from './model/UpdateProductRequestBody'; import UpdateProductResponse from './model/UpdateProductResponse'; import UpdateStageRequest from './model/UpdateStageRequest'; @@ -1448,12 +1448,6 @@ export { */ BasicPersonEmail, - /** - * The BasicProductField model constructor. - * @property {module:model/BasicProductField} - */ - BasicProductField, - /** * The BulkDeleteResponse model constructor. * @property {module:model/BulkDeleteResponse} @@ -4706,6 +4700,12 @@ export { */ UpdatePersonResponse, + /** + * The UpdateProductField model constructor. + * @property {module:model/UpdateProductField} + */ + UpdateProductField, + /** * The UpdateProductRequestBody model constructor. * @property {module:model/UpdateProductRequestBody} diff --git a/src/model/UpdateProductField.js b/src/model/UpdateProductField.js new file mode 100644 index 00000000..396ad4c1 --- /dev/null +++ b/src/model/UpdateProductField.js @@ -0,0 +1,90 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The UpdateProductField model module. + * @module model/UpdateProductField + * @version 1.0.0 + */ +class UpdateProductField { + /** + * Constructs a new UpdateProductField. + * @alias module:model/UpdateProductField + */ + constructor() { + + UpdateProductField.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a UpdateProductField from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UpdateProductField} obj Optional instance to populate. + * @return {module:model/UpdateProductField} The populated UpdateProductField instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new UpdateProductField(); + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + + delete data['name']; + } + if (data.hasOwnProperty('options')) { + obj['options'] = ApiClient.convertToType(data['options'], [Object]); + + delete data['options']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * The name of the field + * @member {String} name + */ +UpdateProductField.prototype['name'] = undefined; + +/** + * When `field_type` is either set or enum, possible options on update must be supplied as an array of objects each containing id and label, for example: [{\"id\":1, \"label\":\"red\"},{\"id\":2, \"label\":\"blue\"},{\"id\":3, \"label\":\"lilac\"}] + * @member {Array.} options + */ +UpdateProductField.prototype['options'] = undefined; + + + + + + +export default UpdateProductField; +