Skip to content

Commit 01bfb84

Browse files
docs: Add descriptions to more of the parameters (#1342)
* 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 * 🦉 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>
1 parent 08852cc commit 01bfb84

File tree

3 files changed

+75
-10
lines changed

3 files changed

+75
-10
lines changed

src/entity.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ export namespace entity {
584584
*
585585
* @private
586586
* @param {*} value Native value.
587+
* @param {string} property The property to use for the average calculation.
587588
* @returns {object}
588589
*
589590
* @example
@@ -797,6 +798,14 @@ export namespace entity {
797798
return entityProto;
798799
}
799800

801+
/**
802+
*
803+
* @param {string[] | undefined} [entities.excludeFromIndexes] Exclude properties from
804+
* indexing using a simple JSON path notation. See the examples in
805+
* {@link Datastore#save} to see how to target properties at different
806+
* levels of nesting within your entity.
807+
* @param {object} entityProto The protocol entity object to convert.
808+
*/
800809
export function addExcludeFromIndexes(
801810
excludeFromIndexes: string[] | undefined,
802811
entityProto: EntityProto
@@ -1407,7 +1416,7 @@ export namespace entity {
14071416
* Convert buffer to base64 encoding.
14081417
*
14091418
* @private
1410-
* @param {Buffer} buffer
1419+
* @param {Buffer} buffer The buffer to convert
14111420
* @returns {string} Base64 encoded string.
14121421
*/
14131422
convertToBase64_(buffer: Buffer): string {

src/filter.ts

+14-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,20 @@ enum CompositeOperator {
3333
OR = 'OR',
3434
}
3535

36+
/**
37+
* Returns an AND composite filter.
38+
*
39+
* @param {EntityFilter[]} filters The filters that make up the AND filter.
40+
*/
3641
export function and(filters: EntityFilter[]): CompositeFilter {
3742
return new CompositeFilter(filters, CompositeOperator.AND);
3843
}
3944

45+
/**
46+
* Returns an OR composite filter.
47+
*
48+
* @param {EntityFilter[]} filters The filters that make up the OR filter.
49+
*/
4050
export function or(filters: EntityFilter[]): CompositeFilter {
4151
return new CompositeFilter(filters, CompositeOperator.OR);
4252
}
@@ -75,9 +85,9 @@ export class PropertyFilter<T extends string>
7585
/**
7686
* Build a Property Filter object.
7787
*
78-
* @param {string} Property
79-
* @param {Operator} operator
80-
* @param {any} val
88+
* @param {string} Property The property name that the filter will be applied to.
89+
* @param {Operator} operator The comparison operator that the filter applies.
90+
* @param {any} val The value that the filter compares the property to.
8191
*/
8292
constructor(
8393
public name: T,
@@ -120,7 +130,7 @@ class CompositeFilter extends EntityFilter {
120130
/**
121131
* Build a Composite Filter object.
122132
*
123-
* @param {EntityFilter[]} filters
133+
* @param {EntityFilter[]} filters The filters that make up the composite filter.
124134
*/
125135
constructor(filters: EntityFilter[], op: CompositeOperator) {
126136
super();

src/index.ts

+51-5
Original file line numberDiff line numberDiff line change
@@ -1306,14 +1306,20 @@ class Datastore extends DatastoreRequest {
13061306
return new entity.Double(value);
13071307
}
13081308

1309+
/**
1310+
* Helper function to get a Datastore Double object.
1311+
*
1312+
* @param {number} value The double value.
1313+
* @returns {object}
1314+
*/
13091315
double(value: number) {
13101316
return Datastore.double(value);
13111317
}
13121318

13131319
/**
13141320
* Helper function to check if something is a Datastore Double object.
13151321
*
1316-
* @param {*} value
1322+
* @param {*} value The double value.
13171323
* @returns {boolean}
13181324
*
13191325
* @example
@@ -1328,14 +1334,21 @@ class Datastore extends DatastoreRequest {
13281334
return entity.isDsDouble(value);
13291335
}
13301336

1337+
/**
1338+
* Helper function to check if something is a Datastore Double object.
1339+
*
1340+
* @param {*} value The double value.
1341+
* @returns {boolean}
1342+
*
1343+
*/
13311344
isDouble(value?: {}) {
13321345
return Datastore.isDouble(value);
13331346
}
13341347

13351348
/**
13361349
* Helper function to get a Datastore Geo Point object.
13371350
*
1338-
* @param {object} coordinates Coordinate value.
1351+
* @param {object} coordinates The coordinates value.
13391352
* @param {number} coordinates.latitude Latitudinal value.
13401353
* @param {number} coordinates.longitude Longitudinal value.
13411354
* @returns {object}
@@ -1365,14 +1378,23 @@ class Datastore extends DatastoreRequest {
13651378
return new entity.GeoPoint(coordinates);
13661379
}
13671380

1381+
/**
1382+
* Helper function to get a Datastore Geo Point object.
1383+
*
1384+
* @param {object} coordinates The coordinates value.
1385+
* @param {number} coordinates.latitude Latitudinal value.
1386+
* @param {number} coordinates.longitude Longitudinal value.
1387+
* @returns {object}
1388+
*
1389+
*/
13681390
geoPoint(coordinates: entity.Coordinates) {
13691391
return Datastore.geoPoint(coordinates);
13701392
}
13711393

13721394
/**
13731395
* Helper function to check if something is a Datastore Geo Point object.
13741396
*
1375-
* @param {*} value
1397+
* @param {*} value The coordinates value.
13761398
* @returns {boolean}
13771399
*
13781400
* @example
@@ -1392,6 +1414,13 @@ class Datastore extends DatastoreRequest {
13921414
return entity.isDsGeoPoint(value);
13931415
}
13941416

1417+
/**
1418+
* Helper function to check if something is a Datastore Geo Point object.
1419+
*
1420+
* @param {*} value The coordinates value.
1421+
* @returns {boolean}
1422+
*
1423+
*/
13951424
isGeoPoint(value?: {}) {
13961425
return Datastore.isGeoPoint(value);
13971426
}
@@ -1424,14 +1453,24 @@ class Datastore extends DatastoreRequest {
14241453
return new entity.Int(value);
14251454
}
14261455

1456+
/**
1457+
* Helper function to get a Datastore Integer object.
1458+
*
1459+
* This is also useful when using an ID outside the bounds of a JavaScript
1460+
* Number object.
1461+
*
1462+
* @param {number | int} value The integer value.
1463+
* @returns {object}
1464+
*
1465+
*/
14271466
int(value: number | string) {
14281467
return Datastore.int(value);
14291468
}
14301469

14311470
/**
14321471
* Helper function to check if something is a Datastore Integer object.
14331472
*
1434-
* @param {*} value
1473+
* @param {*} value The value to check
14351474
* @returns {boolean}
14361475
*
14371476
* @example
@@ -1446,6 +1485,13 @@ class Datastore extends DatastoreRequest {
14461485
return entity.isDsInt(value);
14471486
}
14481487

1488+
/**
1489+
* Helper function to check if something is a Datastore Integer object.
1490+
*
1491+
* @param {*} value The value to check
1492+
* @returns {boolean}
1493+
*
1494+
*/
14491495
isInt(value?: {}) {
14501496
return Datastore.isInt(value);
14511497
}
@@ -1631,7 +1677,7 @@ class Datastore extends DatastoreRequest {
16311677
/**
16321678
* Helper function to check if something is a Datastore Key object.
16331679
*
1634-
* @param {*} value
1680+
* @param {*} value Value to compare property to.
16351681
* @returns {boolean}
16361682
*
16371683
* @example

0 commit comments

Comments
 (0)