ms-graph 1.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ms_graph/__init__.py +5 -0
- ms_graph/client.py +546 -0
- ms_graph/drive_items.py +296 -0
- ms_graph/drives.py +384 -0
- ms_graph/groups.py +51 -0
- ms_graph/logger/logger_setup.py +7 -0
- ms_graph/mail.py +1073 -0
- ms_graph/notes.py +276 -0
- ms_graph/personal_contacts.py +226 -0
- ms_graph/search.py +48 -0
- ms_graph/session.py +182 -0
- ms_graph/users.py +45 -0
- ms_graph/utils/range.py +331 -0
- ms_graph/workbooks_and_charts/__init__.py +23 -0
- ms_graph/workbooks_and_charts/application.py +109 -0
- ms_graph/workbooks_and_charts/comments.py +159 -0
- ms_graph/workbooks_and_charts/enums.py +252 -0
- ms_graph/workbooks_and_charts/range.py +694 -0
- ms_graph/workbooks_and_charts/table.py +467 -0
- ms_graph/workbooks_and_charts/workbook.py +253 -0
- ms_graph/workbooks_and_charts/worksheets.py +636 -0
- ms_graph-1.5.2.dist-info/METADATA +319 -0
- ms_graph-1.5.2.dist-info/RECORD +25 -0
- ms_graph-1.5.2.dist-info/WHEEL +4 -0
- ms_graph-1.5.2.dist-info/licenses/LICENSE +21 -0
ms_graph/drive_items.py
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
from ms_graph.session import GraphSession
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DriveItems():
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
## Overview:
|
|
8
|
+
----
|
|
9
|
+
The driveItem resource represents a file, folder,
|
|
10
|
+
or other item stored in a drive. All file system
|
|
11
|
+
objects in OneDrive and SharePoint are returned as
|
|
12
|
+
driveItem resources.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, session: object) -> None:
|
|
16
|
+
"""Initializes the `DriveItems` object.
|
|
17
|
+
|
|
18
|
+
### Parameters
|
|
19
|
+
----
|
|
20
|
+
session : object
|
|
21
|
+
An authenticated session for our Microsoft Graph Client.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
# Set the session.
|
|
25
|
+
self.graph_session: GraphSession = session
|
|
26
|
+
|
|
27
|
+
# Set the endpoint.
|
|
28
|
+
self.endpoint = "drive"
|
|
29
|
+
self.collections_endpoint = "drives/"
|
|
30
|
+
|
|
31
|
+
def get_drive_item(self, drive_id: str, item_id: str) -> dict:
|
|
32
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
33
|
+
|
|
34
|
+
### Parameters
|
|
35
|
+
----
|
|
36
|
+
drive_id : str
|
|
37
|
+
The Drive ID in which the resource exist.
|
|
38
|
+
|
|
39
|
+
item_id : str
|
|
40
|
+
The item ID of the object you want to
|
|
41
|
+
return.
|
|
42
|
+
|
|
43
|
+
### Returns
|
|
44
|
+
----
|
|
45
|
+
dict :
|
|
46
|
+
A DriveItem resource object.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
content = self.graph_session.make_request(
|
|
50
|
+
method="get",
|
|
51
|
+
endpoint=self.collections_endpoint + f"/{drive_id}/items/{item_id}"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return content
|
|
55
|
+
|
|
56
|
+
def get_drive_item_by_path(self, drive_id: str, item_path: str) -> dict:
|
|
57
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
58
|
+
|
|
59
|
+
### Parameters
|
|
60
|
+
----
|
|
61
|
+
drive_id : str
|
|
62
|
+
The Drive ID in which the resource exist.
|
|
63
|
+
|
|
64
|
+
item_path : str
|
|
65
|
+
The path to the Item.
|
|
66
|
+
|
|
67
|
+
### Returns
|
|
68
|
+
----
|
|
69
|
+
dict :
|
|
70
|
+
A DriveItem resource object.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
content = self.graph_session.make_request(
|
|
74
|
+
method="get",
|
|
75
|
+
endpoint=self.collections_endpoint + f"/{drive_id}/root:/{item_path}"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return content
|
|
79
|
+
|
|
80
|
+
def get_group_drive_item(self, group_id: str, item_id: str) -> dict:
|
|
81
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
82
|
+
|
|
83
|
+
### Parameters
|
|
84
|
+
----
|
|
85
|
+
group_id : str
|
|
86
|
+
The Group ID in which the resource exist.
|
|
87
|
+
|
|
88
|
+
item_id : str
|
|
89
|
+
The item ID of the object you want to
|
|
90
|
+
return.
|
|
91
|
+
|
|
92
|
+
### Returns
|
|
93
|
+
----
|
|
94
|
+
dict :
|
|
95
|
+
A DriveItem resource object.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
content = self.graph_session.make_request(
|
|
99
|
+
method="get",
|
|
100
|
+
endpoint=f"/groups/{group_id}/drive/items/{item_id}"
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
return content
|
|
104
|
+
|
|
105
|
+
def get_group_drive_item_by_path(self, group_id: str, item_path: str) -> dict:
|
|
106
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
107
|
+
|
|
108
|
+
### Parameters
|
|
109
|
+
----
|
|
110
|
+
drive_id : str
|
|
111
|
+
The Drive ID in which the resource exist.
|
|
112
|
+
|
|
113
|
+
item_path : str
|
|
114
|
+
The path to the Item.
|
|
115
|
+
|
|
116
|
+
### Returns
|
|
117
|
+
----
|
|
118
|
+
dict :
|
|
119
|
+
A DriveItem resource object.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
content = self.graph_session.make_request(
|
|
123
|
+
method="get",
|
|
124
|
+
endpoint=f"/groups/{group_id}/drive/root:/{item_path}"
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
return content
|
|
128
|
+
|
|
129
|
+
def get_my_drive_item(self, item_id: str) -> dict:
|
|
130
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
131
|
+
|
|
132
|
+
### Parameters
|
|
133
|
+
----
|
|
134
|
+
item_id : str
|
|
135
|
+
The item ID of the object you want to
|
|
136
|
+
return.
|
|
137
|
+
|
|
138
|
+
### Returns
|
|
139
|
+
----
|
|
140
|
+
dict :
|
|
141
|
+
A DriveItem resource object.
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
content = self.graph_session.make_request(
|
|
145
|
+
method="get",
|
|
146
|
+
endpoint=f"/me/drive/items/{item_id}"
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
return content
|
|
150
|
+
|
|
151
|
+
def get_my_drive_item_by_path(self, item_path: str) -> dict:
|
|
152
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
153
|
+
|
|
154
|
+
### Parameters
|
|
155
|
+
----
|
|
156
|
+
item_path : str
|
|
157
|
+
The path to the Item.
|
|
158
|
+
|
|
159
|
+
### Returns
|
|
160
|
+
----
|
|
161
|
+
dict :
|
|
162
|
+
A DriveItem resource object.
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
content = self.graph_session.make_request(
|
|
166
|
+
method="get",
|
|
167
|
+
endpoint=f"/me/drive/root:/{item_path}"
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
return content
|
|
171
|
+
|
|
172
|
+
def get_site_drive_item(self, site_id: str, item_id: str) -> dict:
|
|
173
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
174
|
+
|
|
175
|
+
### Parameters
|
|
176
|
+
----
|
|
177
|
+
site_id : str
|
|
178
|
+
The site ID which to query the item from.
|
|
179
|
+
|
|
180
|
+
item_id : str
|
|
181
|
+
The item ID of the object you want to
|
|
182
|
+
return.
|
|
183
|
+
|
|
184
|
+
### Returns
|
|
185
|
+
----
|
|
186
|
+
dict :
|
|
187
|
+
A DriveItem resource object.
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
content = self.graph_session.make_request(
|
|
191
|
+
method="get",
|
|
192
|
+
endpoint=f"/sites/{site_id}/drive/items/{item_id}"
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
return content
|
|
196
|
+
|
|
197
|
+
def get_site_drive_item_by_path(self, site_id: str, item_path: str) -> dict:
|
|
198
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
199
|
+
|
|
200
|
+
### Parameters
|
|
201
|
+
----
|
|
202
|
+
site_id : str
|
|
203
|
+
The site ID which to query the item from.
|
|
204
|
+
|
|
205
|
+
item_path : str
|
|
206
|
+
The path to the Item.
|
|
207
|
+
|
|
208
|
+
### Returns
|
|
209
|
+
----
|
|
210
|
+
dict :
|
|
211
|
+
A DriveItem resource object.
|
|
212
|
+
"""
|
|
213
|
+
|
|
214
|
+
content = self.graph_session.make_request(
|
|
215
|
+
method="get",
|
|
216
|
+
endpoint=f"/sites/{site_id}/drive/root:/{item_path}"
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
return content
|
|
220
|
+
|
|
221
|
+
def get_site_drive_item_from_list(self, site_id: str, list_id: str, item_id: str) -> dict:
|
|
222
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
223
|
+
|
|
224
|
+
### Parameters
|
|
225
|
+
----
|
|
226
|
+
site_id : str
|
|
227
|
+
The site ID which to query the item from.
|
|
228
|
+
|
|
229
|
+
list_id : str
|
|
230
|
+
The list ID which to query the item from.
|
|
231
|
+
|
|
232
|
+
item_id : str
|
|
233
|
+
The item ID of the object you want to
|
|
234
|
+
return.
|
|
235
|
+
|
|
236
|
+
### Returns
|
|
237
|
+
----
|
|
238
|
+
dict :
|
|
239
|
+
A DriveItem resource object.
|
|
240
|
+
"""
|
|
241
|
+
|
|
242
|
+
content = self.graph_session.make_request(
|
|
243
|
+
method="get",
|
|
244
|
+
endpoint=f"/sites/{site_id}/lists/{list_id}/items/{item_id}/driveItem"
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
return content
|
|
248
|
+
|
|
249
|
+
def get_user_drive_item(self, user_id: str, item_id: str) -> dict:
|
|
250
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
251
|
+
|
|
252
|
+
### Parameters
|
|
253
|
+
----
|
|
254
|
+
user_id : str
|
|
255
|
+
The User ID which to query the item from.
|
|
256
|
+
|
|
257
|
+
item_id : str
|
|
258
|
+
The item ID of the object you want to
|
|
259
|
+
return.
|
|
260
|
+
|
|
261
|
+
### Returns
|
|
262
|
+
----
|
|
263
|
+
dict :
|
|
264
|
+
A DriveItem resource object.
|
|
265
|
+
"""
|
|
266
|
+
|
|
267
|
+
content = self.graph_session.make_request(
|
|
268
|
+
method="get",
|
|
269
|
+
endpoint=f"/users/{user_id}/drive/items/{item_id}"
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
return content
|
|
273
|
+
|
|
274
|
+
def get_user_drive_item_by_path(self, user_id: str, item_path: str) -> dict:
|
|
275
|
+
"""Grab"s a DriveItem Resource using the Item ID and Drive ID.
|
|
276
|
+
|
|
277
|
+
### Parameters
|
|
278
|
+
----
|
|
279
|
+
site_id : str
|
|
280
|
+
The User ID which to query the item from.
|
|
281
|
+
|
|
282
|
+
item_path : str
|
|
283
|
+
The path to the Item.
|
|
284
|
+
|
|
285
|
+
### Returns
|
|
286
|
+
----
|
|
287
|
+
dict :
|
|
288
|
+
A DriveItem resource object.
|
|
289
|
+
"""
|
|
290
|
+
|
|
291
|
+
content = self.graph_session.make_request(
|
|
292
|
+
method="get",
|
|
293
|
+
endpoint=f"/users/{user_id}/drive/root:/{item_path}"
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
return content
|
ms_graph/drives.py
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
from ms_graph.session import GraphSession
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Drives():
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
## Overview:
|
|
8
|
+
----
|
|
9
|
+
The drive resource is the top level object representing a user"s OneDrive or a
|
|
10
|
+
document library in SharePoint. OneDrive users will always have at least one drive
|
|
11
|
+
available, their default drive. Users without a OneDrive license may not have a default
|
|
12
|
+
drive available.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, session: object) -> None:
|
|
16
|
+
"""Initializes the `Drives` object.
|
|
17
|
+
|
|
18
|
+
### Parameters
|
|
19
|
+
----
|
|
20
|
+
session : object
|
|
21
|
+
An authenticated session for our Microsoft Graph Client.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
# Set the session.
|
|
25
|
+
self.graph_session: GraphSession = session
|
|
26
|
+
|
|
27
|
+
# Set the endpoint.
|
|
28
|
+
self.endpoint = "drive"
|
|
29
|
+
self.collections_endpoint = "drives"
|
|
30
|
+
|
|
31
|
+
def get_root_drive(self) -> dict:
|
|
32
|
+
"""Get root folder for user"s default Drive.
|
|
33
|
+
|
|
34
|
+
### Returns
|
|
35
|
+
----
|
|
36
|
+
dict :
|
|
37
|
+
A Drive Resource Object.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
content = self.graph_session.make_request(
|
|
41
|
+
method="get",
|
|
42
|
+
endpoint=self.endpoint + "/root"
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
return content
|
|
46
|
+
|
|
47
|
+
def get_root_drive_children(self) -> dict:
|
|
48
|
+
"""List children under the Drive for user"s default Drive.
|
|
49
|
+
|
|
50
|
+
### Returns
|
|
51
|
+
----
|
|
52
|
+
dict :
|
|
53
|
+
A List of Drive Resource Object.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
content = self.graph_session.make_request(
|
|
57
|
+
method="get",
|
|
58
|
+
endpoint=self.endpoint + "/root/children"
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
return content
|
|
62
|
+
|
|
63
|
+
def get_root_drive_delta(self) -> dict:
|
|
64
|
+
"""List children under the Drive for user"s default Drive.
|
|
65
|
+
|
|
66
|
+
### Returns
|
|
67
|
+
----
|
|
68
|
+
dict :
|
|
69
|
+
A List of Drive Resource Object.
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
content = self.graph_session.make_request(
|
|
73
|
+
method="get",
|
|
74
|
+
endpoint=self.endpoint + "/root/delta"
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
return content
|
|
78
|
+
|
|
79
|
+
def get_root_drive_followed(self) -> dict:
|
|
80
|
+
"""List user"s followed driveItems.
|
|
81
|
+
|
|
82
|
+
### Returns
|
|
83
|
+
----
|
|
84
|
+
dict :
|
|
85
|
+
A List of DriveItem Resource Object.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
content = self.graph_session.make_request(
|
|
89
|
+
method="get",
|
|
90
|
+
endpoint=self.endpoint + "/root/followed"
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return content
|
|
94
|
+
|
|
95
|
+
def get_recent_files(self) -> dict:
|
|
96
|
+
"""List a set of items that have been recently used by the signed in user.
|
|
97
|
+
|
|
98
|
+
### Overview:
|
|
99
|
+
----
|
|
100
|
+
This collection includes items that are in the user"s drive
|
|
101
|
+
as well as items they have access to from other drives.
|
|
102
|
+
|
|
103
|
+
### Returns
|
|
104
|
+
----
|
|
105
|
+
dict :
|
|
106
|
+
A List of DriveItem Resource Objects.
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
content = self.graph_session.make_request(
|
|
110
|
+
method="get",
|
|
111
|
+
endpoint="me/drive/recent"
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return content
|
|
115
|
+
|
|
116
|
+
def get_shared_files(self) -> dict:
|
|
117
|
+
"""Retrieve a collection of DriveItem resources that have been
|
|
118
|
+
shared with the owner of the Drive.
|
|
119
|
+
|
|
120
|
+
### Returns
|
|
121
|
+
----
|
|
122
|
+
dict :
|
|
123
|
+
A List of DriveItem Resource Objects.
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
content = self.graph_session.make_request(
|
|
127
|
+
method="get",
|
|
128
|
+
endpoint="me/drive/sharedWithMe"
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
return content
|
|
132
|
+
|
|
133
|
+
def get_special_folder_by_name(self, folder_name: str) -> dict:
|
|
134
|
+
"""Use the special collection to access a special folder by name.
|
|
135
|
+
|
|
136
|
+
### Overview:
|
|
137
|
+
----
|
|
138
|
+
Special folders provide simple aliases to access well-known folders
|
|
139
|
+
in OneDrive without the need to look up the folder by path (which
|
|
140
|
+
would require localization), or reference the folder with an ID. If
|
|
141
|
+
a special folder is renamed or moved to another location within the
|
|
142
|
+
drive, this syntax will continue to find that folder. Special folders
|
|
143
|
+
are automatically created the first time an application attempts to write
|
|
144
|
+
to one, if it doesn"t already exist. If a user deletes one, it is recreated
|
|
145
|
+
when written to again. Note: If you have read-only permissions and request
|
|
146
|
+
a special folder that doesn"t exist, you"ll receive a 403 Forbidden error.
|
|
147
|
+
|
|
148
|
+
### Returns
|
|
149
|
+
----
|
|
150
|
+
dict :
|
|
151
|
+
A List of DriveItem Resource Objects.
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
content = self.graph_session.make_request(
|
|
155
|
+
method="get",
|
|
156
|
+
endpoint=f"/me/drive/special/{folder_name}"
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
return content
|
|
160
|
+
|
|
161
|
+
def get_special_folder_children_by_name(self, folder_name: str) -> dict:
|
|
162
|
+
"""Use the special collection to access a collection of Children belonging to special folder
|
|
163
|
+
by name.
|
|
164
|
+
|
|
165
|
+
### Returns
|
|
166
|
+
----
|
|
167
|
+
dict :
|
|
168
|
+
A List of DriveItem Resource Objects.
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
content = self.graph_session.make_request(
|
|
172
|
+
method="get",
|
|
173
|
+
endpoint=f"/me/drive/special/{folder_name}/children"
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
return content
|
|
177
|
+
|
|
178
|
+
def get_drive_by_id(self, drive_id: str) -> dict:
|
|
179
|
+
"""Grab"s a Drive Resource using the Drive ID.
|
|
180
|
+
|
|
181
|
+
### Returns
|
|
182
|
+
----
|
|
183
|
+
dict :
|
|
184
|
+
A Drive Resource Object.
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
content = self.graph_session.make_request(
|
|
188
|
+
method="get",
|
|
189
|
+
endpoint=self.collections_endpoint + f"/{drive_id}"
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
return content
|
|
193
|
+
|
|
194
|
+
def get_my_drive(self) -> dict:
|
|
195
|
+
"""Get"s the User"s Current OneDrive.
|
|
196
|
+
|
|
197
|
+
### Returns
|
|
198
|
+
----
|
|
199
|
+
dict :
|
|
200
|
+
A Drive Resource Object.
|
|
201
|
+
"""
|
|
202
|
+
|
|
203
|
+
content = self.graph_session.make_request(
|
|
204
|
+
method="get",
|
|
205
|
+
endpoint=self.endpoint + "/me"
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
return content
|
|
209
|
+
|
|
210
|
+
def get_my_drive_children(self, item_id: str) -> dict:
|
|
211
|
+
"""Returns a list of DriveItem Resources for the User"s Current OneDrive.
|
|
212
|
+
|
|
213
|
+
### Returns
|
|
214
|
+
----
|
|
215
|
+
dict :
|
|
216
|
+
A List of DriveChildren Resource Objects.
|
|
217
|
+
"""
|
|
218
|
+
|
|
219
|
+
content = self.graph_session.make_request(
|
|
220
|
+
method="get",
|
|
221
|
+
endpoint=self.endpoint + f"/me/drive/items/{item_id}/children"
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
return content
|
|
225
|
+
|
|
226
|
+
def get_my_drives(self) -> dict:
|
|
227
|
+
"""List children under the Drive for user"s default Drive.
|
|
228
|
+
|
|
229
|
+
### Returns
|
|
230
|
+
----
|
|
231
|
+
dict :
|
|
232
|
+
A List of Drive Resource Objects.
|
|
233
|
+
"""
|
|
234
|
+
|
|
235
|
+
content = self.graph_session.make_request(
|
|
236
|
+
method="get",
|
|
237
|
+
endpoint=self.collections_endpoint + "/me"
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
return content
|
|
241
|
+
|
|
242
|
+
def get_user_drive(self, user_id: str) -> dict:
|
|
243
|
+
"""Returns the User"s default OneDrive.
|
|
244
|
+
|
|
245
|
+
### Returns
|
|
246
|
+
----
|
|
247
|
+
dict :
|
|
248
|
+
A Drive Resource Object.
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
content = self.graph_session.make_request(
|
|
252
|
+
method="get",
|
|
253
|
+
endpoint=f"users/{user_id}/drive"
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
return content
|
|
257
|
+
|
|
258
|
+
def get_user_drive_children(self, user_id: str, item_id: str) -> dict:
|
|
259
|
+
"""Returns a list of DriveItem Resources for the Default User Drive.
|
|
260
|
+
|
|
261
|
+
### Returns
|
|
262
|
+
----
|
|
263
|
+
dict :
|
|
264
|
+
A List of DriveChildren Resource Objects.
|
|
265
|
+
"""
|
|
266
|
+
|
|
267
|
+
content = self.graph_session.make_request(
|
|
268
|
+
method="get",
|
|
269
|
+
endpoint=f"users/{user_id}/drive/items/{item_id}/children"
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
return content
|
|
273
|
+
|
|
274
|
+
def get_user_drives(self, user_id: str) -> dict:
|
|
275
|
+
"""Returns a List Drive Resource Objects for user"s default Drive.
|
|
276
|
+
|
|
277
|
+
### Returns
|
|
278
|
+
----
|
|
279
|
+
dict :
|
|
280
|
+
A List of Drive Resource Objects.
|
|
281
|
+
"""
|
|
282
|
+
|
|
283
|
+
content = self.graph_session.make_request(
|
|
284
|
+
method="get",
|
|
285
|
+
endpoint=f"users/{user_id}/drives"
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
return content
|
|
289
|
+
|
|
290
|
+
def get_group_drive(self, group_id: str) -> dict:
|
|
291
|
+
"""Returns a Site Group default Drive..
|
|
292
|
+
|
|
293
|
+
### Returns
|
|
294
|
+
----
|
|
295
|
+
dict :
|
|
296
|
+
A Drive Resource Object.
|
|
297
|
+
"""
|
|
298
|
+
|
|
299
|
+
content = self.graph_session.make_request(
|
|
300
|
+
method="get",
|
|
301
|
+
endpoint=f"groups/{group_id}/drive"
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
return content
|
|
305
|
+
|
|
306
|
+
def get_group_drive_children(self, group_id: str, item_id: str) -> dict:
|
|
307
|
+
"""Returns a list of DriveItems for the Specified Drive ID for the Specified Group.
|
|
308
|
+
|
|
309
|
+
### Returns
|
|
310
|
+
----
|
|
311
|
+
dict :
|
|
312
|
+
A List of DriveChildren Resource Objects.
|
|
313
|
+
"""
|
|
314
|
+
|
|
315
|
+
content = self.graph_session.make_request(
|
|
316
|
+
method="get",
|
|
317
|
+
endpoint=f"groups/{group_id}/drive/items/{item_id}/children"
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
return content
|
|
321
|
+
|
|
322
|
+
def get_group_drives(self, group_id: str) -> dict:
|
|
323
|
+
"""List children under the Drive for user"s default Drive.
|
|
324
|
+
|
|
325
|
+
### Returns
|
|
326
|
+
----
|
|
327
|
+
dict :
|
|
328
|
+
A List of Drive Resource Objects.
|
|
329
|
+
"""
|
|
330
|
+
|
|
331
|
+
content = self.graph_session.make_request(
|
|
332
|
+
method="get",
|
|
333
|
+
endpoint=f"groups/{group_id}/drives"
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
return content
|
|
337
|
+
|
|
338
|
+
def get_sites_drive(self, site_id: str) -> dict:
|
|
339
|
+
"""Returns the Default Drive Resource For the Specified Site ID.
|
|
340
|
+
|
|
341
|
+
### Returns
|
|
342
|
+
----
|
|
343
|
+
dict :
|
|
344
|
+
A Drive Resource Object.
|
|
345
|
+
"""
|
|
346
|
+
|
|
347
|
+
content = self.graph_session.make_request(
|
|
348
|
+
method="get",
|
|
349
|
+
endpoint=f"sites/{site_id}/drive"
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
return content
|
|
353
|
+
|
|
354
|
+
def get_sites_drive_children(self, site_id: str, item_id: str) -> dict:
|
|
355
|
+
"""Returns a list of DriveItems for the Specified Drive ID on the Specified Site.
|
|
356
|
+
|
|
357
|
+
### Returns
|
|
358
|
+
----
|
|
359
|
+
dict :
|
|
360
|
+
A List of DriveChildren Resource Objects.
|
|
361
|
+
"""
|
|
362
|
+
|
|
363
|
+
content = self.graph_session.make_request(
|
|
364
|
+
method="get",
|
|
365
|
+
endpoint=f"sites/{site_id}/drive/items/{item_id}/children"
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
return content
|
|
369
|
+
|
|
370
|
+
def get_sites_drives(self, site_id: str) -> dict:
|
|
371
|
+
"""Returns a List of Drive Resources for the Specified Site ID.
|
|
372
|
+
|
|
373
|
+
### Returns
|
|
374
|
+
----
|
|
375
|
+
dict :
|
|
376
|
+
A List of Drive Resource Objects.
|
|
377
|
+
"""
|
|
378
|
+
|
|
379
|
+
content = self.graph_session.make_request(
|
|
380
|
+
method="get",
|
|
381
|
+
endpoint=f"sites/{site_id}/drives"
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
return content
|