2
2
from typing import Optional
3
3
4
4
from office365 .directory .audit .activity_initiator import AuditActivityInitiator
5
+ from office365 .directory .audit .target_resource import TargetResource
5
6
from office365 .entity import Entity
7
+ from office365 .runtime .client_value_collection import ClientValueCollection
6
8
7
9
8
10
class DirectoryAudit (Entity ):
@@ -25,6 +27,14 @@ def activity_display_name(self):
25
27
"""
26
28
return self .properties .get ("activityDisplayName" , None )
27
29
30
+ @property
31
+ def additional_details (self ):
32
+ # type: () -> Optional[dict]
33
+ """
34
+ Indicates additional details on the activity.
35
+ """
36
+ return self .properties .get ("additionalDetails" , None )
37
+
28
38
@property
29
39
def category (self ):
30
40
# type: () -> Optional[str]
@@ -69,6 +79,14 @@ def logged_by_service(self):
69
79
"""
70
80
return self .properties .get ("loggedByService" , None )
71
81
82
+ @property
83
+ def result (self ):
84
+ # type: () -> Optional[str]
85
+ """
86
+ Indicates the result of the activity. Possible values are: success, failure, timeout, unknownFutureValue.
87
+ """
88
+ return self .properties .get ("result" , None )
89
+
72
90
@property
73
91
def result_reason (self ):
74
92
# type: () -> Optional[str]
@@ -77,11 +95,24 @@ def result_reason(self):
77
95
"""
78
96
return self .properties .get ("resultReason" , None )
79
97
98
+ @property
99
+ def target_resources (self ):
100
+ # type: () -> Optional[str]
101
+ """
102
+ Indicates information on which resource was changed due to the activity. Target Resource Type can be User,
103
+ Device, Directory, App, Role, Group, Policy or Other. Supports $filter (eq) for id and displayName;
104
+ and $filter (startswith) for displayName.
105
+ """
106
+ return self .properties .get (
107
+ "targetResources" , ClientValueCollection (TargetResource )
108
+ )
109
+
80
110
def get_property (self , name , default_value = None ):
81
111
if default_value is None :
82
112
property_mapping = {
83
113
"activityDateTime" : self .activity_datetime ,
84
114
"initiatedBy" : self .initiated_by ,
115
+ "targetResources" : self .target_resources ,
85
116
}
86
117
default_value = property_mapping .get (name , None )
87
118
return super (DirectoryAudit , self ).get_property (name , default_value )
0 commit comments