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.
@@ -0,0 +1,159 @@
1
+ from ms_graph.session import GraphSession
2
+
3
+
4
+ class WorkbookComments:
5
+
6
+ """
7
+ ## Overview:
8
+ ----
9
+ Represents a comment in workbook.
10
+ """
11
+
12
+ def __init__(self, session: object) -> None:
13
+ """Initializes the `WorkbookComment` object.
14
+
15
+ ### Parameters
16
+ ----
17
+ session : object
18
+ An authenticated session for our Microsoft Graph Client.
19
+ """
20
+
21
+ # Set the session.
22
+ self.graph_session: GraphSession = session
23
+
24
+ def list(self, item_id: str) -> dict:
25
+ """Retrieve a list of workbookComment objects using the
26
+ Item ID.
27
+
28
+ ### Parameters
29
+ ----
30
+ item_id : str
31
+ The drive item resource id.
32
+
33
+ ### Returns
34
+ ----
35
+ dict:
36
+ A collection of WorkbookComment objects.
37
+ """
38
+
39
+ content = self.graph_session.make_request(
40
+ method="get",
41
+ endpoint=f"/me/drive/items/{item_id}/workbook/comments",
42
+ )
43
+
44
+ return content
45
+
46
+ def get(self, item_id: str, comment_id: str) -> dict:
47
+ """Retrieve the properties and relationships of
48
+ a WorkbookComment object.
49
+
50
+ ### Parameters
51
+ ----
52
+ item_id : str
53
+ The drive item resource id.
54
+
55
+ comment_id : str
56
+ The comment resource id.
57
+
58
+ ### Returns
59
+ ----
60
+ dict:
61
+ A WorkbookComment object.
62
+ """
63
+
64
+ content = self.graph_session.make_request(
65
+ method="get",
66
+ endpoint=f"/me/drive/items/{item_id}/workbook/comments/{comment_id}",
67
+ )
68
+
69
+ return content
70
+
71
+ def list_replies(self, item_id: str, comment_id) -> dict:
72
+ """Retrieve a list of workbookCommentReply objects using the
73
+ Item ID.
74
+
75
+ ### Parameters
76
+ ----
77
+ item_id : str
78
+ The drive item resource id.
79
+
80
+ comment_id : str
81
+ The comment resource id.
82
+
83
+ ### Returns
84
+ ----
85
+ dict:
86
+ A collection of WorkbookCommentReply objects.
87
+ """
88
+
89
+ content = self.graph_session.make_request(
90
+ method="get",
91
+ endpoint=f"/me/drive/items/{item_id}/workbook/comments/{comment_id}/replies",
92
+ )
93
+
94
+ return content
95
+
96
+ def create_reply(
97
+ self, item_id: str, comment_id: str, content: str, content_type: str = "plain"
98
+ ) -> dict:
99
+ """Creates a new WorkbookCommentReply object using the
100
+ specified Item ID.
101
+
102
+ ### Parameters
103
+ ----
104
+ item_id : str
105
+ The drive item resource id.
106
+
107
+ comment_id : str
108
+ The comment resource id.
109
+
110
+ content : str
111
+ The content of a comment reply.
112
+
113
+ content_type : str (optional, Default='plain')
114
+ Indicates the type for the comment reply.
115
+
116
+ ### Returns
117
+ ----
118
+ dict:
119
+ A WorkbookCommentReply object.
120
+ """
121
+
122
+ body = {"content": content, "contentType": content_type}
123
+
124
+ content = self.graph_session.make_request(
125
+ method="post",
126
+ json=body,
127
+ additional_headers={"Content-type": "application/json"},
128
+ endpoint=f"/me/drive/items/{item_id}/workbook/comments/{comment_id}/replies",
129
+ )
130
+
131
+ return content
132
+
133
+ def get_reply(self, item_id: str, comment_id: str, reply_id: str) -> dict:
134
+ """Retrieve the properties and relationships of WorkbookCommentReply
135
+ object using the specified Item ID.
136
+
137
+ ### Parameters
138
+ ----
139
+ item_id : str
140
+ The drive item resource id.
141
+
142
+ comment_id : str
143
+ The comment resource id.
144
+
145
+ reply_id : str
146
+ The comment reply resource id.
147
+
148
+ ### Returns
149
+ ----
150
+ dict:
151
+ A WorkbookCommentReply object.
152
+ """
153
+
154
+ content = self.graph_session.make_request(
155
+ method="get",
156
+ endpoint=f"/me/drive/items/{item_id}/workbook/comments/{comment_id}/replies/{reply_id}",
157
+ )
158
+
159
+ return content
@@ -0,0 +1,252 @@
1
+ from enum import Enum
2
+
3
+
4
+ class CalculationTypes(Enum):
5
+ """Specifies the calculation types used in the
6
+ `WorkbookApplication` calculate method.
7
+
8
+ ### Usage:
9
+ ----
10
+ >>> from ms_graph.workbooks_and_charts.enums import CalculationTypes
11
+ >>> CalculationTypes.RECALCULATE.value
12
+ """
13
+
14
+ RECALCULATE = "Recalculate"
15
+ FULL = "Full"
16
+ FULLREBUILD = "FullRebuild"
17
+
18
+
19
+ class WorksheetVisibility(Enum):
20
+ """Specifies the visibility types used in the
21
+ `Worksheet` `update_worksheet` method.
22
+
23
+ ### Usage:
24
+ ----
25
+ >>> from ms_graph.workbooks_and_charts.enums import WorksheetVisibility
26
+ >>> WorksheetVisibility.VISIBLE.value
27
+ """
28
+
29
+ VISIBLE = "Visible"
30
+ HIDDEN = "Hidden"
31
+ VERYHIDDEN = "VeryHidden"
32
+
33
+
34
+ class RangeShift(Enum):
35
+ """Specifies the shift directions used in the
36
+ `Range` `insert_range` and `delete` method.
37
+
38
+ ### Usage:
39
+ ----
40
+ >>> from ms_graph.workbooks_and_charts.enums import RangeShift
41
+ >>> RangeShift.DOWN.value
42
+ """
43
+
44
+ # These are for inserts.
45
+ DOWN = "Down"
46
+ RIGHT = "Right"
47
+
48
+ # These are for deletes.
49
+ UP = "Up"
50
+ LEFT = "Left"
51
+
52
+
53
+ class Underline(Enum):
54
+ """Specifies the Underline property used in the
55
+ `RangeFontProperties` object.
56
+
57
+ ### Usage:
58
+ ----
59
+ >>> from ms_graph.workbooks_and_charts.enums import Underline
60
+ >>> RangeFontUnderline.SINGLE.value
61
+ """
62
+
63
+ NONE = "None"
64
+ SINGLE = "Single"
65
+ DOUBLE = "Double"
66
+ SINGLE_ACCOUNTANT = "SingleAccountant"
67
+ DOUBLE_ACCOUNTANT = "DoubleAccountant"
68
+
69
+
70
+ class VerticalAlignment(Enum):
71
+ """Specifies the Vertical Alignment property used in the
72
+ `RangeFormatProperties` object.
73
+
74
+ ### Usage:
75
+ ----
76
+ >>> from ms_graph.workbooks_and_charts.enums import VerticalAlignment
77
+ >>> VerticalAlignment.TOP.value
78
+ """
79
+
80
+ TOP = "Top"
81
+ CENTER = "Center"
82
+ BOTTOM = "Bottom"
83
+ JUSTIFY = "Justify"
84
+ DISTRIBUTED = "Distributed"
85
+
86
+
87
+ class HorizontalAlignment(Enum):
88
+ """Specifies the Horizontal Alignment property used in the
89
+ `RangeFormatProperties` object.
90
+
91
+ ### Usage:
92
+ ----
93
+ >>> from ms_graph.workbooks_and_charts.enums import HorizontalAlignment
94
+ >>> HorizontalAlignment.GENERAL.value
95
+ """
96
+
97
+ GENERAL = "General"
98
+ LEFT = "Left"
99
+ CENTER = "Center"
100
+ RIGHT = "Right"
101
+ FILL = "Fill"
102
+ JUSTIFY = "Justify"
103
+ CENTER_ACCROSS_SELECTION = "CenterAcrossSelection"
104
+ DISTRIBUTED = "Distributed"
105
+
106
+
107
+ class BorderStyle(Enum):
108
+ """Specifies the Border Style property used in the
109
+ `RangeBorderProperties` object.
110
+
111
+ ### Usage:
112
+ ----
113
+ >>> from ms_graph.workbooks_and_charts.enums import BorderStyle
114
+ >>> BorderStyle.CONTINUOUS.value
115
+ """
116
+
117
+ NONE = "None"
118
+ CONTINUOUS = "Continuous"
119
+ DASH = "Dash"
120
+ DASH_DOT = "DashDot"
121
+ DASH_DOT_DOT = "DashDotDot"
122
+ DOT = "Dot"
123
+ DOUBLE = "Double"
124
+ SLANT_DASH_DOT = "SlantDashDot"
125
+
126
+
127
+ class BorderWeight(Enum):
128
+ """Specifies the Border Weight property used in the
129
+ `RangeBorderProperties` object.
130
+
131
+ ### Usage:
132
+ ----
133
+ >>> from ms_graph.workbooks_and_charts.enums import BorderWeight
134
+ >>> BorderWeight.HAIRLINE.value
135
+ """
136
+
137
+ HAIRLINE = "Hairline"
138
+ THIN = "Thin"
139
+ MEDIUM = "Medium"
140
+ THICK = "Thick"
141
+
142
+
143
+ class ApplyTo(Enum):
144
+ """Specifies the type of Clear Action used in the `Range.clear()`
145
+ method.
146
+
147
+ ### Usage:
148
+ ----
149
+ >>> from ms_graph.workbooks_and_charts.enums import ApplyTo
150
+ >>> ApplyTo.ALL.value
151
+ """
152
+
153
+ ALL = "All"
154
+ FORMATS = "Formats"
155
+ CONTENTS = "Contents"
156
+
157
+ class TableStyle(Enum):
158
+ """Specifies the TableStyle property used in the `Table.update()`
159
+ method.
160
+
161
+ ### Usage:
162
+ ----
163
+ >>> from ms_graph.workbooks_and_charts.enums import TableStyle
164
+ >>> TableStyle.TABLE_STYLE_LIGHT_1.value
165
+ """
166
+
167
+ TABLE_STYLE_LIGHT_1 = "TableStyleLight1"
168
+ TABLE_STYLE_LIGHT_2 = "TableStyleLight2"
169
+ TABLE_STYLE_LIGHT_3 = "TableStyleLight3"
170
+ TABLE_STYLE_LIGHT_4 = "TableStyleLight4"
171
+ TABLE_STYLE_LIGHT_5 = "TableStyleLight5"
172
+ TABLE_STYLE_LIGHT_6 = "TableStyleLight6"
173
+ TABLE_STYLE_LIGHT_7 = "TableStyleLight7"
174
+ TABLE_STYLE_LIGHT_8 = "TableStyleLight8"
175
+ TABLE_STYLE_LIGHT_9 = "TableStyleLight9"
176
+ TABLE_STYLE_LIGHT_10 = "TableStyleLight10"
177
+ TABLE_STYLE_LIGHT_11 = "TableStyleLight11"
178
+ TABLE_STYLE_LIGHT_12 = "TableStyleLight12"
179
+ TABLE_STYLE_LIGHT_13 = "TableStyleLight13"
180
+ TABLE_STYLE_LIGHT_14 = "TableStyleLight14"
181
+ TABLE_STYLE_LIGHT_15 = "TableStyleLight15"
182
+ TABLE_STYLE_LIGHT_16 = "TableStyleLight16"
183
+ TABLE_STYLE_LIGHT_17 = "TableStyleLight17"
184
+ TABLE_STYLE_LIGHT_18 = "TableStyleLight18"
185
+ TABLE_STYLE_LIGHT_19 = "TableStyleLight19"
186
+ TABLE_STYLE_LIGHT_20 = "TableStyleLight20"
187
+ TABLE_STYLE_LIGHT_21 = "TableStyleLight21"
188
+ TABLE_STYLE_LIGHT_22 = "TableStyleLight22"
189
+ TABLE_STYLE_LIGHT_23 = "TableStyleLight23"
190
+ TABLE_STYLE_LIGHT_24 = "TableStyleLight24"
191
+ TABLE_STYLE_LIGHT_25 = "TableStyleLight25"
192
+ TABLE_STYLE_LIGHT_26 = "TableStyleLight26"
193
+ TABLE_STYLE_LIGHT_27 = "TableStyleLight27"
194
+ TABLE_STYLE_LIGHT_28 = "TableStyleLight28"
195
+
196
+ TABLE_STYLE_MEDIUM_1 = "TableStyleMedium1"
197
+ TABLE_STYLE_MEDIUM_2 = "TableStyleMedium2"
198
+ TABLE_STYLE_MEDIUM_3 = "TableStyleMedium3"
199
+ TABLE_STYLE_MEDIUM_4 = "TableStyleMedium4"
200
+ TABLE_STYLE_MEDIUM_5 = "TableStyleMedium5"
201
+ TABLE_STYLE_MEDIUM_6 = "TableStyleMedium6"
202
+ TABLE_STYLE_MEDIUM_7 = "TableStyleMedium7"
203
+ TABLE_STYLE_MEDIUM_8 = "TableStyleMedium8"
204
+ TABLE_STYLE_MEDIUM_9 = "TableStyleMedium9"
205
+ TABLE_STYLE_MEDIUM_10 = "TableStyleMedium10"
206
+ TABLE_STYLE_MEDIUM_11 = "TableStyleMedium11"
207
+ TABLE_STYLE_MEDIUM_12 = "TableStyleMedium12"
208
+ TABLE_STYLE_MEDIUM_13 = "TableStyleMedium13"
209
+ TABLE_STYLE_MEDIUM_14 = "TableStyleMedium14"
210
+ TABLE_STYLE_MEDIUM_15 = "TableStyleMedium15"
211
+ TABLE_STYLE_MEDIUM_16 = "TableStyleMedium16"
212
+ TABLE_STYLE_MEDIUM_17 = "TableStyleMedium17"
213
+ TABLE_STYLE_MEDIUM_18 = "TableStyleMedium18"
214
+ TABLE_STYLE_MEDIUM_19 = "TableStyleMedium19"
215
+ TABLE_STYLE_MEDIUM_20 = "TableStyleMedium20"
216
+ TABLE_STYLE_MEDIUM_21 = "TableStyleMedium21"
217
+ TABLE_STYLE_MEDIUM_22 = "TableStyleMedium22"
218
+ TABLE_STYLE_MEDIUM_23 = "TableStyleMedium23"
219
+ TABLE_STYLE_MEDIUM_24 = "TableStyleMedium24"
220
+ TABLE_STYLE_MEDIUM_25 = "TableStyleMedium25"
221
+ TABLE_STYLE_MEDIUM_26 = "TableStyleMedium26"
222
+ TABLE_STYLE_MEDIUM_27 = "TableStyleMedium27"
223
+ TABLE_STYLE_MEDIUM_28 = "TableStyleMedium28"
224
+
225
+ TABLE_STYLE_DARK_1 = "TableStyleDark1"
226
+ TABLE_STYLE_DARK_2 = "TableStyleDark2"
227
+ TABLE_STYLE_DARK_3 = "TableStyleDark3"
228
+ TABLE_STYLE_DARK_4 = "TableStyleDark4"
229
+ TABLE_STYLE_DARK_5 = "TableStyleDark5"
230
+ TABLE_STYLE_DARK_6 = "TableStyleDark6"
231
+ TABLE_STYLE_DARK_7 = "TableStyleDark7"
232
+ TABLE_STYLE_DARK_8 = "TableStyleDark8"
233
+ TABLE_STYLE_DARK_9 = "TableStyleDark9"
234
+ TABLE_STYLE_DARK_10 = "TableStyleDark10"
235
+ TABLE_STYLE_DARK_11 = "TableStyleDark11"
236
+ TABLE_STYLE_DARK_12 = "TableStyleDark12"
237
+ TABLE_STYLE_DARK_13 = "TableStyleDark13"
238
+ TABLE_STYLE_DARK_14 = "TableStyleDark14"
239
+ TABLE_STYLE_DARK_15 = "TableStyleDark15"
240
+ TABLE_STYLE_DARK_16 = "TableStyleDark16"
241
+ TABLE_STYLE_DARK_17 = "TableStyleDark17"
242
+ TABLE_STYLE_DARK_18 = "TableStyleDark18"
243
+ TABLE_STYLE_DARK_19 = "TableStyleDark19"
244
+ TABLE_STYLE_DARK_20 = "TableStyleDark20"
245
+ TABLE_STYLE_DARK_21 = "TableStyleDark21"
246
+ TABLE_STYLE_DARK_22 = "TableStyleDark22"
247
+ TABLE_STYLE_DARK_23 = "TableStyleDark23"
248
+ TABLE_STYLE_DARK_24 = "TableStyleDark24"
249
+ TABLE_STYLE_DARK_25 = "TableStyleDark25"
250
+ TABLE_STYLE_DARK_26 = "TableStyleDark26"
251
+ TABLE_STYLE_DARK_27 = "TableStyleDark27"
252
+ TABLE_STYLE_DARK_28 = "TableStyleDark28"