Skip to content

Commit 261d42c

Browse files
committed
formatting minor changes, model updated
1 parent 4ba6349 commit 261d42c

File tree

5 files changed

+49
-13
lines changed

5 files changed

+49
-13
lines changed

examples/auth/gcc_high.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ def construct_request(request):
3333

3434

3535
client = GraphClient(acquire_token)
36-
client.before_execute(construct_request)
36+
client.pending_request().beforeExecute += construct_request
3737
messages = client.users[test_user_principal_name].messages.get().execute_query()
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
"""
22
Returns a SharePoint site status
33
"""
4+
45
from office365.sharepoint.client_context import ClientContext
5-
from tests import test_team_site_url, test_admin_site_url, test_admin_credentials
6+
from tests import test_admin_credentials, test_admin_site_url, test_team_site_url
67

7-
admin_client = ClientContext(test_admin_site_url).with_credentials(test_admin_credentials)
8+
admin_client = ClientContext(test_admin_site_url).with_credentials(
9+
test_admin_credentials
10+
)
811
result = admin_client.site_manager.get_status(test_team_site_url).execute_query()
912
print(result.value)

generator/import_metadata.py

Lines changed: 3 additions & 3 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/MicrosoftGraph.xml",
3636
help="Import metadata endpoint",
3737
)
3838

