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/groups.py ADDED
@@ -0,0 +1,51 @@
1
+ from ms_graph.session import GraphSession
2
+
3
+
4
+ class Groups():
5
+
6
+ """
7
+ ## Overview:
8
+ ----
9
+ Groups are collections of users and other principals who share
10
+ access to resources in Microsoft services or in your app. Microsoft
11
+ Graph provides APIs that you can use to create and manage different
12
+ types of groups and group functionality according to your scenario.
13
+ All group-related operations in Microsoft Graph require administrator
14
+ consent.
15
+ """
16
+
17
+ def __init__(self, session: object) -> None:
18
+ """Initializes the `Group` service.
19
+
20
+ ### Parameters
21
+ ----
22
+ session : object
23
+ An authenticated session for our Microsoft Graph Client.
24
+ """
25
+
26
+ # Set the session.
27
+ self.graph_session: GraphSession = session
28
+
29
+ # Set the endpoint.
30
+ self.endpoint = "group"
31
+ self.collections_endpoint = "groups"
32
+
33
+ def list_groups(self) -> dict:
34
+ """List all the groups in an organization, including but
35
+ not limited to Microsoft 365 groups.
36
+
37
+ ### Returns
38
+ -------
39
+ dict :
40
+ If successful, this method returns a 200 OK
41
+ response code and collection of group objects in
42
+ the response body. The response includes only the
43
+ default properties of each group.
44
+ """
45
+
46
+ content = self.graph_session.make_request(
47
+ method="get",
48
+ endpoint=self.collections_endpoint
49
+ )
50
+
51
+ return content
@@ -0,0 +1,7 @@
1
+ """ logger setup to configure logger """
2
+
3
+ # logger_setup.py
4
+ from logpy import get_logger
5
+
6
+ # Initiate logging
7
+ log = get_logger(__name__)