-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#693 support for folder coloring methods
- Loading branch information
Showing
15 changed files
with
170 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Demonstrates how to create a folder with a color | ||
""" | ||
from office365.sharepoint.client_context import ClientContext | ||
from office365.sharepoint.folders.coloring_information import FolderColors | ||
from tests import test_team_site_url, test_user_credentials | ||
|
||
ctx = ClientContext(test_team_site_url).with_credentials(test_user_credentials) | ||
|
||
|
||
root_folder = ctx.web.default_document_library().root_folder | ||
folder = root_folder.folders.add( | ||
"Report123", color_hex=FolderColors.DarkGreen | ||
).execute_query() | ||
print("Folder : {0} has been created".format(folder.serverRelativeUrl)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import sys | ||
|
||
from office365.sharepoint.client_context import ClientContext | ||
from tests import test_client_credentials, test_site_url | ||
|
||
ctx = ClientContext(test_site_url).with_credentials(test_client_credentials) | ||
|
||
target_list = ctx.web.lists.get_by_title("Documents") | ||
items = target_list.items.get().top(1).execute_query() | ||
if len(items) == 0: | ||
sys.exit("No items were found") | ||
|
||
item = items[0] | ||
item.system_update().execute_query() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
Gets site changes | ||
""" | ||
from office365.sharepoint.changes.query import ChangeQuery | ||
from office365.sharepoint.client_context import ClientContext | ||
from tests import test_client_credentials, test_team_site_url | ||
|
||
client = ClientContext(test_team_site_url).with_credentials(test_client_credentials) | ||
query = ChangeQuery( | ||
item=True, | ||
add=False, | ||
update=False, | ||
system_update=False, | ||
delete_object=True, | ||
role_assignment_add=False, | ||
role_assignment_delete=False, | ||
) | ||
|
||
list_title = "Documents" | ||
result = client.web.lists.get_by_title(list_title).get_changes(query).execute_query() | ||
for change in result: | ||
print(change.properties) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
Demonstrates creating an anonymous sharing link for a file | ||
""" | ||
from office365.sharepoint.client_context import ClientContext | ||
from office365.sharepoint.sharing.links.kind import SharingLinkKind | ||
from tests import test_team_site_url, test_user_credentials | ||
|
||
ctx = ClientContext(test_team_site_url).with_credentials(test_user_credentials) | ||
|
||
remote_file = ctx.web.get_file_by_server_relative_url( | ||
"Shared Documents/Financial Sample.xlsx" | ||
) | ||
result = remote_file.share_link(SharingLinkKind.AnonymousView).execute_query() | ||
print(result.value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from office365.sharepoint.tenant.insights.report_metadata import ( | ||
SPTenantIBInsightsReportMetadata, | ||
) | ||
|
||
|
||
class SPTenantIBInsightsReport(SPTenantIBInsightsReportMetadata): | ||
""" """ | ||
|
||
@property | ||
def entity_type_name(self): | ||
return "Microsoft.SharePoint.Insights.SPTenantIBInsightsReport" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from office365.sharepoint.entity import Entity | ||
|
||
|
||
class SPTenantIBInsightsReportManager(Entity): | ||
""" """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from office365.sharepoint.entity import Entity | ||
|
||
|
||
class SPTenantIBInsightsReportMetadata(Entity): | ||
""" """ |