2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
16 * @fileoverview ResponseItem containing information about a specific response
23 * Represents a response that was generated
24 * by processing a data request item on the server.
26 * @name opensocial.ResponseItem
31 * Represents a response that was generated by processing a data request item
37 opensocial.ResponseItem = function() {};
41 * Returns true if there was an error in fetching this data from the server.
43 * @return {Boolean} True if there was an error; otherwise, false
45 opensocial.ResponseItem.prototype.hadError = function() {};
52 * Error codes that a response item can return.
54 * @name opensocial.ResponseItem.Error
56 opensocial.ResponseItem.Error = {
58 * This container does not support the request that was made.
59 * This field may be used interchangeably with the string 'notImplemented'.
60 * @member opensocial.ResponseItem.Error
62 NOT_IMPLEMENTED : 'notImplemented',
65 * The gadget does not have access to the requested data.
67 * <a href="opensocial.html#requestPermission">
68 * opensocial.requestPermission()</a>.
69 * This field may be used interchangeably with the string 'unauthorized'.
70 * @member opensocial.ResponseItem.Error
72 UNAUTHORIZED : 'unauthorized',
75 * The gadget can never have access to the requested data.
76 * This field may be used interchangeably with the string 'forbidden'.
77 * @member opensocial.ResponseItem.Error
79 FORBIDDEN : 'forbidden',
82 * The request was invalid. Example: 'max' was -1.
83 * This field may be used interchangeably with the string 'badRequest'.
84 * @member opensocial.ResponseItem.Error
86 BAD_REQUEST : 'badRequest',
89 * The request encountered an unexpected condition that
90 * prevented it from fulfilling the request.
91 * This field may be used interchangeably with the string 'internalError'.
92 * @member opensocial.ResponseItem.Error
94 INTERNAL_ERROR : 'internalError',
97 * The gadget exceeded a quota on the request. Example quotas include a
98 * max number of calls per day, calls per user per day, calls within a
99 * certain time period and so forth.
100 * This field may be used interchangeably with the string 'limitExceeded'.
101 * @member opensocial.ResponseItem.Error
103 LIMIT_EXCEEDED : 'limitExceeded'
108 * If the request had an error, returns the error code.
109 * The error code can be container-specific
110 * or one of the values defined by
111 * <a href="opensocial.ResponseItem.Error.html"><code>Error</code></a>.
113 * @return {String} The error code, or null if no error occurred
115 opensocial.ResponseItem.prototype.getErrorCode = function() {};
119 * If the request had an error, returns the error message.
121 * @return {String} A human-readable description of the error that occurred;
122 * can be null, even if an error occurred
124 opensocial.ResponseItem.prototype.getErrorMessage = function() {};
128 * Returns the original data request item.
130 * @return {Object} The request item used to fetch this data
133 opensocial.ResponseItem.prototype.getOriginalDataRequest = function() {};
137 * Gets the response data.
139 * @return {Object} The requested value calculated by the server; the type of
140 * this value is defined by the type of request that was made
142 opensocial.ResponseItem.prototype.getData = function() {};