vds/CampaignCollection.js

/**
 * @fileoverview Exposed data type for use outside of VdsClient.
 *               All properties should be exposed to allow use from uncompiled
 *               code.
 *
 * @author anders.rejdebrant@spark-vision.com (Anders Rejdebrant)
 */

goog.provide('spv.vds.CampaignCollection');

goog.require('spv.vds.Campaign');




/**
 * @export
 * @struct
 * @constructor
 * @param {Array.<spv.vds.Campaign>} campaigns
 * @param {string} error
 * @param {boolean} is_being_refreshed
 * @param {string} refreshed
 */
spv.vds.CampaignCollection = function(
		campaigns,
		error,
		is_being_refreshed,
		refreshed)
{
	/**
	 * This array can contain campaigns if there are any validated campaigns
	 * available for the requested campaign feed.
	 *
	 * @type {Array.<spv.vds.Campaign>}
	 * @nocollapse
	 */
	this.campaigns = campaigns;

	/**
	 * This property can contain information from internal server errors for
	 * debugging and logging.
	 *
	 * @type {string}
	 * @nocollapse
	 */
	this.error = error;

	/**
	 * The server is currently working on validating refreshed campaign data.
	 * 
	 * Updating the campaign collections can take a significant amount of time
	 * due to the need to test load campaigns to assure compatibility with the
	 * currently available content data. To avoid timing out the connection this
	 * property will be set instead to indicate to the client that a refresh is
	 * recommended within a minute or two.
	 *
	 * The typical usage for this propery is for the GUI to display a loading
	 * indicator until refreshed campaign data can be retrieved.
	 *
	 * @type {boolean}
	 * @nocollapse
	 */
	this.is_being_refreshed = is_being_refreshed;

	/**
	 * Timestamp for last refresh, TODO: change to Date
	 *
	 * @type {string}
	 * @nocollapse
	 */
	this.refreshed = refreshed;
};