Manual Reference Source Test

src/models/Advertisement.js

/**
 * @deprecated
 *
 * Model representing a advertisement.
 *
 */
class AdvertisementModel {
  /**
   * @param {Object} response               - JSON formatted response of a single advertisement
   * @param {Number} response.action        - The action the device needs to execute when the ad is
   *                                          tapped
   * @param {Object} response.action_object - Complementary information for the action, this value
   *                                          depends on the action
   * @param {Number} response.content_id    - The content_id of the image
   * @param {String} response.description   - The description of the image
   * @param {Number} response.id            - The id of the image
   * @param {Object} response.image         - The icon of the advertisement
   * @param {Object} response.image.image   - The url of the advertisement
   * @param {Array}  response.tags          - An Array of tags,
   * @param {String} response.title         - The title of the advertisement, this should be shown
   *                                          in the device
   */
  constructor(response = {}) {
    /** @type {Number} */
    this.action = response.action;

    /** @type {Object} */
    this.action_object = response.action_object;

    /** @type {Number} */
    this.content_id = response.content_id;

    /** @type {String} */
    this.description = response.description;

    /** @type {Number} */
    this.id = response.id;

    /**
     * @type {Object}
     * @property {String} this.image.url
     * @property {Object} this.image.main
     * @property {String} this.image.main.url
     */
    this.image = response.image.image;

    /** @type {Array} */
    this.tags = response.tags;

    /** @type {String} */
    this.title = response.title;
  }
}

export default AdvertisementModel;