Skip to content

Commit c413586

Browse files
committed
directory & teams new types and methods
1 parent b59e027 commit c413586

File tree

35 files changed

+643
-137
lines changed

35 files changed

+643
-137
lines changed

generator/import_metadata.py

Lines changed: 2 additions & 2 deletions
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="graph",
29+
default="sharepoint",
3030
)
3131
parser.add_argument(
3232
"-p",
3333
"--path",
3434
dest="path",
35-
default="./metadata/Graph.xml",
35+
default="./metadata/SharePoint.xml",
3636
help="Import metadata endpoint",
3737
)
3838

generator/metadata/Graph.xml

Lines changed: 112 additions & 3 deletions
Large diffs are not rendered by default.

generator/metadata/SharePoint.xml

Lines changed: 195 additions & 105 deletions
Large diffs are not rendered by default.

office365/communications/calls/participant.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
InvitationParticipantInfo,
55
)
66
from office365.communications.calls.participant_info import ParticipantInfo
7+
from office365.communications.onlinemeetings.restricted import OnlineMeetingRestricted
78
from office365.communications.operations.invite_participants import (
89
InviteParticipantsOperation,
910
)
@@ -73,3 +74,8 @@ def metadata(self):
7374
# type: () -> Optional[str]
7475
"""A blob of data provided by the participant in the roster."""
7576
return self.properties.get("metadata", None)
77+
78+
@property
79+
def restricted_experience(self):
80+
"""Information about the reason or reasons media content from a participant is restricted."""
81+
return self.properties.get("restrictedExperience", OnlineMeetingRestricted())
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.runtime.client_value import ClientValue
2+
3+
4+
class OnlineMeetingRestricted(ClientValue):
5+
"""Indicates the reason or reasons media content from a participant is restricted."""

office365/directory/applications/collection.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ class ApplicationCollection(DeltaCollection[Application]):
99
def __init__(self, context, resource_path=None):
1010
super(ApplicationCollection, self).__init__(context, Application, resource_path)
1111

12+
def add(self, display_name, **kwargs):
13+
"""
14+
Create a new application object.
15+
:param str display_name: Display name of the application.
16+
"""
17+
props = {
18+
"displayName": display_name,
19+
**kwargs,
20+
}
21+
return super(ApplicationCollection, self).add(**props)
22+
1223
def get_by_app_id(self, app_id):
1324
# type: (str) -> Application
1425
"""Retrieves application by Application client identifier

office365/directory/identitygovernance/appconsent/request.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,12 @@ def user_consent_requests(self):
5656
self.context, ResourcePath("userConsentRequests", self.resource_path)
5757
),
5858
)
59+
60+
def get_property(self, name, default_value=None):
61+
if default_value is None:
62+
property_mapping = {
63+
"pendingScopes": self.pending_scopes,
64+
"userConsentRequests": self.user_consent_requests,
65+
}
66+
default_value = property_mapping.get(name, None)
67+
return super(AppConsentRequest, self).get_property(name, default_value)

office365/directory/protection/information.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from office365.directory.protection.threatassessment.request import (
1+
from office365.directory.protection.threatassessment.requests.request import (
22
ThreatAssessmentRequest,
33
)
44
from office365.entity import Entity
@@ -11,6 +11,23 @@
1111
class InformationProtection(Entity):
1212
"""Exposes methods that you can use to get Microsoft Purview Information Protection labels and label policies."""
1313

14+
def create_url_assessment(self, url, expected_assessment, category):
15+
"""Create a new threat assessment request."""
16+
from office365.directory.protection.threatassessment.requests.url import (
17+
UrlAssessmentRequest,
18+
)
19+
20+
return_type = UrlAssessmentRequest(self.context)
21+
return_type.set_property("url", url)
22+
return_type.set_property("expectedAssessment", expected_assessment)
23+
return_type.set_property("category", category)
24+
self.threat_assessment_requests.add_child(return_type)
25+
qry = CreateEntityQuery(
26+
self.threat_assessment_requests, return_type, return_type
27+
)
28+
self.context.add_query(qry)
29+
return return_type
30+
1431
def create_mail_assessment(
1532
self, message, recipient=None, expected_assessment="block", category="spam"
1633
):
@@ -22,7 +39,7 @@ def create_mail_assessment(
2239
:param str category:
2340
"""
2441

25-
from office365.directory.protection.threatassessment.mail_request import (
42+
from office365.directory.protection.threatassessment.requests.mail import (
2643
MailAssessmentRequest,
2744
)
2845

office365/directory/protection/threatassessment/requests/__init__.py

Whitespace-only changes.

office365/directory/protection/threatassessment/email_file_request.py renamed to office365/directory/protection/threatassessment/requests/email_file.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from office365.directory.protection.threatassessment.request import (
3+
from office365.directory.protection.threatassessment.requests.request import (
44
ThreatAssessmentRequest,
55
)
66

@@ -18,3 +18,11 @@ def content_data(self):
1818
Base64 encoded .eml email file content. The file content can't fetch back because it isn't stored.
1919
"""
2020
return self.properties.get("contentData", None)
21+
22+
@property
23+
def file_name(self):
24+
# type: () -> Optional[str]
25+
"""
26+
Base64 encoded .eml email file content. The file content can't fetch back because it isn't stored.
27+
"""
28+
return self.properties.get("fileName", None)

0 commit comments

Comments
 (0)