@@ -35,17 +35,22 @@ class Person(SparkData):
35
35
"""Model a Spark 'person' JSON object as a native Python object."""
36
36
37
37
def __init__ (self , json ):
38
- """Init a new Person data object from a JSON dictionary or string.
38
+ """Initialize a Person data object from a dictionary or JSON string.
39
39
40
40
Args:
41
- json(dict, basestring): Input JSON object .
41
+ json(dict, basestring): Input dictionary or JSON string .
42
42
43
43
Raises:
44
44
TypeError: If the input object is not a dictionary or string.
45
45
46
46
"""
47
47
super (Person , self ).__init__ (json )
48
48
49
+ @property
50
+ def type (self ):
51
+ """The type of object returned by Cisco Spark (should be `person`)."""
52
+ return self ._json .get ('type' )
53
+
49
54
@property
50
55
def id (self ):
51
56
"""The person's unique ID."""
@@ -67,6 +72,11 @@ def displayName(self):
67
72
"""Full name of the person."""
68
73
return self ._json .get ('displayName' )
69
74
75
+ @property
76
+ def nickName (self ):
77
+ """'Nick name' or preferred short name of the person."""
78
+ return self ._json .get ('nickName' )
79
+
70
80
@property
71
81
def firstName (self ):
72
82
"""First name of the person."""
@@ -112,17 +122,27 @@ def lastActivity(self):
112
122
"""The date and time of the person's last activity."""
113
123
return self ._json .get ('lastActivity' )
114
124
125
+ @property
126
+ def invitePending (self ):
127
+ """Person has been sent an invite, but hasn't responded."""
128
+ return self ._json .get ('invitePending' )
129
+
130
+ @property
131
+ def loginEnabled (self ):
132
+ """Person is allowed to login."""
133
+ return self ._json .get ('loginEnabled' )
134
+
115
135
116
136
class PeopleAPI (object ):
117
137
"""Cisco Spark People-API wrapper class.
118
138
119
- Wrappers the Cisco Spark People-API and exposes the API calls as Python
120
- method calls that return native Python objects.
139
+ Wraps the Cisco Spark People-API and exposes the APIs as native Python
140
+ methods that return native Python objects.
121
141
122
142
"""
123
143
124
144
def __init__ (self , session ):
125
- """Init a new PeopleAPI object with the provided RestSession.
145
+ """Initialize a new PeopleAPI object with the provided RestSession.
126
146
127
147
Args:
128
148
session(RestSession): The RESTful session object to be used for
0 commit comments