Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve generated code style #510

Merged
merged 1 commit into from
Feb 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions src/v1/database_admin_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class DatabaseAdminClient {
* client.listDatabases({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 @@ -327,7 +327,7 @@ class DatabaseAdminClient {
* 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 @@ -462,20 +462,14 @@ class DatabaseAdminClient {
* // Handle the operation using the promise pattern.
* client.createDatabase(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 @@ -492,8 +486,7 @@ class DatabaseAdminClient {
* // Handle the operation using the event emitter pattern.
* client.createDatabase(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 @@ -637,20 +630,14 @@ class DatabaseAdminClient {
* // Handle the operation using the promise pattern.
* client.updateDatabaseDdl(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 @@ -667,8 +654,7 @@ class DatabaseAdminClient {
* // Handle the operation using the event emitter pattern.
* client.updateDatabaseDdl(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
30 changes: 8 additions & 22 deletions src/v1/instance_admin_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class InstanceAdminClient {
* client.listInstanceConfigs({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 @@ -351,7 +351,7 @@ class InstanceAdminClient {
* 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 @@ -550,7 +550,7 @@ class InstanceAdminClient {
* client.listInstances({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 @@ -570,7 +570,7 @@ class InstanceAdminClient {
* 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 @@ -798,20 +798,14 @@ class InstanceAdminClient {
* // Handle the operation using the promise pattern.
* client.createInstance(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 @@ -830,8 +824,7 @@ class InstanceAdminClient {
* // Handle the operation using the event emitter pattern.
* client.createInstance(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 @@ -949,20 +942,14 @@ class InstanceAdminClient {
* // Handle the operation using the promise pattern.
* client.updateInstance(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 @@ -979,8 +966,7 @@ class InstanceAdminClient {
* // Handle the operation using the event emitter pattern.
* client.updateInstance(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
4 changes: 2 additions & 2 deletions src/v1/spanner_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class SpannerClient {
* client.listSessions({database: formattedDatabase})
* .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 @@ -419,7 +419,7 @@ class SpannerClient {
* 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 synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-01-17T12:43:21.833302Z",
"updateTime": "2019-02-02T12:24:01.282246Z",
"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