-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: add sample test Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
06a0f0a
commit c1d8ea9
Showing
4 changed files
with
82 additions
and
30 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -20,4 +20,4 @@ | |
"chai": "^4.2.0", | ||
"mocha": "^8.0.0" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,34 +1,64 @@ | ||
// Copyright 2017 Google LLC | ||
// Copyright 2022 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 | ||
// https://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. | ||
// | ||
// ** This file is automatically generated by gapic-generator-typescript. ** | ||
// ** https://github.com/googleapis/gapic-generator-typescript ** | ||
// ** All changes to this file may be overwritten. ** | ||
|
||
'use strict'; | ||
|
||
async function main() { | ||
function main(name) { | ||
// [START oslogin_quickstart] | ||
const {OsLoginServiceClient} = require('@google-cloud/os-login'); | ||
const client = new OsLoginServiceClient(); | ||
|
||
async function quickstart() { | ||
const [loginProfile] = await client.getLoginProfile({ | ||
name: 'users/beckwith@google.com', | ||
}); | ||
console.log('Login Profile:'); | ||
console.log(loginProfile); | ||
/** | ||
* 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 callGetLoginProfile() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await osloginClient.getLoginProfile(request); | ||
console.log(response[0]); | ||
} | ||
|
||
quickstart(); | ||
callGetLoginProfile(); | ||
// [END oslogin_quickstart] | ||
} | ||
|
||
main(); | ||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
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