Skip to content

Commit 686039c

Browse files
committed
Teams API: new types, type hints improvements
1 parent fc53e8d commit 686039c

File tree

39 files changed

+505
-92
lines changed

39 files changed

+505
-92
lines changed

examples/onedrive/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Working with OneDrive and SharePoint API v2 APIs

examples/outlook/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Working with Outlook API
2+
3+
The list of supported APIs:
4+
- [Outlook Contacts REST API](https://msdn.microsoft.com/en-us/office/office365/api/contacts-rest-operations)
5+
- [Outlook Calendar REST API](https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations)
6+
- [Outlook Mail REST API](https://msdn.microsoft.com/en-us/office/office365/api/mail-rest-operations)

examples/sharepoint/README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,26 @@
33
This directory contains examples for SharePoint REST API v1
44

55

6-
### [Working with folders and files](./files/)
7-
- **Download** a file: [`download.py`](./files/download.py)
8-
- **Upload** a file: [`upload.py`](./files/upload.py)
9-
- **Create** a folder: [`create.py`](./folders/create.py)
10-
11-
### [Working with lists](./lists/)
12-
- **Create** a list item: [`create_item.py`](./lists/create_item.py)
13-
- **Read** list items (paged): [`read_items.py`](./lists/read_items.py)
14-
15-
### [Working with list items](./listitems/)
16-
- **Update** items in batch: [`update_batch.py`](./listitems/update_batch.py)
17-
- **Delete** an item: [`delete.py`](./listitems/delete.py)
18-
19-
6+
### Working with folders and files
7+
- **Download** a file: [`./files/download.py`](./files/download.py)
8+
- **Upload** a file: [`./files/upload.py`](./files/upload.py)
9+
- **Create** a folder: [`./folders/create.py`](./folders/create.py)
10+
- **Upload** large file: [`./files/upload_large.py`](./files/upload_large.py)
11+
- **List** file version history: [`./versions/list.py`](./files/versions/list.py)
12+
13+
### Working with lists and list items
14+
- **Create** a list item: [`/lists/create_item.py`](./lists/create_item.py)
15+
- **Read** list items (paged): [`/lists/read_items.py`](./lists/read_items.py)
16+
- **Update** items in batch: [`./listitems/update_batch.py`](./listitems/update_batch.py)
17+
- **Delete** an list item: [`./listitems/delete.py`](./listitems/delete.py)
18+
19+
### Working with fields and field values
20+
- **Create** lookup field: [`create_lookup.py`](./fields/create_lookup.py)
21+
22+
### Working with taxonomy
23+
- **Get** field value : [`get_field_value.py`](./taxonomy/get_field_value.py)
24+
25+
### Working with site
2026

2127
---
2228

generator/metadata/Graph.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41874,6 +41874,7 @@ within the time frame of their original request."/>
4187441874
<Member Name="microsoftDefenderThreatIntelligenceAnalytics" Value="1073741846"/>
4187541875
<Member Name="builtInMl" Value="1073741847"/>
4187641876
<Member Name="microsoftInsiderRiskManagement" Value="1073741848"/>
41877+
<Member Name="microsoftThreatIntelligence" Value="1073741849"/>
4187741878
<Member Name="microsoftSentinel" Value="268435456"/>
4187841879
</EnumType>
4187941880
<EnumType Name="detectionStatus">
@@ -42025,6 +42026,7 @@ within the time frame of their original request."/>
4202542026
<Member Name="microsoftDefenderForCloud" Value="256"/>
4202642027
<Member Name="microsoftSentinel" Value="512"/>
4202742028
<Member Name="microsoftInsiderRiskManagement" Value="1024"/>
42029+
<Member Name="microsoftThreatIntelligence" Value="2048"/>
4202842030
</EnumType>
4202942031
<EnumType Name="teamsDeliveryLocation">
4203042032
<Member Name="unknown" Value="0"/>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
from office365.directory.authentication.method_configuration import (
22
AuthenticationMethodConfiguration,
33
)
4+
from office365.directory.authentication.methods.sms_target import (
5+
SmsAuthenticationMethodTarget,
6+
)
7+
from office365.entity_collection import EntityCollection
8+
from office365.runtime.paths.resource_path import ResourcePath
49

510

611
class SmsAuthenticationMethodConfiguration(AuthenticationMethodConfiguration):
712
"""Represents a text message authentication methods policy. Authentication methods policies define
813
configuration settings and users or groups that are enabled to use the authentication method.
914
"""
15+
16+
@property
17+
def include_targets(self):
18+
"""Groups of users that are excluded from the policy."""
19+
return self.properties.get(
20+
"includeTargets",
21+
EntityCollection(
22+
self.context,
23+
SmsAuthenticationMethodTarget,
24+
ResourcePath("includeTargets", self.resource_path),
25+
),
26+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.sharepoint.entity import Entity
2+
3+
4+
class SmsAuthenticationMethodTarget(Entity):
5+
"""Represents the users or groups of users that are excluded from a policy."""

office365/directory/security/alerts/history_state.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33

44
class AlertHistoryState(ClientValue):
55
"""Stores changes made to alerts."""
6+
7+
def __init__(self, app_id=None, assigned_to=None, comments=None):
8+
# type: (str, str, list[str]) -> None
9+
self.appId = app_id
10+
self.assignedTo = assigned_to
11+
self.comments = comments
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
from office365.directory.security.hunting_row_result import HuntingRowResult
12
from office365.runtime.client_value import ClientValue
3+
from office365.runtime.client_value_collection import ClientValueCollection
24

35

46
class HuntingQueryResults(ClientValue):
57
"""The results of running a query for advanced hunting."""
8+
9+
def __init__(self, results=None):
10+
self.results = ClientValueCollection(HuntingRowResult, results)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from office365.runtime.client_value import ClientValue
2+
3+
4+
class HuntingRowResult(ClientValue):
5+
"""Represents a row of the results from running an advanced hunting query.
6+
7+
The content of the results is depended on the submitted KQL query, see KQL quick reference.
8+
"""

office365/directory/security/security.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
from office365.directory.security.incidents.incident import Incident
77
from office365.directory.security.labels.root import LabelsRoot
88
from office365.directory.security.scorecontrol.profile import SecureScoreControlProfile
9+
from office365.directory.security.subjectrightsrequests.request import (
10+
SubjectRightsRequest,
11+
)
912
from office365.directory.security.threatintelligence.threat_intelligence import (
1013
ThreatIntelligence,
1114
)
@@ -93,6 +96,19 @@ def labels(self):
9396
LabelsRoot(self.context, ResourcePath("labels", self.resource_path)),
9497
)
9598

99+
@property
100+
def subject_rights_requests(self):
101+
# type: () -> EntityCollection[SubjectRightsRequest]
102+
"""Get a list of the subjectRightsRequest objects and their properties."""
103+
return self.properties.get(
104+
"subjectRightsRequests",
105+
EntityCollection(
106+
self.context,
107+
SubjectRightsRequest,
108+
ResourcePath("subjectRightsRequests", self.resource_path),
109+
),
110+
)
111+
96112
@property
97113
def secure_score_control_profiles(self):
98114
""""""
@@ -128,6 +144,7 @@ def get_property(self, name, default_value=None):
128144
property_mapping = {
129145
"alerts_v2": self.alerts_v2,
130146
"attackSimulation": self.attack_simulation,
147+
"subjectRightsRequests": self.subject_rights_requests,
131148
"secureScoreControlProfiles": self.secure_score_control_profiles,
132149
"threatIntelligence": self.threat_intelligence,
133150
}

0 commit comments

Comments
 (0)