Skip to content

Commit 9b67fa7

Browse files
yoshi-automationJustinBeckwith
authored andcommitted
docs: update docstring samples and use json import paths (#181)
1 parent 7a88f4a commit 9b67fa7

9 files changed

+200
-12
lines changed

packages/google-cloud-dataproc/src/v1/cluster_controller_client.js

+61-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
'use strict';
1616

17-
const gapicConfig = require('./cluster_controller_client_config');
17+
const gapicConfig = require('./cluster_controller_client_config.json');
1818
const gax = require('google-gax');
1919
const merge = require('lodash.merge');
2020
const path = require('path');
@@ -367,6 +367,20 @@ class ClusterControllerClient {
367367
* .catch(err => {
368368
* console.error(err);
369369
* });
370+
*
371+
* const projectId = '';
372+
* const region = '';
373+
* const cluster = {};
374+
* const request = {
375+
* projectId: projectId,
376+
* region: region,
377+
* cluster: cluster,
378+
* };
379+
*
380+
* // Handle the operation using the await pattern.
381+
* const [operation] = await client.createCluster(request);
382+
*
383+
* const [response] = await operation.promise();
370384
*/
371385
createCluster(request, options, callback) {
372386
if (options instanceof Function && callback === undefined) {
@@ -555,6 +569,24 @@ class ClusterControllerClient {
555569
* .catch(err => {
556570
* console.error(err);
557571
* });
572+
*
573+
* const projectId = '';
574+
* const region = '';
575+
* const clusterName = '';
576+
* const cluster = {};
577+
* const updateMask = {};
578+
* const request = {
579+
* projectId: projectId,
580+
* region: region,
581+
* clusterName: clusterName,
582+
* cluster: cluster,
583+
* updateMask: updateMask,
584+
* };
585+
*
586+
* // Handle the operation using the await pattern.
587+
* const [operation] = await client.updateCluster(request);
588+
*
589+
* const [response] = await operation.promise();
558590
*/
559591
updateCluster(request, options, callback) {
560592
if (options instanceof Function && callback === undefined) {
@@ -673,6 +705,20 @@ class ClusterControllerClient {
673705
* .catch(err => {
674706
* console.error(err);
675707
* });
708+
*
709+
* const projectId = '';
710+
* const region = '';
711+
* const clusterName = '';
712+
* const request = {
713+
* projectId: projectId,
714+
* region: region,
715+
* clusterName: clusterName,
716+
* };
717+
*
718+
* // Handle the operation using the await pattern.
719+
* const [operation] = await client.deleteCluster(request);
720+
*
721+
* const [response] = await operation.promise();
676722
*/
677723
deleteCluster(request, options, callback) {
678724
if (options instanceof Function && callback === undefined) {
@@ -1045,6 +1091,20 @@ class ClusterControllerClient {
10451091
* .catch(err => {
10461092
* console.error(err);
10471093
* });
1094+
*
1095+
* const projectId = '';
1096+
* const region = '';
1097+
* const clusterName = '';
1098+
* const request = {
1099+
* projectId: projectId,
1100+
* region: region,
1101+
* clusterName: clusterName,
1102+
* };
1103+
*
1104+
* // Handle the operation using the await pattern.
1105+
* const [operation] = await client.diagnoseCluster(request);
1106+
*
1107+
* const [response] = await operation.promise();
10481108
*/
10491109
diagnoseCluster(request, options, callback) {
10501110
if (options instanceof Function && callback === undefined) {

packages/google-cloud-dataproc/src/v1/doc/google/longrunning/doc_operations.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @property {boolean} done
3636
* If the value is `false`, it means the operation is still in progress.
37-
* If true, the operation is completed, and either `error` or `response` is
37+
* If `true`, the operation is completed, and either `error` or `response` is
3838
* available.
3939
*
4040
* @property {Object} error

packages/google-cloud-dataproc/src/v1/job_controller_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
'use strict';
1616

17-
const gapicConfig = require('./job_controller_client_config');
17+
const gapicConfig = require('./job_controller_client_config.json');
1818
const gax = require('google-gax');
1919
const merge = require('lodash.merge');
2020
const path = require('path');

packages/google-cloud-dataproc/src/v1/workflow_template_service_client.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
'use strict';
1616

17-
const gapicConfig = require('./workflow_template_service_client_config');
17+
const gapicConfig = require('./workflow_template_service_client_config.json');
1818
const gax = require('google-gax');
1919
const merge = require('lodash.merge');
2020
const path = require('path');
@@ -488,6 +488,13 @@ class WorkflowTemplateServiceClient {
488488
* .catch(err => {
489489
* console.error(err);
490490
* });
491+
*
492+
* const formattedName = client.workflowTemplatePath('[PROJECT]', '[REGION]', '[WORKFLOW_TEMPLATE]');
493+
*
494+
* // Handle the operation using the await pattern.
495+
* const [operation] = await client.instantiateWorkflowTemplate({name: formattedName});
496+
*
497+
* const [response] = await operation.promise();
491498
*/
492499
instantiateWorkflowTemplate(request, options, callback) {
493500
if (options instanceof Function && callback === undefined) {
@@ -623,6 +630,18 @@ class WorkflowTemplateServiceClient {
623630
* .catch(err => {
624631
* console.error(err);
625632
* });
633+
*
634+
* const formattedParent = client.regionPath('[PROJECT]', '[REGION]');
635+
* const template = {};
636+
* const request = {
637+
* parent: formattedParent,
638+
* template: template,
639+
* };
640+
*
641+
* // Handle the operation using the await pattern.
642+
* const [operation] = await client.instantiateInlineWorkflowTemplate(request);
643+
*
644+
* const [response] = await operation.promise();
626645
*/
627646
instantiateInlineWorkflowTemplate(request, options, callback) {
628647
if (options instanceof Function && callback === undefined) {

packages/google-cloud-dataproc/src/v1beta2/cluster_controller_client.js

+61-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
'use strict';
1616

17-
const gapicConfig = require('./cluster_controller_client_config');
17+
const gapicConfig = require('./cluster_controller_client_config.json');
1818
const gax = require('google-gax');
1919
const merge = require('lodash.merge');
2020
const path = require('path');
@@ -367,6 +367,20 @@ class ClusterControllerClient {
367367
* .catch(err => {
368368
* console.error(err);
369369
* });
370+
*
371+
* const projectId = '';
372+
* const region = '';
373+
* const cluster = {};
374+
* const request = {
375+
* projectId: projectId,
376+
* region: region,
377+
* cluster: cluster,
378+
* };
379+
*
380+
* // Handle the operation using the await pattern.
381+
* const [operation] = await client.createCluster(request);
382+
*
383+
* const [response] = await operation.promise();
370384
*/
371385
createCluster(request, options, callback) {
372386
if (options instanceof Function && callback === undefined) {
@@ -564,6 +578,24 @@ class ClusterControllerClient {
564578
* .catch(err => {
565579
* console.error(err);
566580
* });
581+
*
582+
* const projectId = '';
583+
* const region = '';
584+
* const clusterName = '';
585+
* const cluster = {};
586+
* const updateMask = {};
587+
* const request = {
588+
* projectId: projectId,
589+
* region: region,
590+
* clusterName: clusterName,
591+
* cluster: cluster,
592+
* updateMask: updateMask,
593+
* };
594+
*
595+
* // Handle the operation using the await pattern.
596+
* const [operation] = await client.updateCluster(request);
597+
*
598+
* const [response] = await operation.promise();
567599
*/
568600
updateCluster(request, options, callback) {
569601
if (options instanceof Function && callback === undefined) {
@@ -682,6 +714,20 @@ class ClusterControllerClient {
682714
* .catch(err => {
683715
* console.error(err);
684716
* });
717+
*
718+
* const projectId = '';
719+
* const region = '';
720+
* const clusterName = '';
721+
* const request = {
722+
* projectId: projectId,
723+
* region: region,
724+
* clusterName: clusterName,
725+
* };
726+
*
727+
* // Handle the operation using the await pattern.
728+
* const [operation] = await client.deleteCluster(request);
729+
*
730+
* const [response] = await operation.promise();
685731
*/
686732
deleteCluster(request, options, callback) {
687733
if (options instanceof Function && callback === undefined) {
@@ -1054,6 +1100,20 @@ class ClusterControllerClient {
10541100
* .catch(err => {
10551101
* console.error(err);
10561102
* });
1103+
*
1104+
* const projectId = '';
1105+
* const region = '';
1106+
* const clusterName = '';
1107+
* const request = {
1108+
* projectId: projectId,
1109+
* region: region,
1110+
* clusterName: clusterName,
1111+
* };
1112+
*
1113+
* // Handle the operation using the await pattern.
1114+
* const [operation] = await client.diagnoseCluster(request);
1115+
*
1116+
* const [response] = await operation.promise();
10571117
*/
10581118
diagnoseCluster(request, options, callback) {
10591119
if (options instanceof Function && callback === undefined) {

packages/google-cloud-dataproc/src/v1beta2/doc/google/longrunning/doc_operations.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @property {boolean} done
3636
* If the value is `false`, it means the operation is still in progress.
37-
* If true, the operation is completed, and either `error` or `response` is
37+
* If `true`, the operation is completed, and either `error` or `response` is
3838
* available.
3939
*
4040
* @property {Object} error

packages/google-cloud-dataproc/src/v1beta2/job_controller_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
'use strict';
1616

17-
const gapicConfig = require('./job_controller_client_config');
17+
const gapicConfig = require('./job_controller_client_config.json');
1818
const gax = require('google-gax');
1919
const merge = require('lodash.merge');
2020
const path = require('path');

packages/google-cloud-dataproc/src/v1beta2/workflow_template_service_client.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
'use strict';
1616

17-
const gapicConfig = require('./workflow_template_service_client_config');
17+
const gapicConfig = require('./workflow_template_service_client_config.json');
1818
const gax = require('google-gax');
1919
const merge = require('lodash.merge');
2020
const path = require('path');
@@ -490,6 +490,13 @@ class WorkflowTemplateServiceClient {
490490
* .catch(err => {
491491
* console.error(err);
492492
* });
493+
*
494+
* const formattedName = client.workflowTemplatePath('[PROJECT]', '[REGION]', '[WORKFLOW_TEMPLATE]');
495+
*
496+
* // Handle the operation using the await pattern.
497+
* const [operation] = await client.instantiateWorkflowTemplate({name: formattedName});
498+
*
499+
* const [response] = await operation.promise();
493500
*/
494501
instantiateWorkflowTemplate(request, options, callback) {
495502
if (options instanceof Function && callback === undefined) {
@@ -627,6 +634,18 @@ class WorkflowTemplateServiceClient {
627634
* .catch(err => {
628635
* console.error(err);
629636
* });
637+
*
638+
* const formattedParent = client.regionPath('[PROJECT]', '[REGION]');
639+
* const template = {};
640+
* const request = {
641+
* parent: formattedParent,
642+
* template: template,
643+
* };
644+
*
645+
* // Handle the operation using the await pattern.
646+
* const [operation] = await client.instantiateInlineWorkflowTemplate(request);
647+
*
648+
* const [response] = await operation.promise();
630649
*/
631650
instantiateInlineWorkflowTemplate(request, options, callback) {
632651
if (options instanceof Function && callback === undefined) {

packages/google-cloud-dataproc/synth.metadata

+34-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,48 @@
11
{
2-
"updateTime": "2019-03-08T00:45:38.914249Z",
2+
"updateTime": "2019-03-19T11:11:36.423346Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.15",
8-
"dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2"
7+
"version": "0.16.17",
8+
"dockerImage": "googleapis/artman@sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "c986e1d9618ac41343962b353d136201d72626ae"
15+
"sha": "6d247eee3a33f3436ad6e27f1129f7e1218228e6",
16+
"internalRef": "239014739"
17+
}
18+
},
19+
{
20+
"template": {
21+
"name": "node_library",
22+
"origin": "synthtool.gcp",
23+
"version": "2019.2.26"
24+
}
25+
}
26+
],
27+
"destinations": [
28+
{
29+
"client": {
30+
"source": "googleapis",
31+
"apiName": "dataproc",
32+
"apiVersion": "v1",
33+
"language": "nodejs",
34+
"generator": "gapic",
35+
"config": "google/cloud/dataproc/artman_dataproc_v1.yaml"
36+
}
37+
},
38+
{
39+
"client": {
40+
"source": "googleapis",
41+
"apiName": "dataproc",
42+
"apiVersion": "v1beta2",
43+
"language": "nodejs",
44+
"generator": "gapic",
45+
"config": "google/cloud/dataproc/artman_dataproc_v1beta2.yaml"
1646
}
1747
}
1848
]

0 commit comments

Comments
 (0)