Skip to content

Commit

Permalink
refactor: improve generated code style. (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Feb 2, 2019
1 parent d438553 commit a935f2f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 56 deletions.
67 changes: 16 additions & 51 deletions packages/google-cloud-automl/src/v1beta1/auto_ml_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class AutoMlClient {
* client.listDatasets({parent: formattedParent})
* .then(responses => {
* const resources = responses[0];
* for (let i = 0; i < resources.length; i += 1) {
* for (const resource of resources) {
* // doThingsWith(resources[i])
* }
* })
Expand All @@ -481,7 +481,7 @@ class AutoMlClient {
* const nextRequest = responses[1];
* // The actual response object, if necessary.
* // const rawResponse = responses[2];
* for (let i = 0; i < resources.length; i += 1) {
* for (const resource of resources) {
* // doThingsWith(resources[i]);
* }
* if (nextRequest) {
Expand Down Expand Up @@ -604,20 +604,14 @@ class AutoMlClient {
* // Handle the operation using the promise pattern.
* client.deleteDataset({name: formattedName})
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Operation#promise starts polling for the completion of the LRO.
* return operation.promise();
* })
* .then(responses => {
* // The final result of the operation.
* const result = responses[0];
*
* // The metadata value of the completed operation.
* const metadata = responses[1];
*
* // The response of the api call returning the complete operation.
* const finalApiResponse = responses[2];
* })
* .catch(err => {
Expand All @@ -629,8 +623,7 @@ class AutoMlClient {
* // Handle the operation using the event emitter pattern.
* client.deleteDataset({name: formattedName})
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Adding a listener for the "complete" event starts polling for the
* // completion of the operation.
Expand Down Expand Up @@ -706,20 +699,14 @@ class AutoMlClient {
* // Handle the operation using the promise pattern.
* client.importData(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Operation#promise starts polling for the completion of the LRO.
* return operation.promise();
* })
* .then(responses => {
* // The final result of the operation.
* const result = responses[0];
*
* // The metadata value of the completed operation.
* const metadata = responses[1];
*
* // The response of the api call returning the complete operation.
* const finalApiResponse = responses[2];
* })
* .catch(err => {
Expand All @@ -736,8 +723,7 @@ class AutoMlClient {
* // Handle the operation using the event emitter pattern.
* client.importData(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Adding a listener for the "complete" event starts polling for the
* // completion of the operation.
Expand Down Expand Up @@ -812,20 +798,14 @@ class AutoMlClient {
* // Handle the operation using the promise pattern.
* client.exportData(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Operation#promise starts polling for the completion of the LRO.
* return operation.promise();
* })
* .then(responses => {
* // The final result of the operation.
* const result = responses[0];
*
* // The metadata value of the completed operation.
* const metadata = responses[1];
*
* // The response of the api call returning the complete operation.
* const finalApiResponse = responses[2];
* })
* .catch(err => {
Expand All @@ -842,8 +822,7 @@ class AutoMlClient {
* // Handle the operation using the event emitter pattern.
* client.exportData(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Adding a listener for the "complete" event starts polling for the
* // completion of the operation.
Expand Down Expand Up @@ -920,20 +899,14 @@ class AutoMlClient {
* // Handle the operation using the promise pattern.
* client.createModel(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Operation#promise starts polling for the completion of the LRO.
* return operation.promise();
* })
* .then(responses => {
* // The final result of the operation.
* const result = responses[0];
*
* // The metadata value of the completed operation.
* const metadata = responses[1];
*
* // The response of the api call returning the complete operation.
* const finalApiResponse = responses[2];
* })
* .catch(err => {
Expand All @@ -950,8 +923,7 @@ class AutoMlClient {
* // Handle the operation using the event emitter pattern.
* client.createModel(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Adding a listener for the "complete" event starts polling for the
* // completion of the operation.
Expand Down Expand Up @@ -1092,7 +1064,7 @@ class AutoMlClient {
* client.listModels({parent: formattedParent})
* .then(responses => {
* const resources = responses[0];
* for (let i = 0; i < resources.length; i += 1) {
* for (const resource of resources) {
* // doThingsWith(resources[i])
* }
* })
Expand All @@ -1112,7 +1084,7 @@ class AutoMlClient {
* const nextRequest = responses[1];
* // The actual response object, if necessary.
* // const rawResponse = responses[2];
* for (let i = 0; i < resources.length; i += 1) {
* for (const resource of resources) {
* // doThingsWith(resources[i]);
* }
* if (nextRequest) {
Expand Down Expand Up @@ -1241,20 +1213,14 @@ class AutoMlClient {
* // Handle the operation using the promise pattern.
* client.deleteModel({name: formattedName})
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Operation#promise starts polling for the completion of the LRO.
* return operation.promise();
* })
* .then(responses => {
* // The final result of the operation.
* const result = responses[0];
*
* // The metadata value of the completed operation.
* const metadata = responses[1];
*
* // The response of the api call returning the complete operation.
* const finalApiResponse = responses[2];
* })
* .catch(err => {
Expand All @@ -1266,8 +1232,7 @@ class AutoMlClient {
* // Handle the operation using the event emitter pattern.
* client.deleteModel({name: formattedName})
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Adding a listener for the "complete" event starts polling for the
* // completion of the operation.
Expand Down Expand Up @@ -1506,7 +1471,7 @@ class AutoMlClient {
* client.listModelEvaluations({parent: formattedParent})
* .then(responses => {
* const resources = responses[0];
* for (let i = 0; i < resources.length; i += 1) {
* for (const resource of resources) {
* // doThingsWith(resources[i])
* }
* })
Expand All @@ -1526,7 +1491,7 @@ class AutoMlClient {
* const nextRequest = responses[1];
* // The actual response object, if necessary.
* // const rawResponse = responses[2];
* for (let i = 0; i < resources.length; i += 1) {
* for (const resource of resources) {
* // doThingsWith(resources[i]);
* }
* if (nextRequest) {
Expand Down
10 changes: 5 additions & 5 deletions packages/google-cloud-automl/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-01-30T12:07:46.449548Z",
"updateTime": "2019-02-02T12:08:14.644680Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.7",
"dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80"
"version": "0.16.8",
"dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "f0195b40fd5f5f412e6819ac01df08cedb8e5fd7",
"internalRef": "231440809"
"sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a",
"internalRef": "231974277"
}
},
{
Expand Down

0 comments on commit a935f2f

Please sign in to comment.