Skip to content

Commit dd92579

Browse files
committed
introduced admin namespace with new types
1 parent 92fb43a commit dd92579

File tree

27 files changed

+299
-75
lines changed

27 files changed

+299
-75
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Gets Term by id
3+
"""
4+
5+
from office365.sharepoint.client_context import ClientContext
6+
from tests import test_client_credentials, test_team_site_url
7+
8+
ctx = ClientContext(test_team_site_url).with_credentials(test_client_credentials)
9+
term_guid = "f9a6dae9-633c-474b-b35e-b235cf2b9e73"
10+
taxonomy_list = ctx.web.lists.get_by_title("TaxonomyHiddenList")
11+
result = (
12+
taxonomy_list.items.first("IdForTerm eq '{0}'".format(term_guid))
13+
.get()
14+
.execute_query()
15+
)
16+
print(result.properties.get("Title"))

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="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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39197,6 +39197,11 @@ within the time frame of their original request."/>
3919739197
<Parameter Name="value" Type="Collection(graph.site)"/>
3919839198
<ReturnType Type="Collection(graph.site)"/>
3919939199
</Action>
39200+
<Action Name="remove" IsBound="true">
39201+
<Parameter Name="bindingParameter" Type="Collection(graph.conversationMember)"/>
39202+
<Parameter Name="values" Type="Collection(graph.conversationMember)"/>
39203+
<ReturnType Type="Collection(graph.actionResultPart)"/>
39204+
</Action>
3920039205
<Function Name="getAllSites" IsBound="true">
3920139206
<Parameter Name="bindingParameter" Type="Collection(graph.site)"/>
3920239207
<ReturnType Type="Collection(graph.site)"/>

office365/admin/__init__.py

Whitespace-only changes.

office365/admin/admin.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
from office365.admin.microsoft365_apps import AdminMicrosoft365Apps
2+
from office365.admin.people_settings import PeopleAdminSettings
3+
from office365.admin.report_settings import AdminReportSettings
4+
from office365.admin.sharepoint import Sharepoint
5+
from office365.entity import Entity
6+
from office365.intune.servicecommunications.announcement import ServiceAnnouncement
7+
from office365.runtime.paths.resource_path import ResourcePath
8+
9+
10+
class Admin(Entity):
11+
"""Entity that acts as a container for administrator functionality."""
12+
13+
@property
14+
def microsoft365_apps(self):
15+
"""A container for the Microsoft 365 apps admin functionality."""
16+
return self.properties.get(
17+
"microsoft365Apps",
18+
AdminMicrosoft365Apps(
19+
self.context, ResourcePath("microsoft365Apps", self.resource_path)
20+
),
21+
)
22+
23+
@property
24+
def sharepoint(self):
25+
"""A container for administrative resources to manage tenant-level settings for SharePoint and OneDrive."""
26+
return self.properties.get(
27+
"sharepoint",
28+
Sharepoint(self.context, ResourcePath("sharepoint", self.resource_path)),
29+
)
30+
31+
@property
32+
def service_announcement(self):
33+
"""A container for service communications resources. Read-only."""
34+
return self.properties.get(
35+
"serviceAnnouncement",
36+
ServiceAnnouncement(
37+
self.context, ResourcePath("serviceAnnouncement", self.resource_path)
38+
),
39+
)
40+
41+
@property
42+
def report_settings(self):
43+
"""A container for administrative resources to manage reports."""
44+
return self.properties.get(
45+
"reportSettings",
46+
AdminReportSettings(
47+
self.context, ResourcePath("reportSettings", self.resource_path)
48+
),
49+
)
50+
51+
@property
52+
def people(self):
53+
"""Represents a setting to control people-related admin settings in the tenant."""
54+
return self.properties.get(
55+
"people",
56+
PeopleAdminSettings(
57+
self.context, ResourcePath("people", self.resource_path)
58+
),
59+
)
60+
61+
def get_property(self, name, default_value=None):
62+
if default_value is None:
63+
property_mapping = {
64+
"microsoft365Apps": self.microsoft365_apps,
65+
"serviceAnnouncement": self.service_announcement,
66+
"reportSettings": self.report_settings,
67+
}
68+
default_value = property_mapping.get(name, None)
69+
return super(Admin, self).get_property(name, default_value)

office365/admin/microsoft365_apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.entity import Entity
2+
3+
4+
class AdminMicrosoft365Apps(Entity):
5+
"""Represents an entity that acts as a container for administrator functionality for Microsoft 365 applications."""

office365/admin/people_settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.entity import Entity
2+
3+
4+
class PeopleAdminSettings(Entity):
5+
"""Represents a setting to control people-related admin settings in the tenant."""

office365/admin/report_settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.entity import Entity
2+
3+
4+
class AdminReportSettings(Entity):
5+
"""Represents the tenant-level settings for Microsoft 365 reports."""

office365/onedrive/sharepoint.py renamed to office365/admin/sharepoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from office365.admin.sharepoint_settings import SharepointSettings
12
from office365.entity import Entity
2-
from office365.onedrive.sharepoint_settings import SharepointSettings
33
from office365.runtime.paths.resource_path import ResourcePath
44

55

0 commit comments

Comments
 (0)