From ed894cb27e45a64584ebe744fe5ec445e29149a2 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Mon, 17 Jul 2017 15:52:59 -0400 Subject: [PATCH] datastore docs: add param tags for mixin methods (#2449) --- packages/datastore/src/request.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/packages/datastore/src/request.js b/packages/datastore/src/request.js index 671dc4c4174..8eeb7d43444 100644 --- a/packages/datastore/src/request.js +++ b/packages/datastore/src/request.js @@ -460,6 +460,16 @@ DatastoreRequest.prototype.get = function(keys, options, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `insert`. + * + * @param {object|object[]} entities - Datastore key object(s). + * @param {Key} entities.key - Datastore key object. + * @param {object|object[]} entities.data - Data to save with the provided key. + * If you provide an array of objects, you must use the explicit syntax: + * `name` for the name of the property and `value` for its value. You may + * also specify an `excludeFromIndexes` property, set to `true` or `false`. + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request + * @param {object} callback.apiResponse - The full API response. */ DatastoreRequest.prototype.insert = function(entities, callback) { entities = arrify(entities) @@ -990,6 +1000,16 @@ DatastoreRequest.prototype.save = function(entities, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `update`. + * + * @param {object|object[]} entities - Datastore key object(s). + * @param {Key} entities.key - Datastore key object. + * @param {object|object[]} entities.data - Data to save with the provided key. + * If you provide an array of objects, you must use the explicit syntax: + * `name` for the name of the property and `value` for its value. You may + * also specify an `excludeFromIndexes` property, set to `true` or `false`. + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request + * @param {object} callback.apiResponse - The full API response. */ DatastoreRequest.prototype.update = function(entities, callback) { entities = arrify(entities) @@ -1001,6 +1021,16 @@ DatastoreRequest.prototype.update = function(entities, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `upsert`. + * + * @param {object|object[]} entities - Datastore key object(s). + * @param {Key} entities.key - Datastore key object. + * @param {object|object[]} entities.data - Data to save with the provided key. + * If you provide an array of objects, you must use the explicit syntax: + * `name` for the name of the property and `value` for its value. You may + * also specify an `excludeFromIndexes` property, set to `true` or `false`. + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request + * @param {object} callback.apiResponse - The full API response. */ DatastoreRequest.prototype.upsert = function(entities, callback) { entities = arrify(entities)