1
- from typing import List
2
1
from typing import Dict
3
- from typing import Union
4
-
5
2
from ms_graph .session import GraphSession
6
3
7
4
@@ -10,9 +7,9 @@ class DriveItems():
10
7
"""
11
8
## Overview:
12
9
----
13
- The driveItem resource represents a file, folder,
14
- or other item stored in a drive. All file system
15
- objects in OneDrive and SharePoint are returned as
10
+ The driveItem resource represents a file, folder,
11
+ or other item stored in a drive. All file system
12
+ objects in OneDrive and SharePoint are returned as
16
13
driveItem resources.
17
14
"""
18
15
@@ -32,8 +29,7 @@ def __init__(self, session: object) -> None:
32
29
self .endpoint = 'drive'
33
30
self .collections_endpoint = 'drives/'
34
31
35
-
36
- def get_drive_item (self , drive_id : str , item_id : str ) -> Dict :
32
+ def get_drive_item (self , drive_id : str , item_id : str ) -> Dict :
37
33
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
38
34
39
35
### Parameters
@@ -53,15 +49,15 @@ def get_drive_item(self, drive_id: str, item_id: str) -> Dict:
53
49
54
50
content = self .graph_session .make_request (
55
51
method = 'get' ,
56
- endpoint = self .collections_endpoint + "/{drive_id}/items/{item_id}" .format (
52
+ endpoint = self .collections_endpoint + "/{drive_id}/items/{item_id}" .format (
57
53
drive_id = drive_id ,
58
54
item_id = item_id
59
55
)
60
56
)
61
57
62
58
return content
63
59
64
- def get_drive_item_by_path (self , drive_id : str , item_path : str ) -> Dict :
60
+ def get_drive_item_by_path (self , drive_id : str , item_path : str ) -> Dict :
65
61
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
66
62
67
63
### Parameters
@@ -80,15 +76,15 @@ def get_drive_item_by_path(self, drive_id: str, item_path: str) -> Dict:
80
76
81
77
content = self .graph_session .make_request (
82
78
method = 'get' ,
83
- endpoint = self .collections_endpoint + "/{drive_id}/root:/{path}" .format (
79
+ endpoint = self .collections_endpoint + "/{drive_id}/root:/{path}" .format (
84
80
drive_id = drive_id ,
85
81
path = item_path
86
82
)
87
83
)
88
84
89
85
return content
90
86
91
- def get_group_drive_item (self , group_id : str , item_id : str ) -> Dict :
87
+ def get_group_drive_item (self , group_id : str , item_id : str ) -> Dict :
92
88
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
93
89
94
90
### Parameters
@@ -108,15 +104,15 @@ def get_group_drive_item(self, group_id: str, item_id: str) -> Dict:
108
104
109
105
content = self .graph_session .make_request (
110
106
method = 'get' ,
111
- endpoint = "/groups/{group_id}/drive/items/{item_id}" .format (
107
+ endpoint = "/groups/{group_id}/drive/items/{item_id}" .format (
112
108
group_id = group_id ,
113
109
item_id = item_id
114
110
)
115
111
)
116
112
117
113
return content
118
114
119
- def get_group_drive_item_by_path (self , group_id : str , item_path : str ) -> Dict :
115
+ def get_group_drive_item_by_path (self , group_id : str , item_path : str ) -> Dict :
120
116
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
121
117
122
118
### Parameters
@@ -135,15 +131,15 @@ def get_group_drive_item_by_path(self, group_id: str, item_path: str) -> Dict:
135
131
136
132
content = self .graph_session .make_request (
137
133
method = 'get' ,
138
- endpoint = "/groups/{group_id}/drive/root:/{item_path}" .format (
134
+ endpoint = "/groups/{group_id}/drive/root:/{item_path}" .format (
139
135
group_id = group_id ,
140
136
item_path = item_path
141
137
)
142
138
)
143
139
144
140
return content
145
141
146
- def get_my_drive_item (self , item_id : str ) -> Dict :
142
+ def get_my_drive_item (self , item_id : str ) -> Dict :
147
143
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
148
144
149
145
### Parameters
@@ -160,14 +156,14 @@ def get_my_drive_item(self, item_id: str) -> Dict:
160
156
161
157
content = self .graph_session .make_request (
162
158
method = 'get' ,
163
- endpoint = "/me/drive/items/{item_id}" .format (
159
+ endpoint = "/me/drive/items/{item_id}" .format (
164
160
item_id = item_id
165
161
)
166
162
)
167
163
168
164
return content
169
165
170
- def get_my_drive_item_by_path (self , item_path : str ) -> Dict :
166
+ def get_my_drive_item_by_path (self , item_path : str ) -> Dict :
171
167
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
172
168
173
169
### Parameters
@@ -183,14 +179,14 @@ def get_my_drive_item_by_path(self, item_path: str) -> Dict:
183
179
184
180
content = self .graph_session .make_request (
185
181
method = 'get' ,
186
- endpoint = "/me/drive/root:/{item_path}" .format (
182
+ endpoint = "/me/drive/root:/{item_path}" .format (
187
183
item_path = item_path
188
184
)
189
185
)
190
186
191
187
return content
192
188
193
- def get_site_drive_item (self , site_id : str , item_id : str ) -> Dict :
189
+ def get_site_drive_item (self , site_id : str , item_id : str ) -> Dict :
194
190
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
195
191
196
192
### Parameters
@@ -210,15 +206,15 @@ def get_site_drive_item(self, site_id: str, item_id: str) -> Dict:
210
206
211
207
content = self .graph_session .make_request (
212
208
method = 'get' ,
213
- endpoint = "/sites/{site_id}/drive/items/{item_id}" .format (
209
+ endpoint = "/sites/{site_id}/drive/items/{item_id}" .format (
214
210
site_id = site_id ,
215
211
item_id = item_id
216
212
)
217
213
)
218
214
219
215
return content
220
216
221
- def get_site_drive_item_by_path (self , site_id : str , item_path : str ) -> Dict :
217
+ def get_site_drive_item_by_path (self , site_id : str , item_path : str ) -> Dict :
222
218
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
223
219
224
220
### Parameters
@@ -237,15 +233,15 @@ def get_site_drive_item_by_path(self, site_id: str, item_path: str) -> Dict:
237
233
238
234
content = self .graph_session .make_request (
239
235
method = 'get' ,
240
- endpoint = "/sites/{site_id}/drive/root:/{item_path}" .format (
236
+ endpoint = "/sites/{site_id}/drive/root:/{item_path}" .format (
241
237
site_id = site_id ,
242
238
item_path = item_path
243
239
)
244
240
)
245
241
246
242
return content
247
243
248
- def get_site_drive_item_from_list (self , site_id : str , list_id : str , item_id : str ) -> Dict :
244
+ def get_site_drive_item_from_list (self , site_id : str , list_id : str , item_id : str ) -> Dict :
249
245
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
250
246
251
247
### Parameters
@@ -268,7 +264,7 @@ def get_site_drive_item_from_list(self, site_id: str, list_id: str, item_id: str
268
264
269
265
content = self .graph_session .make_request (
270
266
method = 'get' ,
271
- endpoint = "/sites/{site_id}/lists/{list_id}/items/{item_id}/driveItem" .format (
267
+ endpoint = "/sites/{site_id}/lists/{list_id}/items/{item_id}/driveItem" .format (
272
268
site_id = site_id ,
273
269
list_id = list_id ,
274
270
item_id = item_id
@@ -277,7 +273,7 @@ def get_site_drive_item_from_list(self, site_id: str, list_id: str, item_id: str
277
273
278
274
return content
279
275
280
- def get_user_drive_item (self , user_id : str , item_id : str ) -> Dict :
276
+ def get_user_drive_item (self , user_id : str , item_id : str ) -> Dict :
281
277
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
282
278
283
279
### Parameters
@@ -297,15 +293,15 @@ def get_user_drive_item(self, user_id: str, item_id: str) -> Dict:
297
293
298
294
content = self .graph_session .make_request (
299
295
method = 'get' ,
300
- endpoint = "/users/{user_id}/drive/items/{item_id}" .format (
296
+ endpoint = "/users/{user_id}/drive/items/{item_id}" .format (
301
297
user_id = user_id ,
302
298
item_id = item_id
303
299
)
304
300
)
305
301
306
302
return content
307
303
308
- def get_user_drive_item_by_path (self , user_id : str , item_path : str ) -> Dict :
304
+ def get_user_drive_item_by_path (self , user_id : str , item_path : str ) -> Dict :
309
305
"""Grab's a DriveItem Resource using the Item ID and Drive ID.
310
306
311
307
### Parameters
@@ -324,7 +320,7 @@ def get_user_drive_item_by_path(self, user_id: str, item_path: str) -> Dict:
324
320
325
321
content = self .graph_session .make_request (
326
322
method = 'get' ,
327
- endpoint = "/users/{user_id}/drive/root:/{item_path}" .format (
323
+ endpoint = "/users/{user_id}/drive/root:/{item_path}" .format (
328
324
user_id = user_id ,
329
325
item_path = item_path
330
326
)
0 commit comments