Skip to content

Commit

Permalink
refactor: improve generated code style. (#43)
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 779f058 commit ed4f35e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ class SecurityCenterClient {
* client.groupAssets(request)
* .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 @@ -699,7 +699,7 @@ class SecurityCenterClient {
* 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 @@ -965,7 +965,7 @@ class SecurityCenterClient {
* client.groupFindings(request)
* .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 @@ -990,7 +990,7 @@ class SecurityCenterClient {
* 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 @@ -1251,7 +1251,7 @@ class SecurityCenterClient {
* client.listAssets({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 @@ -1271,7 +1271,7 @@ class SecurityCenterClient {
* 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 @@ -1534,7 +1534,7 @@ class SecurityCenterClient {
* client.listFindings({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 @@ -1554,7 +1554,7 @@ class SecurityCenterClient {
* 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 @@ -1736,7 +1736,7 @@ class SecurityCenterClient {
* client.listSources({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 @@ -1756,7 +1756,7 @@ class SecurityCenterClient {
* 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 @@ -1873,20 +1873,14 @@ class SecurityCenterClient {
* // Handle the operation using the promise pattern.
* client.runAssetDiscovery({parent: formattedParent})
* .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 @@ -1898,8 +1892,7 @@ class SecurityCenterClient {
* // Handle the operation using the event emitter pattern.
* client.runAssetDiscovery({parent: formattedParent})
* .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
10 changes: 5 additions & 5 deletions packages/google-cloud-securitycenter/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-01-17T12:56:42.103153Z",
"updateTime": "2019-02-02T12:22:53.102764Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.6",
"dockerImage": "googleapis/artman@sha256:12722f2ca3fbc3b53cc6aa5f0e569d7d221b46bd876a2136497089dec5e3634e"
"version": "0.16.8",
"dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0ac60e21a1aa86c07c1836865b35308ba8178b05",
"internalRef": "229626798"
"sha": "bce093dab3e65c40eb9a37efbdc960f34df6037a",
"internalRef": "231974277"
}
},
{
Expand Down

0 comments on commit ed4f35e

Please sign in to comment.