Skip to content

Commit 0ef1afb

Browse files
committed
OneDrive: introduced support for recyclebin types, workbooks namespace types update
1 parent 84e7292 commit 0ef1afb

File tree

23 files changed

+200
-21
lines changed

23 files changed

+200
-21
lines changed

examples/directory/applications/grant_application_perms.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
from tests import (
1919
test_client_id,
2020
test_client_secret,
21-
test_tenant,
21+
test_tenant, test_admin_principal_name,
2222
)
2323

24-
# client = GraphClient.with_token_interactive(
25-
# test_tenant, test_client_id, test_admin_principal_name
26-
# )
27-
client = GraphClient.with_client_secret(test_tenant, test_client_id, test_client_secret)
24+
client = GraphClient.with_token_interactive(
25+
test_tenant, test_client_id, test_admin_principal_name
26+
)
27+
#client = GraphClient.with_client_secret(test_tenant, test_client_id, test_client_secret)
2828

2929
# Step 1: Get the resource service principal
3030
resource = client.service_principals.get_by_name("Microsoft Graph")
3131

3232
# Step 2: Grant an app role to a client app
3333
app = client.applications.get_by_app_id(test_client_id)
34-
resource.grant_application_permissions(app, "Bookings.Read.All").execute_query()
34+
resource.grant_application_permissions(app, "ThreatAssessment.Read.All").execute_query()
3535

3636

3737
# Step 3 (optional). Print app role assignments

