Skip to content

Commit

Permalink
docs: update docstring samples and use json import paths (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Mar 19, 2019
1 parent 7a88f4a commit 9b67fa7
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./cluster_controller_client_config');
const gapicConfig = require('./cluster_controller_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -367,6 +367,20 @@ class ClusterControllerClient {
* .catch(err => {
* console.error(err);
* });
*
* const projectId = '';
* const region = '';
* const cluster = {};
* const request = {
* projectId: projectId,
* region: region,
* cluster: cluster,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.createCluster(request);
*
* const [response] = await operation.promise();
*/
createCluster(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down Expand Up @@ -555,6 +569,24 @@ class ClusterControllerClient {
* .catch(err => {
* console.error(err);
* });
*
* const projectId = '';
* const region = '';
* const clusterName = '';
* const cluster = {};
* const updateMask = {};
* const request = {
* projectId: projectId,
* region: region,
* clusterName: clusterName,
* cluster: cluster,
* updateMask: updateMask,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.updateCluster(request);
*
* const [response] = await operation.promise();
*/
updateCluster(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down Expand Up @@ -673,6 +705,20 @@ class ClusterControllerClient {
* .catch(err => {
* console.error(err);
* });
*
* const projectId = '';
* const region = '';
* const clusterName = '';
* const request = {
* projectId: projectId,
* region: region,
* clusterName: clusterName,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.deleteCluster(request);
*
* const [response] = await operation.promise();
*/
deleteCluster(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down Expand Up @@ -1045,6 +1091,20 @@ class ClusterControllerClient {
* .catch(err => {
* console.error(err);
* });
*
* const projectId = '';
* const region = '';
* const clusterName = '';
* const request = {
* projectId: projectId,
* region: region,
* clusterName: clusterName,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.diagnoseCluster(request);
*
* const [response] = await operation.promise();
*/
diagnoseCluster(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @property {boolean} done
* If the value is `false`, it means the operation is still in progress.
* If true, the operation is completed, and either `error` or `response` is
* If `true`, the operation is completed, and either `error` or `response` is
* available.
*
* @property {Object} error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./job_controller_client_config');
const gapicConfig = require('./job_controller_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./workflow_template_service_client_config');
const gapicConfig = require('./workflow_template_service_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -488,6 +488,13 @@ class WorkflowTemplateServiceClient {
* .catch(err => {
* console.error(err);
* });
*
* const formattedName = client.workflowTemplatePath('[PROJECT]', '[REGION]', '[WORKFLOW_TEMPLATE]');
*
* // Handle the operation using the await pattern.
* const [operation] = await client.instantiateWorkflowTemplate({name: formattedName});
*
* const [response] = await operation.promise();
*/
instantiateWorkflowTemplate(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down Expand Up @@ -623,6 +630,18 @@ class WorkflowTemplateServiceClient {
* .catch(err => {
* console.error(err);
* });
*
* const formattedParent = client.regionPath('[PROJECT]', '[REGION]');
* const template = {};
* const request = {
* parent: formattedParent,
* template: template,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.instantiateInlineWorkflowTemplate(request);
*
* const [response] = await operation.promise();
*/
instantiateInlineWorkflowTemplate(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./cluster_controller_client_config');
const gapicConfig = require('./cluster_controller_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -367,6 +367,20 @@ class ClusterControllerClient {
* .catch(err => {
* console.error(err);
* });
*
* const projectId = '';
* const region = '';
* const cluster = {};
* const request = {
* projectId: projectId,
* region: region,
* cluster: cluster,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.createCluster(request);
*
* const [response] = await operation.promise();
*/
createCluster(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down Expand Up @@ -564,6 +578,24 @@ class ClusterControllerClient {
* .catch(err => {
* console.error(err);
* });
*
* const projectId = '';
* const region = '';
* const clusterName = '';
* const cluster = {};
* const updateMask = {};
* const request = {
* projectId: projectId,
* region: region,
* clusterName: clusterName,
* cluster: cluster,
* updateMask: updateMask,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.updateCluster(request);
*
* const [response] = await operation.promise();
*/
updateCluster(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down Expand Up @@ -682,6 +714,20 @@ class ClusterControllerClient {
* .catch(err => {
* console.error(err);
* });
*
* const projectId = '';
* const region = '';
* const clusterName = '';
* const request = {
* projectId: projectId,
* region: region,
* clusterName: clusterName,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.deleteCluster(request);
*
* const [response] = await operation.promise();
*/
deleteCluster(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down Expand Up @@ -1054,6 +1100,20 @@ class ClusterControllerClient {
* .catch(err => {
* console.error(err);
* });
*
* const projectId = '';
* const region = '';
* const clusterName = '';
* const request = {
* projectId: projectId,
* region: region,
* clusterName: clusterName,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.diagnoseCluster(request);
*
* const [response] = await operation.promise();
*/
diagnoseCluster(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @property {boolean} done
* If the value is `false`, it means the operation is still in progress.
* If true, the operation is completed, and either `error` or `response` is
* If `true`, the operation is completed, and either `error` or `response` is
* available.
*
* @property {Object} error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./job_controller_client_config');
const gapicConfig = require('./job_controller_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./workflow_template_service_client_config');
const gapicConfig = require('./workflow_template_service_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -490,6 +490,13 @@ class WorkflowTemplateServiceClient {
* .catch(err => {
* console.error(err);
* });
*
* const formattedName = client.workflowTemplatePath('[PROJECT]', '[REGION]', '[WORKFLOW_TEMPLATE]');
*
* // Handle the operation using the await pattern.
* const [operation] = await client.instantiateWorkflowTemplate({name: formattedName});
*
* const [response] = await operation.promise();
*/
instantiateWorkflowTemplate(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down Expand Up @@ -627,6 +634,18 @@ class WorkflowTemplateServiceClient {
* .catch(err => {
* console.error(err);
* });
*
* const formattedParent = client.regionPath('[PROJECT]', '[REGION]');
* const template = {};
* const request = {
* parent: formattedParent,
* template: template,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.instantiateInlineWorkflowTemplate(request);
*
* const [response] = await operation.promise();
*/
instantiateInlineWorkflowTemplate(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
38 changes: 34 additions & 4 deletions packages/google-cloud-dataproc/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,18 +1,48 @@
{
"updateTime": "2019-03-08T00:45:38.914249Z",
"updateTime": "2019-03-19T11:11:36.423346Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.15",
"dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2"
"version": "0.16.17",
"dockerImage": "googleapis/artman@sha256:7231f27272231a884e09edb5953148c85ecd8467780d33c4a35c3e507885715b"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "c986e1d9618ac41343962b353d136201d72626ae"
"sha": "6d247eee3a33f3436ad6e27f1129f7e1218228e6",
"internalRef": "239014739"
}
},
{
"template": {
"name": "node_library",
"origin": "synthtool.gcp",
"version": "2019.2.26"
}
}
],
"destinations": [
{
"client": {
"source": "googleapis",
"apiName": "dataproc",
"apiVersion": "v1",
"language": "nodejs",
"generator": "gapic",
"config": "google/cloud/dataproc/artman_dataproc_v1.yaml"
}
},
{
"client": {
"source": "googleapis",
"apiName": "dataproc",
"apiVersion": "v1beta2",
"language": "nodejs",
"generator": "gapic",
"config": "google/cloud/dataproc/artman_dataproc_v1beta2.yaml"
}
}
]
Expand Down

0 comments on commit 9b67fa7

Please sign in to comment.