MCPcopy Index your code
hub / github.com/O365/python-o365 / MSGraphProtocol

Class MSGraphProtocol

O365/connection.py:210–247  ·  view source on GitHub ↗

A Microsoft Graph Protocol Implementation https://docs.microsoft.com/en-us/outlook/rest/compare-graph-outlook

Source from the content-addressed store, hash-verified

208
209
210class MSGraphProtocol(Protocol):
211 """ A Microsoft Graph Protocol Implementation
212 https://docs.microsoft.com/en-us/outlook/rest/compare-graph-outlook
213 """
214
215 _protocol_url = 'https://graph.microsoft.com/'
216 _oauth_scope_prefix = 'https://graph.microsoft.com/'
217 _oauth_scopes = DEFAULT_SCOPES
218
219 def __init__(self, api_version='v1.0', default_resource=None, **kwargs):
220 """ Create a new Microsoft Graph protocol object
221
222 _protocol_url = 'https://graph.microsoft.com/'
223
224 _oauth_scope_prefix = 'https://graph.microsoft.com/'
225
226 :param str api_version: api version to use
227 :param str default_resource: the default resource to use when there is
228 nothing explicitly specified during the requests
229 """
230 super().__init__(protocol_url=self._protocol_url,
231 api_version=api_version,
232 default_resource=default_resource,
233 casing_function=to_camel_case,
234 protocol_scope_prefix=self._oauth_scope_prefix,
235 **kwargs)
236
237 self.keyword_data_store['message_type'] = 'microsoft.graph.message'
238 self.keyword_data_store['event_message_type'] = 'microsoft.graph.eventMessage'
239 self.keyword_data_store['file_attachment_type'] = '#microsoft.graph.fileAttachment'
240 self.keyword_data_store['item_attachment_type'] = '#microsoft.graph.itemAttachment'
241 self.keyword_data_store['prefer_timezone_header'] = f'outlook.timezone="{get_windows_tz(self._timezone)}"'
242 self.max_top_value = 999 # Max $top parameter value
243
244 @Protocol.timezone.setter
245 def timezone(self, timezone: Union[str, ZoneInfo]) -> None:
246 super()._update_timezone(timezone)
247 self.keyword_data_store['prefer_timezone_header'] = f'outlook.timezone="{get_windows_tz(self._timezone)}"'
248
249
250class MSOffice365Protocol(Protocol):

Callers 3

TestMessageApiCallsClass · 0.90
messageFunction · 0.90

Calls

no outgoing calls

Tested by 1

messageFunction · 0.72