examples/directory/applications/has_application_perms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
resource = client.service_principals.get_by_name("Microsoft Graph")
21-
app_role = "Bookings.Read.All"
21+
app_role = "ThreatAssessment.Read.All" # "Bookings.Read.All"
2222
result = resource.get_application_permissions(test_client_id).execute_query()
2323
if (
2424
len([cur_app_role for cur_app_role in result.value if cur_app_role == app_role])

generator/metadata/Graph.xml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17290,6 +17290,11 @@ within the time frame of their original request."/>
1729017290
<Member Name="x509CertificateMultiFactor" Value="1"/>
1729117291
<Member Name="unknownFutureValue" Value="2"/>
1729217292
</EnumType>
17293+
<EnumType Name="x509CertificateCRLValidationConfigurationState">
17294+
<Member Name="disabled" Value="0"/>
17295+
<Member Name="enabled" Value="1"/>
17296+
<Member Name="unknownFutureValue" Value="2"/>
17297+
</EnumType>
1729317298
<EnumType Name="x509CertificateRuleType">
1729417299
<Member Name="issuerSubject" Value="0"/>
1729517300
<Member Name="policyOID" Value="1"/>
@@ -18407,6 +18412,13 @@ within the time frame of their original request."/>
1840718412
<Member Name="reactivating" Value="2"/>
1840818413
<Member Name="unknownFutureValue" Value="3"/>
1840918414
</EnumType>
18415+
<EnumType Name="siteLockState">
18416+
<Member Name="unlocked" Value="0"/>
18417+
<Member Name="lockedReadOnly" Value="1"/>
18418+
<Member Name="lockedNoAccess" Value="2"/>
18419+
<Member Name="lockedNoAdditions" Value="3"/>
18420+
<Member Name="unknownFutureValue" Value="4"/>
18421+
</EnumType>
1841018422
<EnumType Name="titleAreaLayoutType">
1841118423
<Member Name="imageAndTitle" Value="0"/>
1841218424
<Member Name="plain" Value="1"/>
@@ -22245,6 +22257,13 @@ within the time frame of their original request."/>
2224522257
<Member Name="unknownFutureValue" Value="7"/>
2224622258
<Member Name="emailUser" Value="8"/>
2224722259
</EnumType>
22260+
<EnumType Name="eligibilityFilteringEnabledEntities" IsFlags="true">
22261+
<Member Name="none" Value="0"/>
22262+
<Member Name="swapRequest" Value="1"/>
22263+
<Member Name="offerShiftRequest" Value="2"/>
22264+
<Member Name="unknownFutureValue" Value="4"/>
22265+
<Member Name="timeOffReason" Value="8"/>
22266+
</EnumType>
2224822267
<EnumType Name="scheduleChangeRequestActor">
2224922268
<Member Name="sender" Value="0"/>
2225022269
<Member Name="recipient" Value="1"/>
@@ -22310,6 +22329,9 @@ within the time frame of their original request."/>
2231022329
<Member Name="openShiftRequest" Value="32"/>
2231122330
<Member Name="offerShiftRequest" Value="64"/>
2231222331
<Member Name="unknownFutureValue" Value="1024"/>
22332+
<Member Name="timeOffReason" Value="4096"/>
22333+
<Member Name="timeOff" Value="8192"/>
22334+
<Member Name="timeOffRequest" Value="16384"/>
2231322335
</EnumType>
2231422336
<EnumType Name="mailDestinationRoutingReason">
2231522337
<Member Name="none" Value="0"/>
@@ -24062,6 +24084,10 @@ within the time frame of their original request."/>
2406224084
<Property Name="x509CertificateRequiredAffinityLevel" Type="graph.x509CertificateAffinityLevel"/>
2406324085
<Property Name="x509CertificateRuleType" Type="graph.x509CertificateRuleType"/>
2406424086
</ComplexType>
24087+
<ComplexType Name="x509CertificateCRLValidationConfiguration">
24088+
<Property Name="exemptedCertificateAuthoritiesSubjectKeyIdentifiers" Type="Collection(Edm.String)"/>
24089+
<Property Name="state" Type="graph.x509CertificateCRLValidationConfigurationState" Nullable="false"/>
24090+
</ComplexType>
2406524091
<ComplexType Name="x509CertificateUserBinding">
2406624092
<Property Name="priority" Type="Edm.Int32" Nullable="false"/>
2406724093
<Property Name="trustAffinityLevel" Type="graph.x509CertificateAffinityLevel"/>
@@ -24286,6 +24312,7 @@ within the time frame of their original request."/>
2428624312
<EntityType Name="x509CertificateAuthenticationMethodConfiguration" BaseType="graph.authenticationMethodConfiguration">
2428724313
<Property Name="authenticationModeConfiguration" Type="graph.x509CertificateAuthenticationModeConfiguration"/>
2428824314
<Property Name="certificateUserBindings" Type="Collection(graph.x509CertificateUserBinding)"/>
24315+
<Property Name="crlValidationConfiguration" Type="graph.x509CertificateCRLValidationConfiguration" Nullable="false"/>
2428924316
<NavigationProperty Name="includeTargets" Type="Collection(graph.authenticationMethodTarget)" ContainsTarget="true"/>
2429024317
</EntityType>
2429124318
<EntityType Name="x509CertificateCombinationConfiguration" BaseType="graph.authenticationCombinationConfiguration">
@@ -26544,6 +26571,7 @@ within the time frame of their original request."/>
2654426571
<Property Name="federatedIdpMfaBehavior" Type="graph.federatedIdpMfaBehavior"/>
2654526572
<Property Name="isSignedAuthenticationRequestRequired" Type="Edm.Boolean"/>
2654626573
<Property Name="nextSigningCertificate" Type="Edm.String"/>
26574+
<Property Name="passwordResetUri" Type="Edm.String"/>
2654726575
<Property Name="promptLoginBehavior" Type="graph.promptLoginBehavior"/>
2654826576
<Property Name="signingCertificateUpdateStatus" Type="graph.signingCertificateUpdateStatus"/>
2654926577
<Property Name="signOutUri" Type="Edm.String"/>
@@ -28428,18 +28456,25 @@ within the time frame of their original request."/>
2842828456
</ComplexType>
2842928457
<EntityType Name="fileStorage" BaseType="graph.entity">
2843028458
<NavigationProperty Name="containers" Type="Collection(graph.fileStorageContainer)" ContainsTarget="true"/>
28459+
<NavigationProperty Name="deletedContainers" Type="Collection(graph.fileStorageContainer)" ContainsTarget="true"/>
2843128460
</EntityType>
2843228461
<EntityType Name="fileStorageContainer" BaseType="graph.entity">
2843328462
<Property Name="containerTypeId" Type="Edm.Guid" Nullable="false"/>
2843428463
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" Nullable="false"/>
2843528464
<Property Name="customProperties" Type="graph.fileStorageContainerCustomPropertyDictionary"/>
2843628465
<Property Name="description" Type="Edm.String"/>
2843728466
<Property Name="displayName" Type="Edm.String" Nullable="false"/>
28467+
<Property Name="lockState" Type="graph.siteLockState"/>
2843828468
<Property Name="settings" Type="graph.fileStorageContainerSettings" Nullable="false"/>
2843928469
<Property Name="status" Type="graph.fileStorageContainerStatus"/>
2844028470
<Property Name="viewpoint" Type="graph.fileStorageContainerViewpoint"/>
2844128471
<NavigationProperty Name="drive" Type="graph.drive" ContainsTarget="true"/>
2844228472
<NavigationProperty Name="permissions" Type="Collection(graph.permission)" ContainsTarget="true"/>
28473+
<NavigationProperty Name="recycleBin" Type="graph.recycleBin" ContainsTarget="true"/>
28474+
</EntityType>
28475+
<EntityType Name="recycleBin" BaseType="graph.baseItem" OpenType="true">
28476+
<Property Name="settings" Type="graph.recycleBinSettings"/>
28477+
<NavigationProperty Name="items" Type="Collection(graph.recycleBinItem)" ContainsTarget="true"/>
2844328478
</EntityType>
2844428479
<EntityType Name="sharepointSettings" BaseType="graph.entity">
2844528480
<Property Name="allowedDomainGuidsForSyncApp" Type="Collection(Edm.Guid)"/>
@@ -28663,6 +28698,9 @@ within the time frame of their original request."/>
2866328698
<Property Name="likeCount" Type="Edm.Int32"/>
2866428699
<Property Name="shareCount" Type="Edm.Int32"/>
2866528700
</ComplexType>
28701+
<ComplexType Name="recycleBinSettings">
28702+
<Property Name="retentionPeriodOverrideDays" Type="Edm.Int32"/>
28703+
</ComplexType>
2866628704
<ComplexType Name="renameAction">
2866728705
<Property Name="newName" Type="Edm.String"/>
2866828706
<Property Name="oldName" Type="Edm.String"/>
@@ -28809,6 +28847,11 @@ within the time frame of their original request."/>
2880928847
<Property Name="startDateTime" Type="Edm.DateTimeOffset"/>
2881028848
<NavigationProperty Name="activities" Type="Collection(graph.itemActivity)"/>
2881128849
</EntityType>
28850+
<EntityType Name="recycleBinItem" BaseType="graph.baseItem" OpenType="true">
28851+
<Property Name="deletedDateTime" Type="Edm.DateTimeOffset"/>
28852+
<Property Name="deletedFromLocation" Type="Edm.String"/>
28853+
<Property Name="size" Type="Edm.Int64"/>
28854+
</EntityType>
2881228855
<EntityType Name="sharedDriveItem" BaseType="graph.baseItem">
2881328856
<Property Name="owner" Type="graph.identitySet"/>
2881428857
<NavigationProperty Name="driveItem" Type="graph.driveItem" ContainsTarget="true"/>
@@ -34641,6 +34684,7 @@ within the time frame of their original request."/>
3464134684
<EntityType Name="workforceIntegration" BaseType="graph.changeTrackedEntity">
3464234685
<Property Name="apiVersion" Type="Edm.Int32"/>
3464334686
<Property Name="displayName" Type="Edm.String"/>
34687+
<Property Name="eligibilityFilteringEnabledEntities" Type="graph.eligibilityFilteringEnabledEntities"/>
3464434688
<Property Name="encryption" Type="graph.workforceIntegrationEncryption"/>
3464534689
<Property Name="isActive" Type="Edm.Boolean"/>
3464634690
<Property Name="supportedEntities" Type="graph.workforceIntegrationSupportedEntities"/>
@@ -34709,6 +34753,7 @@ within the time frame of their original request."/>
3470934753
</EntityType>
3471034754
<EntityType Name="openShift" BaseType="graph.changeTrackedEntity">
3471134755
<Property Name="draftOpenShift" Type="graph.openShiftItem"/>
34756+
<Property Name="isStagedForDeletion" Type="Edm.Boolean"/>
3471234757
<Property Name="schedulingGroupId" Type="Edm.String"/>
3471334758
<Property Name="sharedOpenShift" Type="graph.openShiftItem"/>
3471434759
</EntityType>
@@ -34722,6 +34767,7 @@ within the time frame of their original request."/>
3472234767
</EntityType>
3472334768
<EntityType Name="shift" BaseType="graph.changeTrackedEntity">
3472434769
<Property Name="draftShift" Type="graph.shiftItem"/>
34770+
<Property Name="isStagedForDeletion" Type="Edm.Boolean"/>
3472534771
<Property Name="schedulingGroupId" Type="Edm.String"/>
3472634772
<Property Name="sharedShift" Type="graph.shiftItem"/>
3472734773
<Property Name="userId" Type="Edm.String"/>
@@ -34741,6 +34787,7 @@ within the time frame of their original request."/>
3474134787
</EntityType>
3474234788
<EntityType Name="timeOff" BaseType="graph.changeTrackedEntity">
3474334789
<Property Name="draftTimeOff" Type="graph.timeOffItem"/>
34790+
<Property Name="isStagedForDeletion" Type="Edm.Boolean"/>
3474434791
<Property Name="sharedTimeOff" Type="graph.timeOffItem"/>
3474534792
<Property Name="userId" Type="Edm.String"/>
3474634793
</EntityType>
@@ -35687,6 +35734,10 @@ within the time frame of their original request."/>
3568735734
</Parameter>
3568835735
<ReturnType Type="graph.directoryObject"/>
3568935736
</Action>
35737+
<Action Name="restore" IsBound="true">
35738+
<Parameter Name="bindingParameter" Type="graph.fileStorageContainer"/>
35739+
<ReturnType Type="graph.fileStorageContainer"/>
35740+
</Action>
3569035741
<Action Name="restore" IsBound="true">
3569135742
<Parameter Name="bindingParameter" Type="graph.driveItem"/>
3569235743
<Parameter Name="parentReference" Type="graph.itemReference"/>
@@ -39126,12 +39177,21 @@ within the time frame of their original request."/>
3912639177
<Parameter Name="TimeZoneStandard" Type="graph.timeZoneStandard" Nullable="false"/>
3912739178
<ReturnType Type="Collection(graph.timeZoneInformation)" Nullable="false"/>
3912839179
</Function>
39180+
<Action Name="lock" IsBound="true">
39181+
<Parameter Name="bindingParameter" Type="graph.fileStorageContainer"/>
39182+
<Parameter Name="lockState" Type="graph.siteLockState">
39183+
<Annotation Term="Org.OData.Core.V1.OptionalParameter"/>
39184+
</Parameter>
39185+
</Action>
3912939186
<Action Name="permanentDelete" IsBound="true">
3913039187
<Parameter Name="bindingParameter" Type="graph.fileStorageContainer"/>
3913139188
</Action>
3913239189
<Action Name="permanentDelete" IsBound="true">
3913339190
<Parameter Name="bindingParameter" Type="graph.driveItem"/>
3913439191
</Action>
39192+
<Action Name="unlock" IsBound="true">
39193+
<Parameter Name="bindingParameter" Type="graph.fileStorageContainer"/>
39194+
</Action>
3913539195
<Action Name="remove" IsBound="true">
3913639196
<Parameter Name="bindingParameter" Type="Collection(graph.site)"/>
3913739197
<Parameter Name="value" Type="Collection(graph.site)"/>
@@ -39197,6 +39257,9 @@ within the time frame of their original request."/>
3919739257
</Parameter>
3919839258
<ReturnType Type="graph.permission"/>
3919939259
</Action>
39260+
<Action Name="discardCheckout" IsBound="true">
39261+
<Parameter Name="bindingParameter" Type="graph.driveItem"/>
39262+
</Action>
3920039263
<Action Name="extractSensitivityLabels" IsBound="true">
3920139264
<Parameter Name="bindparameter" Type="graph.driveItem"/>
3920239265
<ReturnType Type="graph.extractSensitivityLabelsResult"/>
@@ -40799,6 +40862,9 @@ within the time frame of their original request."/>
4079940862
<Parameter Name="startDateTime" Type="Edm.DateTimeOffset"/>
4080040863
<Parameter Name="endDateTime" Type="Edm.DateTimeOffset"/>
4080140864
</Action>
40865+
<Action Name="stageForDeletion" IsBound="true">
40866+
<Parameter Name="bindingParameter" Type="graph.changeTrackedEntity"/>
40867+
</Action>
4080240868
<Action Name="endWorkingTime" IsBound="true">
4080340869
<Parameter Name="bindparameter" Type="graph.workingTimeSchedule" Nullable="false"/>
4080440870
</Action>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from typing import Optional
2+
3+
from office365.directory.protection.threatassessment.request import ThreatAssessmentRequest
4+
5+
6+
class EmailFileAssessmentRequest(ThreatAssessmentRequest):
7+
"""
8+
Represents a resource that creates and retrieves an email file threat assessment.
9+
The email file can be an .eml file type.
10+
"""
11+
12+
@property
13+
def content_data(self):
14+
# type: () -> Optional[str]
15+
"""
16+
Base64 encoded .eml email file content. The file content can't fetch back because it isn't stored.
17+
"""
18+
return self.properties.get("contentData", None)

office365/directory/protection/threatassessment/request.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33

44
class ThreatAssessmentRequest(Entity):
55
"""An abstract resource type used to represent a threat assessment request item."""
6+
File renamed without changes.

office365/onedrive/columns/definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from office365.base_item import BaseItem
3+
from office365.onedrive.base_item import BaseItem
44
from office365.onedrive.columns.boolean import BooleanColumn
55
from office365.onedrive.columns.calculated import CalculatedColumn
66
from office365.onedrive.columns.choice import ChoiceColumn

office365/onedrive/contenttypes/content_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from office365.base_item import BaseItem
3+
from office365.onedrive.base_item import BaseItem
44
from office365.entity_collection import EntityCollection
55
from office365.onedrive.columns.column_link import ColumnLink
66
from office365.onedrive.columns.definition import ColumnDefinition

office365/onedrive/driveitems/driveItem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import requests
1010
from typing_extensions import Self
1111

12-
from office365.base_item import BaseItem
12+
from office365.onedrive.base_item import BaseItem
1313
from office365.delta_path import DeltaPath
1414
from office365.entity_collection import EntityCollection
1515
from office365.onedrive.analytics.item_activity_stat import ItemActivityStat

office365/onedrive/drives/drive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from office365.base_item import BaseItem
3+
from office365.onedrive.base_item import BaseItem
44
from office365.directory.permissions.identity_set import IdentitySet
55
from office365.entity_collection import EntityCollection
66
from office365.onedrive.driveitems.conflict_behavior import ConflictBehavior

0 commit comments

Comments
 (0)