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 Representation of a person.
22 * Base interface for all person objects.
24 * @name opensocial.Person
29 * Base interface for all person objects.
34 opensocial.Person = function() {};
40 * All of the fields that a person has. These are the supported keys for the
41 * <a href="opensocial.Person.html#getField">Person.getField()</a> method.
43 * @name opensocial.Person.Field
45 opensocial.Person.Field = {
47 * A string ID that can be permanently associated with this person.
48 * This field may be used interchangeably with the string 'id'.
49 * @member opensocial.Person.Field
54 * A opensocial.Name object containing the person's name.
55 * This field may be used interchangeably with the string 'name'.
56 * @member opensocial.Person.Field
61 * A String representing the person's nickname. This represents the casual
62 * way to address this person in real life.
63 * This field may be used interchangeably with the string 'nickname'.
64 * @member opensocial.Person.Field
66 NICKNAME : 'nickname',
69 * Person's photo thumbnail URL, specified as a string.
70 * This URL must be fully qualified. Relative URLs will not work in gadgets.
71 * This field may be used interchangeably with the string 'thumbnailUrl'.
72 * @member opensocial.Person.Field
74 THUMBNAIL_URL : 'thumbnailUrl',
77 * Person's profile URL, specified as a string.
78 * This URL must be fully qualified. Relative URLs will not work in gadgets.
79 * Container support for this field is OPTIONAL.
80 * This field may be used interchangeably with the string 'profileUrl'.
81 * @member opensocial.Person.Field
83 PROFILE_URL : 'profileUrl',
86 * Person's current location, specified as an
87 * <a href="opensocial.Address.html">Address</a>.
88 * Container support for this field is OPTIONAL.
89 * This field may be used interchangeably with the string 'currentLocation'.
90 * @member opensocial.Person.Field
92 CURRENT_LOCATION : 'currentLocation',
95 * Addresses associated with the person, specified as an Array of
96 * <a href="opensocial.Address.html">Address</a>es.
97 * Container support for this field is OPTIONAL.
98 * This field may be used interchangeably with the string 'addresses'.
99 * @member opensocial.Person.Field
101 ADDRESSES : 'addresses',
104 * Emails associated with the person, specified as an Array of
105 * <a href="opensocial.Email.html">Email</a>s.
106 * Container support for this field is OPTIONAL.
107 * This field may be used interchangeably with the string 'emails'.
108 * @member opensocial.Person.Field
113 * Phone numbers associated with the person, specified as an Array of
114 * <a href="opensocial.Phone.html">Phone</a>s.
115 * Container support for this field is OPTIONAL.
116 * This field may be used interchangeably with the string 'phoneNumbers'.
117 * @member opensocial.Person.Field
119 PHONE_NUMBERS : 'phoneNumbers',
122 * A general statement about the person, specified as a string.
123 * Container support for this field is OPTIONAL.
124 * This field may be used interchangeably with the string 'aboutMe'.
125 * @member opensocial.Person.Field
127 ABOUT_ME : 'aboutMe',
130 * Person's status, headline or shoutout, specified as a string.
131 * Container support for this field is OPTIONAL.
132 * This field may be used interchangeably with the string 'status'.
133 * @member opensocial.Person.Field
138 * Person's profile song, specified as an opensocial.Url.
139 * Container support for this field is OPTIONAL.
140 * This field may be used interchangeably with the string 'profileSong'.
141 * @member opensocial.Person.Field
143 PROFILE_SONG : 'profileSong',
146 * Person's profile video, specified as an opensocial.Url.
147 * Container support for this field is OPTIONAL.
148 * This field may be used interchangeably with the string 'profileVideo'.
149 * @member opensocial.Person.Field
151 PROFILE_VIDEO : 'profileVideo',
154 * Person's gender, specified as an opensocial.Enum with the enum's
155 * key referencing opensocial.Enum.Gender.
156 * Container support for this field is OPTIONAL.
157 * This field may be used interchangeably with the string 'gender'.
158 * @member opensocial.Person.Field
163 * Person's sexual orientation, specified as a string.
164 * Container support for this field is OPTIONAL.
165 * This field may be used interchangeably with the string 'sexualOrientation'.
166 * @member opensocial.Person.Field
168 SEXUAL_ORIENTATION : 'sexualOrientation',
171 * Person's relationship status, specified as a string.
172 * Container support for this field is OPTIONAL.
173 * This field may be used interchangeably with the string
174 * 'relationshipStatus'.
175 * @member opensocial.Person.Field
177 RELATIONSHIP_STATUS : 'relationshipStatus',
180 * Person's age, specified as a number.
181 * Container support for this field is OPTIONAL.
182 * This field may be used interchangeably with the string 'age'.
183 * @member opensocial.Person.Field
188 * Person's date of birth, specified as a Date object.
189 * Container support for this field is OPTIONAL.
190 * This field may be used interchangeably with the string 'dateOfBirth'.
191 * @member opensocial.Person.Field
193 DATE_OF_BIRTH : 'dateOfBirth',
196 * Person's body characteristics, specified as an opensocial.BodyType.
197 * Container support for this field is OPTIONAL.
198 * This field may be used interchangeably with the string 'bodyType'.
199 * @member opensocial.Person.Field
201 BODY_TYPE : 'bodyType',
204 * Person's ethnicity, specified as a string.
205 * Container support for this field is OPTIONAL.
206 * This field may be used interchangeably with the string 'ethnicity'.
207 * @member opensocial.Person.Field
209 ETHNICITY : 'ethnicity',
212 * Person's smoking status, specified as an opensocial.Enum with the enum's
213 * key referencing opensocial.Enum.Smoker.
214 * Container support for this field is OPTIONAL.
215 * This field may be used interchangeably with the string 'smoker'.
216 * @member opensocial.Person.Field
221 * Person's drinking status, specified as an opensocial.Enum with the enum's
222 * key referencing opensocial.Enum.Drinker.
223 * Container support for this field is OPTIONAL.
224 * This field may be used interchangeably with the string 'drinker'.
225 * @member opensocial.Person.Field
230 * Description of the person's children, specified as a string.
231 * Container support for this field is OPTIONAL.
232 * This field may be used interchangeably with the string 'children'.
233 * @member opensocial.Person.Field
235 CHILDREN : 'children',
238 * Description of the person's pets, specified as a string.
239 * Container support for this field is OPTIONAL.
240 * This field may be used interchangeably with the string 'pets'.
241 * @member opensocial.Person.Field
246 * Description of the person's living arrangement, specified as a string.
247 * Container support for this field is OPTIONAL.
248 * This field may be used interchangeably with the string 'livingArrangement'.
249 * @member opensocial.Person.Field
251 LIVING_ARRANGEMENT : 'livingArrangement',
254 * Person's time zone, specified as the difference in minutes between
255 * Greenwich Mean Time (GMT) and the user's local time. See
256 * Date.getTimezoneOffset() in javascript for more details on this format.
257 * Container support for this field is OPTIONAL.
258 * This field may be used interchangeably with the string 'timeZone'.
259 * @member opensocial.Person.Field
261 TIME_ZONE : 'timeZone',
264 * List of the languages that the person speaks as ISO 639-1 codes,
265 * specified as an Array of strings.
266 * Container support for this field is OPTIONAL.
267 * This field may be used interchangeably with the string 'languagesSpoken'.
268 * @member opensocial.Person.Field
270 LANGUAGES_SPOKEN : 'languagesSpoken',
273 * Jobs the person has held, specified as an Array of
274 * <a href="opensocial.Organization.html">Organization</a>s.
275 * Container support for this field is OPTIONAL.
276 * This field may be used interchangeably with the string 'jobs'.
277 * @member opensocial.Person.Field
282 * Person's favorite jobs, or job interests and skills, specified as a string.
283 * Container support for this field is OPTIONAL.
284 * This field may be used interchangeably with the string 'jobInterests'.
285 * @member opensocial.Person.Field
287 JOB_INTERESTS : 'jobInterests',
290 * Schools the person has attended, specified as an Array of
291 * <a href="opensocial.Organization.html">Organization</a>s.
292 * Container support for this field is OPTIONAL.
293 * This field may be used interchangeably with the string 'schools'.
294 * @member opensocial.Person.Field
299 * Person's interests, hobbies or passions, specified as an Array of strings.
300 * Container support for this field is OPTIONAL.
301 * This field may be used interchangeably with the string 'interests'.
302 * @member opensocial.Person.Field
304 INTERESTS : 'interests',
307 * URLs related to the person, their webpages, or feeds. Specified as an
308 * Array of opensocial.Url.
309 * Container support for this field is OPTIONAL.
310 * This field may be used interchangeably with the string 'urls'.
311 * @member opensocial.Person.Field
316 * Person's favorite music, specified as an Array of strings.
317 * Container support for this field is OPTIONAL.
318 * This field may be used interchangeably with the string 'music'.
319 * @member opensocial.Person.Field
324 * Person's favorite movies, specified as an Array of strings.
325 * Container support for this field is OPTIONAL.
326 * This field may be used interchangeably with the string 'movies'.
327 * @member opensocial.Person.Field
332 * Person's favorite TV shows, specified as an Array of strings.
333 * Container support for this field is OPTIONAL.
334 * This field may be used interchangeably with the string 'tvShows'.
335 * @member opensocial.Person.Field
337 TV_SHOWS : 'tvShows',
340 * Person's favorite books, specified as an Array of strings.
341 * Container support for this field is OPTIONAL.
342 * This field may be used interchangeably with the string 'books'.
343 * @member opensocial.Person.Field
348 * Person's favorite activities, specified as an Array of strings.
349 * Container support for this field is OPTIONAL.
350 * This field may be used interchangeably with the string 'activities'.
351 * @member opensocial.Person.Field
353 ACTIVITIES : 'activities',
356 * Person's favorite sports, specified as an Array of strings.
357 * Container support for this field is OPTIONAL.
358 * This field may be used interchangeably with the string 'sports'.
359 * @member opensocial.Person.Field
364 * Person's favorite heroes, specified as an Array of strings.
365 * Container support for this field is OPTIONAL.
366 * This field may be used interchangeably with the string 'heroes'.
367 * @member opensocial.Person.Field
372 * Person's favorite quotes, specified as an Array of strings.
373 * Container support for this field is OPTIONAL.
374 * This field may be used interchangeably with the string 'quotes'.
375 * @member opensocial.Person.Field
380 * Person's favorite cars, specified as an Array of strings.
381 * Container support for this field is OPTIONAL.
382 * This field may be used interchangeably with the string 'cars'.
383 * @member opensocial.Person.Field
388 * Person's favorite food, specified as an Array of strings.
389 * Container support for this field is OPTIONAL.
390 * This field may be used interchangeably with the string 'food'.
391 * @member opensocial.Person.Field
396 * Person's turn ons, specified as an Array of strings.
397 * Container support for this field is OPTIONAL.
398 * This field may be used interchangeably with the string 'turnOns'.
399 * @member opensocial.Person.Field
401 TURN_ONS : 'turnOns',
404 * Person's turn offs, specified as an Array of strings.
405 * Container support for this field is OPTIONAL.
406 * This field may be used interchangeably with the string 'turnOffs'.
407 * @member opensocial.Person.Field
409 TURN_OFFS : 'turnOffs',
412 * Arbitrary tags about the person, specified as an Array of strings.
413 * Container support for this field is OPTIONAL.
414 * This field may be used interchangeably with the string 'tags'.
415 * @member opensocial.Person.Field
420 * Person's comments about romance, specified as a string.
421 * Container support for this field is OPTIONAL.
422 * This field may be used interchangeably with the string 'romance'.
423 * @member opensocial.Person.Field
428 * What the person is scared of, specified as a string.
429 * Container support for this field is OPTIONAL.
430 * This field may be used interchangeably with the string 'scaredOf'.
431 * @member opensocial.Person.Field
433 SCARED_OF : 'scaredOf',
436 * Describes when the person is happiest, specified as a string.
437 * Container support for this field is OPTIONAL.
438 * This field may be used interchangeably with the string 'happiestWhen'.
439 * @member opensocial.Person.Field
441 HAPPIEST_WHEN : 'happiestWhen',
444 * Person's thoughts on fashion, specified as a string.
445 * Container support for this field is OPTIONAL.
446 * This field may be used interchangeably with the string 'fashion'.
447 * @member opensocial.Person.Field
452 * Person's thoughts on humor, specified as a string.
453 * Container support for this field is OPTIONAL.
454 * This field may be used interchangeably with the string 'humor'.
455 * @member opensocial.Person.Field
460 * Person's statement about who or what they are looking for, or what they are
461 * interested in meeting people for. Specified as an Array of opensocial.Enum
462 * with the enum's key referencing opensocial.Enum.LookingFor.
463 * Container support for this field is OPTIONAL.
464 * This field may be used interchangeably with the string 'lookingFor'.
465 * @member opensocial.Person.Field
467 LOOKING_FOR : 'lookingFor',
470 * Person's relgion or religious views, specified as a string.
471 * Container support for this field is OPTIONAL.
472 * This field may be used interchangeably with the string 'religion'.
473 * @member opensocial.Person.Field
475 RELIGION : 'religion',
478 * Person's political views, specified as a string.
479 * Container support for this field is OPTIONAL.
480 * This field may be used interchangeably with the string 'politicalViews'.
481 * @member opensocial.Person.Field
483 POLITICAL_VIEWS : 'politicalViews',
486 * A boolean indicating whether the person has used the current app.
487 * Container support for this field is OPTIONAL.
488 * This field may be used interchangeably with the string 'hasApp'.
489 * @member opensocial.Person.Field
494 * Person's current network status. Specified as an Enum with the enum's
495 * key referencing opensocial.Enum.Presence.
496 * Container support for this field is OPTIONAL.
497 * This field may be used interchangeably with the string 'networkPresence'.
498 * @member opensocial.Person.Field
500 NETWORK_PRESENCE : 'networkPresence'
505 * Gets an ID that can be permanently associated with this person.
507 * @return {String} The ID
509 opensocial.Person.prototype.getId = function() {};
513 * Gets a text display name for this person; guaranteed to return
516 * @return {String} The display name
518 opensocial.Person.prototype.getDisplayName = function() {};
522 * Gets data for this person that is associated with the specified key.
524 * @param {String} key The key to get data for;
525 * keys are defined in <a href="opensocial.Person.Field.html"><code>
526 * Person.Field</code></a>
527 * @param {Map.<opensocial.DataRequest.DataRequestFields, Object>}
528 * opt_params Additional
529 * <a href="opensocial.DataRequest.DataRequestFields.html">params</a>
530 * to pass to the request.
531 * @return {String} The data
533 opensocial.Person.prototype.getField = function(key, opt_params) {};
537 * Returns true if this person object represents the currently logged in user.
539 * @return {Boolean} True if this is the currently logged in user;
542 opensocial.Person.prototype.isViewer = function() {};
546 * Returns true if this person object represents the owner of the current page.
548 * @return {Boolean} True if this is the owner of the page;
551 opensocial.Person.prototype.isOwner = function() {};