Skip to content

Commit 62ba801

Browse files
committed
Examples section updates
1 parent 2a9ac14 commit 62ba801

File tree

27 files changed

+115
-27
lines changed

27 files changed

+115
-27
lines changed
File renamed without changes.
File renamed without changes.

examples/directory/add_cert_to_app.py renamed to examples/directory/applications/add_cert_to_app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
from office365.directory.key_credential import KeyCredential
99
from office365.graph_client import GraphClient
10-
from office365.runtime.client_value_collection import ClientValueCollection
1110
from tests import test_client_credentials
1211
from tests.graph_case import acquire_token_by_username_password
1312

@@ -34,7 +33,7 @@ def read_certificate(path):
3433
)
3534

3635

37-
cert_path = '../selfsigncert.pem'
36+
cert_path = '../../selfsigncert.pem'
3837
key_cred = read_certificate(cert_path)
3938

4039
client = GraphClient(acquire_token_by_username_password)
File renamed without changes.

examples/directory/groups/__init__.py

Whitespace-only changes.
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
from examples import acquire_token_by_username_password
1+
"""
2+
Delete groups in batch mode
3+
4+
https://learn.microsoft.com/en-us/graph/api/group-delete?view=graph-rest-1.0&tabs=http
5+
"""
6+
27
from office365.graph_client import GraphClient
8+
from tests.graph_case import acquire_token_by_username_password
39

410
client = GraphClient(acquire_token_by_username_password)
511

examples/directory/delete_groups.py renamed to examples/directory/groups/delete_groups.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
from examples import acquire_token_by_username_password
1+
"""
2+
Delete group
3+
4+
Notes:
5+
6+
- Group.delete_object() Microsoft 365 groups are moved to a temporary container and can be restored within 30 days
7+
- Group.delete_object(permanent_delete=True) Microsoft 365 permanently deleted
8+
9+
https://learn.microsoft.com/en-us/graph/api/group-delete?view=graph-rest-1.0&tabs=http
10+
"""
211
from office365.graph_client import GraphClient
12+
from tests.graph_case import acquire_token_by_username_password
313

414
client = GraphClient(acquire_token_by_username_password)
5-
615
groups = client.groups.get().top(1).execute_query()
716
deletedCount = 0
817
groups_count = len(groups)

examples/directory/identity/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)