Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrem committed Oct 11, 2024
1 parent 3354fd7 commit 0efc1e0
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 21 deletions.
4 changes: 1 addition & 3 deletions examples/sharepoint/listitems/get_deleted.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from tests import test_client_credentials, test_team_site_url

ctx = ClientContext(test_team_site_url).with_credentials(test_client_credentials)
result = (
ctx.web.recycle_bin.get().execute_query()
)
result = ctx.web.recycle_bin.get().execute_query()
for item in result:
print(item.properties)
39 changes: 35 additions & 4 deletions generator/metadata/SharePoint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@
<Property Name="ContentVersion" Type="Edm.Int32" Nullable="false"/>
<Property Name="Entropy" Type="Edm.String"/>
<Property Name="ETag" Type="Edm.String"/>
<Property Name="FieldValues" Type="Collection(SP.KeyValue)"/>
<Property Name="IsLowPriorityRequest" Type="Edm.Boolean" Nullable="false"/>
<Property Name="IsMediaServiceRequest" Type="Edm.Boolean" Nullable="false"/>
<Property Name="MachineLearningSampleMeta" Type="SP.MachineLearningSampleMeta"/>
Expand Down Expand Up @@ -10559,6 +10560,9 @@
<Parameter Name="partitionColumnName" Type="Edm.String"/>
<Parameter Name="columnsToChecksum" Type="Collection(Edm.String)"/>
</FunctionImport>
<FunctionImport Name="GetCPSChangeToken" ReturnType="Edm.Int64" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
</FunctionImport>
<FunctionImport Name="GetDatabaseProperties" ReturnType="Edm.String" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
</FunctionImport>
Expand Down Expand Up @@ -10595,17 +10599,30 @@
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
<Parameter Name="lockRequestor" Type="Edm.String"/>
</FunctionImport>
<FunctionImport Name="LockSite" ReturnType="Edm.Int32" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
</FunctionImport>
<FunctionImport Name="PauseCrawling" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
</FunctionImport>
<FunctionImport Name="ProcessStorageMetricsChanges" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
</FunctionImport>
<FunctionImport Name="ReleaseSystemSiteLock" ReturnType="Edm.Int32" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
<Parameter Name="lockRequestor" Type="Edm.String"/>
</FunctionImport>
<FunctionImport Name="ResumeCrawling" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
</FunctionImport>
<FunctionImport Name="SourceCleanupAfterMove" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
<Parameter Name="isDeleted" Type="Edm.Boolean" Nullable="false"/>
</FunctionImport>
<FunctionImport Name="UnlockSiteOnFailure" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
<Parameter Name="originalLockFlags" Type="Edm.Int32" Nullable="false"/>
</FunctionImport>
<FunctionImport Name="Microsoft_SharePoint_Administration_SiteMove_Service_SiteRelocationJobManagementService" ReturnType="Microsoft.SharePoint.Administration.SiteMove.Service.SiteRelocationJobManagementService" IsComposable="true" EntitySet="SiteRelocationJobManagementServices"/>
<FunctionImport Name="EnqueueSiteRelocationJob" IsBindable="true">
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.SiteMove.Service.SiteRelocationJobManagementService"/>
Expand Down Expand Up @@ -16769,6 +16786,10 @@
<Parameter Name="this" Type="Microsoft.Online.SharePoint.TenantAdministration.SPDataGovernanceInsightRestApiClient"/>
<Parameter Name="reportId" Type="Edm.Guid" Nullable="false"/>
</FunctionImport>
<FunctionImport Name="GetSPODataAccessGovernanceInsightV2" ReturnType="Collection(Microsoft.Online.SharePoint.TenantAdministration.SPDataGovernanceInsightResponse)" IsBindable="true">
<Parameter Name="this" Type="Microsoft.Online.SharePoint.TenantAdministration.SPDataGovernanceInsightRestApiClient"/>
<Parameter Name="reportEntity" Type="Edm.Int32" Nullable="false"/>
</FunctionImport>
<FunctionImport Name="RemoveDataAccessGovernanceReport" IsBindable="true">
<Parameter Name="this" Type="Microsoft.Online.SharePoint.TenantAdministration.SPDataGovernanceInsightRestApiClient"/>
<Parameter Name="reportId" Type="Edm.Guid" Nullable="false"/>
Expand Down Expand Up @@ -16977,9 +16998,6 @@
<Parameter Name="defaultOriginAdded" Type="Edm.Boolean" Nullable="false"/>
<Parameter Name="configParam" Type="Microsoft.SharePoint.BrandCenter.OrgAssetsLibraryConfigParam"/>
</FunctionImport>
<FunctionImport Name="AppHasAdminSitePermission" ReturnType="Edm.String" IsBindable="true">
<Parameter Name="this" Type="Microsoft.Online.SharePoint.TenantAdministration.Tenant"/>
</FunctionImport>
<FunctionImport Name="ArchiveSiteById" ReturnType="Microsoft.Online.SharePoint.TenantAdministration.SpoOperation" IsBindable="true" EntitySet="SpoOperations">
<Parameter Name="this" Type="Microsoft.Online.SharePoint.TenantAdministration.Tenant"/>
<Parameter Name="siteId" Type="Edm.Guid" Nullable="false"/>
Expand Down Expand Up @@ -22262,6 +22280,9 @@
<Annotations Target="SP.MediaServiceUpdateParameters/Entropy">
<ValueAnnotation Term="Com.Microsoft.VisualStudio.CodeGen.IsBeta" Bool="true"/>
</Annotations>
<Annotations Target="SP.MediaServiceUpdateParameters/FieldValues">
<ValueAnnotation Term="Com.Microsoft.VisualStudio.CodeGen.IsBeta" Bool="true"/>
</Annotations>
<Annotations Target="SP.MediaServiceUpdateParameters/MachineLearningSampleMeta">
<ValueAnnotation Term="Com.Microsoft.VisualStudio.CodeGen.IsBeta" Bool="true"/>
</Annotations>
Expand Down Expand Up @@ -24324,6 +24345,9 @@
<Annotations Target="SP.Publishing.SitePageMetadata/ContentTypeId">
<ValueAnnotation Term="Com.Microsoft.VisualStudio.CodeGen.IsBeta" Bool="true"/>
</Annotations>
<Annotations Target="SP.Publishing.SitePageMetadata/Created">
<ValueAnnotation Term="Com.Microsoft.VisualStudio.CodeGen.IsBeta" Bool="true"/>
</Annotations>
<Annotations Target="SP.Publishing.UserInfo">
<ValueAnnotation Term="Com.Microsoft.VisualStudio.CodeGen.IsBeta" Bool="true"/>
</Annotations>
Expand Down Expand Up @@ -31612,7 +31636,6 @@
<Property Name="FinishVariance" Type="Edm.String"/>
<Property Name="FinishVarianceMilliseconds" Type="Edm.Int32" Nullable="false"/>
<Property Name="FinishVarianceTimeSpan" Type="Edm.Time" Nullable="false"/>
<Property Name="FixedCostAccrual" Type="Edm.Int32" Nullable="false"/>
<Property Name="FreeSlack" Type="Edm.String"/>
<Property Name="FreeSlackMilliseconds" Type="Edm.Int32" Nullable="false"/>
<Property Name="FreeSlackTimeSpan" Type="Edm.Time" Nullable="false"/>
Expand Down Expand Up @@ -31815,6 +31838,7 @@
<Property Name="Finish" Type="Edm.DateTime" Nullable="false"/>
<Property Name="FinishText" Type="Edm.String"/>
<Property Name="FixedCost" Type="Edm.Double" Nullable="false"/>
<Property Name="FixedCostAccrual" Type="Edm.Int32" Nullable="false"/>
<Property Name="IsActive" Type="Edm.Boolean" Nullable="false"/>
<Property Name="IsEffortDriven" Type="Edm.Boolean" Nullable="false"/>
<Property Name="IsLockedByManager" Type="Edm.Boolean" Nullable="false"/>
Expand Down Expand Up @@ -31980,6 +32004,7 @@
<Property Name="Finish" Type="Edm.DateTime" Nullable="false"/>
<Property Name="FinishText" Type="Edm.String"/>
<Property Name="FixedCost" Type="Edm.Double" Nullable="false"/>
<Property Name="FixedCostAccrual" Type="Edm.Int32" Nullable="false"/>
<Property Name="IsActive" Type="Edm.Boolean" Nullable="false"/>
<Property Name="IsEffortDriven" Type="Edm.Boolean" Nullable="false"/>
<Property Name="IsLockedByManager" Type="Edm.Boolean" Nullable="false"/>
Expand Down Expand Up @@ -32039,6 +32064,7 @@
<Property Name="DurationTimeSpan" Type="Edm.Time" Nullable="false"/>
<Property Name="Finish" Type="Edm.DateTime" Nullable="false"/>
<Property Name="FinishText" Type="Edm.String"/>
<Property Name="FixedCostAccrual" Type="Edm.Int32" Nullable="false"/>
<Property Name="Name" Type="Edm.String"/>
<Property Name="PercentComplete" Type="Edm.Int32" Nullable="false"/>
<Property Name="Priority" Type="Edm.Int32" Nullable="false"/>
Expand Down Expand Up @@ -33491,6 +33517,7 @@
<Property Name="CommentCount" Type="Edm.Int32" Nullable="false"/>
<Property Name="CommentsDisabled" Type="Edm.Boolean" Nullable="false"/>
<Property Name="ContentTypeId" Type="Edm.String"/>
<Property Name="Created" Type="Edm.DateTime"/>
<Property Name="Description" Type="Edm.String"/>
<Property Name="DoesUserHaveEditPermission" Type="Edm.Boolean" Nullable="false"/>
<Property Name="FileName" Type="Edm.String"/>
Expand Down Expand Up @@ -38657,6 +38684,7 @@
<Property Name="GroupId" Type="Edm.Guid" Nullable="false"/>
<Property Name="GroupOwnerLoginName" Type="Edm.String"/>
<Property Name="HasHolds" Type="Edm.Boolean" Nullable="false"/>
<Property Name="HidePeoplePreviewingFiles" Type="Edm.Boolean" Nullable="false"/>
<Property Name="HubSiteId" Type="Edm.Guid" Nullable="false"/>
<Property Name="IBMode" Type="Edm.String"/>
<Property Name="IBSegments" Type="Collection(Edm.Guid)" Nullable="false"/>
Expand Down Expand Up @@ -38862,6 +38890,7 @@
<Property Name="AllowSelectSGsInODBListInTenant" Type="Collection(Edm.String)"/>
<Property Name="AllowSensitivityLabelOnRecords" Type="Edm.Boolean" Nullable="false"/>
<Property Name="AllowSharingOutsideRestrictedAccessControlGroups" Type="Edm.Boolean" Nullable="false"/>
<Property Name="AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled" Type="Edm.Boolean" Nullable="false"/>
<Property Name="AmplifyAdminSettings" Type="Edm.String"/>
<Property Name="AnyoneLinkTrackUsers" Type="Edm.Boolean" Nullable="false"/>
<Property Name="AppBypassInformationBarriers" Type="Edm.Boolean" Nullable="false"/>
Expand Down Expand Up @@ -39131,6 +39160,7 @@
<Property Name="TranslationSiteList" Type="Collection(Edm.Guid)" Nullable="false"/>
<Property Name="TranslationSiteListFileName" Type="Edm.String"/>
<Property Name="UniversalAnnotationDisabled" Type="Edm.Boolean" Nullable="false"/>
<Property Name="UnlicensedOdbSyntexBillingEnabled" Type="Edm.Boolean" Nullable="false"/>
<Property Name="UnlicensedOneDriveForBusinessTenantMetricsData" Type="Microsoft.SharePoint.Administration.OdbLicenseEnforcement.UnlicensedOdbTenantMetrics"/>
<Property Name="UseFindPeopleInPeoplePicker" Type="Edm.Boolean" Nullable="false"/>
<Property Name="UsePersistentCookiesForExplorerView" Type="Edm.Boolean" Nullable="false"/>
Expand Down Expand Up @@ -40994,6 +41024,7 @@
<Property Name="AllowSelectSecurityGroupsInSPSitesList" Type="Collection(Edm.String)"/>
<Property Name="AllowSelectSGsInODBList" Type="Collection(Edm.String)"/>
<Property Name="AllowSharingOutsideRestrictedAccessControlGroups" Type="Edm.Boolean" Nullable="false"/>
<Property Name="AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled" Type="Edm.Boolean" Nullable="false"/>
<Property Name="AnyoneLinkTrackUsers" Type="Edm.Boolean" Nullable="false"/>
<Property Name="AppBypassInformationBarriers" Type="Edm.Boolean" Nullable="false"/>
<Property Name="ApplyAppEnforcedRestrictionsToAdHocRecipients" Type="Edm.Boolean" Nullable="false"/>
Expand Down
11 changes: 4 additions & 7 deletions office365/sharepoint/listitems/listitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,7 @@ def _after_system_update(result):
# type: (ClientResult[ClientValueCollection[ListItemFormUpdateValue]]) -> None
has_any_error = any([item.HasException for item in result.value])
if has_any_error:
raise ValueError(
"Update ListItem failed"
)
raise ValueError("Update ListItem failed")

