-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Fix example code for shared folder access. Fixes #1325
- Loading branch information
Erik Cederstrand
committed
Jul 29, 2024
1 parent
73a3b94
commit e8a811d
Showing
1 changed file
with
8 additions
and
5 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 |
---|---|---|
|
@@ -199,18 +199,21 @@ johns_account = Account( | |
``` | ||
|
||
If you want to impersonate an account and access a shared folder that this | ||
account has access to, you need to specify the email adress of the shared | ||
account has access to, you need to specify the email address of the shared | ||
folder to access the folder: | ||
|
||
```python | ||
from exchangelib.folders import Calendar, SingleFolderQuerySet | ||
from exchangelib.folders import Calendar, Folder, SingleFolderQuerySet | ||
from exchangelib.properties import DistinguishedFolderId, Mailbox | ||
|
||
shared_calendar = SingleFolderQuerySet( | ||
account=johns_account, | ||
folder=DistinguishedFolderId( | ||
id=Calendar.DISTINGUISHED_FOLDER_ID, | ||
mailbox=Mailbox(email_address="[email protected]"), | ||
folder=Folder( | ||
root=johns_account.root, | ||
_distinguished_id=DistinguishedFolderId( | ||
id=Calendar.DISTINGUISHED_FOLDER_ID, | ||
mailbox=Mailbox(email_address="[email protected]"), | ||
), | ||
), | ||
).resolve() | ||
``` | ||
|