-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(samples): add auto-generated samples for Node with api short nam…
…e in region tag (#133) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 399287285 Source-Link: googleapis/googleapis@1575986 Source-Link: googleapis/googleapis-gen@b27fff6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9
- Loading branch information
1 parent
141ae23
commit d4ee9a4
Showing
9 changed files
with
487 additions
and
2 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
...le-cloud-bigquery-connection/samples/generated/v1/connection_service.create_connection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(parent, connection) { | ||
// [START bigqueryconnection_v1_generated_ConnectionService_CreateConnection_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Parent resource name. | ||
* Must be in the format `projects/{project_id}/locations/{location_id}` | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Optional. Connection id that should be assigned to the created connection. | ||
*/ | ||
// const connectionId = 'abc123' | ||
/** | ||
* Required. Connection to create. | ||
*/ | ||
// const connection = '' | ||
|
||
// Imports the Connection library | ||
const {ConnectionServiceClient} = | ||
require('@google-cloud/bigquery-connection').v1; | ||
|
||
// Instantiates a client | ||
const connectionClient = new ConnectionServiceClient(); | ||
|
||
async function createConnection() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
connection, | ||
}; | ||
|
||
// Run request | ||
const response = await connectionClient.createConnection(request); | ||
console.log(response); | ||
} | ||
|
||
createConnection(); | ||
// [END bigqueryconnection_v1_generated_ConnectionService_CreateConnection_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
54 changes: 54 additions & 0 deletions
54
...le-cloud-bigquery-connection/samples/generated/v1/connection_service.delete_connection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(name) { | ||
// [START bigqueryconnection_v1_generated_ConnectionService_DeleteConnection_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Name of the deleted connection, for example: | ||
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}` | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Connection library | ||
const {ConnectionServiceClient} = | ||
require('@google-cloud/bigquery-connection').v1; | ||
|
||
// Instantiates a client | ||
const connectionClient = new ConnectionServiceClient(); | ||
|
||
async function deleteConnection() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await connectionClient.deleteConnection(request); | ||
console.log(response); | ||
} | ||
|
||
deleteConnection(); | ||
// [END bigqueryconnection_v1_generated_ConnectionService_DeleteConnection_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
54 changes: 54 additions & 0 deletions
54
...oogle-cloud-bigquery-connection/samples/generated/v1/connection_service.get_connection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(name) { | ||
// [START bigqueryconnection_v1_generated_ConnectionService_GetConnection_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Name of the requested connection, for example: | ||
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}` | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Connection library | ||
const {ConnectionServiceClient} = | ||
require('@google-cloud/bigquery-connection').v1; | ||
|
||
// Instantiates a client | ||
const connectionClient = new ConnectionServiceClient(); | ||
|
||
async function getConnection() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await connectionClient.getConnection(request); | ||
console.log(response); | ||
} | ||
|
||
getConnection(); | ||
// [END bigqueryconnection_v1_generated_ConnectionService_GetConnection_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
59 changes: 59 additions & 0 deletions
59
...oogle-cloud-bigquery-connection/samples/generated/v1/connection_service.get_iam_policy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(resource) { | ||
// [START bigqueryconnection_v1_generated_ConnectionService_GetIamPolicy_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* REQUIRED: The resource for which the policy is being requested. | ||
* See the operation documentation for the appropriate value for this field. | ||
*/ | ||
// const resource = 'abc123' | ||
/** | ||
* OPTIONAL: A `GetPolicyOptions` object for specifying options to | ||
* `GetIamPolicy`. This field is only used by Cloud IAM. | ||
*/ | ||
// const options = '' | ||
|
||
// Imports the Connection library | ||
const {ConnectionServiceClient} = | ||
require('@google-cloud/bigquery-connection').v1; | ||
|
||
// Instantiates a client | ||
const connectionClient = new ConnectionServiceClient(); | ||
|
||
async function getIamPolicy() { | ||
// Construct request | ||
const request = { | ||
resource, | ||
}; | ||
|
||
// Run request | ||
const response = await connectionClient.getIamPolicy(request); | ||
console.log(response); | ||
} | ||
|
||
getIamPolicy(); | ||
// [END bigqueryconnection_v1_generated_ConnectionService_GetIamPolicy_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
65 changes: 65 additions & 0 deletions
65
...gle-cloud-bigquery-connection/samples/generated/v1/connection_service.list_connections.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(parent, pageSize) { | ||
// [START bigqueryconnection_v1_generated_ConnectionService_ListConnections_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Parent resource name. | ||
* Must be in the form: `projects/{project_id}/locations/{location_id}` | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Required. Page size. | ||
*/ | ||
// const pageSize = 1234 | ||
/** | ||
* Page token. | ||
*/ | ||
// const pageToken = 'abc123' | ||
|
||
// Imports the Connection library | ||
const {ConnectionServiceClient} = | ||
require('@google-cloud/bigquery-connection').v1; | ||
|
||
// Instantiates a client | ||
const connectionClient = new ConnectionServiceClient(); | ||
|
||
async function listConnections() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
pageSize, | ||
}; | ||
|
||
// Run request | ||
const iterable = await connectionClient.listConnectionsAsync(request); | ||
for await (const response of iterable) { | ||
console.log(response); | ||
} | ||
} | ||
|
||
listConnections(); | ||
// [END bigqueryconnection_v1_generated_ConnectionService_ListConnections_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
62 changes: 62 additions & 0 deletions
62
...oogle-cloud-bigquery-connection/samples/generated/v1/connection_service.set_iam_policy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
function main(resource, policy) { | ||
// [START bigqueryconnection_v1_generated_ConnectionService_SetIamPolicy_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* REQUIRED: The resource for which the policy is being specified. | ||
* See the operation documentation for the appropriate value for this field. | ||
*/ | ||
// const resource = 'abc123' | ||
/** | ||
* REQUIRED: The complete policy to be applied to the `resource`. The size of | ||
* the policy is limited to a few 10s of KB. An empty policy is a | ||
* valid policy but certain Cloud Platform services (such as Projects) | ||
* might reject them. | ||
*/ | ||
// const policy = '' | ||
|
||
// Imports the Connection library | ||
const {ConnectionServiceClient} = | ||
require('@google-cloud/bigquery-connection').v1; | ||
|
||
// Instantiates a client | ||
const connectionClient = new ConnectionServiceClient(); | ||
|
||
async function setIamPolicy() { | ||
// Construct request | ||
const request = { | ||
resource, | ||
policy, | ||
}; | ||
|
||
// Run request | ||
const response = await connectionClient.setIamPolicy(request); | ||
console.log(response); | ||
} | ||
|
||
setIamPolicy(); | ||
// [END bigqueryconnection_v1_generated_ConnectionService_SetIamPolicy_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.