@@ -43,7 +43,7 @@ def export_to_file(path, content):
4343
ctx = ClientContext(test_site_url).with_credentials(test_client_credentials)
4444
result = ctx.get_metadata().execute_query()
4545
export_to_file(args.path, result.value)
46-
elif args.endpoint == "microsoftgraph":
46+
elif args.endpoint == "graph":
4747
print("Importing Microsoft Graph model metadata...")
4848
client = GraphClient.with_client_secret(
4949
test_tenant, test_client_id, test_client_secret

generator/metadata/MicrosoftGraph.xml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21928,6 +21928,7 @@
2192821928
<Member Name="required" Value="0"/>
2192921929
<Member Name="recommended" Value="1"/>
2193021930
<Member Name="unknownFutureValue" Value="2"/>
21931+
<Member Name="peerRecommended" Value="3"/>
2193121932
</EnumType>
2193221933
<EnumType Name="courseStatus">
2193321934
<Member Name="notStarted" Value="0"/>
@@ -22367,7 +22368,7 @@
2236722368
<NavigationProperty Name="managedAppRegistrations" Type="Collection(graph.managedAppRegistration)"/>
2236822369
<NavigationProperty Name="deviceManagementTroubleshootingEvents" Type="Collection(graph.deviceManagementTroubleshootingEvent)" ContainsTarget="true"/>
2236922370
<NavigationProperty Name="planner" Type="graph.plannerUser" ContainsTarget="true"/>
22370-
<NavigationProperty Name="insights" Type="graph.officeGraphInsights" ContainsTarget="true"/>
22371+
<NavigationProperty Name="insights" Type="graph.itemInsights" ContainsTarget="true"/>
2237122372
<NavigationProperty Name="settings" Type="graph.userSettings" ContainsTarget="true"/>
2237222373
<NavigationProperty Name="onenote" Type="graph.onenote" ContainsTarget="true"/>
2237322374
<NavigationProperty Name="cloudClipboard" Type="graph.cloudClipboardRoot" ContainsTarget="true"/>
@@ -22850,11 +22851,13 @@
2285022851
<NavigationProperty Name="trending" Type="Collection(graph.trending)" ContainsTarget="true"/>
2285122852
<NavigationProperty Name="used" Type="Collection(graph.usedInsight)" ContainsTarget="true"/>
2285222853
</EntityType>
22854+
<EntityType Name="itemInsights" BaseType="graph.officeGraphInsights"/>
2285322855
<EntityType Name="userSettings" BaseType="graph.entity">
2285422856
<Property Name="contributionToContentDiscoveryAsOrganizationDisabled" Type="Edm.Boolean" Nullable="false"/>
2285522857
<Property Name="contributionToContentDiscoveryDisabled" Type="Edm.Boolean" Nullable="false"/>
2285622858
<NavigationProperty Name="windows" Type="Collection(graph.windowsSetting)" ContainsTarget="true"/>
2285722859
<NavigationProperty Name="shiftPreferences" Type="graph.shiftPreferences" ContainsTarget="true"/>
22860+
<NavigationProperty Name="storage" Type="graph.userStorage" ContainsTarget="true"/>
2285822861
</EntityType>
2285922862
<EntityType Name="onenote" BaseType="graph.entity">
2286022863
<NavigationProperty Name="notebooks" Type="Collection(graph.notebook)" ContainsTarget="true"/>
@@ -26388,6 +26391,7 @@
2638826391
<EntityType Name="peopleAdminSettings" BaseType="graph.entity">
2638926392
<NavigationProperty Name="profileCardProperties" Type="Collection(graph.profileCardProperty)" ContainsTarget="true"/>
2639026393
<NavigationProperty Name="pronouns" Type="graph.pronounsSettings" ContainsTarget="true"/>
26394+
<NavigationProperty Name="itemInsights" Type="graph.insightsSettings" ContainsTarget="true"/>
2639126395
</EntityType>
2639226396
<EntityType Name="browserSharedCookie" BaseType="graph.entity">
2639326397
<Property Name="comment" Type="Edm.String" Nullable="false"/>
@@ -27756,6 +27760,10 @@
2775627760
</EntityType>
2775727761
<EntityType Name="storage">
2775827762
<NavigationProperty Name="fileStorage" Type="graph.fileStorage" ContainsTarget="true"/>
27763+
<NavigationProperty Name="settings" Type="graph.storageSettings" ContainsTarget="true"/>
27764+
</EntityType>
27765+
<EntityType Name="storageSettings" BaseType="graph.entity">
27766+
<NavigationProperty Name="quota" Type="graph.unifiedStorageQuota" ContainsTarget="true"/>
2775927767
</EntityType>
2776027768
<ComplexType Name="accessAction" OpenType="true"/>
2776127769
<ComplexType Name="album">
@@ -32020,6 +32028,9 @@
3202032028
<EntityType Name="shiftPreferences" BaseType="graph.changeTrackedEntity">
3202132029
<Property Name="availability" Type="Collection(graph.shiftAvailability)"/>
3202232030
</EntityType>
32031+
<EntityType Name="userStorage" BaseType="graph.entity">
32032+
<NavigationProperty Name="quota" Type="graph.unifiedStorageQuota" ContainsTarget="true"/>
32033+
</EntityType>
3202332034
<ComplexType Name="CopyNotebookModel">
3202432035
<Property Name="createdBy" Type="Edm.String"/>
3202532036
<Property Name="createdByIdentity" Type="graph.identitySet"/>
@@ -32218,6 +32229,10 @@
3221832229
<EntityType Name="pronounsSettings" BaseType="graph.entity">
3221932230
<Property Name="isEnabledInOrganization" Type="Edm.Boolean" Nullable="false"/>
3222032231
</EntityType>
32232+
<EntityType Name="insightsSettings" BaseType="graph.entity">
32233+
<Property Name="disabledForGroup" Type="Edm.String"/>
32234+
<Property Name="isEnabledInOrganization" Type="Edm.Boolean"/>
32235+
</EntityType>
3222132236
<ComplexType Name="approvalSettings">
3222232237
<Property Name="approvalMode" Type="Edm.String"/>
3222332238
<Property Name="approvalStages" Type="Collection(graph.unifiedApprovalStage)"/>
@@ -34001,6 +34016,21 @@
3400134016
<NavigationProperty Name="extensions" Type="Collection(graph.extension)" ContainsTarget="true"/>
3400234017
<NavigationProperty Name="linkedResources" Type="Collection(graph.linkedResource)" ContainsTarget="true"/>
3400334018
</EntityType>
34019+
<EntityType Name="storageQuotaBreakdown" BaseType="graph.entity">
34020+
<Property Name="displayName" Type="Edm.String"/>
34021+
<Property Name="manageWebUrl" Type="Edm.String"/>
34022+
<Property Name="used" Type="Edm.Int64"/>
34023+
</EntityType>
34024+
<EntityType Name="serviceStorageQuotaBreakdown" BaseType="graph.storageQuotaBreakdown"/>
34025+
<EntityType Name="unifiedStorageQuota" BaseType="graph.entity">
34026+
<Property Name="deleted" Type="Edm.Int64"/>
34027+
<Property Name="manageWebUrl" Type="Edm.String"/>
34028+
<Property Name="remaining" Type="Edm.Int64"/>
34029+
<Property Name="state" Type="Edm.String"/>
34030+
<Property Name="total" Type="Edm.Int64"/>
34031+
<Property Name="used" Type="Edm.Int64"/>
34032+
<NavigationProperty Name="services" Type="Collection(graph.serviceStorageQuotaBreakdown)" ContainsTarget="true"/>
34033+
</EntityType>
3400434034
<EntityType Name="employeeExperience">
3400534035
<NavigationProperty Name="learningCourseActivities" Type="Collection(graph.learningCourseActivity)" ContainsTarget="true"/>
3400634036
<NavigationProperty Name="learningProviders" Type="Collection(graph.learningProvider)" ContainsTarget="true"/>
@@ -38192,6 +38222,12 @@
3819238222
<Parameter Name="TimeZoneStandard" Type="graph.timeZoneStandard" Nullable="false"/>
3819338223
<ReturnType Type="Collection(graph.timeZoneInformation)" Nullable="false"/>
3819438224
</Function>
38225+
<Action Name="permanentDelete" IsBound="true">
38226+
<Parameter Name="bindingParameter" Type="graph.fileStorageContainer"/>
38227+
</Action>
38228+
<Action Name="permanentDelete" IsBound="true">
38229+
<Parameter Name="bindingParameter" Type="graph.driveItem"/>
38230+
</Action>
3819538231
<Action Name="remove" IsBound="true">
3819638232
<Parameter Name="bindingParameter" Type="Collection(graph.site)"/>
3819738233
<Parameter Name="value" Type="Collection(graph.site)"/>
@@ -38283,9 +38319,6 @@
3828338319
<Parameter Name="clientContext" Type="Edm.String" Unicode="false"/>
3828438320
<ReturnType Type="graph.inviteParticipantsOperation"/>
3828538321
</Action>
38286-
<Action Name="permanentDelete" IsBound="true">
38287-
<Parameter Name="bindingParameter" Type="graph.driveItem"/>
38288-
</Action>
3828938322
<Action Name="preview" IsBound="true">
3829038323
<Parameter Name="bindingParameter" Type="graph.driveItem"/>
3829138324
<Parameter Name="page" Type="Edm.String" Unicode="false"/>

office365/onedrive/driveitems/driveItem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ def _process_response(resp):
502502

503503
payload = {"name": name, "parentReference": parent_reference}
504504
qry = ServiceOperationQuery(self, "copy", None, payload, None, return_type)
505-
self.context.add_query(qry).before_query_execute(_create_request).after_execute(
506-
_process_response
507-
)
505+
self.context.add_query(qry).before_query_execute(
506+
_create_request
507+
).after_execute(_process_response)
508508

509509
if isinstance(parent, DriveItem):
510510

0 commit comments

Comments
 (0)