22from typing import Optional
33
44from office365 .directory .audit .activity_initiator import AuditActivityInitiator
5+ from office365 .directory .audit .target_resource import TargetResource
56from office365 .entity import Entity
7+ from office365 .runtime .client_value_collection import ClientValueCollection
68
79
810class DirectoryAudit (Entity ):
@@ -25,6 +27,14 @@ def activity_display_name(self):
2527 """
2628 return self .properties .get ("activityDisplayName" , None )
2729
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+
2838 @property
2939 def category (self ):
3040 # type: () -> Optional[str]
@@ -69,6 +79,14 @@ def logged_by_service(self):
6979 """
7080 return self .properties .get ("loggedByService" , None )
7181
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+
7290 @property
7391 def result_reason (self ):
7492 # type: () -> Optional[str]
@@ -77,11 +95,24 @@ def result_reason(self):
7795 """
7896 return self .properties .get ("resultReason" , None )
7997
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+
80110 def get_property (self , name , default_value = None ):
81111 if default_value is None :
82112 property_mapping = {
83113 "activityDateTime" : self .activity_datetime ,
84114 "initiatedBy" : self .initiated_by ,
115+ "targetResources" : self .target_resources ,
85116 }
86117 default_value = property_mapping .get (name , None )
87118 return super (DirectoryAudit , self ).get_property (name , default_value )
0 commit comments