1
+ from typing import Optional
2
+
3
+ from office365 .directory .users .insights_settings import UserInsightsSettings
4
+ from office365 .directory .users .storage import UserStorage
1
5
from office365 .entity import Entity
2
6
from office365 .runtime .paths .resource_path import ResourcePath
3
7
from office365 .teams .schedule .shifts .preferences import ShiftPreferences
6
10
class UserSettings (Entity ):
7
11
"""The current user settings for content discovery."""
8
12
13
+ @property
14
+ def contribution_to_content_discovery_as_organization_disabled (self ):
15
+ # type: () -> Optional[bool]
16
+ """Reflects the organization level setting controlling delegate access to the trending API.
17
+ When set to true, the organization doesn't have access to Office Delve. The relevancy of the content
18
+ displayed in Microsoft 365, for example in Suggested sites in SharePoint Home and the Discover view in
19
+ OneDrive for work or school is affected for the whole organization. This setting is read-only and can only
20
+ be changed by administrators in the SharePoint admin center."""
21
+ return self .properties .get (
22
+ "contributionToContentDiscoveryAsOrganizationDisabled" , None
23
+ )
24
+
25
+ @property
26
+ def contribution_to_content_discovery_disabled (self ):
27
+ # type: () -> Optional[bool]
28
+ """When set to true, the delegate access to the user's trending API is disabled.
29
+ When set to true, documents in the user's Office Delve are disabled. When set to true, the relevancy of
30
+ the content displayed in Microsoft 365, for example in Suggested sites in SharePoint Home and the
31
+ Discover view in OneDrive for work or school is affected. Users can control this setting in Office Delve
32
+ """
33
+ return self .properties .get ("contributionToContentDiscoveryDisabled" , None )
34
+
35
+ @property
36
+ def item_insights (self ):
37
+ # type: () -> UserInsightsSettings
38
+ """The user's settings for the visibility of meeting hour insights, and insights derived between
39
+ a user and other items in Microsoft 365, such as documents or sites.
40
+ Get userInsightsSettings through this navigation property."""
41
+ return self .properties .get (
42
+ "itemInsights" ,
43
+ UserInsightsSettings (
44
+ self .context , ResourcePath ("itemInsights" , self .resource_path )
45
+ ),
46
+ )
47
+
9
48
@property
10
49
def shift_preferences (self ):
11
50
# type: () -> ShiftPreferences
@@ -16,8 +55,19 @@ def shift_preferences(self):
16
55
),
17
56
)
18
57
58
+ @property
59
+ def storage (self ):
60
+ # type: () -> ShiftPreferences
61
+ return self .properties .get (
62
+ "storage" ,
63
+ UserStorage (self .context , ResourcePath ("storage" , self .resource_path )),
64
+ )
65
+
19
66
def get_property (self , name , default_value = None ):
20
67
if default_value is None :
21
- property_mapping = {"shiftPreferences" : self .shift_preferences }
68
+ property_mapping = {
69
+ "itemInsights" : self .item_insights ,
70
+ "shiftPreferences" : self .shift_preferences ,
71
+ }
22
72
default_value = property_mapping .get (name , None )
23
73
return super (UserSettings , self ).get_property (name , default_value )
0 commit comments