def _system_update():
from office365.sharepoint.fields.user_value import FieldUserValue
Expand All @@ -335,24 +333,23 @@ def _system_update():
user = self.context.web.site_users.get_by_id(self.get_property(n))
form_values[n[:-2]] = FieldUserValue.from_user(user)
else:
form_values[n] = self.get_property(n)
form_values[n] = self.get_property(n)

self.validate_update_list_item(
form_values=form_values,
dates_in_utc=True,
new_document_update=True,
).after_execute(_after_system_update)


def _list_loaded():
if self.parent_list.base_template == 101:
self.ensure_properties(sys_metadata, _system_update)
self.ensure_properties(sys_metadata, _system_update)
else:
next_qry = ServiceOperationQuery(self, "SystemUpdate")
self.context.add_query(next_qry)

self.parent_list.ensure_properties(["BaseTemplate"], _list_loaded)
#self.ensure_properties(sys_metadata, _system_update)
# self.ensure_properties(sys_metadata, _system_update)
return self

def update_overwrite_version(self):
Expand Down
1 change: 0 additions & 1 deletion office365/sharepoint/tenant/administration/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ def get_ransomware_events_overview(self):
self.context.add_query(qry)
return return_type


def get_sp_list_item_count(self, list_name):
# type: (str) -> ClientResult[int]
""" """
Expand Down
10 changes: 5 additions & 5 deletions office365/subscriptions/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def add(
The possible values are: v1_0, v1_1, v1_2, v1_3.
:param bool include_resource_data: Indicates whether the resource data for the resource that generated the
change notification should be included in the payload of the notification.
:param str encryption_certificate: Specifies the public key certificate which contains only the public key
that Microsoft Graph uses to encrypt the resource data it returns to your app. For security, Microsoft
Graph encrypts the resource data returned in a rich notification. You must provide a public encryption
key as part of creating the subscription.
:param str encryption_certificate: Specifies the public key certificate which contains only the public key
that Microsoft Graph uses to encrypt the resource data it returns to your app. For security, Microsoft
Graph encrypts the resource data returned in a rich notification. You must provide a public encryption
key as part of creating the subscription.
:param str encryption_certificate_id: Specifies the identifier of the certificate used to encrypt the content
of the change notification. Use this ID to match in each change notification, which certificate to use
of the change notification. Use this ID to match in each change notification, which certificate to use
for decryption.
:return: Subscription
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/sharepoint/test_tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,6 @@ def test_30_get_cdn_urls(self):
self.assertIsNotNone(result.value)

# You need a SharePoint Advanced Management license to perform this action
#def test_31_get_ransomware_events_overview(self):
# def test_31_get_ransomware_events_overview(self):
# result = self.tenant.get_ransomware_events_overview().execute_query()
# self.assertIsNotNone(result.value)

0 comments on commit 0efc1e0

Please sign in to comment.