UNPKG

@authress/sdk

Version:

Client SDK for Authress authorization as a service. Provides managed authorization api to secure service resources including user data.

20 lines (16 loc) 582 B
const ArgumentRequiredError = require('./argumentRequiredError'); class UsersApi { constructor(client) { this.client = client; } async getUser(userId) { // verify required parameter 'userId' is not null or undefined if (userId === null || userId === undefined) { throw new ArgumentRequiredError('userId', 'Required parameter userId was null or undefined when calling getUser.'); } const url = `/v1/users/${encodeURIComponent(String(userId))}`; const response = await this.client.get(url); return response; } } module.exports = UsersApi;