@@ -329,7 +329,7 @@ class CloudRedisClient {
329
329
* client.listInstances({parent: formattedParent})
330
330
* .then(responses => {
331
331
* const resources = responses[0];
332
- * for (let i = 0; i < resources.length; i += 1 ) {
332
+ * for (const resource of resources) {
333
333
* // doThingsWith(resources[i])
334
334
* }
335
335
* })
@@ -349,7 +349,7 @@ class CloudRedisClient {
349
349
* const nextRequest = responses[1];
350
350
* // The actual response object, if necessary.
351
351
* // const rawResponse = responses[2];
352
- * for (let i = 0; i < resources.length; i += 1 ) {
352
+ * for (const resource of resources) {
353
353
* // doThingsWith(resources[i]);
354
354
* }
355
355
* if (nextRequest) {
@@ -547,20 +547,14 @@ class CloudRedisClient {
547
547
* // Handle the operation using the promise pattern.
548
548
* client.createInstance(request)
549
549
* .then(responses => {
550
- * const operation = responses[0];
551
- * const initialApiResponse = responses[1];
550
+ * const [operation, initialApiResponse] = responses;
552
551
*
553
552
* // Operation#promise starts polling for the completion of the LRO.
554
553
* return operation.promise();
555
554
* })
556
555
* .then(responses => {
557
- * // The final result of the operation.
558
556
* const result = responses[0];
559
- *
560
- * // The metadata value of the completed operation.
561
557
* const metadata = responses[1];
562
- *
563
- * // The response of the api call returning the complete operation.
564
558
* const finalApiResponse = responses[2];
565
559
* })
566
560
* .catch(err => {
@@ -584,8 +578,7 @@ class CloudRedisClient {
584
578
* // Handle the operation using the event emitter pattern.
585
579
* client.createInstance(request)
586
580
* .then(responses => {
587
- * const operation = responses[0];
588
- * const initialApiResponse = responses[1];
581
+ * const [operation, initialApiResponse] = responses;
589
582
*
590
583
* // Adding a listener for the "complete" event starts polling for the
591
584
* // completion of the operation.
@@ -682,20 +675,14 @@ class CloudRedisClient {
682
675
* // Handle the operation using the promise pattern.
683
676
* client.updateInstance(request)
684
677
* .then(responses => {
685
- * const operation = responses[0];
686
- * const initialApiResponse = responses[1];
678
+ * const [operation, initialApiResponse] = responses;
687
679
*
688
680
* // Operation#promise starts polling for the completion of the LRO.
689
681
* return operation.promise();
690
682
* })
691
683
* .then(responses => {
692
- * // The final result of the operation.
693
684
* const result = responses[0];
694
- *
695
- * // The metadata value of the completed operation.
696
685
* const metadata = responses[1];
697
- *
698
- * // The response of the api call returning the complete operation.
699
686
* const finalApiResponse = responses[2];
700
687
* })
701
688
* .catch(err => {
@@ -722,8 +709,7 @@ class CloudRedisClient {
722
709
* // Handle the operation using the event emitter pattern.
723
710
* client.updateInstance(request)
724
711
* .then(responses => {
725
- * const operation = responses[0];
726
- * const initialApiResponse = responses[1];
712
+ * const [operation, initialApiResponse] = responses;
727
713
*
728
714
* // Adding a listener for the "complete" event starts polling for the
729
715
* // completion of the operation.
@@ -790,20 +776,14 @@ class CloudRedisClient {
790
776
* // Handle the operation using the promise pattern.
791
777
* client.deleteInstance({name: formattedName})
792
778
* .then(responses => {
793
- * const operation = responses[0];
794
- * const initialApiResponse = responses[1];
779
+ * const [operation, initialApiResponse] = responses;
795
780
*
796
781
* // Operation#promise starts polling for the completion of the LRO.
797
782
* return operation.promise();
798
783
* })
799
784
* .then(responses => {
800
- * // The final result of the operation.
801
785
* const result = responses[0];
802
- *
803
- * // The metadata value of the completed operation.
804
786
* const metadata = responses[1];
805
- *
806
- * // The response of the api call returning the complete operation.
807
787
* const finalApiResponse = responses[2];
808
788
* })
809
789
* .catch(err => {
@@ -815,8 +795,7 @@ class CloudRedisClient {
815
795
* // Handle the operation using the event emitter pattern.
816
796
* client.deleteInstance({name: formattedName})
817
797
* .then(responses => {
818
- * const operation = responses[0];
819
- * const initialApiResponse = responses[1];
798
+ * const [operation, initialApiResponse] = responses;
820
799
*
821
800
* // Adding a listener for the "complete" event starts polling for the
822
801
* // completion of the operation.
0 commit comments