Skip to content

Commit 5c04884

Browse files
fix(bigquery): Standardized punctuation and style in all documents
1 parent dbb3a4d commit 5c04884

File tree

6 files changed

+48
-48
lines changed

6 files changed

+48
-48
lines changed

bigquery/cloud-client/grantAccessToDataset.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515
'use strict';
1616

1717
/**
18-
* Grants access to a BigQuery dataset for a specified entity
18+
* Grants access to a BigQuery dataset for a specified entity.
1919
*
20-
* @param {string} datasetId ID of the dataset to grant access to
21-
* @param {string} entityId ID of the entity to grant access to
22-
* @param {string} role Role to grant
23-
* @returns {Promise<Array>} Array of access entries
20+
* @param {string} datasetId ID of the dataset to grant access to.
21+
* @param {string} entityId ID of the entity to grant access to.
22+
* @param {string} role Role to grant.
23+
* @returns {Promise<Array>} Array of access entries.
2424
*/
2525
async function grantAccessToDataset(datasetId, entityId, role) {
2626
// [START bigquery_grant_access_to_dataset]
2727
const {BigQuery} = require('@google-cloud/bigquery');
2828

29-
// Define enum for HTTP codes
29+
// Define enum for HTTP codes.
3030
const HTTP_STATUS = {
3131
PRECONDITION_FAILED: 412,
3232
};
@@ -79,7 +79,7 @@ async function grantAccessToDataset(datasetId, entityId, role) {
7979
// Update will only succeed if the dataset
8080
// has not been modified externally since retrieval.
8181
//
82-
// See the BigQuery client library documentation for more details on metadata updates
82+
// See the BigQuery client library documentation for more details on metadata updates:
8383
// https://cloud.google.com/nodejs/docs/reference/bigquery/latest
8484

8585
// Update just the 'access entries' property of the dataset.
@@ -89,8 +89,7 @@ async function grantAccessToDataset(datasetId, entityId, role) {
8989

9090
// Show a success message.
9191
console.log(
92-
`Role '${role}' granted for entity '${entityId}'` +
93-
` in dataset '${datasetId}'.`
92+
`Role '${role}' granted for entity '${entityId}' in dataset '${datasetId}'.`
9493
);
9594

9695
return updatedDataset.access;

bigquery/cloud-client/grantAccessToTableOrView.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
'use strict';
1616

1717
/**
18-
* Grants access to a BigQuery table or view for a specified principal
18+
* Grants access to a BigQuery table or view for a specified principal.
1919
*
20-
* @param {string} projectId Google Cloud Platform project ID
21-
* @param {string} datasetId Dataset where the table or view is
22-
* @param {string} resourceName Table or view name to get the access policy
23-
* @param {string} principalId The principal requesting access to the table or view
24-
* @param {string} role Role to assign to the member
25-
* @returns {Promise<object[]>} The updated policy bindings
20+
* @param {string} projectId Google Cloud Platform project ID.
21+
* @param {string} datasetId Dataset where the table or view is.
22+
* @param {string} resourceName Table or view name to get the access policy.
23+
* @param {string} principalId The principal requesting access to the table or view.
24+
* @param {string} role Role to assign to the member.
25+
* @returns {Promise<object[]>} The updated policy bindings.
2626
*/
2727
async function grantAccessToTableOrView(
2828
projectId,
@@ -34,7 +34,7 @@ async function grantAccessToTableOrView(
3434
// [START bigquery_grant_access_to_table_or_view]
3535
const {BigQuery} = require('@google-cloud/bigquery');
3636

37-
// TODO(developer): Update and un-comment below lines
37+
// TODO(developer): Update and un-comment below lines.
3838

3939
// Google Cloud Platform project.
4040
// projectId = "my_project_id"

bigquery/cloud-client/revokeDatasetAccess.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,22 @@
1414

1515
'use strict';
1616

17-
// Define enum for HTTP codes
17+
// Define enum for HTTP codes.
1818
const HTTP_STATUS = {
1919
PRECONDITION_FAILED: 412,
2020
};
2121

2222
/**
23-
* Revokes access to a dataset for a specified entity
23+
* Revokes access to a dataset for a specified entity.
2424
*
25-
* @param {string} datasetId ID of the dataset to revoke access to
26-
* @param {string} entityId ID of the user or group from whom you are revoking access
25+
* @param {string} datasetId ID of the dataset to revoke access to.
26+
* @param {string} entityId ID of the user or group from whom you are revoking access.
2727
* Alternatively, the JSON REST API representation of the entity,
28-
* such as a view's table reference
29-
* @returns {Promise<Array>} A promise that resolves to the updated access entries
28+
* such as a view's table reference.
29+
* @returns {Promise<Array>} A promise that resolves to the updated access entries.
3030
*/
3131
async function revokeDatasetAccess(datasetId, entityId) {
3232
// [START bigquery_revoke_dataset_access]
33-
// Imports the Google Cloud client library.
3433
const {BigQuery} = require('@google-cloud/bigquery');
3534

3635
// TODO (developer): Update and un-comment below lines.
@@ -49,15 +48,15 @@ async function revokeDatasetAccess(datasetId, entityId) {
4948
// Get a reference to the dataset.
5049
const [dataset] = await bigquery.dataset(datasetId).get();
5150

52-
// To revoke access to a dataset, remove elements from the access list
51+
// To revoke access to a dataset, remove elements from the access list.
5352
//
54-
// See the BigQuery client library documentation for more details on access entries
53+
// See the BigQuery client library documentation for more details on access entries:
5554
// https://cloud.google.com/nodejs/docs/reference/secret-manager/4.1.4
5655

5756
// Filter access entries to exclude entries matching the specified entity_id
5857
// and assign a new list back to the access list.
5958
dataset.metadata.access = dataset.metadata.access.filter(entry => {
60-
// Return false (remove entry) if any of these fields match entityId
59+
// Return false (remove entry) if any of these fields match entityId.
6160
return !(
6261
entry.entity_id === entityId ||
6362
entry.userByEmail === entityId ||

bigquery/cloud-client/revokeTableOrViewAccess.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
'use strict';
1616

1717
/**
18-
* Revokes access to a BigQuery table or view
19-
* @param {string} projectId The ID of the Google Cloud project
20-
* @param {string} datasetId The ID of the dataset containing the table/view
21-
* @param {string} resourceName The ID of the table or view
22-
* @param {string} [roleToRemove=null] Optional. Specific role to revoke
23-
* @param {string} [principalToRemove=null] Optional. Specific principal to revoke access from
24-
* @returns {Promise<Object>} The updated IAM policy
18+
* Revokes access to a BigQuery table or view.
19+
* @param {string} projectId The ID of the Google Cloud project.
20+
* @param {string} datasetId The ID of the dataset containing the table/view.
21+
* @param {string} resourceName The ID of the table or view.
22+
* @param {string} [roleToRemove=null] Optional. Specific role to revoke.
23+
* @param {string} [principalToRemove=null] Optional. Specific principal to revoke access from.
24+
* @returns {Promise<Object>} The updated IAM policy.
2525
*/
2626
async function revokeAccessToTableOrView(
2727
projectId,
@@ -31,10 +31,10 @@ async function revokeAccessToTableOrView(
3131
principalToRemove = null
3232
) {
3333
// [START bigquery_revoke_access_to_table_or_view]
34-
// Imports the Google Cloud client library.
3534
const {BigQuery} = require('@google-cloud/bigquery');
3635

37-
// TODO (developer): Update and un-comment below lines
36+
// TODO (developer): Update and un-comment below lines.
37+
3838
// Google Cloud Platform project.
3939
// projectId = "my_project_id"
4040

bigquery/cloud-client/viewDatasetAccessPolicy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
'use strict';
1616

1717
/**
18-
* View access policies for a BigQuery dataset
19-
* @param {string} datasetId Dataset ID to view access policies for
20-
* @returns {Array} List of access entries
18+
* View access policies for a BigQuery dataset.
19+
* @param {string} datasetId Dataset ID to view access policies for.
20+
* @returns {Array} List of access entries.
2121
*/
2222
function viewDatasetAccessPolicy(datasetId) {
2323
// [START bigquery_view_dataset_access_policy]
24-
// Import the Google Cloud client library.
2524
const {BigQuery} = require('@google-cloud/bigquery');
2625

2726
// Instantiate a client.
2827
const bigquery = new BigQuery();
2928

3029
// TODO (developer): Update and un-comment below lines.
30+
3131
// Dataset from which to get the access policy
3232
// datasetId = "my_dataset_id";
3333

@@ -38,7 +38,7 @@ function viewDatasetAccessPolicy(datasetId) {
3838
const accessEntries = metadata.access || [];
3939

4040
// Show the list of AccessEntry objects.
41-
// More details about the AccessEntry object in the BigQuery documentation
41+
// More details about the AccessEntry object in the BigQuery documentation:
4242
// https://cloud.google.com/nodejs/docs/reference/bigquery/latest
4343
console.log(
4444
`${accessEntries.length} Access entries in dataset '${datasetId}':`

bigquery/cloud-client/viewTableOrViewAccessPolicy.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,25 @@
1515
'use strict';
1616

1717
/**
18-
* View access policy for a BigQuery table or view
18+
* View access policy for a BigQuery table or view.
1919
*
20-
* @param {string} projectId Google Cloud Platform project
21-
* @param {string} datasetId Dataset where the table or view is
22-
* @param {string} resourceName Table or view name to get the access policy
23-
* @returns {Promise<object>} The IAM policy object
20+
* @param {string} projectId Google Cloud Platform project.
21+
* @param {string} datasetId Dataset where the table or view is.
22+
* @param {string} resourceName Table or view name to get the access policy.
23+
* @returns {Promise<object>} The IAM policy object.
2424
*/
2525
async function viewTableOrViewAccessPolicy(projectId, datasetId, resourceName) {
2626
// [START bigquery_view_table_or_view_access_policy]
27-
// Imports the Google Cloud client library
2827
const {BigQuery} = require('@google-cloud/bigquery');
2928

30-
// TODO(developer): Update and un-comment below lines
29+
// TODO(developer): Update and un-comment below lines.
30+
3131
// Google Cloud Platform project.
3232
// projectId = "my_project_id";
33+
3334
// Dataset where the table or view is.
3435
// datasetId = "my_dataset_id";
36+
3537
// Table or view name to get the access policy.
3638
// resourceName = "my_table_name_id";
3739

0 commit comments

Comments
 (0)