Skip to content

Commit d572da8

Browse files
committed
support for search method on message collections
1 parent a4cecad commit d572da8

File tree

35 files changed

+167
-43
lines changed

35 files changed

+167
-43
lines changed

examples/sharepoint/listitems/versions/list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
ctx = ClientContext(test_team_site_url).with_credentials(test_client_credentials)
99
items = (
1010
ctx.web.lists.get_by_title("Site Pages")
11-
.items.get()
12-
.expand(["Versions"])
11+
.items.expand(["Versions"])
12+
.get()
1313
.top(10)
1414
.execute_query()
1515
)
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""
2-
Creates a site
2+
Create a modern site
3+
34
"""
45

5-
import json
6+
import logging
67
from random import randint
78

89
from office365.sharepoint.tenant.administration.tenant import Tenant
@@ -13,11 +14,20 @@
1314
test_user_principal_name_alt,
1415
)
1516

17+
logging.basicConfig(level=logging.INFO)
18+
logger = logging.getLogger(__name__)
19+
1620
alias = str(randint(0, 10000))
1721
title = "Custom Site"
1822
site_url = "{0}/sites/{1}".format(test_site_url, alias)
1923

2024
tenant = Tenant.from_url(test_admin_site_url).with_credentials(test_user_credentials)
25+
26+
logger.info(f"Creating a site at: {site_url}")
2127
site = tenant.create_site_sync(site_url, test_user_principal_name_alt).execute_query()
22-
print(json.dumps(site.to_json(), indent=4))
23-
tenant.remove_site(site_url).execute_query() # cleanup
28+
29+
logger.info("\nSite created successfully:")
30+
logger.info(f" URL: {site.title}")
31+
32+
# Cleanup - delete the test site
33+
# tenant.remove_site(site_url).execute_query() # cleanup

generator/generate_model.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from configparser import ConfigParser
21

32
from generator import load_settings
43
from generator.builders.type_builder import TypeBuilder
5-
from office365.runtime.odata.model import ODataModel
64
from office365.runtime.odata.v3.metadata_reader import ODataV3Reader
75
from office365.runtime.odata.v4.metadata_reader import ODataV4Reader
86

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from office365.entity import Entity
2+
3+
4+
class NamedLocation(Entity):
5+
"""This is the base class that represents a Microsoft Entra ID named location.
6+
Named locations are custom rules that define network locations which can then be used
7+
in a Conditional Access policy."""

office365/directory/policies/conditional_access.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from datetime import datetime
2+
13
from office365.entity import Entity
24

35

@@ -7,4 +9,7 @@ class ConditionalAccessPolicy(Entity):
79
Conditional access policies are custom rules that define an access scenario.
810
"""
911

10-
pass
12+
@property
13+
def created_datetime(self):
14+
"""Date and time (UTC) the sign-in was initiated."""
15+
return self.properties.get("createdDateTime", datetime.min)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
from office365.directory.protection.riskyusers.risk_detail import RiskDetail
12
from office365.runtime.client_value import ClientValue
23

34

45
class RiskUserActivity(ClientValue):
56
"""Represents the risk activites of an Azure AD user as determined by Azure AD Identity Protection."""
7+
8+
def __init__(self, detail=RiskDetail()):
9+
self.detail = detail
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 RiskDetail(ClientValue):
5+
""" """

office365/graph_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def pending_request(self):
175175
self._pending_request.beforeExecute += self._build_specific_query
176176
return self._pending_request
177177

178+
@property
178179
def service_root_url(self):
179180
# type: () -> str
180181
return self.pending_request().service_root_url

office365/intune/devices/detail.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ class DeviceDetail(ClientValue):
66
like device browser and operating system, and whether the device is Azure AD managed.
77
"""
88

9-
def __init__(self, browser=None, device_id=None, display_name=None):
9+
def __init__(
10+
self,
11+
browser=None,
12+
device_id=None,
13+
display_name=None,
14+
is_compliant=None,
15+
is_managed=None,
16+
operating_system=None,
17+
trust_type=None
18+
):
1019
"""
1120
:param str browser: Indicates the browser information of the used for signing in.
1221
:param str device_id: Refers to the UniqueID of the device used for signing in.
@@ -15,3 +24,7 @@ def __init__(self, browser=None, device_id=None, display_name=None):
1524
self.browser = browser
1625
self.deviceId = device_id
1726
self.displayName = display_name
27+
self.isCompliant = is_compliant
28+
self.isManaged = is_managed
29+
self.operatingSystem = operating_system
30+
self.trustType = trust_type

0 commit comments

Comments
 (0)