HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/quadcode.com/node_modules/pipedrive/dist/api/NotesApi.js
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _AddNoteRequest = _interopRequireDefault(require("../model/AddNoteRequest"));
var _CommentPostPutObject = _interopRequireDefault(require("../model/CommentPostPutObject"));
var _DeleteComment = _interopRequireDefault(require("../model/DeleteComment"));
var _DeleteNote = _interopRequireDefault(require("../model/DeleteNote"));
var _GetComments = _interopRequireDefault(require("../model/GetComments"));
var _GetNotes = _interopRequireDefault(require("../model/GetNotes"));
var _Note = _interopRequireDefault(require("../model/Note"));
var _NumberBoolean = _interopRequireDefault(require("../model/NumberBoolean"));
var _PostComment = _interopRequireDefault(require("../model/PostComment"));
var _PostNote = _interopRequireDefault(require("../model/PostNote"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /**
 * 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.
 *
 */
/**
* Notes service.
* @module api/NotesApi
* @version 1.0.0
*/
var NotesApi = /*#__PURE__*/function () {
  /**
  * Constructs a new NotesApi. 
  * @alias module:api/NotesApi
  * @class
  * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
  * default to {@link module:ApiClient#instance} if unspecified.
  */
  function NotesApi(apiClient) {
    (0, _classCallCheck2["default"])(this, NotesApi);
    this.apiClient = apiClient;
  }

  /**
   * Add a note
   * Adds a new note.
   * @param {Object} opts Optional parameters
   * @param {module:model/AddNoteRequest} opts.addNoteRequest 
   * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PostNote} and HTTP response
   */
  (0, _createClass2["default"])(NotesApi, [{
    key: "addNoteWithHttpInfo",
    value: function addNoteWithHttpInfo(opts) {
      opts = opts || {};
      var postBody = opts['addNoteRequest'];
      var pathParams = {};
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = ['application/json'];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _PostNote["default"];
      return this.apiClient.callApi('/notes', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Add a note
     * Adds a new note.
     * @param {Object} opts Optional parameters
     * @param {module:model/AddNoteRequest} opts.addNoteRequest 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PostNote}
     */
  }, {
    key: "addNote",
    value: function addNote(opts) {
      return this.addNoteWithHttpInfo(opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Add a comment to a note
     * Adds a new comment to a note.
     * @param {Number} id The ID of the note
     * @param {Object} opts Optional parameters
     * @param {module:model/CommentPostPutObject} opts.commentPostPutObject 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PostComment} and HTTP response
     */
  }, {
    key: "addNoteCommentWithHttpInfo",
    value: function addNoteCommentWithHttpInfo(id, opts) {
      opts = opts || {};
      var postBody = opts['commentPostPutObject'];

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling addNoteComment");
      }
      if (opts['content'] === undefined || opts['content'] === null) {
        throw new Error("Missing the required parameter 'content' when calling addNoteComment");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = ['application/json'];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _PostComment["default"];
      return this.apiClient.callApi('/notes/{id}/comments', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Add a comment to a note
     * Adds a new comment to a note.
     * @param {Number} id The ID of the note
     * @param {Object} opts Optional parameters
     * @param {module:model/CommentPostPutObject} opts.commentPostPutObject 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PostComment}
     */
  }, {
    key: "addNoteComment",
    value: function addNoteComment(id, opts) {
      return this.addNoteCommentWithHttpInfo(id, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Delete a comment related to a note
     * Deletes a comment.
     * @param {Number} id The ID of the note
     * @param {String} commentId The ID of the comment
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteComment} and HTTP response
     */
  }, {
    key: "deleteCommentWithHttpInfo",
    value: function deleteCommentWithHttpInfo(id, commentId) {
      var opts = {};
      var postBody = null;

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling deleteComment");
      }

      // verify the required parameter 'commentId' is set
      if (commentId === undefined || commentId === null) {
        throw new Error("Missing the required parameter 'commentId' when calling deleteComment");
      }
      var pathParams = {
        'id': id,
        'commentId': commentId
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _DeleteComment["default"];
      return this.apiClient.callApi('/notes/{id}/comments/{commentId}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Delete a comment related to a note
     * Deletes a comment.
     * @param {Number} id The ID of the note
     * @param {String} commentId The ID of the comment
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteComment}
     */
  }, {
    key: "deleteComment",
    value: function deleteComment(id, commentId) {
      return this.deleteCommentWithHttpInfo(id, commentId).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Delete a note
     * Deletes a specific note.
     * @param {Number} id The ID of the note
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteNote} and HTTP response
     */
  }, {
    key: "deleteNoteWithHttpInfo",
    value: function deleteNoteWithHttpInfo(id) {
      var opts = {};
      var postBody = null;

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling deleteNote");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _DeleteNote["default"];
      return this.apiClient.callApi('/notes/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Delete a note
     * Deletes a specific note.
     * @param {Number} id The ID of the note
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteNote}
     */
  }, {
    key: "deleteNote",
    value: function deleteNote(id) {
      return this.deleteNoteWithHttpInfo(id).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get one comment
     * Returns the details of a comment.
     * @param {Number} id The ID of the note
     * @param {String} commentId The ID of the comment
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PostComment} and HTTP response
     */
  }, {
    key: "getCommentWithHttpInfo",
    value: function getCommentWithHttpInfo(id, commentId) {
      var opts = {};
      var postBody = null;

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling getComment");
      }

      // verify the required parameter 'commentId' is set
      if (commentId === undefined || commentId === null) {
        throw new Error("Missing the required parameter 'commentId' when calling getComment");
      }
      var pathParams = {
        'id': id,
        'commentId': commentId
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _PostComment["default"];
      return this.apiClient.callApi('/notes/{id}/comments/{commentId}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get one comment
     * Returns the details of a comment.
     * @param {Number} id The ID of the note
     * @param {String} commentId The ID of the comment
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PostComment}
     */
  }, {
    key: "getComment",
    value: function getComment(id, commentId) {
      return this.getCommentWithHttpInfo(id, commentId).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get one note
     * Returns details about a specific note.
     * @param {Number} id The ID of the note
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PostNote} and HTTP response
     */
  }, {
    key: "getNoteWithHttpInfo",
    value: function getNoteWithHttpInfo(id) {
      var opts = {};
      var postBody = null;

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling getNote");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _PostNote["default"];
      return this.apiClient.callApi('/notes/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get one note
     * Returns details about a specific note.
     * @param {Number} id The ID of the note
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PostNote}
     */
  }, {
    key: "getNote",
    value: function getNote(id) {
      return this.getNoteWithHttpInfo(id).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get all comments for a note
     * Returns all comments associated with a note.
     * @param {Number} id The ID of the note
     * @param {Object} opts Optional parameters
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit Items shown per page
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetComments} and HTTP response
     */
  }, {
    key: "getNoteCommentsWithHttpInfo",
    value: function getNoteCommentsWithHttpInfo(id, opts) {
      opts = opts || {};
      var postBody = null;

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling getNoteComments");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {
        'start': opts['start'] === undefined ? opts['start'] : opts['start'],
        'limit': opts['limit'] === undefined ? opts['limit'] : opts['limit']
      };
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _GetComments["default"];
      return this.apiClient.callApi('/notes/{id}/comments', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get all comments for a note
     * Returns all comments associated with a note.
     * @param {Number} id The ID of the note
     * @param {Object} opts Optional parameters
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit Items shown per page
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetComments}
     */
  }, {
    key: "getNoteComments",
    value: function getNoteComments(id, opts) {
      return this.getNoteCommentsWithHttpInfo(id, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Get all notes
     * Returns all notes.
     * @param {Object} opts Optional parameters
     * @param {Number} opts.userId The ID of the user whose notes to fetch. If omitted, notes by all users will be returned.
     * @param {String} opts.leadId The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned.
     * @param {Number} opts.dealId The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned.
     * @param {Number} opts.personId The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned.
     * @param {Number} opts.orgId The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned.
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit Items shown per page
     * @param {String} opts.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 {Date} opts.startDate The date in format of YYYY-MM-DD from which notes to fetch
     * @param {Date} opts.endDate The date in format of YYYY-MM-DD until which notes to fetch to
     * @param {module:model/NumberBoolean} opts.pinnedToLeadFlag If set, the results are filtered by note to lead pinning state
     * @param {module:model/NumberBoolean} opts.pinnedToDealFlag If set, the results are filtered by note to deal pinning state
     * @param {module:model/NumberBoolean} opts.pinnedToOrganizationFlag If set, the results are filtered by note to organization pinning state
     * @param {module:model/NumberBoolean} opts.pinnedToPersonFlag If set, the results are filtered by note to person pinning state
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetNotes} and HTTP response
     */
  }, {
    key: "getNotesWithHttpInfo",
    value: function getNotesWithHttpInfo(opts) {
      opts = opts || {};
      var postBody = null;
      var pathParams = {};
      var queryParams = {
        'user_id': opts['user_id'] === undefined ? opts['userId'] : opts['user_id'],
        'lead_id': opts['lead_id'] === undefined ? opts['leadId'] : opts['lead_id'],
        'deal_id': opts['deal_id'] === undefined ? opts['dealId'] : opts['deal_id'],
        'person_id': opts['person_id'] === undefined ? opts['personId'] : opts['person_id'],
        'org_id': opts['org_id'] === undefined ? opts['orgId'] : opts['org_id'],
        'start': opts['start'] === undefined ? opts['start'] : opts['start'],
        'limit': opts['limit'] === undefined ? opts['limit'] : opts['limit'],
        'sort': opts['sort'] === undefined ? opts['sort'] : opts['sort'],
        'start_date': opts['start_date'] === undefined ? opts['startDate'] : opts['start_date'],
        'end_date': opts['end_date'] === undefined ? opts['endDate'] : opts['end_date'],
        'pinned_to_lead_flag': opts['pinned_to_lead_flag'] === undefined ? opts['pinnedToLeadFlag'] : opts['pinned_to_lead_flag'],
        'pinned_to_deal_flag': opts['pinned_to_deal_flag'] === undefined ? opts['pinnedToDealFlag'] : opts['pinned_to_deal_flag'],
        'pinned_to_organization_flag': opts['pinned_to_organization_flag'] === undefined ? opts['pinnedToOrganizationFlag'] : opts['pinned_to_organization_flag'],
        'pinned_to_person_flag': opts['pinned_to_person_flag'] === undefined ? opts['pinnedToPersonFlag'] : opts['pinned_to_person_flag']
      };
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = [];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _GetNotes["default"];
      return this.apiClient.callApi('/notes', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Get all notes
     * Returns all notes.
     * @param {Object} opts Optional parameters
     * @param {Number} opts.userId The ID of the user whose notes to fetch. If omitted, notes by all users will be returned.
     * @param {String} opts.leadId The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned.
     * @param {Number} opts.dealId The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned.
     * @param {Number} opts.personId The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned.
     * @param {Number} opts.orgId The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned.
     * @param {Number} opts.start Pagination start (default to 0)
     * @param {Number} opts.limit Items shown per page
     * @param {String} opts.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 {Date} opts.startDate The date in format of YYYY-MM-DD from which notes to fetch
     * @param {Date} opts.endDate The date in format of YYYY-MM-DD until which notes to fetch to
     * @param {module:model/NumberBoolean} opts.pinnedToLeadFlag If set, the results are filtered by note to lead pinning state
     * @param {module:model/NumberBoolean} opts.pinnedToDealFlag If set, the results are filtered by note to deal pinning state
     * @param {module:model/NumberBoolean} opts.pinnedToOrganizationFlag If set, the results are filtered by note to organization pinning state
     * @param {module:model/NumberBoolean} opts.pinnedToPersonFlag If set, the results are filtered by note to person pinning state
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetNotes}
     */
  }, {
    key: "getNotes",
    value: function getNotes(opts) {
      return this.getNotesWithHttpInfo(opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Update a comment related to a note
     * Updates a comment related to a note.
     * @param {Number} id The ID of the note
     * @param {String} commentId The ID of the comment
     * @param {Object} opts Optional parameters
     * @param {module:model/CommentPostPutObject} opts.commentPostPutObject 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PostComment} and HTTP response
     */
  }, {
    key: "updateCommentForNoteWithHttpInfo",
    value: function updateCommentForNoteWithHttpInfo(id, commentId, opts) {
      opts = opts || {};
      var postBody = opts['commentPostPutObject'];

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling updateCommentForNote");
      }

      // verify the required parameter 'commentId' is set
      if (commentId === undefined || commentId === null) {
        throw new Error("Missing the required parameter 'commentId' when calling updateCommentForNote");
      }
      if (opts['content'] === undefined || opts['content'] === null) {
        throw new Error("Missing the required parameter 'content' when calling updateCommentForNote");
      }
      var pathParams = {
        'id': id,
        'commentId': commentId
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = ['application/json'];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _PostComment["default"];
      return this.apiClient.callApi('/notes/{id}/comments/{commentId}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Update a comment related to a note
     * Updates a comment related to a note.
     * @param {Number} id The ID of the note
     * @param {String} commentId The ID of the comment
     * @param {Object} opts Optional parameters
     * @param {module:model/CommentPostPutObject} opts.commentPostPutObject 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PostComment}
     */
  }, {
    key: "updateCommentForNote",
    value: function updateCommentForNote(id, commentId, opts) {
      return this.updateCommentForNoteWithHttpInfo(id, commentId, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }

    /**
     * Update a note
     * Updates a note.
     * @param {Number} id The ID of the note
     * @param {Object} opts Optional parameters
     * @param {module:model/Note} opts.note 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PostNote} and HTTP response
     */
  }, {
    key: "updateNoteWithHttpInfo",
    value: function updateNoteWithHttpInfo(id, opts) {
      opts = opts || {};
      var postBody = opts['note'];

      // verify the required parameter 'id' is set
      if (id === undefined || id === null) {
        throw new Error("Missing the required parameter 'id' when calling updateNote");
      }
      var pathParams = {
        'id': id
      };
      var queryParams = {};
      var headerParams = {};
      var formParams = {};
      var formParamArray = [];
      var contentTypes = ['application/json'];
      var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
      var isJSON = contentTypes.includes('application/json');
      if (isJSON) {
        postBody = _objectSpread(_objectSpread({}, postBody), opts);
      } else if (isURLEncoded) {
        for (var key in opts) {
          if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
            formParams[key] = opts[key];
          }
        }
      }
      var authNames = ['api_key', 'oauth2'];
      var accepts = ['application/json'];
      var returnType = _PostNote["default"];
      return this.apiClient.callApi('/notes/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
    }

    /**
     * Update a note
     * Updates a note.
     * @param {Number} id The ID of the note
     * @param {Object} opts Optional parameters
     * @param {module:model/Note} opts.note 
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PostNote}
     */
  }, {
    key: "updateNote",
    value: function updateNote(id, opts) {
      return this.updateNoteWithHttpInfo(id, opts).then(function (response_and_data) {
        return response_and_data;
      });
    }
  }]);
  return NotesApi;
}();
exports["default"] = NotesApi;