Skip to content

Commit 39644e6

Browse files
committed
a few updates to governance & identity namespaces
1 parent 9584c62 commit 39644e6

File tree

9 files changed

+1655
-626
lines changed

9 files changed

+1655
-626
lines changed

generator/import_metadata.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ def export_to_file(path, content):
2626
"--endpoint",
2727
dest="endpoint",
2828
help="Import metadata endpoint",
29-
default="sharepoint",
29+
default="graph",
3030
)
3131
parser.add_argument(
3232
"-p",
3333
"--path",
3434
dest="path",
35-
default="./metadata/SharePoint.xml",
35+
default="./metadata/Graph.xml",
3636
help="Import metadata endpoint",
3737
)
3838

generator/metadata/Graph.xml

+239-27
Large diffs are not rendered by default.

generator/metadata/SharePoint.xml

+1,367-596
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from office365.entity import Entity
2+
3+
4+
class UnifiedRoleAssignmentScheduleRequest(Entity):
5+
"""In PIM, represents a request for an active role assignment to a principal. The role assignment can be
6+
permanently active with or without an expiry date, or temporarily active after activation of an eligible
7+
assignment. Inherits from request."""

office365/directory/policies/cross_tenant_access.py

+13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from office365.directory.policies.base import PolicyBase
2+
from office365.directory.policies.template import PolicyTemplate
3+
from office365.runtime.paths.resource_path import ResourcePath
24
from office365.runtime.types.collections import StringCollection
35

46

@@ -13,3 +15,14 @@ def allowed_cloud_endpoints(self):
1315
and partner.microsoftonline.cn.
1416
"""
1517
return self.properties.get("allowedCloudEndpoints", StringCollection())
18+
19+
def templates(self):
20+
# type: () -> PolicyTemplate
21+
"""Represents the base policy in the directory for multitenant organization settings."""
22+
return self.properties.get(
23+
"templates",
24+
PolicyTemplate(
25+
self.context,
26+
ResourcePath("templates", self.resource_path),
27+
),
28+
)
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.entity import Entity
2+
3+
4+
class PolicyTemplate(Entity):
5+
"""Represents the base policy in the directory for multitenant organization settings."""

office365/directory/rolemanagement/application.py

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from office365.directory.identitygovernance.privilegedaccess.unified_role_assignment_schedule_request import (
2+
UnifiedRoleAssignmentScheduleRequest,
3+
)
14
from office365.directory.rolemanagement.unified_role_assignment import (
25
UnifiedRoleAssignment,
36
)
@@ -40,6 +43,18 @@ def role_definitions(self):
4043
),
4144
)
4245

46+
def role_assignment_schedule_requests(self):
47+
# type: () -> EntityCollection[UnifiedRoleAssignmentScheduleRequest]
48+
"""Resource representing the roles allowed by RBAC providers and the permissions assigned to the roles."""
49+
return self.properties.get(
50+
"roleAssignmentScheduleRequests",
51+
EntityCollection(
52+
self.context,
53+
UnifiedRoleAssignmentScheduleRequest,
54+
ResourcePath("roleAssignmentScheduleRequests", self.resource_path),
55+
),
56+
)
57+
4358
def get_property(self, name, default_value=None):
4459
if default_value is None:
4560
property_mapping = {

office365/sharepoint/request.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional, List, Callable
1+
from typing import Callable, List, Optional
22

33
from requests import Response
44
from typing_extensions import Self

tests/directory/test_governance.py

+6
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ def test1_list_app_consent_requests(self):
1616
self.client.identity_governance.app_consent.app_consent_requests.get().execute_query()
1717
)
1818
self.assertIsNotNone(result.resource_path)
19+
20+
# def test2_list_role_assignment_requests(self):
21+
# result = (
22+
# self.client.role_management.directory.role_assignment_schedule_requests().get().execute_query()
23+
# )
24+
# self.assertIsNotNone(result.resource_path)

0 commit comments

Comments
 (0)