src/models/sso/SsoOption.js
/**
* Model representing an SSO Option.
*/
class SsoOptionModel {
/**
* @param {Object} response - JSON formatted response of an SSO Option.
* @param {Number} response.id - The SSO Option ID value
* @param {Boolean} response.name - The name of the SSO Option
* @param {String} response.user_type - The user type of the SSO Option
* @param {String} response.permanent_link - The permanent link of the SSO Option
*/
constructor(response = {}) {
const _response = response.data || response; // if json api is passed in directly
const attributes = _response.attributes || _response; // if json api is passed in directly
if (_response.id) {
/** @type {Number} */
this.id = parseInt(_response.id, 10);
}
/** @type {String} */
this.name = attributes.name;
/** @type {String} */
this.userType = attributes.user_type;
/** @type {String} */
this.permanentLink = attributes.permanent_link;
}
}
export default SsoOptionModel;