1 /**
  2  * @fileOverview JavaScript representation of the Finesse WrapUpReason object.
  3  *
  4  * @name finesse.restservices.WrapUpReason
  5  * @requires finesse.clientservices.ClientServices
  6  * @requires Class
  7  * @requires finesse.FinesseBase
  8  * @requires finesse.restservices.RestBase
  9  */
 10 
 11 var finesse = finesse || {};
 12 finesse.restservices = finesse.restservices || {};
 13 
 14 /** @private */
 15 finesse.restservices.WrapUpReason = finesse.restservices.RestBase.extend(/** @lends finesse.restservices.WrapUpReason.prototype */{
 16 
 17     /**
 18      * @class
 19      * JavaScript representation of a WrapUpReason object. Also exposes
 20      * methods to operate on the object against the server.
 21      *
 22 	 * @param {Object} options
 23 	 *     An object with the following properties:<ul>
 24      *         <li><b>id:</b> The id of the object being constructed</li>
 25      *         <li><b>onLoad(this): (optional)</b> when the object is successfully loaded from the server</li>
 26      *         <li><b>onChange(this): (optional)</b> when an update notification of the object is received</li>
 27      *         <li><b>onAdd(this): (optional)</b> when a notification that the object is created is received</li>
 28      *         <li><b>onDelete(this): (optional)</b> when a notification that the object is deleted is received</li>
 29      *         <li><b>onError(rsp): (optional)</b> if loading of the object fails, invoked with the error response object:<ul>
 30      *             <li><b>status:</b> {Number} The HTTP status code returned</li>
 31      *             <li><b>content:</b> {String} Raw string of response</li>
 32      *             <li><b>object:</b> {Object} Parsed object of response</li>
 33      *             <li><b>error:</b> {Object} Wrapped exception that was caught:<ul>
 34      *                 <li><b>errorType:</b> {String} Type of error that was caught</li>
 35      *                 <li><b>errorMessage:</b> {String} Message associated with error</li>
 36      *             </ul></li>
 37      *         </ul></li>
 38      *         <li><b>parentObj: (optional)</b> The parent object</li></ul>
 39      * @constructs finesse.restservices.WrapUpReason
 40      **/
 41     init: function (options) {
 42         this._super(options);
 43     },
 44 
 45     /**
 46      * @private
 47      * Gets the REST class for the current object - this is the WrapUpReason class.
 48      * @returns {Object} The WrapUpReason class.
 49      */
 50     getRestClass: function () {
 51         return finesse.restservices.WrapUpReason;
 52     },
 53 
 54     /**
 55      * @private
 56      * Gets the REST type for the current object - this is a "WrapUpReason".
 57      * @returns {String} The WrapUpReason string.
 58      */
 59     getRestType: function () {
 60         return "WrapUpReason";
 61     },
 62 
 63     /**
 64      * @private
 65      * Gets the REST type for the current object - this is a "WrapUpReasons".
 66      * @returns {String} The WrapUpReasons string.
 67      */
 68     getParentRestType: function () {
 69         return "WrapUpReasons";
 70     },
 71 
 72     /**
 73      * @private
 74      * Override default to indicate that this object doesn't support making
 75      * requests.
 76      */
 77     supportsRequests: false,
 78 
 79     /**
 80      * @private
 81      * Override default to indicate that this object doesn't support subscriptions.
 82      */
 83     supportsSubscriptions: false,
 84 
 85     /**
 86      * Getter for the label.
 87      * @returns {String} The label.
 88      */
 89     getLabel: function () {
 90         this.isLoaded();
 91         return this.getData().label;
 92     },
 93 
 94     /**
 95      * Getter for the forAall flag.
 96      * @returns {String} The from address.
 97      */
 98     getForAll: function () {
 99         this.isLoaded();
100         return this.getData().forAll;
101     },
102 
103     /**
104      * Getter for the Uri value.
105      * @returns {String} The Uri.
106      */
107     getUri: function () {
108         this.isLoaded();
109         return this.getData().uri;
110     }
111 });
112 
113