1 /** 2 * @fileOverview JavaScript representation of the Finesse Not Ready Reason Code object. 3 * 4 * @name finesse.restservices.NotReadyReasonCode 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.NotReadyReasonCode = finesse.restservices.RestBase.extend(/** @lends finesse.restservices.NotReadyReasonCode.prototype */{ 16 17 /** 18 * @class 19 * JavaScript representation of a ReasonCode 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.NotReadyReasonCode 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 ReasonCodes class. 48 * @returns {Object} The ReasonCodes class. 49 */ 50 getRestClass: function () { 51 return finesse.restservices.NotReadyReasonCode; 52 }, 53 54 /** 55 * @private 56 * Gets the REST type for the current object - this is a "ReasonCode". 57 * @returns {String} The ReasonCode string. 58 */ 59 getRestType: function () { 60 return "ReasonCode"; 61 }, 62 63 64 /** 65 * @private 66 * Gets the REST type for the current object - this is a "ReasonCodes". 67 * @returns {String} The ReasonCode string. 68 */ 69 getParentRestType: function () { 70 return "ReasonCodes"; 71 }, 72 73 /** 74 * @private 75 * Override default to indicate that this object doesn't support making 76 * requests. 77 */ 78 supportsRequests: false, 79 80 /** 81 * @private 82 * Override default to indicate that this object doesn't support subscriptions. 83 */ 84 supportsSubscriptions: false, 85 86 /** 87 * Getter for the category. 88 * @returns {String} The category. 89 */ 90 getCategory: function () { 91 this.isLoaded(); 92 return this.getData().category; 93 }, 94 95 /** 96 * Getter for the code. 97 * @returns {String} The code. 98 */ 99 getCode: function () { 100 this.isLoaded(); 101 return this.getData().code; 102 }, 103 104 /** 105 * Getter for the label. 106 * @returns {String} The label. 107 */ 108 getLabel: function () { 109 this.isLoaded(); 110 return this.getData().label; 111 }, 112 113 /** 114 * Getter for the forAll value. 115 * @returns {String} The forAll. 116 */ 117 getForAll: function () { 118 this.isLoaded(); 119 return this.getData().forAll; 120 }, 121 122 /** 123 * Getter for the Uri value. 124 * @returns {String} The Uri. 125 */ 126 getUri: function () { 127 this.isLoaded(); 128 return this.getData().uri; 129 } 130 131 }); 132 133