forked from vgrem/Office365-REST-Python-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SearchEntity.query and DriveItem.resumable_upload methods enhancements
- Loading branch information
Showing
13 changed files
with
196 additions
and
209 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +0,0 @@ | ||
from office365.onedrive.drives.drive import Drive | ||
|
||
|
||
def upload_sample_files(drive): | ||
# type: (Drive) -> None | ||
local_paths = ["../../data/Financial Sample.xlsx"] | ||
for local_path in local_paths: | ||
file = drive.root.resumable_upload(local_path).get().execute_query() | ||
print("File {0} has been uploaded", file.web_url) | ||
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 |
---|---|---|
@@ -1,28 +1,31 @@ | ||
""" | ||
Demonstrates how to upload large attachment to Outlook message | ||
Demonstrates how send e message with large attachment to Outlook message | ||
https://learn.microsoft.com/en-us/graph/api/attachment-createuploadsession?view=graph-rest-1.0 | ||
""" | ||
|
||
from office365.graph_client import GraphClient | ||
from tests import test_user_principal_name_alt | ||
from tests.graph_case import acquire_token_by_username_password | ||
|
||
client = GraphClient(acquire_token_by_username_password) | ||
|
||
local_path = "../../../tests/data/big_buck_bunny.mp4" | ||
|
||
|
||
def print_progress(range_pos): | ||
print("{0} bytes uploaded".format(range_pos)) | ||
|
||
|
||
client = GraphClient(acquire_token_by_username_password) | ||
local_path = "../../../tests/data/big_buck_bunny.mp4" | ||
message = ( | ||
client.me.messages.add( | ||
subject="Meet for lunch?", | ||
body="The new cafeteria is open.", | ||
to_recipients=["[email protected]"], | ||
( | ||
client.me.messages.add( | ||
subject="Meet for lunch?", | ||
body="The new cafeteria is open.", | ||
to_recipients=[ | ||
"[email protected]", | ||
test_user_principal_name_alt, | ||
], | ||
).upload_attachment(local_path, print_progress) | ||
) | ||
.upload_attachment(local_path, print_progress) | ||
.send() | ||
.execute_query() | ||
) | ||
message.send().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
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
Oops, something went wrong.