node-calendly
Version:
Node module to access calendly api.
35 lines • 1.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Information about the user. Extends the user type definition by two more methods:
* - fromJson: Creates a user object from a json object.
* - getUUID: Returns the uuid of the user.
*
* @export default
* @interface User
* @implements {UserType}
* @see https://developer.calendly.com/api-docs/647961f90c0dd-user
*/
class User {
constructor(data) {
this.uri = data.uri;
this.name = data.name;
this.slug = data.slug;
this.email = data.email;
this.scheduling_url = data.scheduling_url;
this.timezone = data.timezone;
this.avatar_url = data.avatar_url;
this.created_at = data.created_at;
this.updated_at = data.updated_at;
this.current_organization = data.current_organization;
this.uuid = this.getUuid(data.uri);
}
static fromJson(data) {
return new User(data);
}
getUuid(uri) {
return uri.split('/').pop() || undefined;
}
}
exports.default = User;
//# sourceMappingURL=User.js.map