@@ -72,7 +72,7 @@ def get_root_drive_delta(self) -> Dict:
72
72
Dict:
73
73
A List of Drive Resource Object.
74
74
"""
75
-
75
+
76
76
content = self .graph_session .make_request (
77
77
method = 'get' ,
78
78
endpoint = self .endpoint + "/root/delta"
@@ -96,6 +96,90 @@ def get_root_drive_followed(self) -> Dict:
96
96
97
97
return content
98
98
99
+ def get_recent_files (self ) -> Dict :
100
+ """List a set of items that have been recently used by the signed in user.
101
+
102
+ ### Overview:
103
+ ----
104
+ This collection includes items that are in the user's drive
105
+ as well as items they have access to from other drives.
106
+
107
+ ### Returns
108
+ ----
109
+ Dict:
110
+ A List of DriveItem Resource Objects.
111
+ """
112
+
113
+ content = self .graph_session .make_request (
114
+ method = 'get' ,
115
+ endpoint = "me/drive/recent"
116
+ )
117
+
118
+ return content
119
+
120
+ def get_shared_files (self ) -> Dict :
121
+ """Retrieve a collection of DriveItem resources that have been shared with the owner of the Drive.
122
+
123
+ ### Returns
124
+ ----
125
+ Dict:
126
+ A List of DriveItem Resource Objects.
127
+ """
128
+
129
+ content = self .graph_session .make_request (
130
+ method = 'get' ,
131
+ endpoint = "me/drive/sharedWithMe"
132
+ )
133
+
134
+ return content
135
+
136
+ def get_special_folder_by_name (self , folder_name : str ) -> Dict :
137
+ """Use the special collection to access a special folder by name.
138
+
139
+ ### Overview:
140
+ ----
141
+ Special folders provide simple aliases to access well-known folders
142
+ in OneDrive without the need to look up the folder by path (which
143
+ would require localization), or reference the folder with an ID. If
144
+ a special folder is renamed or moved to another location within the
145
+ drive, this syntax will continue to find that folder. Special folders
146
+ are automatically created the first time an application attempts to write
147
+ to one, if it doesn't already exist. If a user deletes one, it is recreated
148
+ when written to again. Note: If you have read-only permissions and request
149
+ a special folder that doesn't exist, you'll receive a 403 Forbidden error.
150
+
151
+ ### Returns
152
+ ----
153
+ Dict:
154
+ A List of DriveItem Resource Objects.
155
+ """
156
+
157
+ content = self .graph_session .make_request (
158
+ method = 'get' ,
159
+ endpoint = "/me/drive/special/{folder_name}" .format (
160
+ folder_name = folder_name )
161
+ )
162
+
163
+ return content
164
+
165
+ def get_special_folder_children_by_name (self , folder_name : str ) -> Dict :
166
+ """Use the special collection to access a collection of Children belonging to special folder
167
+ by name.
168
+
169
+ ### Returns
170
+ ----
171
+ Dict:
172
+ A List of DriveItem Resource Objects.
173
+ """
174
+
175
+ content = self .graph_session .make_request (
176
+ method = 'get' ,
177
+ endpoint = "/me/drive/special/{folder_name}/children" .format (
178
+ folder_name = folder_name )
179
+ )
180
+
181
+ return content
182
+
99
183
def get_drive_by_id (self , drive_id : str ) -> Dict :
100
184
"""Grab's a Drive Resource using the Drive ID.
101
185
@@ -112,13 +196,47 @@ def get_drive_by_id(self, drive_id: str) -> Dict:
112
196
113
197
return content
114
198
199
+ def get_my_drive (self ) -> Dict :
200
+ """Get's the User's Current OneDrive.
201
+
202
+ ### Returns
203
+ ----
204
+ Dict:
205
+ A Drive Resource Object.
206
+ """
207
+
208
+ content = self .graph_session .make_request (
209
+ method = 'get' ,
210
+ endpoint = self .endpoint + "/me"
211
+ )
212
+
213
+ return content
214
+
215
+ def get_my_drive_children (self , item_id : str ) -> Dict :
216
+ """Returns a list of DriveItem Resources for the User's Current OneDrive.
217
+
218
+ ### Returns
219
+ ----
220
+ Dict:
221
+ A List of DriveChildren Resource Objects.
222
+ """
223
+
224
+ content = self .graph_session .make_request (
225
+ method = 'get' ,
226
+ endpoint = self .endpoint + "/me/drive/items/{item_id}/children" .format (
227
+ item_id = item_id
228
+ )
229
+ )
230
+
231
+ return content
232
+
115
233
def get_my_drives (self ) -> Dict :
116
234
"""List children under the Drive for user's default Drive.
117
235
118
236
### Returns
119
237
----
120
238
Dict:
121
- A List of Drive Resource Object .
239
+ A List of Drive Resource Objects .
122
240
"""
123
241
124
242
content = self .graph_session .make_request (
@@ -128,28 +246,99 @@ def get_my_drives(self) -> Dict:
128
246
129
247
return content
130
248
249
+ def get_user_drive (self , user_id : str ) -> Dict :
250
+ """Returns the User's default OneDrive.
251
+
252
+ ### Returns
253
+ ----
254
+ Dict:
255
+ A Drive Resource Object.
256
+ """
257
+
258
+ content = self .graph_session .make_request (
259
+ method = 'get' ,
260
+ endpoint = "users/{user_id}/drive" .format (user_id = user_id )
261
+ )
262
+
263
+ return content
264
+
265
+ def get_user_drive_children (self , user_id : str , item_id : str ) -> Dict :
266
+ """Returns a list of DriveItem Resources for the Default User Drive.
267
+
268
+ ### Returns
269
+ ----
270
+ Dict:
271
+ A List of DriveChildren Resource Objects.
272
+ """
273
+
274
+ content = self .graph_session .make_request (
275
+ method = 'get' ,
276
+ endpoint = "users/{user_id}/drive/items/{item_id}/children" .format (
277
+ user_id = user_id ,
278
+ item_id = item_id
279
+ )
280
+ )
281
+
282
+ return content
283
+
131
284
def get_user_drives (self , user_id : str ) -> Dict :
132
- """List children under the Drive for user's default Drive.
285
+ """Returns a List Drive Resource Objects for user's default Drive.
133
286
134
287
### Returns
135
288
----
136
289
Dict:
137
- A List of Drive Resource Object .
290
+ A List of Drive Resource Objects .
138
291
"""
292
+
139
293
content = self .graph_session .make_request (
140
294
method = 'get' ,
141
295
endpoint = "users/{user_id}/drives" .format (user_id = user_id )
142
296
)
143
297
144
298
return content
145
299
300
+ def get_group_drive (self , group_id : str ) -> Dict :
301
+ """Returns a Site Group default Drive..
302
+
303
+ ### Returns
304
+ ----
305
+ Dict:
306
+ A Drive Resource Object.
307
+ """
308
+
309
+ content = self .graph_session .make_request (
310
+ method = 'get' ,
311
+ endpoint = "groups/{group_id}/drive" .format (group_id = group_id )
312
+ )
313
+
314
+ return content
315
+
316
+ def get_group_drive_children (self , group_id : str , item_id : str ) -> Dict :
317
+ """Returns a list of DriveItems for the Specified Drive ID for the Specified Group.
318
+
319
+ ### Returns
320
+ ----
321
+ Dict:
322
+ A List of DriveChildren Resource Objects.
323
+ """
324
+
325
+ content = self .graph_session .make_request (
326
+ method = 'get' ,
327
+ endpoint = "groups/{group_id}/drive/items/{item_id}/children" .format (
328
+ group_id = group_id ,
329
+ item_id = item_id
330
+ )
331
+ )
332
+
333
+ return content
334
+
146
335
def get_group_drives (self , group_id : str ) -> Dict :
147
336
"""List children under the Drive for user's default Drive.
148
337
149
338
### Returns
150
339
----
151
340
Dict:
152
- A List of Drive Resource Object .
341
+ A List of Drive Resource Objects .
153
342
"""
154
343
155
344
content = self .graph_session .make_request (
@@ -158,3 +347,54 @@ def get_group_drives(self, group_id: str) -> Dict:
158
347
)
159
348
160
349
return content
350
+
351
+ def get_sites_drive (self , site_id : str ) -> Dict :
352
+ """Returns the Default Drive Resource For the Specified Site ID.
353
+
354
+ ### Returns
355
+ ----
356
+ Dict:
357
+ A Drive Resource Object.
358
+ """
359
+
360
+ content = self .graph_session .make_request (
361
+ method = 'get' ,
362
+ endpoint = "sites/{site_id}/drive" .format (site_id = site_id )
363
+ )
364
+
365
+ return content
366
+
367
+ def get_sites_drive_children (self , site_id : str , item_id : str ) -> Dict :
368
+ """Returns a list of DriveItems for the Specified Drive ID on the Specified Site.
369
+
370
+ ### Returns
371
+ ----
372
+ Dict:
373
+ A List of DriveChildren Resource Objects.
374
+ """
375
+
376
+ content = self .graph_session .make_request (
377
+ method = 'get' ,
378
+ endpoint = "sites/{site_id}/drive/items/{item_id}/children" .format (
379
+ site_id = site_id ,
380
+ item_id = item_id
381
+ )
382
+ )
383
+
384
+ return content
385
+
386
+ def get_sites_drives (self , site_id : str ) -> Dict :
387
+ """Returns a List of Drive Resources for the Specified Site ID.
388
+
389
+ ### Returns
390
+ ----
391
+ Dict:
392
+ A List of Drive Resource Objects.
393
+ """
394
+
395
+ content = self .graph_session .make_request (
396
+ method = 'get' ,
397
+ endpoint = "sites/{site_id}/drives" .format (site_id = site_id )
398
+ )
399
+
400
+ return content
0 commit comments