From ff6b5eb57dfbd7ec79e02c9ac4573be60d2e8896 Mon Sep 17 00:00:00 2001 From: Yevhenii Date: Tue, 3 Jul 2018 17:38:15 +0200 Subject: [PATCH] Update documentation for ManagementClient.getLogs --- src/management/LogsManager.js | 25 ++++++++++++++++++++++--- src/management/index.js | 26 ++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/management/LogsManager.js b/src/management/LogsManager.js index 9f00081a7..debf268bb 100644 --- a/src/management/LogsManager.js +++ b/src/management/LogsManager.js @@ -58,12 +58,31 @@ var LogsManager = function(options) { * @method getAll * @memberOf module:management.LogsManager.prototype * - * @example - * management.logs.getAll(function (err, logs) { + * @example + * This method takes an optional object as first argument that may be used to + * specify pagination settings and the search query. If pagination options are + * not present, the first page of a limited number of results will be returned. + * + * + * // Pagination settings. + * var params = { + * per_page: 10, + * page: 2 + * }; + * + * management.logs.getAll(params, function (err, logs) { * console.log(logs.length); * }); * - * @param {Function} [cb] Callback function. + * @param {Object} [params] Logs params. + * @param {String} [params.q] Search Criteria using Query String Syntax + * @param {Number} [params.page] Page number. Zero based + * @param {Number} [params.per_page] The amount of entries per page + * @param {String} [params.sort] The field to use for sorting. + * @param {String} [params.fields] A comma separated list of fields to include or exclude + * @param {Boolean} [params.include_fields] true if the fields specified are to be included in the result, false otherwise. + * @param {Boolean} [params.include_totals] true if a query summary must be included in the result, false otherwise. Default false + * @param {Function} [cb] Callback function. * * @return {Promise|undefined} */ diff --git a/src/management/index.js b/src/management/index.js index 96754028c..fe5774de6 100644 --- a/src/management/index.js +++ b/src/management/index.js @@ -1551,13 +1551,31 @@ utils.wrapPropertyMethod(ManagementClient, 'getLog', 'logs.get'); * @method getLogs * @memberOf module:management.ManagementClient.prototype * - * @example - * management.getLogs(function (err, logs) { + * @example + * This method takes an optional object as first argument that may be used to + * specify pagination settings and the search query. If pagination options are + * not present, the first page of a limited number of results will be returned. + * + * + * // Pagination settings. + * var params = { + * per_page: 10, + * page: 2 + * }; + * + * management.getLogs(params, function (err, logs) { * console.log(logs.length); * }); * - * @param {Object} data Log data object. - * @param {Function} [cb] Callback function. + * @param {Object} [params] Logs params. + * @param {String} [params.q] Search Criteria using Query String Syntax + * @param {Number} [params.page] Page number. Zero based + * @param {Number} [params.per_page] The amount of entries per page + * @param {String} [params.sort] The field to use for sorting. + * @param {String} [params.fields] A comma separated list of fields to include or exclude + * @param {Boolean} [params.include_fields] true if the fields specified are to be included in the result, false otherwise. + * @param {Boolean} [params.include_totals] true if a query summary must be included in the result, false otherwise. Default false + * @param {Function} [cb] Callback function. * * @return {Promise|undefined} */