Skip to content

Commit 09b76ca

Browse files
danieljbrucegcf-owl-bot[bot]kevkim-codes
authored
docs: Ensure all parameters in the documentation have a type and a description (#1345)
* Add descriptions for some query parameters * Eliminate the extra space * Add a description to all the alias parameters * Add documentation for property parameters * Add descriptions for the aggregation argument * Add property params to these objects * Add descriptions for data types * Fix the broken links * Add documentation for the addExcludeFromIndexes * Buffer description * Add a description for entity filters * Add parameters documentation for the `and` and `or * Add descriptions for the filter object * Add some parameter documentation for the client * Parameter for prepareGaxRequest_ * Add documentation to a few of the helper functions * Add more documentation for txn and request params * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Kevin Kim <[email protected]>
1 parent 01d4acb commit 09b76ca

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

src/request.ts

+32-3
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ class DatastoreRequest {
692692
/**
693693
* This function saves results from a successful beginTransaction call.
694694
*
695-
* @param {BeginAsyncResponse} [response] The response from a call to
695+
* @param {object} [response] The response from a call to
696696
* begin a transaction that completed successfully.
697697
*
698698
**/
@@ -1078,6 +1078,11 @@ class DatastoreRequest {
10781078
return stream;
10791079
}
10801080

1081+
/**
1082+
* Gets request options from a RunQueryStream options configuration
1083+
*
1084+
* @param {RunQueryStreamOptions} [options] The RunQueryStream options configuration
1085+
*/
10811086
private getRequestOptions(
10821087
options: RunQueryStreamOptions
10831088
): SharedQueryOptions {
@@ -1114,6 +1119,12 @@ class DatastoreRequest {
11141119
return sharedQueryOpts;
11151120
}
11161121

1122+
/**
1123+
* Gets request options from a RunQueryStream options configuration
1124+
*
1125+
* @param {Query} [query] A Query object
1126+
* @param {RunQueryStreamOptions} [options] The RunQueryStream options configuration
1127+
*/
11171128
private getQueryOptions(
11181129
query: Query,
11191130
options: RunQueryStreamOptions = {}
@@ -1200,6 +1211,11 @@ class DatastoreRequest {
12001211
}
12011212

12021213
/**
1214+
* Builds a request and sends it to the Gapic Layer.
1215+
*
1216+
* @param {object} config Configuration object.
1217+
* @param {function} callback The callback function.
1218+
*
12031219
* @private
12041220
*/
12051221
prepareGaxRequest_(config: RequestConfig, callback: Function): void {
@@ -1328,10 +1344,23 @@ class DatastoreRequest {
13281344
}
13291345
}
13301346

1347+
/**
1348+
* Check to see if a request is a Transaction
1349+
*
1350+
* @param {DatastoreRequest} request The Datastore request object
1351+
*
1352+
*/
13311353
function isTransaction(request: DatastoreRequest): request is Transaction {
13321354
return request instanceof Transaction;
13331355
}
13341356

1357+
/**
1358+
* Throw an error if read options are not properly specified.
1359+
*
1360+
* @param {DatastoreRequest} request The Datastore request object
1361+
* @param {SharedQueryOptions} options The Query options
1362+
*
1363+
*/
13351364
function throwOnTransactionErrors(
13361365
request: DatastoreRequest,
13371366
options: SharedQueryOptions
@@ -1354,8 +1383,8 @@ function throwOnTransactionErrors(
13541383
* This function gets transaction request options used for defining a
13551384
* request to create a new transaction on the server.
13561385
*
1357-
* @param transaction The transaction for which the request will be made.
1358-
* @param options Custom options that will be used to create the request.
1386+
* @param {Transaction} transaction The transaction for which the request will be made.
1387+
* @param {RunOptions} options Custom options that will be used to create the request.
13591388
*/
13601389
export function getTransactionRequest(
13611390
transaction: Transaction,

src/transaction.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ class Transaction extends DatastoreRequest {
130130
* If the commit request fails, we will automatically rollback the
131131
* transaction.
132132
*
133-
* @param {object} [gaxOptions] Request configuration options, outlined here:
134-
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions.
133+
* @param {CallOptions | https://googleapis.github.io/gax-nodejs/global.html#CallOptions} [gaxOptions] Request configuration options.
135134
* @param {function} callback The callback function.
136135
* @param {?error} callback.err An error returned while making this request.
137136
* If the commit fails, we automatically try to rollback the transaction
@@ -280,6 +279,7 @@ class Transaction extends DatastoreRequest {
280279
* Create an aggregation query from the query specified. See {module:datastore/query} for all
281280
* of the available methods.
282281
*
282+
* @param {Query} query A Query object
283283
*/
284284
createAggregationQuery(query: Query): AggregateQuery {
285285
return this.datastore.createAggregationQuery.call(this, query);

0 commit comments

Comments
 (0)