-
Notifications
You must be signed in to change notification settings - Fork 595
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 Node samples (#485)
* docs(samples): add auto-generated Node samples build(generator): find protoc based on its bazel location PiperOrigin-RevId: 398604509 Source-Link: googleapis/googleapis@6ef16b9 Source-Link: googleapis/googleapis-gen@8314e1e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODMxNGUxZWFkM2U5MDZkYmYyMDEyY2VkOGQ5MmYyYmM4ZGQ0NWM5NSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ad08b22
commit db53826
Showing
12 changed files
with
690 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.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 oslogin_v1_generated_OsLoginService_DeletePosixAccount_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. A reference to the POSIX account to update. POSIX accounts are identified | ||
* by the project ID they are associated with. A reference to the POSIX | ||
* account is in format `users/{user}/projects/{project}`. | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Oslogin library | ||
const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; | ||
|
||
// Instantiates a client | ||
const osloginClient = new OsLoginServiceClient(); | ||
|
||
async function deletePosixAccount() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await osloginClient.deletePosixAccount(request); | ||
console.log(response); | ||
} | ||
|
||
deletePosixAccount(); | ||
// [END oslogin_v1_generated_OsLoginService_DeletePosixAccount_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
54 changes: 54 additions & 0 deletions
54
packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.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 oslogin_v1_generated_OsLoginService_DeleteSshPublicKey_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The fingerprint of the public key to update. Public keys are identified by | ||
* their SHA-256 fingerprint. The fingerprint of the public key is in format | ||
* `users/{user}/sshPublicKeys/{fingerprint}`. | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Oslogin library | ||
const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; | ||
|
||
// Instantiates a client | ||
const osloginClient = new OsLoginServiceClient(); | ||
|
||
async function deleteSshPublicKey() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await osloginClient.deleteSshPublicKey(request); | ||
console.log(response); | ||
} | ||
|
||
deleteSshPublicKey(); | ||
// [END oslogin_v1_generated_OsLoginService_DeleteSshPublicKey_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
60 changes: 60 additions & 0 deletions
60
packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.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,60 @@ | ||
// 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 oslogin_v1_generated_OsLoginService_GetLoginProfile_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The unique ID for the user in format `users/{user}`. | ||
*/ | ||
// const name = 'abc123' | ||
/** | ||
* The project ID of the Google Cloud Platform project. | ||
*/ | ||
// const projectId = 'abc123' | ||
/** | ||
* A system ID for filtering the results of the request. | ||
*/ | ||
// const systemId = 'abc123' | ||
|
||
// Imports the Oslogin library | ||
const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; | ||
|
||
// Instantiates a client | ||
const osloginClient = new OsLoginServiceClient(); | ||
|
||
async function getLoginProfile() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await osloginClient.getLoginProfile(request); | ||
console.log(response); | ||
} | ||
|
||
getLoginProfile(); | ||
// [END oslogin_v1_generated_OsLoginService_GetLoginProfile_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
54 changes: 54 additions & 0 deletions
54
packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.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 oslogin_v1_generated_OsLoginService_GetSshPublicKey_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The fingerprint of the public key to retrieve. Public keys are identified | ||
* by their SHA-256 fingerprint. The fingerprint of the public key is in | ||
* format `users/{user}/sshPublicKeys/{fingerprint}`. | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Oslogin library | ||
const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; | ||
|
||
// Instantiates a client | ||
const osloginClient = new OsLoginServiceClient(); | ||
|
||
async function getSshPublicKey() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await osloginClient.getSshPublicKey(request); | ||
console.log(response); | ||
} | ||
|
||
getSshPublicKey(); | ||
// [END oslogin_v1_generated_OsLoginService_GetSshPublicKey_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
60 changes: 60 additions & 0 deletions
60
packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.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,60 @@ | ||
// 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) { | ||
// [START oslogin_v1_generated_OsLoginService_ImportSshPublicKey_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The unique ID for the user in format `users/{user}`. | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Optional. The SSH public key and expiration time. | ||
*/ | ||
// const sshPublicKey = '' | ||
/** | ||
* The project ID of the Google Cloud Platform project. | ||
*/ | ||
// const projectId = 'abc123' | ||
|
||
// Imports the Oslogin library | ||
const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; | ||
|
||
// Instantiates a client | ||
const osloginClient = new OsLoginServiceClient(); | ||
|
||
async function importSshPublicKey() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
}; | ||
|
||
// Run request | ||
const response = await osloginClient.importSshPublicKey(request); | ||
console.log(response); | ||
} | ||
|
||
importSshPublicKey(); | ||
// [END oslogin_v1_generated_OsLoginService_ImportSshPublicKey_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
63 changes: 63 additions & 0 deletions
63
packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.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(name, sshPublicKey) { | ||
// [START oslogin_v1_generated_OsLoginService_UpdateSshPublicKey_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The fingerprint of the public key to update. Public keys are identified by | ||
* their SHA-256 fingerprint. The fingerprint of the public key is in format | ||
* `users/{user}/sshPublicKeys/{fingerprint}`. | ||
*/ | ||
// const name = 'abc123' | ||
/** | ||
* Required. The SSH public key and expiration time. | ||
*/ | ||
// const sshPublicKey = '' | ||
/** | ||
* Mask to control which fields get updated. Updates all if not present. | ||
*/ | ||
// const updateMask = '' | ||
|
||
// Imports the Oslogin library | ||
const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; | ||
|
||
// Instantiates a client | ||
const osloginClient = new OsLoginServiceClient(); | ||
|
||
async function updateSshPublicKey() { | ||
// Construct request | ||
const request = { | ||
name, | ||
sshPublicKey, | ||
}; | ||
|
||
// Run request | ||
const response = await osloginClient.updateSshPublicKey(request); | ||
console.log(response); | ||
} | ||
|
||
updateSshPublicKey(); | ||
// [END oslogin_v1_generated_OsLoginService_UpdateSshPublicKey_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.