Manual Reference Source Test

src/models/callback/CallbackCondition.js

/**
 * Model representing a callback condition.
 */
class CallbackConditionModel {
  /**
   * @param {Object} response               - JSON formatted response of the callback's condtionals
   * @param {String} response.callbackId    - The callback condition's ID
   * @param {String} response.callbackType  - The type of callback
   * @param {String} response.createdAt     - The callback condition's creation time
   * @param {String} response.id            - The response id
   * @param {String} response.criteria      - The callback condition's trigger criteria
   * @param {String} response.updated_at    - The condition's last update time
   * @param {Number} response.contentId     - The content Id associated with the condition.
   * @param {String} response.operator      - The callback condition's trigger operator
   * @param {String} response.value         - The callback condition's value
   * @param {String} response.unit          - The callback condition's unit
   */
  constructor(response = {}) {
    /** @type {String} */
    this.callbackId = response.callbackId;
    /** @type {String} */
    this.callbackType = response.callback_type;
    /** @type {String} */
    this.createdAt = response.created_at;
    /** @type {String} */
    this.id = response.id;
    /** @type {String} */
    this.criteria = response.criteria;
    /** @type {String} */
    this.updatedAt = response.updated_at;
    /** @type {Number} */
    this.contentId = response.content_id;
    /** @type {String} */
    this.operator = response.operator;
    /** @type {String} */
    this.value = response.value;
    /** @type {String} */
    this.unit = response.unit;
  }
}

export default CallbackConditionModel;