Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 6b54110

Browse files
yoshi-automationJustinBeckwith
authored andcommitted
refactor: improve generated code style. (#316)
1 parent 0a5ea7f commit 6b54110

File tree

6 files changed

+31
-66
lines changed

6 files changed

+31
-66
lines changed

src/v1/image_annotator_client.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,20 +302,14 @@ class ImageAnnotatorClient {
302302
* // Handle the operation using the promise pattern.
303303
* client.asyncBatchAnnotateFiles({requests: requests})
304304
* .then(responses => {
305-
* const operation = responses[0];
306-
* const initialApiResponse = responses[1];
305+
* const [operation, initialApiResponse] = responses;
307306
*
308307
* // Operation#promise starts polling for the completion of the LRO.
309308
* return operation.promise();
310309
* })
311310
* .then(responses => {
312-
* // The final result of the operation.
313311
* const result = responses[0];
314-
*
315-
* // The metadata value of the completed operation.
316312
* const metadata = responses[1];
317-
*
318-
* // The response of the api call returning the complete operation.
319313
* const finalApiResponse = responses[2];
320314
* })
321315
* .catch(err => {
@@ -327,8 +321,7 @@ class ImageAnnotatorClient {
327321
* // Handle the operation using the event emitter pattern.
328322
* client.asyncBatchAnnotateFiles({requests: requests})
329323
* .then(responses => {
330-
* const operation = responses[0];
331-
* const initialApiResponse = responses[1];
324+
* const [operation, initialApiResponse] = responses;
332325
*
333326
* // Adding a listener for the "complete" event starts polling for the
334327
* // completion of the operation.

src/v1/product_search_client.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ class ProductSearchClient {
411411
* client.listProducts({parent: formattedParent})
412412
* .then(responses => {
413413
* const resources = responses[0];
414-
* for (let i = 0; i < resources.length; i += 1) {
414+
* for (const resource of resources) {
415415
* // doThingsWith(resources[i])
416416
* }
417417
* })
@@ -431,7 +431,7 @@ class ProductSearchClient {
431431
* const nextRequest = responses[1];
432432
* // The actual response object, if necessary.
433433
* // const rawResponse = responses[2];
434-
* for (let i = 0; i < resources.length; i += 1) {
434+
* for (const resource of resources) {
435435
* // doThingsWith(resources[i]);
436436
* }
437437
* if (nextRequest) {
@@ -745,7 +745,7 @@ class ProductSearchClient {
745745
* client.listReferenceImages({parent: formattedParent})
746746
* .then(responses => {
747747
* const resources = responses[0];
748-
* for (let i = 0; i < resources.length; i += 1) {
748+
* for (const resource of resources) {
749749
* // doThingsWith(resources[i])
750750
* }
751751
* })
@@ -765,7 +765,7 @@ class ProductSearchClient {
765765
* const nextRequest = responses[1];
766766
* // The actual response object, if necessary.
767767
* // const rawResponse = responses[2];
768-
* for (let i = 0; i < resources.length; i += 1) {
768+
* for (const resource of resources) {
769769
* // doThingsWith(resources[i]);
770770
* }
771771
* if (nextRequest) {
@@ -1159,7 +1159,7 @@ class ProductSearchClient {
11591159
* client.listProductSets({parent: formattedParent})
11601160
* .then(responses => {
11611161
* const resources = responses[0];
1162-
* for (let i = 0; i < resources.length; i += 1) {
1162+
* for (const resource of resources) {
11631163
* // doThingsWith(resources[i])
11641164
* }
11651165
* })
@@ -1179,7 +1179,7 @@ class ProductSearchClient {
11791179
* const nextRequest = responses[1];
11801180
* // The actual response object, if necessary.
11811181
* // const rawResponse = responses[2];
1182-
* for (let i = 0; i < resources.length; i += 1) {
1182+
* for (const resource of resources) {
11831183
* // doThingsWith(resources[i]);
11841184
* }
11851185
* if (nextRequest) {
@@ -1603,7 +1603,7 @@ class ProductSearchClient {
16031603
* client.listProductsInProductSet({name: formattedName})
16041604
* .then(responses => {
16051605
* const resources = responses[0];
1606-
* for (let i = 0; i < resources.length; i += 1) {
1606+
* for (const resource of resources) {
16071607
* // doThingsWith(resources[i])
16081608
* }
16091609
* })
@@ -1623,7 +1623,7 @@ class ProductSearchClient {
16231623
* const nextRequest = responses[1];
16241624
* // The actual response object, if necessary.
16251625
* // const rawResponse = responses[2];
1626-
* for (let i = 0; i < resources.length; i += 1) {
1626+
* for (const resource of resources) {
16271627
* // doThingsWith(resources[i]);
16281628
* }
16291629
* if (nextRequest) {
@@ -1761,20 +1761,14 @@ class ProductSearchClient {
17611761
* // Handle the operation using the promise pattern.
17621762
* client.importProductSets(request)
17631763
* .then(responses => {
1764-
* const operation = responses[0];
1765-
* const initialApiResponse = responses[1];
1764+
* const [operation, initialApiResponse] = responses;
17661765
*
17671766
* // Operation#promise starts polling for the completion of the LRO.
17681767
* return operation.promise();
17691768
* })
17701769
* .then(responses => {
1771-
* // The final result of the operation.
17721770
* const result = responses[0];
1773-
*
1774-
* // The metadata value of the completed operation.
17751771
* const metadata = responses[1];
1776-
*
1777-
* // The response of the api call returning the complete operation.
17781772
* const finalApiResponse = responses[2];
17791773
* })
17801774
* .catch(err => {
@@ -1791,8 +1785,7 @@ class ProductSearchClient {
17911785
* // Handle the operation using the event emitter pattern.
17921786
* client.importProductSets(request)
17931787
* .then(responses => {
1794-
* const operation = responses[0];
1795-
* const initialApiResponse = responses[1];
1788+
* const [operation, initialApiResponse] = responses;
17961789
*
17971790
* // Adding a listener for the "complete" event starts polling for the
17981791
* // completion of the operation.

src/v1p2beta1/image_annotator_client.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,20 +302,14 @@ class ImageAnnotatorClient {
302302
* // Handle the operation using the promise pattern.
303303
* client.asyncBatchAnnotateFiles({requests: requests})
304304
* .then(responses => {
305-
* const operation = responses[0];
306-
* const initialApiResponse = responses[1];
305+
* const [operation, initialApiResponse] = responses;
307306
*
308307
* // Operation#promise starts polling for the completion of the LRO.
309308
* return operation.promise();
310309
* })
311310
* .then(responses => {
312-
* // The final result of the operation.
313311
* const result = responses[0];
314-
*
315-
* // The metadata value of the completed operation.
316312
* const metadata = responses[1];
317-
*
318-
* // The response of the api call returning the complete operation.
319313
* const finalApiResponse = responses[2];
320314
* })
321315
* .catch(err => {
@@ -327,8 +321,7 @@ class ImageAnnotatorClient {
327321
* // Handle the operation using the event emitter pattern.
328322
* client.asyncBatchAnnotateFiles({requests: requests})
329323
* .then(responses => {
330-
* const operation = responses[0];
331-
* const initialApiResponse = responses[1];
324+
* const [operation, initialApiResponse] = responses;
332325
*
333326
* // Adding a listener for the "complete" event starts polling for the
334327
* // completion of the operation.

src/v1p3beta1/image_annotator_client.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,20 +302,14 @@ class ImageAnnotatorClient {
302302
* // Handle the operation using the promise pattern.
303303
* client.asyncBatchAnnotateFiles({requests: requests})
304304
* .then(responses => {
305-
* const operation = responses[0];
306-
* const initialApiResponse = responses[1];
305+
* const [operation, initialApiResponse] = responses;
307306
*
308307
* // Operation#promise starts polling for the completion of the LRO.
309308
* return operation.promise();
310309
* })
311310
* .then(responses => {
312-
* // The final result of the operation.
313311
* const result = responses[0];
314-
*
315-
* // The metadata value of the completed operation.
316312
* const metadata = responses[1];
317-
*
318-
* // The response of the api call returning the complete operation.
319313
* const finalApiResponse = responses[2];
320314
* })
321315
* .catch(err => {
@@ -327,8 +321,7 @@ class ImageAnnotatorClient {
327321
* // Handle the operation using the event emitter pattern.
328322
* client.asyncBatchAnnotateFiles({requests: requests})
329323
* .then(responses => {
330-
* const operation = responses[0];
331-
* const initialApiResponse = responses[1];
324+
* const [operation, initialApiResponse] = responses;
332325
*
333326
* // Adding a listener for the "complete" event starts polling for the
334327
* // completion of the operation.

src/v1p3beta1/product_search_client.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ class ProductSearchClient {
410410
* client.listProductSets({parent: formattedParent})
411411
* .then(responses => {
412412
* const resources = responses[0];
413-
* for (let i = 0; i < resources.length; i += 1) {
413+
* for (const resource of resources) {
414414
* // doThingsWith(resources[i])
415415
* }
416416
* })
@@ -430,7 +430,7 @@ class ProductSearchClient {
430430
* const nextRequest = responses[1];
431431
* // The actual response object, if necessary.
432432
* // const rawResponse = responses[2];
433-
* for (let i = 0; i < resources.length; i += 1) {
433+
* for (const resource of resources) {
434434
* // doThingsWith(resources[i]);
435435
* }
436436
* if (nextRequest) {
@@ -808,7 +808,7 @@ class ProductSearchClient {
808808
* client.listProducts({parent: formattedParent})
809809
* .then(responses => {
810810
* const resources = responses[0];
811-
* for (let i = 0; i < resources.length; i += 1) {
811+
* for (const resource of resources) {
812812
* // doThingsWith(resources[i])
813813
* }
814814
* })
@@ -828,7 +828,7 @@ class ProductSearchClient {
828828
* const nextRequest = responses[1];
829829
* // The actual response object, if necessary.
830830
* // const rawResponse = responses[2];
831-
* for (let i = 0; i < resources.length; i += 1) {
831+
* for (const resource of resources) {
832832
* // doThingsWith(resources[i]);
833833
* }
834834
* if (nextRequest) {
@@ -1282,7 +1282,7 @@ class ProductSearchClient {
12821282
* client.listReferenceImages({parent: formattedParent})
12831283
* .then(responses => {
12841284
* const resources = responses[0];
1285-
* for (let i = 0; i < resources.length; i += 1) {
1285+
* for (const resource of resources) {
12861286
* // doThingsWith(resources[i])
12871287
* }
12881288
* })
@@ -1302,7 +1302,7 @@ class ProductSearchClient {
13021302
* const nextRequest = responses[1];
13031303
* // The actual response object, if necessary.
13041304
* // const rawResponse = responses[2];
1305-
* for (let i = 0; i < resources.length; i += 1) {
1305+
* for (const resource of resources) {
13061306
* // doThingsWith(resources[i]);
13071307
* }
13081308
* if (nextRequest) {
@@ -1618,7 +1618,7 @@ class ProductSearchClient {
16181618
* client.listProductsInProductSet({name: formattedName})
16191619
* .then(responses => {
16201620
* const resources = responses[0];
1621-
* for (let i = 0; i < resources.length; i += 1) {
1621+
* for (const resource of resources) {
16221622
* // doThingsWith(resources[i])
16231623
* }
16241624
* })
@@ -1638,7 +1638,7 @@ class ProductSearchClient {
16381638
* const nextRequest = responses[1];
16391639
* // The actual response object, if necessary.
16401640
* // const rawResponse = responses[2];
1641-
* for (let i = 0; i < resources.length; i += 1) {
1641+
* for (const resource of resources) {
16421642
* // doThingsWith(resources[i]);
16431643
* }
16441644
* if (nextRequest) {
@@ -1776,20 +1776,14 @@ class ProductSearchClient {
17761776
* // Handle the operation using the promise pattern.
17771777
* client.importProductSets(request)
17781778
* .then(responses => {
1779-
* const operation = responses[0];
1780-
* const initialApiResponse = responses[1];
1779+
* const [operation, initialApiResponse] = responses;
17811780
*
17821781
* // Operation#promise starts polling for the completion of the LRO.
17831782
* return operation.promise();
17841783
* })
17851784
* .then(responses => {
1786-
* // The final result of the operation.
17871785
* const result = responses[0];
1788-
*
1789-
* // The metadata value of the completed operation.
17901786
* const metadata = responses[1];
1791-
*
1792-
* // The response of the api call returning the complete operation.
17931787
* const finalApiResponse = responses[2];
17941788
* })
17951789
* .catch(err => {
@@ -1806,8 +1800,7 @@ class ProductSearchClient {
18061800
* // Handle the operation using the event emitter pattern.
18071801
* client.importProductSets(request)
18081802
* .then(responses => {
1809-
* const operation = responses[0];
1810-
* const initialApiResponse = responses[1];
1803+
* const [operation, initialApiResponse] = responses;
18111804
*
18121805
* // Adding a listener for the "complete" event starts polling for the
18131806
* // completion of the operation.

synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-01-17T12:47:29.238091Z",
2+
"updateTime": "2019-02-02T12:27:39.142556Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.6",
8-
"dockerImage": "googleapis/artman@sha256:12722f2ca3fbc3b53cc6aa5f0e569d7d221b46bd876a2136497089dec5e3634e"
7+
"version": "0.16.8",
8+
"dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "0ac60e21a1aa86c07c1836865b35308ba8178b05",
16-
"internalRef": "229626798"
15+
"sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a",
16+
"internalRef": "231974277"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)