Codebase list python-exchangelib / af10ff5
New upstream version 4.7.6 Ileana Dumitrescu 1 year, 8 months ago
76 changed file(s) with 4213 addition(s) and 1843 deletion(s). Raw diff Collapse all Expand all
4949 # Only repo owners have access to the secret. PRs will run only the unit tests
5050 if: env.AES_256_CBC_PASS != ''
5151 run: |
52 openssl aes-256-cbc -d -in settings.yml.ghenc -out settings.yml -pass env:AES_256_CBC_PASS
52 openssl aes-256-cbc -d -md sha256 -in settings.yml.ghenc -out settings.yml -pass env:AES_256_CBC_PASS
5353
5454 - name: Upgrade pip
5555 run: |
7676 env:
7777 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7878 run: |
79 black --check exchangelib tests
80 isort --check exchangelib tests
79 black --check --diff exchangelib tests scripts setup.py
80 isort --check --diff exchangelib tests scripts setup.py
81 flake8 exchangelib tests scripts setup.py
8182 unittest-parallel -j 4 --class-fixtures --coverage --coverage-source exchangelib
8283 coveralls --service=github
8384
101102 # Only repo owners have access to the secret. PRs will run only the unit tests
102103 if: env.AES_256_CBC_PASS != ''
103104 run: |
104 openssl aes-256-cbc -d -in settings.yml.ghenc -out settings.yml -pass env:AES_256_CBC_PASS
105 openssl aes-256-cbc -d -md sha256 -in settings.yml.ghenc -out settings.yml -pass env:AES_256_CBC_PASS
105106
106107 - name: Upgrade pip
107108 run: |
88 build
99 dist
1010 __pycache__
11 venv
1112
1213 settings.yml
1314 scratch*.py
0 # See https://pre-commit.com for more information
1 # See https://pre-commit.com/hooks.html for more hooks
2 repos:
3 - repo: https://github.com/pre-commit/pre-commit-hooks
4 rev: v3.2.0
5 hooks:
6 - id: trailing-whitespace
7 - id: end-of-file-fixer
8 - id: check-yaml
9 - id: check-added-large-files
10 - repo: https://github.com/compilerla/conventional-pre-commit
11 rev: v1.2.0
12 hooks:
13 - id: conventional-pre-commit
14 stages: [ commit-msg ]
15 args: [ ] # optional: list of Conventional Commits types to allow
16 - repo: local
17 hooks:
18 - id: black
19 name: black
20 stages: [ commit ]
21 entry: black --check --diff
22 language: system
23 types: [ python ]
24 - id: isort
25 name: isort
26 stages: [ commit ]
27 entry: isort --check --diff
28 types: [ python ]
29 language: system
30 always_run: true
31 - id: flake8
32 name: flake8
33 stages: [ commit ]
34 entry: flake8
35 types: [ python ]
36 language: system
37 always_run: true
22
33 HEAD
44 ----
5
6
7 4.7.6
8 -----
9 - Fixed token refresh bug with OAuth2 authentication, again
10
11
12 4.7.5
13 -----
14 - Fixed `Protocol.get_free_busy_info()` when called with +100 accounts.
15 - Allowed configuring DNS timeout for a single nameserver
16 (`Autodiscovery.DNS_RESOLVER_ATTRS["timeout""]`) and the total query lifetime
17 (`Autodiscovery.DNS_RESOLVER_LIFETIME`) separately.
18 - Fixed token refresh bug with OAuth2 authentication
19
20
21 4.7.4
22 -----
23 - Bugfix release
24
25
26 4.7.3
27 -----
28 - Bugfix release
529
630
731 4.7.2
835859 ---
836860
837861 - Initial import
838
5353
5454 log = logging.getLogger(__name__)
5555
56 DNS_LOOKUP_ERRORS = (
57 dns.name.EmptyLabel,
58 dns.resolver.NXDOMAIN,
59 dns.resolver.NoAnswer,
60 dns.resolver.NoNameservers,
61 )
62
5663
5764 def discover(email, credentials=None, auth_type=None, retry_policy=None):
5865 ad_response, protocol = Autodiscovery(email=email, credentials=credentials).discover()
108115 MAX_REDIRECTS = 10 # Maximum number of URL redirects before we give up
109116 DNS_RESOLVER_KWARGS = {}
110117 DNS_RESOLVER_ATTRS = {
111 "timeout": AutodiscoverProtocol.TIMEOUT,
118 "timeout": AutodiscoverProtocol.TIMEOUT / 2.5, # Timeout for query to a single nameserver
112119 }
120 DNS_RESOLVER_LIFETIME = AutodiscoverProtocol.TIMEOUT # Total timeout for a query in case of multiple nameservers
113121
114122 def __init__(self, email, credentials=None):
115123 """
384392 def _is_valid_hostname(self, hostname):
385393 log.debug("Checking if %s can be looked up in DNS", hostname)
386394 try:
387 self.resolver.resolve(hostname)
388 except (dns.resolver.NoNameservers, dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.name.EmptyLabel):
395 self.resolver.resolve(f"{hostname}.", "A", lifetime=self.DNS_RESOLVER_LIFETIME)
396 except DNS_LOOKUP_ERRORS as e:
397 log.debug("DNS A lookup failure: %s", e)
389398 return False
390399 return True
391400
405414 log.debug("Attempting to get SRV records for %s", hostname)
406415 records = []
407416 try:
408 answers = self.resolver.resolve(f"{hostname}.", "SRV")
409 except (dns.resolver.NoNameservers, dns.resolver.NoAnswer, dns.resolver.NXDOMAIN) as e:
410 log.debug("DNS lookup failure: %s", e)
417 answers = self.resolver.resolve(f"{hostname}.", "SRV", lifetime=self.DNS_RESOLVER_LIFETIME)
418 except DNS_LOOKUP_ERRORS as e:
419 log.debug("DNS SRV lookup failure: %s", e)
411420 return records
412421 for rdata in answers:
413422 try:
682691 MAX_REDIRECTS = 10 # Maximum number of URL redirects before we give up
683692 DNS_RESOLVER_KWARGS = {}
684693 DNS_RESOLVER_ATTRS = {
685 "timeout": AutodiscoverProtocol.TIMEOUT,
694 "timeout": AutodiscoverProtocol.TIMEOUT / 2.5, # Timeout for query to a single nameserver
686695 }
696 DNS_RESOLVER_LIFETIME = AutodiscoverProtocol.TIMEOUT # Total timeout for a query in case of multiple nameservers
687697
688698 def __init__(self, email, credentials=None):
689699 """
958968 def _is_valid_hostname(self, hostname):
959969 log.debug("Checking if %s can be looked up in DNS", hostname)
960970 try:
961 self.resolver.resolve(hostname)
962 except (dns.resolver.NoNameservers, dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.name.EmptyLabel):
971 self.resolver.resolve(f"{hostname}.", "A", lifetime=self.DNS_RESOLVER_LIFETIME)
972 except DNS_LOOKUP_ERRORS as e:
973 log.debug("DNS A lookup failure: %s", e)
963974 return False
964975 return True
965976
979990 log.debug("Attempting to get SRV records for %s", hostname)
980991 records = []
981992 try:
982 answers = self.resolver.resolve(f"{hostname}.", "SRV")
983 except (dns.resolver.NoNameservers, dns.resolver.NoAnswer, dns.resolver.NXDOMAIN) as e:
984 log.debug("DNS lookup failure: %s", e)
993 answers = self.resolver.resolve(f"{hostname}.", "SRV", lifetime=self.DNS_RESOLVER_LIFETIME)
994 except DNS_LOOKUP_ERRORS as e:
995 log.debug("DNS SRV lookup failure: %s", e)
985996 return records
986997 for rdata in answers:
987998 try:
11531164 <div class="desc"></div>
11541165 </dd>
11551166 <dt id="exchangelib.autodiscover.discovery.Autodiscovery.DNS_RESOLVER_KWARGS"><code class="name">var <span class="ident">DNS_RESOLVER_KWARGS</span></code></dt>
1167 <dd>
1168 <div class="desc"></div>
1169 </dd>
1170 <dt id="exchangelib.autodiscover.discovery.Autodiscovery.DNS_RESOLVER_LIFETIME"><code class="name">var <span class="ident">DNS_RESOLVER_LIFETIME</span></code></dt>
11561171 <dd>
11571172 <div class="desc"></div>
11581173 </dd>
13131328 <ul class="">
13141329 <li><code><a title="exchangelib.autodiscover.discovery.Autodiscovery.DNS_RESOLVER_ATTRS" href="#exchangelib.autodiscover.discovery.Autodiscovery.DNS_RESOLVER_ATTRS">DNS_RESOLVER_ATTRS</a></code></li>
13151330 <li><code><a title="exchangelib.autodiscover.discovery.Autodiscovery.DNS_RESOLVER_KWARGS" href="#exchangelib.autodiscover.discovery.Autodiscovery.DNS_RESOLVER_KWARGS">DNS_RESOLVER_KWARGS</a></code></li>
1331 <li><code><a title="exchangelib.autodiscover.discovery.Autodiscovery.DNS_RESOLVER_LIFETIME" href="#exchangelib.autodiscover.discovery.Autodiscovery.DNS_RESOLVER_LIFETIME">DNS_RESOLVER_LIFETIME</a></code></li>
13161332 <li><code><a title="exchangelib.autodiscover.discovery.Autodiscovery.INITIAL_RETRY_POLICY" href="#exchangelib.autodiscover.discovery.Autodiscovery.INITIAL_RETRY_POLICY">INITIAL_RETRY_POLICY</a></code></li>
13171333 <li><code><a title="exchangelib.autodiscover.discovery.Autodiscovery.MAX_REDIRECTS" href="#exchangelib.autodiscover.discovery.Autodiscovery.MAX_REDIRECTS">MAX_REDIRECTS</a></code></li>
13181334 <li><code><a title="exchangelib.autodiscover.discovery.Autodiscovery.RETRY_WAIT" href="#exchangelib.autodiscover.discovery.Autodiscovery.RETRY_WAIT">RETRY_WAIT</a></code></li>
388388 MAX_REDIRECTS = 10 # Maximum number of URL redirects before we give up
389389 DNS_RESOLVER_KWARGS = {}
390390 DNS_RESOLVER_ATTRS = {
391 &#34;timeout&#34;: AutodiscoverProtocol.TIMEOUT,
391 &#34;timeout&#34;: AutodiscoverProtocol.TIMEOUT / 2.5, # Timeout for query to a single nameserver
392392 }
393 DNS_RESOLVER_LIFETIME = AutodiscoverProtocol.TIMEOUT # Total timeout for a query in case of multiple nameservers
393394
394395 def __init__(self, email, credentials=None):
395396 &#34;&#34;&#34;
664665 def _is_valid_hostname(self, hostname):
665666 log.debug(&#34;Checking if %s can be looked up in DNS&#34;, hostname)
666667 try:
667 self.resolver.resolve(hostname)
668 except (dns.resolver.NoNameservers, dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.name.EmptyLabel):
668 self.resolver.resolve(f&#34;{hostname}.&#34;, &#34;A&#34;, lifetime=self.DNS_RESOLVER_LIFETIME)
669 except DNS_LOOKUP_ERRORS as e:
670 log.debug(&#34;DNS A lookup failure: %s&#34;, e)
669671 return False
670672 return True
671673
685687 log.debug(&#34;Attempting to get SRV records for %s&#34;, hostname)
686688 records = []
687689 try:
688 answers = self.resolver.resolve(f&#34;{hostname}.&#34;, &#34;SRV&#34;)
689 except (dns.resolver.NoNameservers, dns.resolver.NoAnswer, dns.resolver.NXDOMAIN) as e:
690 log.debug(&#34;DNS lookup failure: %s&#34;, e)
690 answers = self.resolver.resolve(f&#34;{hostname}.&#34;, &#34;SRV&#34;, lifetime=self.DNS_RESOLVER_LIFETIME)
691 except DNS_LOOKUP_ERRORS as e:
692 log.debug(&#34;DNS SRV lookup failure: %s&#34;, e)
691693 return records
692694 for rdata in answers:
693695 try:
859861 <div class="desc"></div>
860862 </dd>
861863 <dt id="exchangelib.autodiscover.Autodiscovery.DNS_RESOLVER_KWARGS"><code class="name">var <span class="ident">DNS_RESOLVER_KWARGS</span></code></dt>
864 <dd>
865 <div class="desc"></div>
866 </dd>
867 <dt id="exchangelib.autodiscover.Autodiscovery.DNS_RESOLVER_LIFETIME"><code class="name">var <span class="ident">DNS_RESOLVER_LIFETIME</span></code></dt>
862868 <dd>
863869 <div class="desc"></div>
864870 </dd>
10191025 <ul class="">
10201026 <li><code><a title="exchangelib.autodiscover.Autodiscovery.DNS_RESOLVER_ATTRS" href="#exchangelib.autodiscover.Autodiscovery.DNS_RESOLVER_ATTRS">DNS_RESOLVER_ATTRS</a></code></li>
10211027 <li><code><a title="exchangelib.autodiscover.Autodiscovery.DNS_RESOLVER_KWARGS" href="#exchangelib.autodiscover.Autodiscovery.DNS_RESOLVER_KWARGS">DNS_RESOLVER_KWARGS</a></code></li>
1028 <li><code><a title="exchangelib.autodiscover.Autodiscovery.DNS_RESOLVER_LIFETIME" href="#exchangelib.autodiscover.Autodiscovery.DNS_RESOLVER_LIFETIME">DNS_RESOLVER_LIFETIME</a></code></li>
10221029 <li><code><a title="exchangelib.autodiscover.Autodiscovery.INITIAL_RETRY_POLICY" href="#exchangelib.autodiscover.Autodiscovery.INITIAL_RETRY_POLICY">INITIAL_RETRY_POLICY</a></code></li>
10231030 <li><code><a title="exchangelib.autodiscover.Autodiscovery.MAX_REDIRECTS" href="#exchangelib.autodiscover.Autodiscovery.MAX_REDIRECTS">MAX_REDIRECTS</a></code></li>
10241031 <li><code><a title="exchangelib.autodiscover.Autodiscovery.RETRY_WAIT" href="#exchangelib.autodiscover.Autodiscovery.RETRY_WAIT">RETRY_WAIT</a></code></li>
8888 if auth_type is None:
8989 # Set a default auth type for the credentials where this makes sense
9090 auth_type = DEFAULT_AUTH_TYPE.get(type(credentials))
91 elif credentials is None and auth_type in CREDENTIALS_REQUIRED:
91 if auth_type is not None and auth_type not in AUTH_TYPE_MAP:
92 raise InvalidEnumValue(&#34;auth_type&#34;, auth_type, AUTH_TYPE_MAP)
93 if credentials is None and auth_type in CREDENTIALS_REQUIRED:
9294 raise ValueError(f&#34;Auth type {auth_type!r} was detected but no credentials were provided&#34;)
9395 if server and service_endpoint:
9496 raise AttributeError(&#34;Only one of &#39;server&#39; or &#39;service_endpoint&#39; must be provided&#34;)
95 if auth_type is not None and auth_type not in AUTH_TYPE_MAP:
96 raise InvalidEnumValue(&#34;auth_type&#34;, auth_type, AUTH_TYPE_MAP)
9797 if not retry_policy:
9898 retry_policy = FailFast()
9999 if not isinstance(version, (Version, type(None))):
211211 if auth_type is None:
212212 # Set a default auth type for the credentials where this makes sense
213213 auth_type = DEFAULT_AUTH_TYPE.get(type(credentials))
214 elif credentials is None and auth_type in CREDENTIALS_REQUIRED:
214 if auth_type is not None and auth_type not in AUTH_TYPE_MAP:
215 raise InvalidEnumValue(&#34;auth_type&#34;, auth_type, AUTH_TYPE_MAP)
216 if credentials is None and auth_type in CREDENTIALS_REQUIRED:
215217 raise ValueError(f&#34;Auth type {auth_type!r} was detected but no credentials were provided&#34;)
216218 if server and service_endpoint:
217219 raise AttributeError(&#34;Only one of &#39;server&#39; or &#39;service_endpoint&#39; must be provided&#34;)
218 if auth_type is not None and auth_type not in AUTH_TYPE_MAP:
219 raise InvalidEnumValue(&#34;auth_type&#34;, auth_type, AUTH_TYPE_MAP)
220220 if not retry_policy:
221221 retry_policy = FailFast()
222222 if not isinstance(version, (Version, type(None))):
140140 the associated auth code grant type for multi-tenant applications.
141141 &#34;&#34;&#34;
142142
143 def __init__(self, client_id, client_secret, tenant_id=None, identity=None):
143 def __init__(self, client_id, client_secret, tenant_id=None, identity=None, access_token=None):
144144 &#34;&#34;&#34;
145145
146146 :param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
147147 :param client_secret: Secret associated with the OAuth application
148148 :param tenant_id: Microsoft tenant ID of the account to access
149149 :param identity: An Identity object representing the account that these credentials are connected to.
150 :param access_token: Previously-obtained access token, as a dict or an oauthlib.oauth2.OAuth2Token
150151 &#34;&#34;&#34;
151152 super().__init__()
152153 self.client_id = client_id
153154 self.client_secret = client_secret
154155 self.tenant_id = tenant_id
155156 self.identity = identity
156 # When set, access_token is a dict (or an oauthlib.oauth2.OAuth2Token, which is also a dict)
157 self.access_token = None
157 self.access_token = access_token
158158
159159 def refresh(self, session):
160160 # Creating a new session gets a new access token, so there&#39;s no work here to refresh the credentials. This
194194 res.append(getattr(self, k))
195195 return hash(tuple(res))
196196
197 @property
198 def token_url(self):
199 return f&#34;https://login.microsoftonline.com/{self.tenant_id}/oauth2/v2.0/token&#34;
200
201 @property
202 def scope(self):
203 return [&#34;https://outlook.office365.com/.default&#34;]
204
197205 def __repr__(self):
198206 return self.__class__.__name__ + repr((self.client_id, &#34;********&#34;))
199207
206214 several ways:
207215 * Given an authorization code, client ID, and client secret, fetch a token ourselves and refresh it as needed if
208216 supplied with a refresh token.
209 * Given an existing access token, refresh token, client ID, and client secret, use the access token until it
210 expires and then refresh it as needed.
217 * Given an existing access token, client ID, and client secret, use the access token until it expires and then
218 refresh it as needed.
211219 * Given only an existing access token, use it until it expires. This can be used to let the calling application
212220 refresh tokens itself by subclassing and implementing refresh().
213221
216224 tenant.
217225 &#34;&#34;&#34;
218226
219 def __init__(self, authorization_code=None, access_token=None, **kwargs):
227 def __init__(self, authorization_code=None, access_token=None, client_id=None, client_secret=None, **kwargs):
220228 &#34;&#34;&#34;
221229
222230 :param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
228236 :param access_token: Previously-obtained access token. If a token exists and the application will handle
229237 refreshing by itself (or opts not to handle it), this parameter alone is sufficient.
230238 &#34;&#34;&#34;
231 super().__init__(**kwargs)
239 super().__init__(client_id=client_id, client_secret=client_secret, **kwargs)
232240 self.authorization_code = authorization_code
233241 if access_token is not None and not isinstance(access_token, dict):
234242 raise InvalidTypeError(&#34;access_token&#34;, access_token, OAuth2Token)
235243 self.access_token = access_token
244
245 @property
246 def token_url(self):
247 # We don&#39;t know (or need) the Microsoft tenant ID. Use common/ to let Microsoft select the appropriate
248 # tenant for the provided authorization code or refresh token.
249 return &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec
250
251 @property
252 def scope(self):
253 res = super().scope
254 res.append(&#34;offline_access&#34;)
255 return res
236256
237257 def __repr__(self):
238258 return self.__class__.__name__ + repr(
441461 </dd>
442462 <dt id="exchangelib.credentials.OAuth2AuthorizationCodeCredentials"><code class="flex name class">
443463 <span>class <span class="ident">OAuth2AuthorizationCodeCredentials</span></span>
444 <span>(</span><span>authorization_code=None, access_token=None, **kwargs)</span>
464 <span>(</span><span>authorization_code=None, access_token=None, client_id=None, client_secret=None, **kwargs)</span>
445465 </code></dt>
446466 <dd>
447467 <div class="desc"><p>Login info for OAuth 2.0 authentication using the authorization code grant type. This can be used in one of
448468 several ways:
449469 * Given an authorization code, client ID, and client secret, fetch a token ourselves and refresh it as needed if
450470 supplied with a refresh token.
451 * Given an existing access token, refresh token, client ID, and client secret, use the access token until it
452 expires and then refresh it as needed.
471 * Given an existing access token, client ID, and client secret, use the access token until it expires and then
472 refresh it as needed.
453473 * Given only an existing access token, use it until it expires. This can be used to let the calling application
454474 refresh tokens itself by subclassing and implementing refresh().</p>
455475 <p>Unlike the base (client credentials) grant, authorization code credentials don't require a Microsoft tenant ID
472492 several ways:
473493 * Given an authorization code, client ID, and client secret, fetch a token ourselves and refresh it as needed if
474494 supplied with a refresh token.
475 * Given an existing access token, refresh token, client ID, and client secret, use the access token until it
476 expires and then refresh it as needed.
495 * Given an existing access token, client ID, and client secret, use the access token until it expires and then
496 refresh it as needed.
477497 * Given only an existing access token, use it until it expires. This can be used to let the calling application
478498 refresh tokens itself by subclassing and implementing refresh().
479499
482502 tenant.
483503 &#34;&#34;&#34;
484504
485 def __init__(self, authorization_code=None, access_token=None, **kwargs):
505 def __init__(self, authorization_code=None, access_token=None, client_id=None, client_secret=None, **kwargs):
486506 &#34;&#34;&#34;
487507
488508 :param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
494514 :param access_token: Previously-obtained access token. If a token exists and the application will handle
495515 refreshing by itself (or opts not to handle it), this parameter alone is sufficient.
496516 &#34;&#34;&#34;
497 super().__init__(**kwargs)
517 super().__init__(client_id=client_id, client_secret=client_secret, **kwargs)
498518 self.authorization_code = authorization_code
499519 if access_token is not None and not isinstance(access_token, dict):
500520 raise InvalidTypeError(&#34;access_token&#34;, access_token, OAuth2Token)
501521 self.access_token = access_token
522
523 @property
524 def token_url(self):
525 # We don&#39;t know (or need) the Microsoft tenant ID. Use common/ to let Microsoft select the appropriate
526 # tenant for the provided authorization code or refresh token.
527 return &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec
528
529 @property
530 def scope(self):
531 res = super().scope
532 res.append(&#34;offline_access&#34;)
533 return res
502534
503535 def __repr__(self):
504536 return self.__class__.__name__ + repr(
520552 <li><a title="exchangelib.credentials.OAuth2Credentials" href="#exchangelib.credentials.OAuth2Credentials">OAuth2Credentials</a></li>
521553 <li><a title="exchangelib.credentials.BaseCredentials" href="#exchangelib.credentials.BaseCredentials">BaseCredentials</a></li>
522554 </ul>
555 <h3>Instance variables</h3>
556 <dl>
557 <dt id="exchangelib.credentials.OAuth2AuthorizationCodeCredentials.scope"><code class="name">var <span class="ident">scope</span></code></dt>
558 <dd>
559 <div class="desc"></div>
560 <details class="source">
561 <summary>
562 <span>Expand source code</span>
563 </summary>
564 <pre><code class="python">@property
565 def scope(self):
566 res = super().scope
567 res.append(&#34;offline_access&#34;)
568 return res</code></pre>
569 </details>
570 </dd>
571 <dt id="exchangelib.credentials.OAuth2AuthorizationCodeCredentials.token_url"><code class="name">var <span class="ident">token_url</span></code></dt>
572 <dd>
573 <div class="desc"></div>
574 <details class="source">
575 <summary>
576 <span>Expand source code</span>
577 </summary>
578 <pre><code class="python">@property
579 def token_url(self):
580 # We don&#39;t know (or need) the Microsoft tenant ID. Use common/ to let Microsoft select the appropriate
581 # tenant for the provided authorization code or refresh token.
582 return &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec</code></pre>
583 </details>
584 </dd>
585 </dl>
523586 <h3>Inherited members</h3>
524587 <ul class="hlist">
525588 <li><code><b><a title="exchangelib.credentials.OAuth2Credentials" href="#exchangelib.credentials.OAuth2Credentials">OAuth2Credentials</a></b></code>:
532595 </dd>
533596 <dt id="exchangelib.credentials.OAuth2Credentials"><code class="flex name class">
534597 <span>class <span class="ident">OAuth2Credentials</span></span>
535 <span>(</span><span>client_id, client_secret, tenant_id=None, identity=None)</span>
598 <span>(</span><span>client_id, client_secret, tenant_id=None, identity=None, access_token=None)</span>
536599 </code></dt>
537600 <dd>
538601 <div class="desc"><p>Login info for OAuth 2.0 client credentials authentication, as well as a base for other OAuth 2.0 grant types.</p>
543606 <p>:param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
544607 :param client_secret: Secret associated with the OAuth application
545608 :param tenant_id: Microsoft tenant ID of the account to access
546 :param identity: An Identity object representing the account that these credentials are connected to.</p></div>
609 :param identity: An Identity object representing the account that these credentials are connected to.
610 :param access_token: Previously-obtained access token, as a dict or an oauthlib.oauth2.OAuth2Token</p></div>
547611 <details class="source">
548612 <summary>
549613 <span>Expand source code</span>
557621 the associated auth code grant type for multi-tenant applications.
558622 &#34;&#34;&#34;
559623
560 def __init__(self, client_id, client_secret, tenant_id=None, identity=None):
624 def __init__(self, client_id, client_secret, tenant_id=None, identity=None, access_token=None):
561625 &#34;&#34;&#34;
562626
563627 :param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
564628 :param client_secret: Secret associated with the OAuth application
565629 :param tenant_id: Microsoft tenant ID of the account to access
566630 :param identity: An Identity object representing the account that these credentials are connected to.
631 :param access_token: Previously-obtained access token, as a dict or an oauthlib.oauth2.OAuth2Token
567632 &#34;&#34;&#34;
568633 super().__init__()
569634 self.client_id = client_id
570635 self.client_secret = client_secret
571636 self.tenant_id = tenant_id
572637 self.identity = identity
573 # When set, access_token is a dict (or an oauthlib.oauth2.OAuth2Token, which is also a dict)
574 self.access_token = None
638 self.access_token = access_token
575639
576640 def refresh(self, session):
577641 # Creating a new session gets a new access token, so there&#39;s no work here to refresh the credentials. This
611675 res.append(getattr(self, k))
612676 return hash(tuple(res))
613677
678 @property
679 def token_url(self):
680 return f&#34;https://login.microsoftonline.com/{self.tenant_id}/oauth2/v2.0/token&#34;
681
682 @property
683 def scope(self):
684 return [&#34;https://outlook.office365.com/.default&#34;]
685
614686 def __repr__(self):
615687 return self.__class__.__name__ + repr((self.client_id, &#34;********&#34;))
616688
625697 <ul class="hlist">
626698 <li><a title="exchangelib.credentials.OAuth2AuthorizationCodeCredentials" href="#exchangelib.credentials.OAuth2AuthorizationCodeCredentials">OAuth2AuthorizationCodeCredentials</a></li>
627699 </ul>
700 <h3>Instance variables</h3>
701 <dl>
702 <dt id="exchangelib.credentials.OAuth2Credentials.scope"><code class="name">var <span class="ident">scope</span></code></dt>
703 <dd>
704 <div class="desc"></div>
705 <details class="source">
706 <summary>
707 <span>Expand source code</span>
708 </summary>
709 <pre><code class="python">@property
710 def scope(self):
711 return [&#34;https://outlook.office365.com/.default&#34;]</code></pre>
712 </details>
713 </dd>
714 <dt id="exchangelib.credentials.OAuth2Credentials.token_url"><code class="name">var <span class="ident">token_url</span></code></dt>
715 <dd>
716 <div class="desc"></div>
717 <details class="source">
718 <summary>
719 <span>Expand source code</span>
720 </summary>
721 <pre><code class="python">@property
722 def token_url(self):
723 return f&#34;https://login.microsoftonline.com/{self.tenant_id}/oauth2/v2.0/token&#34;</code></pre>
724 </details>
725 </dd>
726 </dl>
628727 <h3>Methods</h3>
629728 <dl>
630729 <dt id="exchangelib.credentials.OAuth2Credentials.on_token_auto_refreshed"><code class="name flex">
722821 </li>
723822 <li>
724823 <h4><code><a title="exchangelib.credentials.OAuth2AuthorizationCodeCredentials" href="#exchangelib.credentials.OAuth2AuthorizationCodeCredentials">OAuth2AuthorizationCodeCredentials</a></code></h4>
824 <ul class="">
825 <li><code><a title="exchangelib.credentials.OAuth2AuthorizationCodeCredentials.scope" href="#exchangelib.credentials.OAuth2AuthorizationCodeCredentials.scope">scope</a></code></li>
826 <li><code><a title="exchangelib.credentials.OAuth2AuthorizationCodeCredentials.token_url" href="#exchangelib.credentials.OAuth2AuthorizationCodeCredentials.token_url">token_url</a></code></li>
827 </ul>
725828 </li>
726829 <li>
727830 <h4><code><a title="exchangelib.credentials.OAuth2Credentials" href="#exchangelib.credentials.OAuth2Credentials">OAuth2Credentials</a></code></h4>
728831 <ul class="">
729832 <li><code><a title="exchangelib.credentials.OAuth2Credentials.on_token_auto_refreshed" href="#exchangelib.credentials.OAuth2Credentials.on_token_auto_refreshed">on_token_auto_refreshed</a></code></li>
833 <li><code><a title="exchangelib.credentials.OAuth2Credentials.scope" href="#exchangelib.credentials.OAuth2Credentials.scope">scope</a></code></li>
730834 <li><code><a title="exchangelib.credentials.OAuth2Credentials.sig" href="#exchangelib.credentials.OAuth2Credentials.sig">sig</a></code></li>
835 <li><code><a title="exchangelib.credentials.OAuth2Credentials.token_url" href="#exchangelib.credentials.OAuth2Credentials.token_url">token_url</a></code></li>
731836 </ul>
732837 </li>
733838 </ul>
7373 def __eq__(self, other):
7474 return repr(self) == repr(other)
7575
76 def __hash__(self):
77 return hash(str(self))
78
7679
7780 # Warnings
7881 class EWSWarning(EWSError):
148151 pass
149152
150153
151 class TimezoneDefinitionInvalidForYear(EWSError):
152 pass
153
154
155154 class SessionPoolMinSizeReached(EWSError):
156155 pass
157156
14451444 pass
14461445
14471446
1447 class ErrorRecoverableItemsAccessDenied(ResponseMessageError):
1448 pass
1449
1450
14481451 class ErrorRecurrenceEndDateTooBig(ResponseMessageError):
14491452 pass
14501453
17191722 pass
17201723
17211724
1722 # Microsoft recommends to cache the autodiscover data around 24 hours and perform autodiscover
1725 # Microsoft recommends caching the autodiscover data around 24 hours and perform autodiscover
17231726 # immediately following certain error responses from EWS. See more at
17241727 # http://blogs.msdn.com/b/mstehle/archive/2010/11/09/ews-best-practices-use-autodiscover.aspx
17251728
18891892 return str(self.value)
18901893
18911894 def __eq__(self, other):
1892 return repr(self) == repr(other)</code></pre>
1895 return repr(self) == repr(other)
1896
1897 def __hash__(self):
1898 return hash(str(self))</code></pre>
18931899 </details>
18941900 <h3>Ancestors</h3>
18951901 <ul class="hlist">
19021908 <li><a title="exchangelib.errors.EWSWarning" href="#exchangelib.errors.EWSWarning">EWSWarning</a></li>
19031909 <li><a title="exchangelib.errors.SessionPoolMaxSizeReached" href="#exchangelib.errors.SessionPoolMaxSizeReached">SessionPoolMaxSizeReached</a></li>
19041910 <li><a title="exchangelib.errors.SessionPoolMinSizeReached" href="#exchangelib.errors.SessionPoolMinSizeReached">SessionPoolMinSizeReached</a></li>
1905 <li><a title="exchangelib.errors.TimezoneDefinitionInvalidForYear" href="#exchangelib.errors.TimezoneDefinitionInvalidForYear">TimezoneDefinitionInvalidForYear</a></li>
19061911 <li><a title="exchangelib.errors.TransportError" href="#exchangelib.errors.TransportError">TransportError</a></li>
19071912 <li><a title="exchangelib.errors.UnauthorizedError" href="#exchangelib.errors.UnauthorizedError">UnauthorizedError</a></li>
19081913 <li><a title="exchangelib.errors.UnknownTimeZone" href="#exchangelib.errors.UnknownTimeZone">UnknownTimeZone</a></li>
88698874 <span>Expand source code</span>
88708875 </summary>
88718876 <pre><code class="python">class ErrorReadReceiptNotPending(ResponseMessageError):
8877 pass</code></pre>
8878 </details>
8879 <h3>Ancestors</h3>
8880 <ul class="hlist">
8881 <li><a title="exchangelib.errors.ResponseMessageError" href="#exchangelib.errors.ResponseMessageError">ResponseMessageError</a></li>
8882 <li><a title="exchangelib.errors.TransportError" href="#exchangelib.errors.TransportError">TransportError</a></li>
8883 <li><a title="exchangelib.errors.EWSError" href="#exchangelib.errors.EWSError">EWSError</a></li>
8884 <li>builtins.Exception</li>
8885 <li>builtins.BaseException</li>
8886 </ul>
8887 </dd>
8888 <dt id="exchangelib.errors.ErrorRecoverableItemsAccessDenied"><code class="flex name class">
8889 <span>class <span class="ident">ErrorRecoverableItemsAccessDenied</span></span>
8890 <span>(</span><span>value)</span>
8891 </code></dt>
8892 <dd>
8893 <div class="desc"><p>Global error type within this module.</p></div>
8894 <details class="source">
8895 <summary>
8896 <span>Expand source code</span>
8897 </summary>
8898 <pre><code class="python">class ErrorRecoverableItemsAccessDenied(ResponseMessageError):
88728899 pass</code></pre>
88738900 </details>
88748901 <h3>Ancestors</h3>
1091310940 <li><a title="exchangelib.errors.ErrorQuotaExceeded" href="#exchangelib.errors.ErrorQuotaExceeded">ErrorQuotaExceeded</a></li>
1091410941 <li><a title="exchangelib.errors.ErrorReadEventsFailed" href="#exchangelib.errors.ErrorReadEventsFailed">ErrorReadEventsFailed</a></li>
1091510942 <li><a title="exchangelib.errors.ErrorReadReceiptNotPending" href="#exchangelib.errors.ErrorReadReceiptNotPending">ErrorReadReceiptNotPending</a></li>
10943 <li><a title="exchangelib.errors.ErrorRecoverableItemsAccessDenied" href="#exchangelib.errors.ErrorRecoverableItemsAccessDenied">ErrorRecoverableItemsAccessDenied</a></li>
1091610944 <li><a title="exchangelib.errors.ErrorRecurrenceEndDateTooBig" href="#exchangelib.errors.ErrorRecurrenceEndDateTooBig">ErrorRecurrenceEndDateTooBig</a></li>
1091710945 <li><a title="exchangelib.errors.ErrorRecurrenceHasNoOccurrence" href="#exchangelib.errors.ErrorRecurrenceHasNoOccurrence">ErrorRecurrenceHasNoOccurrence</a></li>
1091810946 <li><a title="exchangelib.errors.ErrorRemoveDelegatesFailed" href="#exchangelib.errors.ErrorRemoveDelegatesFailed">ErrorRemoveDelegatesFailed</a></li>
1104411072 <li>builtins.BaseException</li>
1104511073 </ul>
1104611074 </dd>
11047 <dt id="exchangelib.errors.TimezoneDefinitionInvalidForYear"><code class="flex name class">
11048 <span>class <span class="ident">TimezoneDefinitionInvalidForYear</span></span>
11049 <span>(</span><span>value)</span>
11050 </code></dt>
11051 <dd>
11052 <div class="desc"><p>Global error type within this module.</p></div>
11053 <details class="source">
11054 <summary>
11055 <span>Expand source code</span>
11056 </summary>
11057 <pre><code class="python">class TimezoneDefinitionInvalidForYear(EWSError):
11058 pass</code></pre>
11059 </details>
11060 <h3>Ancestors</h3>
11061 <ul class="hlist">
11062 <li><a title="exchangelib.errors.EWSError" href="#exchangelib.errors.EWSError">EWSError</a></li>
11063 <li>builtins.Exception</li>
11064 <li>builtins.BaseException</li>
11065 </ul>
11066 </dd>
1106711075 <dt id="exchangelib.errors.TransportError"><code class="flex name class">
1106811076 <span>class <span class="ident">TransportError</span></span>
1106911077 <span>(</span><span>value)</span>
1212012128 <h4><code><a title="exchangelib.errors.ErrorReadReceiptNotPending" href="#exchangelib.errors.ErrorReadReceiptNotPending">ErrorReadReceiptNotPending</a></code></h4>
1212112129 </li>
1212212130 <li>
12131 <h4><code><a title="exchangelib.errors.ErrorRecoverableItemsAccessDenied" href="#exchangelib.errors.ErrorRecoverableItemsAccessDenied">ErrorRecoverableItemsAccessDenied</a></code></h4>
12132 </li>
12133 <li>
1212312134 <h4><code><a title="exchangelib.errors.ErrorRecurrenceEndDateTooBig" href="#exchangelib.errors.ErrorRecurrenceEndDateTooBig">ErrorRecurrenceEndDateTooBig</a></code></h4>
1212412135 </li>
1212512136 <li>
1235812369 </li>
1235912370 <li>
1236012371 <h4><code><a title="exchangelib.errors.SessionPoolMinSizeReached" href="#exchangelib.errors.SessionPoolMinSizeReached">SessionPoolMinSizeReached</a></code></h4>
12361 </li>
12362 <li>
12363 <h4><code><a title="exchangelib.errors.TimezoneDefinitionInvalidForYear" href="#exchangelib.errors.TimezoneDefinitionInvalidForYear">TimezoneDefinitionInvalidForYear</a></code></h4>
1236412372 </li>
1236512373 <li>
1236612374 <h4><code><a title="exchangelib.errors.TransportError" href="#exchangelib.errors.TransportError">TransportError</a></code></h4>
952952 </details>
953953 <h3>Ancestors</h3>
954954 <ul class="hlist">
955 <li>backports.zoneinfo.ZoneInfo</li>
955 <li>zoneinfo.ZoneInfo</li>
956956 <li>datetime.tzinfo</li>
957957 </ul>
958958 <h3>Class variables</h3>
66106610 <dl>
66116611 <dt id="exchangelib.fields.TimeDeltaField.value_cls"><code class="name">var <span class="ident">value_cls</span></code></dt>
66126612 <dd>
6613 <div class="desc"><p>Difference between two datetime values.</p></div>
6613 <div class="desc"><p>Difference between two datetime values.</p>
6614 <p>timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)</p>
6615 <p>All arguments are optional and default to 0.
6616 Arguments may be integers or floats, and may be positive or negative.</p></div>
66146617 </dd>
66156618 </dl>
66166619 <h3>Methods</h3>
3737 ErrorDeleteDistinguishedFolder,
3838 ErrorFolderNotFound,
3939 ErrorItemNotFound,
40 ErrorRecoverableItemsAccessDenied,
4041 InvalidTypeError,
4142 )
4243 from ..fields import (
7475
7576 log = logging.getLogger(__name__)
7677
78 DELETE_FOLDER_ERRORS = (
79 ErrorAccessDenied,
80 ErrorCannotDeleteObject,
81 ErrorCannotEmptyFolder,
82 ErrorItemNotFound,
83 )
84
7785
7886 class BaseFolder(RegisterMixIn, SearchableMixIn, metaclass=EWSMeta):
7987 &#34;&#34;&#34;Base class for all classes that implement a folder.&#34;&#34;&#34;
256264 :return:
257265 &#34;&#34;&#34;
258266 from .known_folders import (
267 ApplicationData,
259268 Calendar,
260269 Contacts,
261270 ConversationSettings,
271 CrawlerData,
272 DlpPolicyEvaluation,
273 FreeBusyCache,
262274 GALContacts,
263275 Messages,
264276 RecipientCache,
277 RecoveryPoints,
265278 Reminders,
266279 RSSFeeds,
280 Signal,
281 SwssItems,
267282 Tasks,
268283 )
269284
270285 for folder_cls in (
286 ApplicationData,
287 Calendar,
288 Contacts,
289 ConversationSettings,
290 CrawlerData,
291 DlpPolicyEvaluation,
292 FreeBusyCache,
293 GALContacts,
271294 Messages,
295 RSSFeeds,
296 RecipientCache,
297 RecoveryPoints,
298 Reminders,
299 Signal,
300 SwssItems,
272301 Tasks,
273 Calendar,
274 ConversationSettings,
275 Contacts,
276 GALContacts,
277 Reminders,
278 RecipientCache,
279 RSSFeeds,
280302 ):
281303 if folder_cls.CONTAINER_CLASS == container_class:
282304 return folder_cls
429451 def wipe(self, page_size=None, chunk_size=None, _seen=None, _level=0):
430452 # Recursively deletes all items in this folder, and all subfolders and their content. Attempts to protect
431453 # distinguished folders from being deleted. Use with caution!
454 from .known_folders import Audits
455
432456 _seen = _seen or set()
433457 if self.id in _seen:
434458 raise RecursionError(f&#34;We already tried to wipe {self}&#34;)
435459 if _level &gt; 16:
436460 raise RecursionError(f&#34;Max recursion level reached: {_level}&#34;)
437461 _seen.add(self.id)
462 if isinstance(self, Audits):
463 # Shortcircuit because this folder can have many items that are all non-deletable
464 log.warning(&#34;Cannot wipe audits folder %s&#34;, self)
465 return
466 if self.is_distinguished and &#34;recoverableitems&#34; in self.DISTINGUISHED_FOLDER_ID:
467 log.warning(&#34;Cannot wipe recoverable items folder %s&#34;, self)
468 return
438469 log.warning(&#34;Wiping %s&#34;, self)
439470 has_distinguished_subfolders = any(f.is_distinguished for f in self.children)
440471 try:
442473 self.empty(delete_sub_folders=False)
443474 else:
444475 self.empty(delete_sub_folders=True)
445 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
476 except ErrorRecoverableItemsAccessDenied:
477 log.warning(&#34;Access denied to %s. Skipping&#34;, self)
478 return
479 except DELETE_FOLDER_ERRORS:
446480 try:
447481 if has_distinguished_subfolders:
448482 raise # We already tried this
449483 self.empty(delete_sub_folders=False)
450 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
484 except DELETE_FOLDER_ERRORS:
451485 log.warning(&#34;Not allowed to empty %s. Trying to delete items instead&#34;, self)
452486 kwargs = {}
453487 if page_size is not None:
456490 kwargs[&#34;chunk_size&#34;] = chunk_size
457491 try:
458492 self.all().delete(**kwargs)
459 except (ErrorAccessDenied, ErrorCannotDeleteObject, ErrorItemNotFound):
493 except DELETE_FOLDER_ERRORS:
460494 log.warning(&#34;Not allowed to delete items in %s&#34;, self)
461495 _level += 1
462496 for f in self.children:
11261160 :return:
11271161 &#34;&#34;&#34;
11281162 from .known_folders import (
1163 ApplicationData,
11291164 Calendar,
11301165 Contacts,
11311166 ConversationSettings,
1167 CrawlerData,
1168 DlpPolicyEvaluation,
1169 FreeBusyCache,
11321170 GALContacts,
11331171 Messages,
11341172 RecipientCache,
1173 RecoveryPoints,
11351174 Reminders,
11361175 RSSFeeds,
1176 Signal,
1177 SwssItems,
11371178 Tasks,
11381179 )
11391180
11401181 for folder_cls in (
1182 ApplicationData,
1183 Calendar,
1184 Contacts,
1185 ConversationSettings,
1186 CrawlerData,
1187 DlpPolicyEvaluation,
1188 FreeBusyCache,
1189 GALContacts,
11411190 Messages,
1191 RSSFeeds,
1192 RecipientCache,
1193 RecoveryPoints,
1194 Reminders,
1195 Signal,
1196 SwssItems,
11421197 Tasks,
1143 Calendar,
1144 ConversationSettings,
1145 Contacts,
1146 GALContacts,
1147 Reminders,
1148 RecipientCache,
1149 RSSFeeds,
11501198 ):
11511199 if folder_cls.CONTAINER_CLASS == container_class:
11521200 return folder_cls
12991347 def wipe(self, page_size=None, chunk_size=None, _seen=None, _level=0):
13001348 # Recursively deletes all items in this folder, and all subfolders and their content. Attempts to protect
13011349 # distinguished folders from being deleted. Use with caution!
1350 from .known_folders import Audits
1351
13021352 _seen = _seen or set()
13031353 if self.id in _seen:
13041354 raise RecursionError(f&#34;We already tried to wipe {self}&#34;)
13051355 if _level &gt; 16:
13061356 raise RecursionError(f&#34;Max recursion level reached: {_level}&#34;)
13071357 _seen.add(self.id)
1358 if isinstance(self, Audits):
1359 # Shortcircuit because this folder can have many items that are all non-deletable
1360 log.warning(&#34;Cannot wipe audits folder %s&#34;, self)
1361 return
1362 if self.is_distinguished and &#34;recoverableitems&#34; in self.DISTINGUISHED_FOLDER_ID:
1363 log.warning(&#34;Cannot wipe recoverable items folder %s&#34;, self)
1364 return
13081365 log.warning(&#34;Wiping %s&#34;, self)
13091366 has_distinguished_subfolders = any(f.is_distinguished for f in self.children)
13101367 try:
13121369 self.empty(delete_sub_folders=False)
13131370 else:
13141371 self.empty(delete_sub_folders=True)
1315 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
1372 except ErrorRecoverableItemsAccessDenied:
1373 log.warning(&#34;Access denied to %s. Skipping&#34;, self)
1374 return
1375 except DELETE_FOLDER_ERRORS:
13161376 try:
13171377 if has_distinguished_subfolders:
13181378 raise # We already tried this
13191379 self.empty(delete_sub_folders=False)
1320 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
1380 except DELETE_FOLDER_ERRORS:
13211381 log.warning(&#34;Not allowed to empty %s. Trying to delete items instead&#34;, self)
13221382 kwargs = {}
13231383 if page_size is not None:
13261386 kwargs[&#34;chunk_size&#34;] = chunk_size
13271387 try:
13281388 self.all().delete(**kwargs)
1329 except (ErrorAccessDenied, ErrorCannotDeleteObject, ErrorItemNotFound):
1389 except DELETE_FOLDER_ERRORS:
13301390 log.warning(&#34;Not allowed to delete items in %s&#34;, self)
13311391 _level += 1
13321392 for f in self.children:
17761836 :return:
17771837 &#34;&#34;&#34;
17781838 from .known_folders import (
1839 ApplicationData,
17791840 Calendar,
17801841 Contacts,
17811842 ConversationSettings,
1843 CrawlerData,
1844 DlpPolicyEvaluation,
1845 FreeBusyCache,
17821846 GALContacts,
17831847 Messages,
17841848 RecipientCache,
1849 RecoveryPoints,
17851850 Reminders,
17861851 RSSFeeds,
1852 Signal,
1853 SwssItems,
17871854 Tasks,
17881855 )
17891856
17901857 for folder_cls in (
1858 ApplicationData,
1859 Calendar,
1860 Contacts,
1861 ConversationSettings,
1862 CrawlerData,
1863 DlpPolicyEvaluation,
1864 FreeBusyCache,
1865 GALContacts,
17911866 Messages,
1867 RSSFeeds,
1868 RecipientCache,
1869 RecoveryPoints,
1870 Reminders,
1871 Signal,
1872 SwssItems,
17921873 Tasks,
1793 Calendar,
1794 ConversationSettings,
1795 Contacts,
1796 GALContacts,
1797 Reminders,
1798 RecipientCache,
1799 RSSFeeds,
18001874 ):
18011875 if folder_cls.CONTAINER_CLASS == container_class:
18021876 return folder_cls
27872861 <pre><code class="python">def wipe(self, page_size=None, chunk_size=None, _seen=None, _level=0):
27882862 # Recursively deletes all items in this folder, and all subfolders and their content. Attempts to protect
27892863 # distinguished folders from being deleted. Use with caution!
2864 from .known_folders import Audits
2865
27902866 _seen = _seen or set()
27912867 if self.id in _seen:
27922868 raise RecursionError(f&#34;We already tried to wipe {self}&#34;)
27932869 if _level &gt; 16:
27942870 raise RecursionError(f&#34;Max recursion level reached: {_level}&#34;)
27952871 _seen.add(self.id)
2872 if isinstance(self, Audits):
2873 # Shortcircuit because this folder can have many items that are all non-deletable
2874 log.warning(&#34;Cannot wipe audits folder %s&#34;, self)
2875 return
2876 if self.is_distinguished and &#34;recoverableitems&#34; in self.DISTINGUISHED_FOLDER_ID:
2877 log.warning(&#34;Cannot wipe recoverable items folder %s&#34;, self)
2878 return
27962879 log.warning(&#34;Wiping %s&#34;, self)
27972880 has_distinguished_subfolders = any(f.is_distinguished for f in self.children)
27982881 try:
28002883 self.empty(delete_sub_folders=False)
28012884 else:
28022885 self.empty(delete_sub_folders=True)
2803 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
2886 except ErrorRecoverableItemsAccessDenied:
2887 log.warning(&#34;Access denied to %s. Skipping&#34;, self)
2888 return
2889 except DELETE_FOLDER_ERRORS:
28042890 try:
28052891 if has_distinguished_subfolders:
28062892 raise # We already tried this
28072893 self.empty(delete_sub_folders=False)
2808 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
2894 except DELETE_FOLDER_ERRORS:
28092895 log.warning(&#34;Not allowed to empty %s. Trying to delete items instead&#34;, self)
28102896 kwargs = {}
28112897 if page_size is not None:
28142900 kwargs[&#34;chunk_size&#34;] = chunk_size
28152901 try:
28162902 self.all().delete(**kwargs)
2817 except (ErrorAccessDenied, ErrorCannotDeleteObject, ErrorItemNotFound):
2903 except DELETE_FOLDER_ERRORS:
28182904 log.warning(&#34;Not allowed to delete items in %s&#34;, self)
28192905 _level += 1
28202906 for f in self.children:
30043090 <h3>Subclasses</h3>
30053091 <ul class="hlist">
30063092 <li><a title="exchangelib.folders.known_folders.AllItems" href="known_folders.html#exchangelib.folders.known_folders.AllItems">AllItems</a></li>
3093 <li><a title="exchangelib.folders.known_folders.ApplicationData" href="known_folders.html#exchangelib.folders.known_folders.ApplicationData">ApplicationData</a></li>
30073094 <li><a title="exchangelib.folders.known_folders.Audits" href="known_folders.html#exchangelib.folders.known_folders.Audits">Audits</a></li>
3095 <li><a title="exchangelib.folders.known_folders.Birthdays" href="known_folders.html#exchangelib.folders.known_folders.Birthdays">Birthdays</a></li>
30083096 <li><a title="exchangelib.folders.known_folders.Calendar" href="known_folders.html#exchangelib.folders.known_folders.Calendar">Calendar</a></li>
30093097 <li><a title="exchangelib.folders.known_folders.CalendarLogging" href="known_folders.html#exchangelib.folders.known_folders.CalendarLogging">CalendarLogging</a></li>
30103098 <li><a title="exchangelib.folders.known_folders.CommonViews" href="known_folders.html#exchangelib.folders.known_folders.CommonViews">CommonViews</a></li>
30113099 <li><a title="exchangelib.folders.known_folders.Contacts" href="known_folders.html#exchangelib.folders.known_folders.Contacts">Contacts</a></li>
30123100 <li><a title="exchangelib.folders.known_folders.ConversationSettings" href="known_folders.html#exchangelib.folders.known_folders.ConversationSettings">ConversationSettings</a></li>
3101 <li><a title="exchangelib.folders.known_folders.CrawlerData" href="known_folders.html#exchangelib.folders.known_folders.CrawlerData">CrawlerData</a></li>
30133102 <li><a title="exchangelib.folders.known_folders.DefaultFoldersChangeHistory" href="known_folders.html#exchangelib.folders.known_folders.DefaultFoldersChangeHistory">DefaultFoldersChangeHistory</a></li>
30143103 <li><a title="exchangelib.folders.known_folders.DeferredAction" href="known_folders.html#exchangelib.folders.known_folders.DeferredAction">DeferredAction</a></li>
30153104 <li><a title="exchangelib.folders.known_folders.DeletedItems" href="known_folders.html#exchangelib.folders.known_folders.DeletedItems">DeletedItems</a></li>
3105 <li><a title="exchangelib.folders.known_folders.DlpPolicyEvaluation" href="known_folders.html#exchangelib.folders.known_folders.DlpPolicyEvaluation">DlpPolicyEvaluation</a></li>
30163106 <li><a title="exchangelib.folders.known_folders.ExchangeSyncData" href="known_folders.html#exchangelib.folders.known_folders.ExchangeSyncData">ExchangeSyncData</a></li>
30173107 <li><a title="exchangelib.folders.known_folders.Files" href="known_folders.html#exchangelib.folders.known_folders.Files">Files</a></li>
3108 <li><a title="exchangelib.folders.known_folders.FreeBusyCache" href="known_folders.html#exchangelib.folders.known_folders.FreeBusyCache">FreeBusyCache</a></li>
30183109 <li><a title="exchangelib.folders.known_folders.FreebusyData" href="known_folders.html#exchangelib.folders.known_folders.FreebusyData">FreebusyData</a></li>
30193110 <li><a title="exchangelib.folders.known_folders.GraphAnalytics" href="known_folders.html#exchangelib.folders.known_folders.GraphAnalytics">GraphAnalytics</a></li>
30203111 <li><a title="exchangelib.folders.known_folders.Location" href="known_folders.html#exchangelib.folders.known_folders.Location">Location</a></li>
30243115 <li><a title="exchangelib.folders.known_folders.PassThroughSearchResults" href="known_folders.html#exchangelib.folders.known_folders.PassThroughSearchResults">PassThroughSearchResults</a></li>
30253116 <li><a title="exchangelib.folders.known_folders.PdpProfileV2Secured" href="known_folders.html#exchangelib.folders.known_folders.PdpProfileV2Secured">PdpProfileV2Secured</a></li>
30263117 <li><a title="exchangelib.folders.known_folders.RSSFeeds" href="known_folders.html#exchangelib.folders.known_folders.RSSFeeds">RSSFeeds</a></li>
3118 <li><a title="exchangelib.folders.known_folders.RecoveryPoints" href="known_folders.html#exchangelib.folders.known_folders.RecoveryPoints">RecoveryPoints</a></li>
30273119 <li><a title="exchangelib.folders.known_folders.Reminders" href="known_folders.html#exchangelib.folders.known_folders.Reminders">Reminders</a></li>
30283120 <li><a title="exchangelib.folders.known_folders.Schedule" href="known_folders.html#exchangelib.folders.known_folders.Schedule">Schedule</a></li>
30293121 <li><a title="exchangelib.folders.known_folders.Sharing" href="known_folders.html#exchangelib.folders.known_folders.Sharing">Sharing</a></li>
30303122 <li><a title="exchangelib.folders.known_folders.Shortcuts" href="known_folders.html#exchangelib.folders.known_folders.Shortcuts">Shortcuts</a></li>
30313123 <li><a title="exchangelib.folders.known_folders.Signal" href="known_folders.html#exchangelib.folders.known_folders.Signal">Signal</a></li>
3124 <li><a title="exchangelib.folders.known_folders.SkypeTeamsMessages" href="known_folders.html#exchangelib.folders.known_folders.SkypeTeamsMessages">SkypeTeamsMessages</a></li>
30323125 <li><a title="exchangelib.folders.known_folders.SmsAndChatsSync" href="known_folders.html#exchangelib.folders.known_folders.SmsAndChatsSync">SmsAndChatsSync</a></li>
30333126 <li><a title="exchangelib.folders.known_folders.SpoolerQueue" href="known_folders.html#exchangelib.folders.known_folders.SpoolerQueue">SpoolerQueue</a></li>
3127 <li><a title="exchangelib.folders.known_folders.SwssItems" href="known_folders.html#exchangelib.folders.known_folders.SwssItems">SwssItems</a></li>
30343128 <li><a title="exchangelib.folders.known_folders.System" href="known_folders.html#exchangelib.folders.known_folders.System">System</a></li>
30353129 <li><a title="exchangelib.folders.known_folders.System1" href="known_folders.html#exchangelib.folders.known_folders.System1">System1</a></li>
30363130 <li><a title="exchangelib.folders.known_folders.Tasks" href="known_folders.html#exchangelib.folders.known_folders.Tasks">Tasks</a></li>
3333 AdminAuditLogs,
3434 AllContacts,
3535 AllItems,
36 ApplicationData,
3637 ArchiveDeletedItems,
3738 ArchiveInbox,
3839 ArchiveMsgFolderRoot,
4142 ArchiveRecoverableItemsRoot,
4243 ArchiveRecoverableItemsVersions,
4344 Audits,
45 Birthdays,
4446 Calendar,
4547 CalendarLogging,
4648 CommonViews,
4951 Contacts,
5052 ConversationHistory,
5153 ConversationSettings,
54 CrawlerData,
5255 DefaultFoldersChangeHistory,
5356 DeferredAction,
5457 DeletedItems,
5558 Directory,
59 DlpPolicyEvaluation,
5660 Drafts,
5761 ExchangeSyncData,
5862 Favorites,
5963 Files,
64 FreeBusyCache,
6065 FreebusyData,
6166 Friends,
6267 GALContacts,
8792 RecoverableItemsPurges,
8893 RecoverableItemsRoot,
8994 RecoverableItemsVersions,
95 RecoveryPoints,
9096 Reminders,
9197 RSSFeeds,
9298 Schedule,
96102 Sharing,
97103 Shortcuts,
98104 Signal,
105 SkypeTeamsMessages,
99106 SmsAndChatsSync,
100107 SpoolerQueue,
108 SwssItems,
101109 SyncIssues,
102110 System,
103111 Tasks,
112120 from .roots import ArchiveRoot, PublicFoldersRoot, Root, RootOfHierarchy
113121
114122 __all__ = [
115 &#34;FolderId&#34;,
116 &#34;DistinguishedFolderId&#34;,
117 &#34;FolderCollection&#34;,
118 &#34;BaseFolder&#34;,
119 &#34;Folder&#34;,
120123 &#34;AdminAuditLogs&#34;,
121124 &#34;AllContacts&#34;,
122125 &#34;AllItems&#34;,
126 &#34;ApplicationData&#34;,
123127 &#34;ArchiveDeletedItems&#34;,
124128 &#34;ArchiveInbox&#34;,
125129 &#34;ArchiveMsgFolderRoot&#34;,
127131 &#34;ArchiveRecoverableItemsPurges&#34;,
128132 &#34;ArchiveRecoverableItemsRoot&#34;,
129133 &#34;ArchiveRecoverableItemsVersions&#34;,
134 &#34;ArchiveRoot&#34;,
130135 &#34;Audits&#34;,
136 &#34;BaseFolder&#34;,
137 &#34;Birthdays&#34;,
131138 &#34;Calendar&#34;,
132139 &#34;CalendarLogging&#34;,
133140 &#34;CommonViews&#34;,
141 &#34;Companies&#34;,
134142 &#34;Conflicts&#34;,
135143 &#34;Contacts&#34;,
136144 &#34;ConversationHistory&#34;,
137145 &#34;ConversationSettings&#34;,
146 &#34;CrawlerData&#34;,
147 &#34;DEEP&#34;,
138148 &#34;DefaultFoldersChangeHistory&#34;,
139149 &#34;DeferredAction&#34;,
140150 &#34;DeletedItems&#34;,
141151 &#34;Directory&#34;,
152 &#34;DistinguishedFolderId&#34;,
153 &#34;DlpPolicyEvaluation&#34;,
142154 &#34;Drafts&#34;,
143155 &#34;ExchangeSyncData&#34;,
156 &#34;FOLDER_TRAVERSAL_CHOICES&#34;,
144157 &#34;Favorites&#34;,
145158 &#34;Files&#34;,
159 &#34;Folder&#34;,
160 &#34;FolderCollection&#34;,
161 &#34;FolderId&#34;,
162 &#34;FolderQuerySet&#34;,
163 &#34;FreeBusyCache&#34;,
146164 &#34;FreebusyData&#34;,
147165 &#34;Friends&#34;,
148166 &#34;GALContacts&#34;,
158176 &#34;MsgFolderRoot&#34;,
159177 &#34;MyContacts&#34;,
160178 &#34;MyContactsExtended&#34;,
179 &#34;NON_DELETABLE_FOLDERS&#34;,
161180 &#34;NonDeletableFolderMixin&#34;,
162181 &#34;Notes&#34;,
182 &#34;OrganizationalContacts&#34;,
163183 &#34;Outbox&#34;,
164184 &#34;ParkedMessages&#34;,
165185 &#34;PassThroughSearchResults&#34;,
166186 &#34;PdpProfileV2Secured&#34;,
187 &#34;PeopleCentricConversationBuddies&#34;,
167188 &#34;PeopleConnect&#34;,
189 &#34;PublicFoldersRoot&#34;,
168190 &#34;QuickContacts&#34;,
169191 &#34;RSSFeeds&#34;,
170192 &#34;RecipientCache&#34;,
172194 &#34;RecoverableItemsPurges&#34;,
173195 &#34;RecoverableItemsRoot&#34;,
174196 &#34;RecoverableItemsVersions&#34;,
197 &#34;RecoveryPoints&#34;,
175198 &#34;Reminders&#34;,
199 &#34;Root&#34;,
200 &#34;RootOfHierarchy&#34;,
201 &#34;SHALLOW&#34;,
202 &#34;SOFT_DELETED&#34;,
176203 &#34;Schedule&#34;,
177204 &#34;SearchFolders&#34;,
178205 &#34;SentItems&#34;,
180207 &#34;Sharing&#34;,
181208 &#34;Shortcuts&#34;,
182209 &#34;Signal&#34;,
210 &#34;SingleFolderQuerySet&#34;,
211 &#34;SkypeTeamsMessages&#34;,
183212 &#34;SmsAndChatsSync&#34;,
184213 &#34;SpoolerQueue&#34;,
214 &#34;SwssItems&#34;,
185215 &#34;SyncIssues&#34;,
186216 &#34;System&#34;,
187217 &#34;Tasks&#34;,
191221 &#34;VoiceMail&#34;,
192222 &#34;WellknownFolder&#34;,
193223 &#34;WorkingSet&#34;,
194 &#34;Companies&#34;,
195 &#34;OrganizationalContacts&#34;,
196 &#34;PeopleCentricConversationBuddies&#34;,
197 &#34;NON_DELETABLE_FOLDERS&#34;,
198 &#34;FolderQuerySet&#34;,
199 &#34;SingleFolderQuerySet&#34;,
200 &#34;FOLDER_TRAVERSAL_CHOICES&#34;,
201 &#34;SHALLOW&#34;,
202 &#34;DEEP&#34;,
203 &#34;SOFT_DELETED&#34;,
204 &#34;Root&#34;,
205 &#34;ArchiveRoot&#34;,
206 &#34;PublicFoldersRoot&#34;,
207 &#34;RootOfHierarchy&#34;,
208224 ]</code></pre>
209225 </details>
210226 </section>
431447 <div class="desc"></div>
432448 </dd>
433449 <dt id="exchangelib.folders.AllItems.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
450 <dd>
451 <div class="desc"></div>
452 </dd>
453 </dl>
454 <h3>Inherited members</h3>
455 <ul class="hlist">
456 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
457 <ul class="hlist">
458 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
459 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
460 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
461 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
462 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
463 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
464 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
465 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
466 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
467 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
468 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
469 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
470 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
471 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
472 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
473 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
474 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
475 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
476 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
477 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
478 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
479 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
480 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
481 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
482 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
483 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
484 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
485 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
486 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
487 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
488 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
489 </ul>
490 </li>
491 </ul>
492 </dd>
493 <dt id="exchangelib.folders.ApplicationData"><code class="flex name class">
494 <span>class <span class="ident">ApplicationData</span></span>
495 <span>(</span><span>**kwargs)</span>
496 </code></dt>
497 <dd>
498 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
499 <details class="source">
500 <summary>
501 <span>Expand source code</span>
502 </summary>
503 <pre><code class="python">class ApplicationData(NonDeletableFolderMixin, Folder):
504 CONTAINER_CLASS = &#34;IPM.ApplicationData&#34;</code></pre>
505 </details>
506 <h3>Ancestors</h3>
507 <ul class="hlist">
508 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
509 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
510 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
511 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
512 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
513 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
514 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
515 </ul>
516 <h3>Class variables</h3>
517 <dl>
518 <dt id="exchangelib.folders.ApplicationData.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
434519 <dd>
435520 <div class="desc"></div>
436521 </dd>
13411426 :return:
13421427 &#34;&#34;&#34;
13431428 from .known_folders import (
1429 ApplicationData,
13441430 Calendar,
13451431 Contacts,
13461432 ConversationSettings,
1433 CrawlerData,
1434 DlpPolicyEvaluation,
1435 FreeBusyCache,
13471436 GALContacts,
13481437 Messages,
13491438 RecipientCache,
1439 RecoveryPoints,
13501440 Reminders,
13511441 RSSFeeds,
1442 Signal,
1443 SwssItems,
13521444 Tasks,
13531445 )
13541446
13551447 for folder_cls in (
1448 ApplicationData,
1449 Calendar,
1450 Contacts,
1451 ConversationSettings,
1452 CrawlerData,
1453 DlpPolicyEvaluation,
1454 FreeBusyCache,
1455 GALContacts,
13561456 Messages,
1457 RSSFeeds,
1458 RecipientCache,
1459 RecoveryPoints,
1460 Reminders,
1461 Signal,
1462 SwssItems,
13571463 Tasks,
1358 Calendar,
1359 ConversationSettings,
1360 Contacts,
1361 GALContacts,
1362 Reminders,
1363 RecipientCache,
1364 RSSFeeds,
13651464 ):
13661465 if folder_cls.CONTAINER_CLASS == container_class:
13671466 return folder_cls
15141613 def wipe(self, page_size=None, chunk_size=None, _seen=None, _level=0):
15151614 # Recursively deletes all items in this folder, and all subfolders and their content. Attempts to protect
15161615 # distinguished folders from being deleted. Use with caution!
1616 from .known_folders import Audits
1617
15171618 _seen = _seen or set()
15181619 if self.id in _seen:
15191620 raise RecursionError(f&#34;We already tried to wipe {self}&#34;)
15201621 if _level &gt; 16:
15211622 raise RecursionError(f&#34;Max recursion level reached: {_level}&#34;)
15221623 _seen.add(self.id)
1624 if isinstance(self, Audits):
1625 # Shortcircuit because this folder can have many items that are all non-deletable
1626 log.warning(&#34;Cannot wipe audits folder %s&#34;, self)
1627 return
1628 if self.is_distinguished and &#34;recoverableitems&#34; in self.DISTINGUISHED_FOLDER_ID:
1629 log.warning(&#34;Cannot wipe recoverable items folder %s&#34;, self)
1630 return
15231631 log.warning(&#34;Wiping %s&#34;, self)
15241632 has_distinguished_subfolders = any(f.is_distinguished for f in self.children)
15251633 try:
15271635 self.empty(delete_sub_folders=False)
15281636 else:
15291637 self.empty(delete_sub_folders=True)
1530 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
1638 except ErrorRecoverableItemsAccessDenied:
1639 log.warning(&#34;Access denied to %s. Skipping&#34;, self)
1640 return
1641 except DELETE_FOLDER_ERRORS:
15311642 try:
15321643 if has_distinguished_subfolders:
15331644 raise # We already tried this
15341645 self.empty(delete_sub_folders=False)
1535 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
1646 except DELETE_FOLDER_ERRORS:
15361647 log.warning(&#34;Not allowed to empty %s. Trying to delete items instead&#34;, self)
15371648 kwargs = {}
15381649 if page_size is not None:
15411652 kwargs[&#34;chunk_size&#34;] = chunk_size
15421653 try:
15431654 self.all().delete(**kwargs)
1544 except (ErrorAccessDenied, ErrorCannotDeleteObject, ErrorItemNotFound):
1655 except DELETE_FOLDER_ERRORS:
15451656 log.warning(&#34;Not allowed to delete items in %s&#34;, self)
15461657 _level += 1
15471658 for f in self.children:
19912102 :return:
19922103 &#34;&#34;&#34;
19932104 from .known_folders import (
2105 ApplicationData,
19942106 Calendar,
19952107 Contacts,
19962108 ConversationSettings,
2109 CrawlerData,
2110 DlpPolicyEvaluation,
2111 FreeBusyCache,
19972112 GALContacts,
19982113 Messages,
19992114 RecipientCache,
2115 RecoveryPoints,
20002116 Reminders,
20012117 RSSFeeds,
2118 Signal,
2119 SwssItems,
20022120 Tasks,
20032121 )
20042122
20052123 for folder_cls in (
2124 ApplicationData,
2125 Calendar,
2126 Contacts,
2127 ConversationSettings,
2128 CrawlerData,
2129 DlpPolicyEvaluation,
2130 FreeBusyCache,
2131 GALContacts,
20062132 Messages,
2133 RSSFeeds,
2134 RecipientCache,
2135 RecoveryPoints,
2136 Reminders,
2137 Signal,
2138 SwssItems,
20072139 Tasks,
2008 Calendar,
2009 ConversationSettings,
2010 Contacts,
2011 GALContacts,
2012 Reminders,
2013 RecipientCache,
2014 RSSFeeds,
20152140 ):
20162141 if folder_cls.CONTAINER_CLASS == container_class:
20172142 return folder_cls
30023127 <pre><code class="python">def wipe(self, page_size=None, chunk_size=None, _seen=None, _level=0):
30033128 # Recursively deletes all items in this folder, and all subfolders and their content. Attempts to protect
30043129 # distinguished folders from being deleted. Use with caution!
3130 from .known_folders import Audits
3131
30053132 _seen = _seen or set()
30063133 if self.id in _seen:
30073134 raise RecursionError(f&#34;We already tried to wipe {self}&#34;)
30083135 if _level &gt; 16:
30093136 raise RecursionError(f&#34;Max recursion level reached: {_level}&#34;)
30103137 _seen.add(self.id)
3138 if isinstance(self, Audits):
3139 # Shortcircuit because this folder can have many items that are all non-deletable
3140 log.warning(&#34;Cannot wipe audits folder %s&#34;, self)
3141 return
3142 if self.is_distinguished and &#34;recoverableitems&#34; in self.DISTINGUISHED_FOLDER_ID:
3143 log.warning(&#34;Cannot wipe recoverable items folder %s&#34;, self)
3144 return
30113145 log.warning(&#34;Wiping %s&#34;, self)
30123146 has_distinguished_subfolders = any(f.is_distinguished for f in self.children)
30133147 try:
30153149 self.empty(delete_sub_folders=False)
30163150 else:
30173151 self.empty(delete_sub_folders=True)
3018 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
3152 except ErrorRecoverableItemsAccessDenied:
3153 log.warning(&#34;Access denied to %s. Skipping&#34;, self)
3154 return
3155 except DELETE_FOLDER_ERRORS:
30193156 try:
30203157 if has_distinguished_subfolders:
30213158 raise # We already tried this
30223159 self.empty(delete_sub_folders=False)
3023 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
3160 except DELETE_FOLDER_ERRORS:
30243161 log.warning(&#34;Not allowed to empty %s. Trying to delete items instead&#34;, self)
30253162 kwargs = {}
30263163 if page_size is not None:
30293166 kwargs[&#34;chunk_size&#34;] = chunk_size
30303167 try:
30313168 self.all().delete(**kwargs)
3032 except (ErrorAccessDenied, ErrorCannotDeleteObject, ErrorItemNotFound):
3169 except DELETE_FOLDER_ERRORS:
30333170 log.warning(&#34;Not allowed to delete items in %s&#34;, self)
30343171 _level += 1
30353172 for f in self.children:
30683205 </li>
30693206 </ul>
30703207 </dd>
3071 <dt id="exchangelib.folders.Calendar"><code class="flex name class">
3072 <span>class <span class="ident">Calendar</span></span>
3208 <dt id="exchangelib.folders.Birthdays"><code class="flex name class">
3209 <span>class <span class="ident">Birthdays</span></span>
30733210 <span>(</span><span>**kwargs)</span>
30743211 </code></dt>
30753212 <dd>
3076 <div class="desc"><p>An interface for the Exchange calendar.</p></div>
3077 <details class="source">
3078 <summary>
3079 <span>Expand source code</span>
3080 </summary>
3081 <pre><code class="python">class Calendar(Folder):
3082 &#34;&#34;&#34;An interface for the Exchange calendar.&#34;&#34;&#34;
3083
3084 DISTINGUISHED_FOLDER_ID = &#34;calendar&#34;
3085 CONTAINER_CLASS = &#34;IPF.Appointment&#34;
3086 supported_item_models = (CalendarItem,)
3087
3213 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
3214 <details class="source">
3215 <summary>
3216 <span>Expand source code</span>
3217 </summary>
3218 <pre><code class="python">class Birthdays(Folder):
3219 CONTAINER_CLASS = &#34;IPF.Appointment.Birthday&#34;
30883220 LOCALIZED_NAMES = {
3089 &#34;da_DK&#34;: (&#34;Kalender&#34;,),
3090 &#34;de_DE&#34;: (&#34;Kalender&#34;,),
3091 &#34;en_US&#34;: (&#34;Calendar&#34;,),
3092 &#34;es_ES&#34;: (&#34;Calendario&#34;,),
3093 &#34;fr_CA&#34;: (&#34;Calendrier&#34;,),
3094 &#34;nl_NL&#34;: (&#34;Agenda&#34;,),
3095 &#34;ru_RU&#34;: (&#34;Календарь&#34;,),
3096 &#34;sv_SE&#34;: (&#34;Kalender&#34;,),
3097 &#34;zh_CN&#34;: (&#34;日历&#34;,),
3098 }
3099
3100 def view(self, *args, **kwargs):
3101 return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)</code></pre>
3221 None: (&#34;Birthdays&#34;,),
3222 &#34;da_DK&#34;: (&#34;Fødselsdage&#34;,),
3223 }</code></pre>
31023224 </details>
31033225 <h3>Ancestors</h3>
31043226 <ul class="hlist">
31113233 </ul>
31123234 <h3>Class variables</h3>
31133235 <dl>
3114 <dt id="exchangelib.folders.Calendar.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
3115 <dd>
3116 <div class="desc"></div>
3117 </dd>
3118 <dt id="exchangelib.folders.Calendar.DISTINGUISHED_FOLDER_ID"><code class="name">var <span class="ident">DISTINGUISHED_FOLDER_ID</span></code></dt>
3119 <dd>
3120 <div class="desc"></div>
3121 </dd>
3122 <dt id="exchangelib.folders.Calendar.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3123 <dd>
3124 <div class="desc"></div>
3125 </dd>
3126 <dt id="exchangelib.folders.Calendar.supported_item_models"><code class="name">var <span class="ident">supported_item_models</span></code></dt>
3127 <dd>
3128 <div class="desc"></div>
3129 </dd>
3130 </dl>
3131 <h3>Methods</h3>
3132 <dl>
3133 <dt id="exchangelib.folders.Calendar.view"><code class="name flex">
3134 <span>def <span class="ident">view</span></span>(<span>self, *args, **kwargs)</span>
3135 </code></dt>
3136 <dd>
3137 <div class="desc"></div>
3138 <details class="source">
3139 <summary>
3140 <span>Expand source code</span>
3141 </summary>
3142 <pre><code class="python">def view(self, *args, **kwargs):
3143 return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)</code></pre>
3144 </details>
3236 <dt id="exchangelib.folders.Birthdays.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
3237 <dd>
3238 <div class="desc"></div>
3239 </dd>
3240 <dt id="exchangelib.folders.Birthdays.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3241 <dd>
3242 <div class="desc"></div>
31453243 </dd>
31463244 </dl>
31473245 <h3>Inherited members</h3>
31833281 </li>
31843282 </ul>
31853283 </dd>
3186 <dt id="exchangelib.folders.CalendarLogging"><code class="flex name class">
3187 <span>class <span class="ident">CalendarLogging</span></span>
3284 <dt id="exchangelib.folders.Calendar"><code class="flex name class">
3285 <span>class <span class="ident">Calendar</span></span>
31883286 <span>(</span><span>**kwargs)</span>
31893287 </code></dt>
31903288 <dd>
3191 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
3192 <details class="source">
3193 <summary>
3194 <span>Expand source code</span>
3195 </summary>
3196 <pre><code class="python">class CalendarLogging(NonDeletableFolderMixin, Folder):
3289 <div class="desc"><p>An interface for the Exchange calendar.</p></div>
3290 <details class="source">
3291 <summary>
3292 <span>Expand source code</span>
3293 </summary>
3294 <pre><code class="python">class Calendar(Folder):
3295 &#34;&#34;&#34;An interface for the Exchange calendar.&#34;&#34;&#34;
3296
3297 DISTINGUISHED_FOLDER_ID = &#34;calendar&#34;
3298 CONTAINER_CLASS = &#34;IPF.Appointment&#34;
3299 supported_item_models = (CalendarItem,)
3300
31973301 LOCALIZED_NAMES = {
3198 None: (&#34;Calendar Logging&#34;,),
3199 }</code></pre>
3302 &#34;da_DK&#34;: (&#34;Kalender&#34;,),
3303 &#34;de_DE&#34;: (&#34;Kalender&#34;,),
3304 &#34;en_US&#34;: (&#34;Calendar&#34;,),
3305 &#34;es_ES&#34;: (&#34;Calendario&#34;,),
3306 &#34;fr_CA&#34;: (&#34;Calendrier&#34;,),
3307 &#34;nl_NL&#34;: (&#34;Agenda&#34;,),
3308 &#34;ru_RU&#34;: (&#34;Календарь&#34;,),
3309 &#34;sv_SE&#34;: (&#34;Kalender&#34;,),
3310 &#34;zh_CN&#34;: (&#34;日历&#34;,),
3311 }
3312
3313 def view(self, *args, **kwargs):
3314 return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)</code></pre>
32003315 </details>
32013316 <h3>Ancestors</h3>
32023317 <ul class="hlist">
3203 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
32043318 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
32053319 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
32063320 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
32103324 </ul>
32113325 <h3>Class variables</h3>
32123326 <dl>
3213 <dt id="exchangelib.folders.CalendarLogging.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3214 <dd>
3215 <div class="desc"></div>
3327 <dt id="exchangelib.folders.Calendar.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
3328 <dd>
3329 <div class="desc"></div>
3330 </dd>
3331 <dt id="exchangelib.folders.Calendar.DISTINGUISHED_FOLDER_ID"><code class="name">var <span class="ident">DISTINGUISHED_FOLDER_ID</span></code></dt>
3332 <dd>
3333 <div class="desc"></div>
3334 </dd>
3335 <dt id="exchangelib.folders.Calendar.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3336 <dd>
3337 <div class="desc"></div>
3338 </dd>
3339 <dt id="exchangelib.folders.Calendar.supported_item_models"><code class="name">var <span class="ident">supported_item_models</span></code></dt>
3340 <dd>
3341 <div class="desc"></div>
3342 </dd>
3343 </dl>
3344 <h3>Methods</h3>
3345 <dl>
3346 <dt id="exchangelib.folders.Calendar.view"><code class="name flex">
3347 <span>def <span class="ident">view</span></span>(<span>self, *args, **kwargs)</span>
3348 </code></dt>
3349 <dd>
3350 <div class="desc"></div>
3351 <details class="source">
3352 <summary>
3353 <span>Expand source code</span>
3354 </summary>
3355 <pre><code class="python">def view(self, *args, **kwargs):
3356 return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)</code></pre>
3357 </details>
32163358 </dd>
32173359 </dl>
32183360 <h3>Inherited members</h3>
32543396 </li>
32553397 </ul>
32563398 </dd>
3257 <dt id="exchangelib.folders.CommonViews"><code class="flex name class">
3258 <span>class <span class="ident">CommonViews</span></span>
3399 <dt id="exchangelib.folders.CalendarLogging"><code class="flex name class">
3400 <span>class <span class="ident">CalendarLogging</span></span>
32593401 <span>(</span><span>**kwargs)</span>
32603402 </code></dt>
32613403 <dd>
32643406 <summary>
32653407 <span>Expand source code</span>
32663408 </summary>
3267 <pre><code class="python">class CommonViews(NonDeletableFolderMixin, Folder):
3268 DEFAULT_ITEM_TRAVERSAL_DEPTH = ASSOCIATED
3409 <pre><code class="python">class CalendarLogging(NonDeletableFolderMixin, Folder):
32693410 LOCALIZED_NAMES = {
3270 None: (&#34;Common Views&#34;,),
3411 None: (&#34;Calendar Logging&#34;,),
32713412 }</code></pre>
32723413 </details>
32733414 <h3>Ancestors</h3>
32823423 </ul>
32833424 <h3>Class variables</h3>
32843425 <dl>
3285 <dt id="exchangelib.folders.CommonViews.DEFAULT_ITEM_TRAVERSAL_DEPTH"><code class="name">var <span class="ident">DEFAULT_ITEM_TRAVERSAL_DEPTH</span></code></dt>
3286 <dd>
3287 <div class="desc"></div>
3288 </dd>
3289 <dt id="exchangelib.folders.CommonViews.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3426 <dt id="exchangelib.folders.CalendarLogging.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
32903427 <dd>
32913428 <div class="desc"></div>
32923429 </dd>
33303467 </li>
33313468 </ul>
33323469 </dd>
3470 <dt id="exchangelib.folders.CommonViews"><code class="flex name class">
3471 <span>class <span class="ident">CommonViews</span></span>
3472 <span>(</span><span>**kwargs)</span>
3473 </code></dt>
3474 <dd>
3475 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
3476 <details class="source">
3477 <summary>
3478 <span>Expand source code</span>
3479 </summary>
3480 <pre><code class="python">class CommonViews(NonDeletableFolderMixin, Folder):
3481 DEFAULT_ITEM_TRAVERSAL_DEPTH = ASSOCIATED
3482 LOCALIZED_NAMES = {
3483 None: (&#34;Common Views&#34;,),
3484 }</code></pre>
3485 </details>
3486 <h3>Ancestors</h3>
3487 <ul class="hlist">
3488 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
3489 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
3490 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
3491 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
3492 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
3493 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
3494 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
3495 </ul>
3496 <h3>Class variables</h3>
3497 <dl>
3498 <dt id="exchangelib.folders.CommonViews.DEFAULT_ITEM_TRAVERSAL_DEPTH"><code class="name">var <span class="ident">DEFAULT_ITEM_TRAVERSAL_DEPTH</span></code></dt>
3499 <dd>
3500 <div class="desc"></div>
3501 </dd>
3502 <dt id="exchangelib.folders.CommonViews.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3503 <dd>
3504 <div class="desc"></div>
3505 </dd>
3506 </dl>
3507 <h3>Inherited members</h3>
3508 <ul class="hlist">
3509 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
3510 <ul class="hlist">
3511 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
3512 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
3513 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
3514 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
3515 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
3516 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
3517 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
3518 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
3519 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
3520 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
3521 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
3522 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
3523 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
3524 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
3525 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
3526 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
3527 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
3528 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
3529 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
3530 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
3531 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
3532 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
3533 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
3534 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
3535 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
3536 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
3537 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
3538 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
3539 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
3540 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
3541 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
3542 </ul>
3543 </li>
3544 </ul>
3545 </dd>
33333546 <dt id="exchangelib.folders.Companies"><code class="flex name class">
33343547 <span>class <span class="ident">Companies</span></span>
33353548 <span>(</span><span>**kwargs)</span>
33453558 CONTAINTER_CLASS = &#34;IPF.Contact.Company&#34;
33463559 LOCALIZED_NAMES = {
33473560 None: (&#34;Companies&#34;,),
3561 &#34;da_DK&#34;: (&#34;Firmaer&#34;,),
33483562 }</code></pre>
33493563 </details>
33503564 <h3>Ancestors</h3>
37413955 </li>
37423956 </ul>
37433957 </dd>
3744 <dt id="exchangelib.folders.DefaultFoldersChangeHistory"><code class="flex name class">
3745 <span>class <span class="ident">DefaultFoldersChangeHistory</span></span>
3958 <dt id="exchangelib.folders.CrawlerData"><code class="flex name class">
3959 <span>class <span class="ident">CrawlerData</span></span>
37463960 <span>(</span><span>**kwargs)</span>
37473961 </code></dt>
37483962 <dd>
3749 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
3750 <details class="source">
3751 <summary>
3752 <span>Expand source code</span>
3753 </summary>
3754 <pre><code class="python">class DefaultFoldersChangeHistory(NonDeletableFolderMixin, Folder):
3755 CONTAINER_CLASS = &#34;IPM.DefaultFolderHistoryItem&#34;
3756 LOCALIZED_NAMES = {
3757 None: (&#34;DefaultFoldersChangeHistory&#34;,),
3758 }</code></pre>
3963 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
3964 <details class="source">
3965 <summary>
3966 <span>Expand source code</span>
3967 </summary>
3968 <pre><code class="python">class CrawlerData(Folder):
3969 CONTAINER_CLASS = &#34;IPF.StoreItem.CrawlerData&#34;</code></pre>
37593970 </details>
37603971 <h3>Ancestors</h3>
37613972 <ul class="hlist">
3762 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
37633973 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
37643974 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
37653975 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
37693979 </ul>
37703980 <h3>Class variables</h3>
37713981 <dl>
3772 <dt id="exchangelib.folders.DefaultFoldersChangeHistory.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
3773 <dd>
3774 <div class="desc"></div>
3775 </dd>
3776 <dt id="exchangelib.folders.DefaultFoldersChangeHistory.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3982 <dt id="exchangelib.folders.CrawlerData.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
37773983 <dd>
37783984 <div class="desc"></div>
37793985 </dd>
38174023 </li>
38184024 </ul>
38194025 </dd>
3820 <dt id="exchangelib.folders.DeferredAction"><code class="flex name class">
3821 <span>class <span class="ident">DeferredAction</span></span>
4026 <dt id="exchangelib.folders.DefaultFoldersChangeHistory"><code class="flex name class">
4027 <span>class <span class="ident">DefaultFoldersChangeHistory</span></span>
38224028 <span>(</span><span>**kwargs)</span>
38234029 </code></dt>
38244030 <dd>
38274033 <summary>
38284034 <span>Expand source code</span>
38294035 </summary>
3830 <pre><code class="python">class DeferredAction(NonDeletableFolderMixin, Folder):
4036 <pre><code class="python">class DefaultFoldersChangeHistory(NonDeletableFolderMixin, Folder):
4037 CONTAINER_CLASS = &#34;IPM.DefaultFolderHistoryItem&#34;
38314038 LOCALIZED_NAMES = {
3832 None: (&#34;Deferred Action&#34;,),
4039 None: (&#34;DefaultFoldersChangeHistory&#34;,),
38334040 }</code></pre>
38344041 </details>
38354042 <h3>Ancestors</h3>
38444051 </ul>
38454052 <h3>Class variables</h3>
38464053 <dl>
3847 <dt id="exchangelib.folders.DeferredAction.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
4054 <dt id="exchangelib.folders.DefaultFoldersChangeHistory.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
4055 <dd>
4056 <div class="desc"></div>
4057 </dd>
4058 <dt id="exchangelib.folders.DefaultFoldersChangeHistory.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
38484059 <dd>
38494060 <div class="desc"></div>
38504061 </dd>
38884099 </li>
38894100 </ul>
38904101 </dd>
3891 <dt id="exchangelib.folders.DeletedItems"><code class="flex name class">
3892 <span>class <span class="ident">DeletedItems</span></span>
4102 <dt id="exchangelib.folders.DeferredAction"><code class="flex name class">
4103 <span>class <span class="ident">DeferredAction</span></span>
38934104 <span>(</span><span>**kwargs)</span>
38944105 </code></dt>
38954106 <dd>
3896 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
3897 <details class="source">
3898 <summary>
3899 <span>Expand source code</span>
3900 </summary>
3901 <pre><code class="python">class DeletedItems(Folder):
3902 DISTINGUISHED_FOLDER_ID = &#34;deleteditems&#34;
3903 CONTAINER_CLASS = &#34;IPF.Note&#34;
3904 supported_item_models = ITEM_CLASSES
3905
4107 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
4108 <details class="source">
4109 <summary>
4110 <span>Expand source code</span>
4111 </summary>
4112 <pre><code class="python">class DeferredAction(NonDeletableFolderMixin, Folder):
39064113 LOCALIZED_NAMES = {
3907 &#34;da_DK&#34;: (&#34;Slettet post&#34;,),
3908 &#34;de_DE&#34;: (&#34;Gelöschte Elemente&#34;,),
3909 &#34;en_US&#34;: (&#34;Deleted Items&#34;,),
3910 &#34;es_ES&#34;: (&#34;Elementos eliminados&#34;,),
3911 &#34;fr_CA&#34;: (&#34;Éléments supprimés&#34;,),
3912 &#34;nl_NL&#34;: (&#34;Verwijderde items&#34;,),
3913 &#34;ru_RU&#34;: (&#34;Удаленные&#34;,),
3914 &#34;sv_SE&#34;: (&#34;Borttaget&#34;,),
3915 &#34;zh_CN&#34;: (&#34;已删除邮件&#34;,),
4114 None: (&#34;Deferred Action&#34;,),
39164115 }</code></pre>
39174116 </details>
39184117 <h3>Ancestors</h3>
39194118 <ul class="hlist">
4119 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
39204120 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
39214121 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
39224122 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
39264126 </ul>
39274127 <h3>Class variables</h3>
39284128 <dl>
3929 <dt id="exchangelib.folders.DeletedItems.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
3930 <dd>
3931 <div class="desc"></div>
3932 </dd>
3933 <dt id="exchangelib.folders.DeletedItems.DISTINGUISHED_FOLDER_ID"><code class="name">var <span class="ident">DISTINGUISHED_FOLDER_ID</span></code></dt>
3934 <dd>
3935 <div class="desc"></div>
3936 </dd>
3937 <dt id="exchangelib.folders.DeletedItems.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3938 <dd>
3939 <div class="desc"></div>
3940 </dd>
3941 <dt id="exchangelib.folders.DeletedItems.supported_item_models"><code class="name">var <span class="ident">supported_item_models</span></code></dt>
4129 <dt id="exchangelib.folders.DeferredAction.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
39424130 <dd>
39434131 <div class="desc"></div>
39444132 </dd>
39824170 </li>
39834171 </ul>
39844172 </dd>
4173 <dt id="exchangelib.folders.DeletedItems"><code class="flex name class">
4174 <span>class <span class="ident">DeletedItems</span></span>
4175 <span>(</span><span>**kwargs)</span>
4176 </code></dt>
4177 <dd>
4178 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
4179 <details class="source">
4180 <summary>
4181 <span>Expand source code</span>
4182 </summary>
4183 <pre><code class="python">class DeletedItems(Folder):
4184 DISTINGUISHED_FOLDER_ID = &#34;deleteditems&#34;
4185 CONTAINER_CLASS = &#34;IPF.Note&#34;
4186 supported_item_models = ITEM_CLASSES
4187
4188 LOCALIZED_NAMES = {
4189 &#34;da_DK&#34;: (&#34;Slettet post&#34;,),
4190 &#34;de_DE&#34;: (&#34;Gelöschte Elemente&#34;,),
4191 &#34;en_US&#34;: (&#34;Deleted Items&#34;,),
4192 &#34;es_ES&#34;: (&#34;Elementos eliminados&#34;,),
4193 &#34;fr_CA&#34;: (&#34;Éléments supprimés&#34;,),
4194 &#34;nl_NL&#34;: (&#34;Verwijderde items&#34;,),
4195 &#34;ru_RU&#34;: (&#34;Удаленные&#34;,),
4196 &#34;sv_SE&#34;: (&#34;Borttaget&#34;,),
4197 &#34;zh_CN&#34;: (&#34;已删除邮件&#34;,),
4198 }</code></pre>
4199 </details>
4200 <h3>Ancestors</h3>
4201 <ul class="hlist">
4202 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
4203 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
4204 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
4205 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
4206 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
4207 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
4208 </ul>
4209 <h3>Class variables</h3>
4210 <dl>
4211 <dt id="exchangelib.folders.DeletedItems.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
4212 <dd>
4213 <div class="desc"></div>
4214 </dd>
4215 <dt id="exchangelib.folders.DeletedItems.DISTINGUISHED_FOLDER_ID"><code class="name">var <span class="ident">DISTINGUISHED_FOLDER_ID</span></code></dt>
4216 <dd>
4217 <div class="desc"></div>
4218 </dd>
4219 <dt id="exchangelib.folders.DeletedItems.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
4220 <dd>
4221 <div class="desc"></div>
4222 </dd>
4223 <dt id="exchangelib.folders.DeletedItems.supported_item_models"><code class="name">var <span class="ident">supported_item_models</span></code></dt>
4224 <dd>
4225 <div class="desc"></div>
4226 </dd>
4227 </dl>
4228 <h3>Inherited members</h3>
4229 <ul class="hlist">
4230 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
4231 <ul class="hlist">
4232 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
4233 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
4234 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
4235 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
4236 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
4237 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
4238 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
4239 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
4240 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
4241 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
4242 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
4243 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
4244 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
4245 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
4246 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
4247 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
4248 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
4249 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
4250 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
4251 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
4252 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
4253 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
4254 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
4255 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
4256 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
4257 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
4258 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
4259 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
4260 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
4261 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
4262 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
4263 </ul>
4264 </li>
4265 </ul>
4266 </dd>
39854267 <dt id="exchangelib.folders.Directory"><code class="flex name class">
39864268 <span>class <span class="ident">Directory</span></span>
39874269 <span>(</span><span>**kwargs)</span>
41354417 <li><code><a title="exchangelib.properties.FolderId.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
41364418 <li><code><a title="exchangelib.properties.FolderId.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
41374419 <li><code><a title="exchangelib.properties.FolderId.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
4420 </ul>
4421 </li>
4422 </ul>
4423 </dd>
4424 <dt id="exchangelib.folders.DlpPolicyEvaluation"><code class="flex name class">
4425 <span>class <span class="ident">DlpPolicyEvaluation</span></span>
4426 <span>(</span><span>**kwargs)</span>
4427 </code></dt>
4428 <dd>
4429 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
4430 <details class="source">
4431 <summary>
4432 <span>Expand source code</span>
4433 </summary>
4434 <pre><code class="python">class DlpPolicyEvaluation(Folder):
4435 CONTAINER_CLASS = &#34;IPF.StoreItem.DlpPolicyEvaluation&#34;</code></pre>
4436 </details>
4437 <h3>Ancestors</h3>
4438 <ul class="hlist">
4439 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
4440 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
4441 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
4442 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
4443 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
4444 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
4445 </ul>
4446 <h3>Class variables</h3>
4447 <dl>
4448 <dt id="exchangelib.folders.DlpPolicyEvaluation.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
4449 <dd>
4450 <div class="desc"></div>
4451 </dd>
4452 </dl>
4453 <h3>Inherited members</h3>
4454 <ul class="hlist">
4455 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
4456 <ul class="hlist">
4457 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
4458 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
4459 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
4460 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
4461 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
4462 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
4463 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
4464 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
4465 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
4466 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
4467 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
4468 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
4469 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
4470 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
4471 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
4472 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
4473 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
4474 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
4475 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
4476 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
4477 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
4478 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
4479 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
4480 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
4481 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
4482 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
4483 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
4484 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
4485 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
4486 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
4487 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
41384488 </ul>
41394489 </li>
41404490 </ul>
46024952 <h3>Subclasses</h3>
46034953 <ul class="hlist">
46044954 <li><a title="exchangelib.folders.known_folders.AllItems" href="known_folders.html#exchangelib.folders.known_folders.AllItems">AllItems</a></li>
4955 <li><a title="exchangelib.folders.known_folders.ApplicationData" href="known_folders.html#exchangelib.folders.known_folders.ApplicationData">ApplicationData</a></li>
46054956 <li><a title="exchangelib.folders.known_folders.Audits" href="known_folders.html#exchangelib.folders.known_folders.Audits">Audits</a></li>
4957 <li><a title="exchangelib.folders.known_folders.Birthdays" href="known_folders.html#exchangelib.folders.known_folders.Birthdays">Birthdays</a></li>
46064958 <li><a title="exchangelib.folders.known_folders.Calendar" href="known_folders.html#exchangelib.folders.known_folders.Calendar">Calendar</a></li>
46074959 <li><a title="exchangelib.folders.known_folders.CalendarLogging" href="known_folders.html#exchangelib.folders.known_folders.CalendarLogging">CalendarLogging</a></li>
46084960 <li><a title="exchangelib.folders.known_folders.CommonViews" href="known_folders.html#exchangelib.folders.known_folders.CommonViews">CommonViews</a></li>
46094961 <li><a title="exchangelib.folders.known_folders.Contacts" href="known_folders.html#exchangelib.folders.known_folders.Contacts">Contacts</a></li>
46104962 <li><a title="exchangelib.folders.known_folders.ConversationSettings" href="known_folders.html#exchangelib.folders.known_folders.ConversationSettings">ConversationSettings</a></li>
4963 <li><a title="exchangelib.folders.known_folders.CrawlerData" href="known_folders.html#exchangelib.folders.known_folders.CrawlerData">CrawlerData</a></li>
46114964 <li><a title="exchangelib.folders.known_folders.DefaultFoldersChangeHistory" href="known_folders.html#exchangelib.folders.known_folders.DefaultFoldersChangeHistory">DefaultFoldersChangeHistory</a></li>
46124965 <li><a title="exchangelib.folders.known_folders.DeferredAction" href="known_folders.html#exchangelib.folders.known_folders.DeferredAction">DeferredAction</a></li>
46134966 <li><a title="exchangelib.folders.known_folders.DeletedItems" href="known_folders.html#exchangelib.folders.known_folders.DeletedItems">DeletedItems</a></li>
4967 <li><a title="exchangelib.folders.known_folders.DlpPolicyEvaluation" href="known_folders.html#exchangelib.folders.known_folders.DlpPolicyEvaluation">DlpPolicyEvaluation</a></li>
46144968 <li><a title="exchangelib.folders.known_folders.ExchangeSyncData" href="known_folders.html#exchangelib.folders.known_folders.ExchangeSyncData">ExchangeSyncData</a></li>
46154969 <li><a title="exchangelib.folders.known_folders.Files" href="known_folders.html#exchangelib.folders.known_folders.Files">Files</a></li>
4970 <li><a title="exchangelib.folders.known_folders.FreeBusyCache" href="known_folders.html#exchangelib.folders.known_folders.FreeBusyCache">FreeBusyCache</a></li>
46164971 <li><a title="exchangelib.folders.known_folders.FreebusyData" href="known_folders.html#exchangelib.folders.known_folders.FreebusyData">FreebusyData</a></li>
46174972 <li><a title="exchangelib.folders.known_folders.GraphAnalytics" href="known_folders.html#exchangelib.folders.known_folders.GraphAnalytics">GraphAnalytics</a></li>
46184973 <li><a title="exchangelib.folders.known_folders.Location" href="known_folders.html#exchangelib.folders.known_folders.Location">Location</a></li>
46224977 <li><a title="exchangelib.folders.known_folders.PassThroughSearchResults" href="known_folders.html#exchangelib.folders.known_folders.PassThroughSearchResults">PassThroughSearchResults</a></li>
46234978 <li><a title="exchangelib.folders.known_folders.PdpProfileV2Secured" href="known_folders.html#exchangelib.folders.known_folders.PdpProfileV2Secured">PdpProfileV2Secured</a></li>
46244979 <li><a title="exchangelib.folders.known_folders.RSSFeeds" href="known_folders.html#exchangelib.folders.known_folders.RSSFeeds">RSSFeeds</a></li>
4980 <li><a title="exchangelib.folders.known_folders.RecoveryPoints" href="known_folders.html#exchangelib.folders.known_folders.RecoveryPoints">RecoveryPoints</a></li>
46254981 <li><a title="exchangelib.folders.known_folders.Reminders" href="known_folders.html#exchangelib.folders.known_folders.Reminders">Reminders</a></li>
46264982 <li><a title="exchangelib.folders.known_folders.Schedule" href="known_folders.html#exchangelib.folders.known_folders.Schedule">Schedule</a></li>
46274983 <li><a title="exchangelib.folders.known_folders.Sharing" href="known_folders.html#exchangelib.folders.known_folders.Sharing">Sharing</a></li>
46284984 <li><a title="exchangelib.folders.known_folders.Shortcuts" href="known_folders.html#exchangelib.folders.known_folders.Shortcuts">Shortcuts</a></li>
46294985 <li><a title="exchangelib.folders.known_folders.Signal" href="known_folders.html#exchangelib.folders.known_folders.Signal">Signal</a></li>
4986 <li><a title="exchangelib.folders.known_folders.SkypeTeamsMessages" href="known_folders.html#exchangelib.folders.known_folders.SkypeTeamsMessages">SkypeTeamsMessages</a></li>
46304987 <li><a title="exchangelib.folders.known_folders.SmsAndChatsSync" href="known_folders.html#exchangelib.folders.known_folders.SmsAndChatsSync">SmsAndChatsSync</a></li>
46314988 <li><a title="exchangelib.folders.known_folders.SpoolerQueue" href="known_folders.html#exchangelib.folders.known_folders.SpoolerQueue">SpoolerQueue</a></li>
4989 <li><a title="exchangelib.folders.known_folders.SwssItems" href="known_folders.html#exchangelib.folders.known_folders.SwssItems">SwssItems</a></li>
46324990 <li><a title="exchangelib.folders.known_folders.System" href="known_folders.html#exchangelib.folders.known_folders.System">System</a></li>
46334991 <li><a title="exchangelib.folders.known_folders.System1" href="known_folders.html#exchangelib.folders.known_folders.System1">System1</a></li>
46344992 <li><a title="exchangelib.folders.known_folders.Tasks" href="known_folders.html#exchangelib.folders.known_folders.Tasks">Tasks</a></li>
60606418 <h3>Subclasses</h3>
60616419 <ul class="hlist">
60626420 <li><a title="exchangelib.properties.DistinguishedFolderId" href="../properties.html#exchangelib.properties.DistinguishedFolderId">DistinguishedFolderId</a></li>
6421 <li><a title="exchangelib.properties.OldFolderId" href="../properties.html#exchangelib.properties.OldFolderId">OldFolderId</a></li>
60636422 </ul>
60646423 <h3>Class variables</h3>
60656424 <dl>
63536712 </dd>
63546713 </dl>
63556714 </dd>
6356 <dt id="exchangelib.folders.FreebusyData"><code class="flex name class">
6357 <span>class <span class="ident">FreebusyData</span></span>
6715 <dt id="exchangelib.folders.FreeBusyCache"><code class="flex name class">
6716 <span>class <span class="ident">FreeBusyCache</span></span>
63586717 <span>(</span><span>**kwargs)</span>
63596718 </code></dt>
63606719 <dd>
6361 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
6362 <details class="source">
6363 <summary>
6364 <span>Expand source code</span>
6365 </summary>
6366 <pre><code class="python">class FreebusyData(NonDeletableFolderMixin, Folder):
6367 LOCALIZED_NAMES = {
6368 None: (&#34;Freebusy Data&#34;,),
6369 }</code></pre>
6720 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
6721 <details class="source">
6722 <summary>
6723 <span>Expand source code</span>
6724 </summary>
6725 <pre><code class="python">class FreeBusyCache(Folder):
6726 CONTAINER_CLASS = &#34;IPF.StoreItem.FreeBusyCache&#34;</code></pre>
63706727 </details>
63716728 <h3>Ancestors</h3>
63726729 <ul class="hlist">
6373 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
63746730 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
63756731 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
63766732 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
63806736 </ul>
63816737 <h3>Class variables</h3>
63826738 <dl>
6383 <dt id="exchangelib.folders.FreebusyData.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
6739 <dt id="exchangelib.folders.FreeBusyCache.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
63846740 <dd>
63856741 <div class="desc"></div>
63866742 </dd>
64246780 </li>
64256781 </ul>
64266782 </dd>
6783 <dt id="exchangelib.folders.FreebusyData"><code class="flex name class">
6784 <span>class <span class="ident">FreebusyData</span></span>
6785 <span>(</span><span>**kwargs)</span>
6786 </code></dt>
6787 <dd>
6788 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
6789 <details class="source">
6790 <summary>
6791 <span>Expand source code</span>
6792 </summary>
6793 <pre><code class="python">class FreebusyData(NonDeletableFolderMixin, Folder):
6794 LOCALIZED_NAMES = {
6795 None: (&#34;Freebusy Data&#34;,),
6796 }</code></pre>
6797 </details>
6798 <h3>Ancestors</h3>
6799 <ul class="hlist">
6800 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
6801 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
6802 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
6803 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
6804 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
6805 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
6806 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
6807 </ul>
6808 <h3>Class variables</h3>
6809 <dl>
6810 <dt id="exchangelib.folders.FreebusyData.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
6811 <dd>
6812 <div class="desc"></div>
6813 </dd>
6814 </dl>
6815 <h3>Inherited members</h3>
6816 <ul class="hlist">
6817 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
6818 <ul class="hlist">
6819 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
6820 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
6821 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
6822 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
6823 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
6824 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
6825 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
6826 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
6827 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
6828 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
6829 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
6830 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
6831 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
6832 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
6833 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
6834 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
6835 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
6836 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
6837 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
6838 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
6839 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
6840 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
6841 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
6842 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
6843 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
6844 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
6845 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
6846 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
6847 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
6848 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
6849 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
6850 </ul>
6851 </li>
6852 </ul>
6853 </dd>
64276854 <dt id="exchangelib.folders.Friends"><code class="flex name class">
64286855 <span>class <span class="ident">Friends</span></span>
64296856 <span>(</span><span>**kwargs)</span>
72967723
72977724 DISTINGUISHED_FOLDER_ID = &#34;msgfolderroot&#34;
72987725 LOCALIZED_NAMES = {
7726 None: (&#34;Top of Information Store&#34;,),
7727 &#34;da_DK&#34;: (&#34;Informationslagerets øverste niveau&#34;,),
72997728 &#34;zh_CN&#34;: (&#34;信息存储顶部&#34;,),
73007729 }</code></pre>
73017730 </details>
75357964 <ul class="hlist">
75367965 <li><a title="exchangelib.folders.known_folders.AllContacts" href="known_folders.html#exchangelib.folders.known_folders.AllContacts">AllContacts</a></li>
75377966 <li><a title="exchangelib.folders.known_folders.AllItems" href="known_folders.html#exchangelib.folders.known_folders.AllItems">AllItems</a></li>
7967 <li><a title="exchangelib.folders.known_folders.ApplicationData" href="known_folders.html#exchangelib.folders.known_folders.ApplicationData">ApplicationData</a></li>
75387968 <li><a title="exchangelib.folders.known_folders.Audits" href="known_folders.html#exchangelib.folders.known_folders.Audits">Audits</a></li>
75397969 <li><a title="exchangelib.folders.known_folders.CalendarLogging" href="known_folders.html#exchangelib.folders.known_folders.CalendarLogging">CalendarLogging</a></li>
75407970 <li><a title="exchangelib.folders.known_folders.CommonViews" href="known_folders.html#exchangelib.folders.known_folders.CommonViews">CommonViews</a></li>
77678197 &#34;de_DE&#34;: (&#34;Postausgang&#34;,),
77688198 &#34;en_US&#34;: (&#34;Outbox&#34;,),
77698199 &#34;es_ES&#34;: (&#34;Bandeja de salida&#34;,),
7770 &#34;fr_CA&#34;: (u&#34;Boîte d&#39;envoi&#34;,),
8200 &#34;fr_CA&#34;: (&#34;Boîte d&#39;envoi&#34;,),
77718201 &#34;nl_NL&#34;: (&#34;Postvak UIT&#34;,),
77728202 &#34;ru_RU&#34;: (&#34;Исходящие&#34;,),
77738203 &#34;sv_SE&#34;: (&#34;Utkorgen&#34;,),
89239353 <li><code><a title="exchangelib.folders.known_folders.WellknownFolder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
89249354 <li><code><a title="exchangelib.folders.known_folders.WellknownFolder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
89259355 <li><code><a title="exchangelib.folders.known_folders.WellknownFolder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
9356 </ul>
9357 </li>
9358 </ul>
9359 </dd>
9360 <dt id="exchangelib.folders.RecoveryPoints"><code class="flex name class">
9361 <span>class <span class="ident">RecoveryPoints</span></span>
9362 <span>(</span><span>**kwargs)</span>
9363 </code></dt>
9364 <dd>
9365 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
9366 <details class="source">
9367 <summary>
9368 <span>Expand source code</span>
9369 </summary>
9370 <pre><code class="python">class RecoveryPoints(Folder):
9371 CONTAINER_CLASS = &#34;IPF.StoreItem.RecoveryPoints&#34;</code></pre>
9372 </details>
9373 <h3>Ancestors</h3>
9374 <ul class="hlist">
9375 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
9376 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
9377 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
9378 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
9379 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
9380 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
9381 </ul>
9382 <h3>Class variables</h3>
9383 <dl>
9384 <dt id="exchangelib.folders.RecoveryPoints.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
9385 <dd>
9386 <div class="desc"></div>
9387 </dd>
9388 </dl>
9389 <h3>Inherited members</h3>
9390 <ul class="hlist">
9391 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
9392 <ul class="hlist">
9393 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
9394 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
9395 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
9396 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
9397 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
9398 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
9399 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
9400 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
9401 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
9402 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
9403 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
9404 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
9405 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
9406 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
9407 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
9408 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
9409 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
9410 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
9411 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
9412 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
9413 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
9414 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
9415 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
9416 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
9417 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
9418 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
9419 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
9420 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
9421 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
9422 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
9423 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
89269424 </ul>
89279425 </li>
89289426 </ul>
93509848 :param folder_name:
93519849 :param locale: a string, e.g. &#39;da_DK&#39;
93529850 &#34;&#34;&#34;
9353 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS:
9851 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS + MISC_FOLDERS:
93549852 if folder_name.lower() in folder_cls.localized_names(locale):
93559853 return folder_cls
93569854 raise KeyError()
94169914 :param folder_name:
94179915 :param locale: a string, e.g. &#39;da_DK&#39;
94189916 &#34;&#34;&#34;
9419 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS:
9917 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS + MISC_FOLDERS:
94209918 if folder_name.lower() in folder_cls.localized_names(locale):
94219919 return folder_cls
94229920 raise KeyError()</code></pre>
1022510723 </li>
1022610724 </ul>
1022710725 </dd>
10228 <dt id="exchangelib.folders.SmsAndChatsSync"><code class="flex name class">
10229 <span>class <span class="ident">SmsAndChatsSync</span></span>
10726 <dt id="exchangelib.folders.SkypeTeamsMessages"><code class="flex name class">
10727 <span>class <span class="ident">SkypeTeamsMessages</span></span>
1023010728 <span>(</span><span>**kwargs)</span>
1023110729 </code></dt>
1023210730 <dd>
10233 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
10234 <details class="source">
10235 <summary>
10236 <span>Expand source code</span>
10237 </summary>
10238 <pre><code class="python">class SmsAndChatsSync(NonDeletableFolderMixin, Folder):
10239 CONTAINER_CLASS = &#34;IPF.SmsAndChatsSync&#34;
10731 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
10732 <details class="source">
10733 <summary>
10734 <span>Expand source code</span>
10735 </summary>
10736 <pre><code class="python">class SkypeTeamsMessages(Folder):
10737 CONTAINER_CLASS = &#34;IPF.SkypeTeams.Message&#34;
1024010738 LOCALIZED_NAMES = {
10241 None: (&#34;SmsAndChatsSync&#34;,),
10739 None: (&#34;Team-chat&#34;,),
1024210740 }</code></pre>
1024310741 </details>
1024410742 <h3>Ancestors</h3>
1024510743 <ul class="hlist">
10246 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
1024710744 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
1024810745 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
1024910746 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
1025310750 </ul>
1025410751 <h3>Class variables</h3>
1025510752 <dl>
10256 <dt id="exchangelib.folders.SmsAndChatsSync.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
10257 <dd>
10258 <div class="desc"></div>
10259 </dd>
10260 <dt id="exchangelib.folders.SmsAndChatsSync.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
10753 <dt id="exchangelib.folders.SkypeTeamsMessages.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
10754 <dd>
10755 <div class="desc"></div>
10756 </dd>
10757 <dt id="exchangelib.folders.SkypeTeamsMessages.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
1026110758 <dd>
1026210759 <div class="desc"></div>
1026310760 </dd>
1030110798 </li>
1030210799 </ul>
1030310800 </dd>
10304 <dt id="exchangelib.folders.SpoolerQueue"><code class="flex name class">
10305 <span>class <span class="ident">SpoolerQueue</span></span>
10801 <dt id="exchangelib.folders.SmsAndChatsSync"><code class="flex name class">
10802 <span>class <span class="ident">SmsAndChatsSync</span></span>
1030610803 <span>(</span><span>**kwargs)</span>
1030710804 </code></dt>
1030810805 <dd>
1031110808 <summary>
1031210809 <span>Expand source code</span>
1031310810 </summary>
10314 <pre><code class="python">class SpoolerQueue(NonDeletableFolderMixin, Folder):
10811 <pre><code class="python">class SmsAndChatsSync(NonDeletableFolderMixin, Folder):
10812 CONTAINER_CLASS = &#34;IPF.SmsAndChatsSync&#34;
1031510813 LOCALIZED_NAMES = {
10316 None: (&#34;Spooler Queue&#34;,),
10814 None: (&#34;SmsAndChatsSync&#34;,),
1031710815 }</code></pre>
1031810816 </details>
1031910817 <h3>Ancestors</h3>
1032810826 </ul>
1032910827 <h3>Class variables</h3>
1033010828 <dl>
10331 <dt id="exchangelib.folders.SpoolerQueue.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
10829 <dt id="exchangelib.folders.SmsAndChatsSync.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
10830 <dd>
10831 <div class="desc"></div>
10832 </dd>
10833 <dt id="exchangelib.folders.SmsAndChatsSync.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
1033210834 <dd>
1033310835 <div class="desc"></div>
1033410836 </dd>
1037210874 </li>
1037310875 </ul>
1037410876 </dd>
10877 <dt id="exchangelib.folders.SpoolerQueue"><code class="flex name class">
10878 <span>class <span class="ident">SpoolerQueue</span></span>
10879 <span>(</span><span>**kwargs)</span>
10880 </code></dt>
10881 <dd>
10882 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
10883 <details class="source">
10884 <summary>
10885 <span>Expand source code</span>
10886 </summary>
10887 <pre><code class="python">class SpoolerQueue(NonDeletableFolderMixin, Folder):
10888 LOCALIZED_NAMES = {
10889 None: (&#34;Spooler Queue&#34;,),
10890 }</code></pre>
10891 </details>
10892 <h3>Ancestors</h3>
10893 <ul class="hlist">
10894 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="known_folders.html#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
10895 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
10896 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
10897 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
10898 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
10899 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
10900 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
10901 </ul>
10902 <h3>Class variables</h3>
10903 <dl>
10904 <dt id="exchangelib.folders.SpoolerQueue.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
10905 <dd>
10906 <div class="desc"></div>
10907 </dd>
10908 </dl>
10909 <h3>Inherited members</h3>
10910 <ul class="hlist">
10911 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
10912 <ul class="hlist">
10913 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
10914 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
10915 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
10916 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
10917 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
10918 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
10919 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
10920 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
10921 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
10922 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
10923 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
10924 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
10925 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
10926 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
10927 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
10928 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
10929 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
10930 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
10931 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
10932 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
10933 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
10934 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
10935 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
10936 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
10937 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
10938 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
10939 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
10940 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
10941 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
10942 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
10943 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
10944 </ul>
10945 </li>
10946 </ul>
10947 </dd>
10948 <dt id="exchangelib.folders.SwssItems"><code class="flex name class">
10949 <span>class <span class="ident">SwssItems</span></span>
10950 <span>(</span><span>**kwargs)</span>
10951 </code></dt>
10952 <dd>
10953 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
10954 <details class="source">
10955 <summary>
10956 <span>Expand source code</span>
10957 </summary>
10958 <pre><code class="python">class SwssItems(Folder):
10959 CONTAINER_CLASS = &#34;IPF.StoreItem.SwssItems&#34;</code></pre>
10960 </details>
10961 <h3>Ancestors</h3>
10962 <ul class="hlist">
10963 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
10964 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
10965 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
10966 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
10967 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
10968 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
10969 </ul>
10970 <h3>Class variables</h3>
10971 <dl>
10972 <dt id="exchangelib.folders.SwssItems.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
10973 <dd>
10974 <div class="desc"></div>
10975 </dd>
10976 </dl>
10977 <h3>Inherited members</h3>
10978 <ul class="hlist">
10979 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
10980 <ul class="hlist">
10981 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
10982 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
10983 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
10984 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
10985 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
10986 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
10987 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
10988 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
10989 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
10990 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
10991 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
10992 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
10993 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
10994 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
10995 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
10996 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
10997 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
10998 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
10999 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
11000 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
11001 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
11002 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
11003 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
11004 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
11005 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
11006 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
11007 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
11008 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
11009 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
11010 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
11011 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
11012 </ul>
11013 </li>
11014 </ul>
11015 </dd>
1037511016 <dt id="exchangelib.folders.SyncIssues"><code class="flex name class">
1037611017 <span>class <span class="ident">SyncIssues</span></span>
1037711018 <span>(</span><span>**kwargs)</span>
1114911790 <ul class="">
1115011791 <li><code><a title="exchangelib.folders.AllItems.CONTAINER_CLASS" href="#exchangelib.folders.AllItems.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
1115111792 <li><code><a title="exchangelib.folders.AllItems.LOCALIZED_NAMES" href="#exchangelib.folders.AllItems.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
11793 </ul>
11794 </li>
11795 <li>
11796 <h4><code><a title="exchangelib.folders.ApplicationData" href="#exchangelib.folders.ApplicationData">ApplicationData</a></code></h4>
11797 <ul class="">
11798 <li><code><a title="exchangelib.folders.ApplicationData.CONTAINER_CLASS" href="#exchangelib.folders.ApplicationData.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
1115211799 </ul>
1115311800 </li>
1115411801 <li>
1128911936 </ul>
1129011937 </li>
1129111938 <li>
11939 <h4><code><a title="exchangelib.folders.Birthdays" href="#exchangelib.folders.Birthdays">Birthdays</a></code></h4>
11940 <ul class="">
11941 <li><code><a title="exchangelib.folders.Birthdays.CONTAINER_CLASS" href="#exchangelib.folders.Birthdays.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
11942 <li><code><a title="exchangelib.folders.Birthdays.LOCALIZED_NAMES" href="#exchangelib.folders.Birthdays.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
11943 </ul>
11944 </li>
11945 <li>
1129211946 <h4><code><a title="exchangelib.folders.Calendar" href="#exchangelib.folders.Calendar">Calendar</a></code></h4>
1129311947 <ul class="">
1129411948 <li><code><a title="exchangelib.folders.Calendar.CONTAINER_CLASS" href="#exchangelib.folders.Calendar.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
1135012004 </ul>
1135112005 </li>
1135212006 <li>
12007 <h4><code><a title="exchangelib.folders.CrawlerData" href="#exchangelib.folders.CrawlerData">CrawlerData</a></code></h4>
12008 <ul class="">
12009 <li><code><a title="exchangelib.folders.CrawlerData.CONTAINER_CLASS" href="#exchangelib.folders.CrawlerData.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
12010 </ul>
12011 </li>
12012 <li>
1135312013 <h4><code><a title="exchangelib.folders.DefaultFoldersChangeHistory" href="#exchangelib.folders.DefaultFoldersChangeHistory">DefaultFoldersChangeHistory</a></code></h4>
1135412014 <ul class="">
1135512015 <li><code><a title="exchangelib.folders.DefaultFoldersChangeHistory.CONTAINER_CLASS" href="#exchangelib.folders.DefaultFoldersChangeHistory.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
1138512045 <li><code><a title="exchangelib.folders.DistinguishedFolderId.FIELDS" href="#exchangelib.folders.DistinguishedFolderId.FIELDS">FIELDS</a></code></li>
1138612046 <li><code><a title="exchangelib.folders.DistinguishedFolderId.clean" href="#exchangelib.folders.DistinguishedFolderId.clean">clean</a></code></li>
1138712047 <li><code><a title="exchangelib.folders.DistinguishedFolderId.mailbox" href="#exchangelib.folders.DistinguishedFolderId.mailbox">mailbox</a></code></li>
12048 </ul>
12049 </li>
12050 <li>
12051 <h4><code><a title="exchangelib.folders.DlpPolicyEvaluation" href="#exchangelib.folders.DlpPolicyEvaluation">DlpPolicyEvaluation</a></code></h4>
12052 <ul class="">
12053 <li><code><a title="exchangelib.folders.DlpPolicyEvaluation.CONTAINER_CLASS" href="#exchangelib.folders.DlpPolicyEvaluation.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
1138812054 </ul>
1138912055 </li>
1139012056 <li>
1147012136 </ul>
1147112137 </li>
1147212138 <li>
12139 <h4><code><a title="exchangelib.folders.FreeBusyCache" href="#exchangelib.folders.FreeBusyCache">FreeBusyCache</a></code></h4>
12140 <ul class="">
12141 <li><code><a title="exchangelib.folders.FreeBusyCache.CONTAINER_CLASS" href="#exchangelib.folders.FreeBusyCache.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
12142 </ul>
12143 </li>
12144 <li>
1147312145 <h4><code><a title="exchangelib.folders.FreebusyData" href="#exchangelib.folders.FreebusyData">FreebusyData</a></code></h4>
1147412146 <ul class="">
1147512147 <li><code><a title="exchangelib.folders.FreebusyData.LOCALIZED_NAMES" href="#exchangelib.folders.FreebusyData.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
1169812370 <ul class="">
1169912371 <li><code><a title="exchangelib.folders.RecoverableItemsVersions.DISTINGUISHED_FOLDER_ID" href="#exchangelib.folders.RecoverableItemsVersions.DISTINGUISHED_FOLDER_ID">DISTINGUISHED_FOLDER_ID</a></code></li>
1170012372 <li><code><a title="exchangelib.folders.RecoverableItemsVersions.supported_from" href="#exchangelib.folders.RecoverableItemsVersions.supported_from">supported_from</a></code></li>
12373 </ul>
12374 </li>
12375 <li>
12376 <h4><code><a title="exchangelib.folders.RecoveryPoints" href="#exchangelib.folders.RecoveryPoints">RecoveryPoints</a></code></h4>
12377 <ul class="">
12378 <li><code><a title="exchangelib.folders.RecoveryPoints.CONTAINER_CLASS" href="#exchangelib.folders.RecoveryPoints.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
1170112379 </ul>
1170212380 </li>
1170312381 <li>
1178612464 </ul>
1178712465 </li>
1178812466 <li>
12467 <h4><code><a title="exchangelib.folders.SkypeTeamsMessages" href="#exchangelib.folders.SkypeTeamsMessages">SkypeTeamsMessages</a></code></h4>
12468 <ul class="">
12469 <li><code><a title="exchangelib.folders.SkypeTeamsMessages.CONTAINER_CLASS" href="#exchangelib.folders.SkypeTeamsMessages.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
12470 <li><code><a title="exchangelib.folders.SkypeTeamsMessages.LOCALIZED_NAMES" href="#exchangelib.folders.SkypeTeamsMessages.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
12471 </ul>
12472 </li>
12473 <li>
1178912474 <h4><code><a title="exchangelib.folders.SmsAndChatsSync" href="#exchangelib.folders.SmsAndChatsSync">SmsAndChatsSync</a></code></h4>
1179012475 <ul class="">
1179112476 <li><code><a title="exchangelib.folders.SmsAndChatsSync.CONTAINER_CLASS" href="#exchangelib.folders.SmsAndChatsSync.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
1179612481 <h4><code><a title="exchangelib.folders.SpoolerQueue" href="#exchangelib.folders.SpoolerQueue">SpoolerQueue</a></code></h4>
1179712482 <ul class="">
1179812483 <li><code><a title="exchangelib.folders.SpoolerQueue.LOCALIZED_NAMES" href="#exchangelib.folders.SpoolerQueue.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
12484 </ul>
12485 </li>
12486 <li>
12487 <h4><code><a title="exchangelib.folders.SwssItems" href="#exchangelib.folders.SwssItems">SwssItems</a></code></h4>
12488 <ul class="">
12489 <li><code><a title="exchangelib.folders.SwssItems.CONTAINER_CLASS" href="#exchangelib.folders.SwssItems.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
1179912490 </ul>
1180012491 </li>
1180112492 <li>
8989 supported_item_models = (Message, MeetingRequest, MeetingResponse, MeetingCancellation)
9090
9191
92 class CrawlerData(Folder):
93 CONTAINER_CLASS = &#34;IPF.StoreItem.CrawlerData&#34;
94
95
96 class DlpPolicyEvaluation(Folder):
97 CONTAINER_CLASS = &#34;IPF.StoreItem.DlpPolicyEvaluation&#34;
98
99
100 class FreeBusyCache(Folder):
101 CONTAINER_CLASS = &#34;IPF.StoreItem.FreeBusyCache&#34;
102
103
104 class RecoveryPoints(Folder):
105 CONTAINER_CLASS = &#34;IPF.StoreItem.RecoveryPoints&#34;
106
107
108 class SwssItems(Folder):
109 CONTAINER_CLASS = &#34;IPF.StoreItem.SwssItems&#34;
110
111
112 class SkypeTeamsMessages(Folder):
113 CONTAINER_CLASS = &#34;IPF.SkypeTeams.Message&#34;
114 LOCALIZED_NAMES = {
115 None: (&#34;Team-chat&#34;,),
116 }
117
118
119 class Birthdays(Folder):
120 CONTAINER_CLASS = &#34;IPF.Appointment.Birthday&#34;
121 LOCALIZED_NAMES = {
122 None: (&#34;Birthdays&#34;,),
123 &#34;da_DK&#34;: (&#34;Fødselsdage&#34;,),
124 }
125
126
92127 class Drafts(Messages):
93128 DISTINGUISHED_FOLDER_ID = &#34;drafts&#34;
94129
129164 &#34;de_DE&#34;: (&#34;Postausgang&#34;,),
130165 &#34;en_US&#34;: (&#34;Outbox&#34;,),
131166 &#34;es_ES&#34;: (&#34;Bandeja de salida&#34;,),
132 &#34;fr_CA&#34;: (u&#34;Boîte d&#39;envoi&#34;,),
167 &#34;fr_CA&#34;: (&#34;Boîte d&#39;envoi&#34;,),
133168 &#34;nl_NL&#34;: (&#34;Postvak UIT&#34;,),
134169 &#34;ru_RU&#34;: (&#34;Исходящие&#34;,),
135170 &#34;sv_SE&#34;: (&#34;Utkorgen&#34;,),
294329
295330 DISTINGUISHED_FOLDER_ID = &#34;msgfolderroot&#34;
296331 LOCALIZED_NAMES = {
332 None: (&#34;Top of Information Store&#34;,),
333 &#34;da_DK&#34;: (&#34;Informationslagerets øverste niveau&#34;,),
297334 &#34;zh_CN&#34;: (&#34;信息存储顶部&#34;,),
298335 }
299336
408445 }
409446
410447
448 class ApplicationData(NonDeletableFolderMixin, Folder):
449 CONTAINER_CLASS = &#34;IPM.ApplicationData&#34;
450
451
411452 class Audits(NonDeletableFolderMixin, Folder):
412453 LOCALIZED_NAMES = {
413454 None: (&#34;Audits&#34;,),
433474 CONTAINTER_CLASS = &#34;IPF.Contact.Company&#34;
434475 LOCALIZED_NAMES = {
435476 None: (&#34;Companies&#34;,),
477 &#34;da_DK&#34;: (&#34;Firmaer&#34;,),
436478 }
437479
438480
646688 NON_DELETABLE_FOLDERS = [
647689 AllContacts,
648690 AllItems,
691 ApplicationData,
649692 Audits,
650693 CalendarLogging,
651694 CommonViews,
725768 ArchiveRecoverableItemsPurges,
726769 ArchiveRecoverableItemsRoot,
727770 ArchiveRecoverableItemsVersions,
771 ]
772
773 MISC_FOLDERS = [
774 CrawlerData,
775 DlpPolicyEvaluation,
776 FreeBusyCache,
777 RecoveryPoints,
778 SwssItems,
779 SkypeTeamsMessages,
780 Birthdays,
728781 ]</code></pre>
729782 </details>
730783 </section>
9711024 </li>
9721025 </ul>
9731026 </dd>
1027 <dt id="exchangelib.folders.known_folders.ApplicationData"><code class="flex name class">
1028 <span>class <span class="ident">ApplicationData</span></span>
1029 <span>(</span><span>**kwargs)</span>
1030 </code></dt>
1031 <dd>
1032 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
1033 <details class="source">
1034 <summary>
1035 <span>Expand source code</span>
1036 </summary>
1037 <pre><code class="python">class ApplicationData(NonDeletableFolderMixin, Folder):
1038 CONTAINER_CLASS = &#34;IPM.ApplicationData&#34;</code></pre>
1039 </details>
1040 <h3>Ancestors</h3>
1041 <ul class="hlist">
1042 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
1043 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
1044 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
1045 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
1046 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
1047 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
1048 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
1049 </ul>
1050 <h3>Class variables</h3>
1051 <dl>
1052 <dt id="exchangelib.folders.known_folders.ApplicationData.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
1053 <dd>
1054 <div class="desc"></div>
1055 </dd>
1056 </dl>
1057 <h3>Inherited members</h3>
1058 <ul class="hlist">
1059 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
1060 <ul class="hlist">
1061 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
1062 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
1063 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
1064 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
1065 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
1066 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
1067 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
1068 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
1069 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
1070 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
1071 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
1072 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
1073 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
1074 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
1075 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
1076 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
1077 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
1078 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
1079 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
1080 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
1081 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
1082 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
1083 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
1084 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
1085 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
1086 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
1087 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
1088 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
1089 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
1090 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
1091 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
1092 </ul>
1093 </li>
1094 </ul>
1095 </dd>
9741096 <dt id="exchangelib.folders.known_folders.ArchiveDeletedItems"><code class="flex name class">
9751097 <span>class <span class="ident">ArchiveDeletedItems</span></span>
9761098 <span>(</span><span>**kwargs)</span>
15651687 </li>
15661688 </ul>
15671689 </dd>
1568 <dt id="exchangelib.folders.known_folders.Calendar"><code class="flex name class">
1569 <span>class <span class="ident">Calendar</span></span>
1570 <span>(</span><span>**kwargs)</span>
1571 </code></dt>
1572 <dd>
1573 <div class="desc"><p>An interface for the Exchange calendar.</p></div>
1574 <details class="source">
1575 <summary>
1576 <span>Expand source code</span>
1577 </summary>
1578 <pre><code class="python">class Calendar(Folder):
1579 &#34;&#34;&#34;An interface for the Exchange calendar.&#34;&#34;&#34;
1580
1581 DISTINGUISHED_FOLDER_ID = &#34;calendar&#34;
1582 CONTAINER_CLASS = &#34;IPF.Appointment&#34;
1583 supported_item_models = (CalendarItem,)
1584
1585 LOCALIZED_NAMES = {
1586 &#34;da_DK&#34;: (&#34;Kalender&#34;,),
1587 &#34;de_DE&#34;: (&#34;Kalender&#34;,),
1588 &#34;en_US&#34;: (&#34;Calendar&#34;,),
1589 &#34;es_ES&#34;: (&#34;Calendario&#34;,),
1590 &#34;fr_CA&#34;: (&#34;Calendrier&#34;,),
1591 &#34;nl_NL&#34;: (&#34;Agenda&#34;,),
1592 &#34;ru_RU&#34;: (&#34;Календарь&#34;,),
1593 &#34;sv_SE&#34;: (&#34;Kalender&#34;,),
1594 &#34;zh_CN&#34;: (&#34;日历&#34;,),
1595 }
1596
1597 def view(self, *args, **kwargs):
1598 return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)</code></pre>
1599 </details>
1600 <h3>Ancestors</h3>
1601 <ul class="hlist">
1602 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
1603 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
1604 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
1605 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
1606 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
1607 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
1608 </ul>
1609 <h3>Class variables</h3>
1610 <dl>
1611 <dt id="exchangelib.folders.known_folders.Calendar.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
1612 <dd>
1613 <div class="desc"></div>
1614 </dd>
1615 <dt id="exchangelib.folders.known_folders.Calendar.DISTINGUISHED_FOLDER_ID"><code class="name">var <span class="ident">DISTINGUISHED_FOLDER_ID</span></code></dt>
1616 <dd>
1617 <div class="desc"></div>
1618 </dd>
1619 <dt id="exchangelib.folders.known_folders.Calendar.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
1620 <dd>
1621 <div class="desc"></div>
1622 </dd>
1623 <dt id="exchangelib.folders.known_folders.Calendar.supported_item_models"><code class="name">var <span class="ident">supported_item_models</span></code></dt>
1624 <dd>
1625 <div class="desc"></div>
1626 </dd>
1627 </dl>
1628 <h3>Methods</h3>
1629 <dl>
1630 <dt id="exchangelib.folders.known_folders.Calendar.view"><code class="name flex">
1631 <span>def <span class="ident">view</span></span>(<span>self, *args, **kwargs)</span>
1632 </code></dt>
1633 <dd>
1634 <div class="desc"></div>
1635 <details class="source">
1636 <summary>
1637 <span>Expand source code</span>
1638 </summary>
1639 <pre><code class="python">def view(self, *args, **kwargs):
1640 return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)</code></pre>
1641 </details>
1690 <dt id="exchangelib.folders.known_folders.Birthdays"><code class="flex name class">
1691 <span>class <span class="ident">Birthdays</span></span>
1692 <span>(</span><span>**kwargs)</span>
1693 </code></dt>
1694 <dd>
1695 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
1696 <details class="source">
1697 <summary>
1698 <span>Expand source code</span>
1699 </summary>
1700 <pre><code class="python">class Birthdays(Folder):
1701 CONTAINER_CLASS = &#34;IPF.Appointment.Birthday&#34;
1702 LOCALIZED_NAMES = {
1703 None: (&#34;Birthdays&#34;,),
1704 &#34;da_DK&#34;: (&#34;Fødselsdage&#34;,),
1705 }</code></pre>
1706 </details>
1707 <h3>Ancestors</h3>
1708 <ul class="hlist">
1709 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
1710 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
1711 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
1712 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
1713 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
1714 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
1715 </ul>
1716 <h3>Class variables</h3>
1717 <dl>
1718 <dt id="exchangelib.folders.known_folders.Birthdays.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
1719 <dd>
1720 <div class="desc"></div>
1721 </dd>
1722 <dt id="exchangelib.folders.known_folders.Birthdays.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
1723 <dd>
1724 <div class="desc"></div>
16421725 </dd>
16431726 </dl>
16441727 <h3>Inherited members</h3>
16801763 </li>
16811764 </ul>
16821765 </dd>
1683 <dt id="exchangelib.folders.known_folders.CalendarLogging"><code class="flex name class">
1684 <span>class <span class="ident">CalendarLogging</span></span>
1685 <span>(</span><span>**kwargs)</span>
1686 </code></dt>
1687 <dd>
1688 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
1689 <details class="source">
1690 <summary>
1691 <span>Expand source code</span>
1692 </summary>
1693 <pre><code class="python">class CalendarLogging(NonDeletableFolderMixin, Folder):
1694 LOCALIZED_NAMES = {
1695 None: (&#34;Calendar Logging&#34;,),
1696 }</code></pre>
1697 </details>
1698 <h3>Ancestors</h3>
1699 <ul class="hlist">
1700 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
1701 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
1702 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
1703 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
1704 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
1705 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
1706 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
1707 </ul>
1708 <h3>Class variables</h3>
1709 <dl>
1710 <dt id="exchangelib.folders.known_folders.CalendarLogging.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
1711 <dd>
1712 <div class="desc"></div>
1766 <dt id="exchangelib.folders.known_folders.Calendar"><code class="flex name class">
1767 <span>class <span class="ident">Calendar</span></span>
1768 <span>(</span><span>**kwargs)</span>
1769 </code></dt>
1770 <dd>
1771 <div class="desc"><p>An interface for the Exchange calendar.</p></div>
1772 <details class="source">
1773 <summary>
1774 <span>Expand source code</span>
1775 </summary>
1776 <pre><code class="python">class Calendar(Folder):
1777 &#34;&#34;&#34;An interface for the Exchange calendar.&#34;&#34;&#34;
1778
1779 DISTINGUISHED_FOLDER_ID = &#34;calendar&#34;
1780 CONTAINER_CLASS = &#34;IPF.Appointment&#34;
1781 supported_item_models = (CalendarItem,)
1782
1783 LOCALIZED_NAMES = {
1784 &#34;da_DK&#34;: (&#34;Kalender&#34;,),
1785 &#34;de_DE&#34;: (&#34;Kalender&#34;,),
1786 &#34;en_US&#34;: (&#34;Calendar&#34;,),
1787 &#34;es_ES&#34;: (&#34;Calendario&#34;,),
1788 &#34;fr_CA&#34;: (&#34;Calendrier&#34;,),
1789 &#34;nl_NL&#34;: (&#34;Agenda&#34;,),
1790 &#34;ru_RU&#34;: (&#34;Календарь&#34;,),
1791 &#34;sv_SE&#34;: (&#34;Kalender&#34;,),
1792 &#34;zh_CN&#34;: (&#34;日历&#34;,),
1793 }
1794
1795 def view(self, *args, **kwargs):
1796 return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)</code></pre>
1797 </details>
1798 <h3>Ancestors</h3>
1799 <ul class="hlist">
1800 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
1801 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
1802 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
1803 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
1804 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
1805 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
1806 </ul>
1807 <h3>Class variables</h3>
1808 <dl>
1809 <dt id="exchangelib.folders.known_folders.Calendar.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
1810 <dd>
1811 <div class="desc"></div>
1812 </dd>
1813 <dt id="exchangelib.folders.known_folders.Calendar.DISTINGUISHED_FOLDER_ID"><code class="name">var <span class="ident">DISTINGUISHED_FOLDER_ID</span></code></dt>
1814 <dd>
1815 <div class="desc"></div>
1816 </dd>
1817 <dt id="exchangelib.folders.known_folders.Calendar.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
1818 <dd>
1819 <div class="desc"></div>
1820 </dd>
1821 <dt id="exchangelib.folders.known_folders.Calendar.supported_item_models"><code class="name">var <span class="ident">supported_item_models</span></code></dt>
1822 <dd>
1823 <div class="desc"></div>
1824 </dd>
1825 </dl>
1826 <h3>Methods</h3>
1827 <dl>
1828 <dt id="exchangelib.folders.known_folders.Calendar.view"><code class="name flex">
1829 <span>def <span class="ident">view</span></span>(<span>self, *args, **kwargs)</span>
1830 </code></dt>
1831 <dd>
1832 <div class="desc"></div>
1833 <details class="source">
1834 <summary>
1835 <span>Expand source code</span>
1836 </summary>
1837 <pre><code class="python">def view(self, *args, **kwargs):
1838 return FolderCollection(account=self.account, folders=[self]).view(*args, **kwargs)</code></pre>
1839 </details>
17131840 </dd>
17141841 </dl>
17151842 <h3>Inherited members</h3>
17511878 </li>
17521879 </ul>
17531880 </dd>
1754 <dt id="exchangelib.folders.known_folders.CommonViews"><code class="flex name class">
1755 <span>class <span class="ident">CommonViews</span></span>
1881 <dt id="exchangelib.folders.known_folders.CalendarLogging"><code class="flex name class">
1882 <span>class <span class="ident">CalendarLogging</span></span>
17561883 <span>(</span><span>**kwargs)</span>
17571884 </code></dt>
17581885 <dd>
17611888 <summary>
17621889 <span>Expand source code</span>
17631890 </summary>
1764 <pre><code class="python">class CommonViews(NonDeletableFolderMixin, Folder):
1765 DEFAULT_ITEM_TRAVERSAL_DEPTH = ASSOCIATED
1766 LOCALIZED_NAMES = {
1767 None: (&#34;Common Views&#34;,),
1891 <pre><code class="python">class CalendarLogging(NonDeletableFolderMixin, Folder):
1892 LOCALIZED_NAMES = {
1893 None: (&#34;Calendar Logging&#34;,),
17681894 }</code></pre>
17691895 </details>
17701896 <h3>Ancestors</h3>
17791905 </ul>
17801906 <h3>Class variables</h3>
17811907 <dl>
1782 <dt id="exchangelib.folders.known_folders.CommonViews.DEFAULT_ITEM_TRAVERSAL_DEPTH"><code class="name">var <span class="ident">DEFAULT_ITEM_TRAVERSAL_DEPTH</span></code></dt>
1783 <dd>
1784 <div class="desc"></div>
1785 </dd>
1786 <dt id="exchangelib.folders.known_folders.CommonViews.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
1908 <dt id="exchangelib.folders.known_folders.CalendarLogging.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
17871909 <dd>
17881910 <div class="desc"></div>
17891911 </dd>
18271949 </li>
18281950 </ul>
18291951 </dd>
1952 <dt id="exchangelib.folders.known_folders.CommonViews"><code class="flex name class">
1953 <span>class <span class="ident">CommonViews</span></span>
1954 <span>(</span><span>**kwargs)</span>
1955 </code></dt>
1956 <dd>
1957 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
1958 <details class="source">
1959 <summary>
1960 <span>Expand source code</span>
1961 </summary>
1962 <pre><code class="python">class CommonViews(NonDeletableFolderMixin, Folder):
1963 DEFAULT_ITEM_TRAVERSAL_DEPTH = ASSOCIATED
1964 LOCALIZED_NAMES = {
1965 None: (&#34;Common Views&#34;,),
1966 }</code></pre>
1967 </details>
1968 <h3>Ancestors</h3>
1969 <ul class="hlist">
1970 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
1971 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
1972 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
1973 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
1974 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
1975 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
1976 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
1977 </ul>
1978 <h3>Class variables</h3>
1979 <dl>
1980 <dt id="exchangelib.folders.known_folders.CommonViews.DEFAULT_ITEM_TRAVERSAL_DEPTH"><code class="name">var <span class="ident">DEFAULT_ITEM_TRAVERSAL_DEPTH</span></code></dt>
1981 <dd>
1982 <div class="desc"></div>
1983 </dd>
1984 <dt id="exchangelib.folders.known_folders.CommonViews.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
1985 <dd>
1986 <div class="desc"></div>
1987 </dd>
1988 </dl>
1989 <h3>Inherited members</h3>
1990 <ul class="hlist">
1991 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
1992 <ul class="hlist">
1993 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
1994 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
1995 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
1996 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
1997 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
1998 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
1999 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
2000 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
2001 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
2002 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
2003 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
2004 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
2005 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
2006 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
2007 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
2008 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
2009 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
2010 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
2011 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
2012 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
2013 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
2014 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
2015 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
2016 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
2017 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
2018 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
2019 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
2020 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
2021 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
2022 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
2023 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
2024 </ul>
2025 </li>
2026 </ul>
2027 </dd>
18302028 <dt id="exchangelib.folders.known_folders.Companies"><code class="flex name class">
18312029 <span>class <span class="ident">Companies</span></span>
18322030 <span>(</span><span>**kwargs)</span>
18422040 CONTAINTER_CLASS = &#34;IPF.Contact.Company&#34;
18432041 LOCALIZED_NAMES = {
18442042 None: (&#34;Companies&#34;,),
2043 &#34;da_DK&#34;: (&#34;Firmaer&#34;,),
18452044 }</code></pre>
18462045 </details>
18472046 <h3>Ancestors</h3>
22382437 </li>
22392438 </ul>
22402439 </dd>
2241 <dt id="exchangelib.folders.known_folders.DefaultFoldersChangeHistory"><code class="flex name class">
2242 <span>class <span class="ident">DefaultFoldersChangeHistory</span></span>
2243 <span>(</span><span>**kwargs)</span>
2244 </code></dt>
2245 <dd>
2246 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
2247 <details class="source">
2248 <summary>
2249 <span>Expand source code</span>
2250 </summary>
2251 <pre><code class="python">class DefaultFoldersChangeHistory(NonDeletableFolderMixin, Folder):
2252 CONTAINER_CLASS = &#34;IPM.DefaultFolderHistoryItem&#34;
2253 LOCALIZED_NAMES = {
2254 None: (&#34;DefaultFoldersChangeHistory&#34;,),
2255 }</code></pre>
2256 </details>
2257 <h3>Ancestors</h3>
2258 <ul class="hlist">
2259 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
2260 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
2261 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
2262 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
2263 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
2264 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
2265 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
2266 </ul>
2267 <h3>Class variables</h3>
2268 <dl>
2269 <dt id="exchangelib.folders.known_folders.DefaultFoldersChangeHistory.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
2270 <dd>
2271 <div class="desc"></div>
2272 </dd>
2273 <dt id="exchangelib.folders.known_folders.DefaultFoldersChangeHistory.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
2440 <dt id="exchangelib.folders.known_folders.CrawlerData"><code class="flex name class">
2441 <span>class <span class="ident">CrawlerData</span></span>
2442 <span>(</span><span>**kwargs)</span>
2443 </code></dt>
2444 <dd>
2445 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
2446 <details class="source">
2447 <summary>
2448 <span>Expand source code</span>
2449 </summary>
2450 <pre><code class="python">class CrawlerData(Folder):
2451 CONTAINER_CLASS = &#34;IPF.StoreItem.CrawlerData&#34;</code></pre>
2452 </details>
2453 <h3>Ancestors</h3>
2454 <ul class="hlist">
2455 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
2456 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
2457 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
2458 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
2459 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
2460 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
2461 </ul>
2462 <h3>Class variables</h3>
2463 <dl>
2464 <dt id="exchangelib.folders.known_folders.CrawlerData.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
22742465 <dd>
22752466 <div class="desc"></div>
22762467 </dd>
23142505 </li>
23152506 </ul>
23162507 </dd>
2317 <dt id="exchangelib.folders.known_folders.DeferredAction"><code class="flex name class">
2318 <span>class <span class="ident">DeferredAction</span></span>
2508 <dt id="exchangelib.folders.known_folders.DefaultFoldersChangeHistory"><code class="flex name class">
2509 <span>class <span class="ident">DefaultFoldersChangeHistory</span></span>
23192510 <span>(</span><span>**kwargs)</span>
23202511 </code></dt>
23212512 <dd>
23242515 <summary>
23252516 <span>Expand source code</span>
23262517 </summary>
2327 <pre><code class="python">class DeferredAction(NonDeletableFolderMixin, Folder):
2328 LOCALIZED_NAMES = {
2329 None: (&#34;Deferred Action&#34;,),
2518 <pre><code class="python">class DefaultFoldersChangeHistory(NonDeletableFolderMixin, Folder):
2519 CONTAINER_CLASS = &#34;IPM.DefaultFolderHistoryItem&#34;
2520 LOCALIZED_NAMES = {
2521 None: (&#34;DefaultFoldersChangeHistory&#34;,),
23302522 }</code></pre>
23312523 </details>
23322524 <h3>Ancestors</h3>
23412533 </ul>
23422534 <h3>Class variables</h3>
23432535 <dl>
2344 <dt id="exchangelib.folders.known_folders.DeferredAction.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
2536 <dt id="exchangelib.folders.known_folders.DefaultFoldersChangeHistory.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
2537 <dd>
2538 <div class="desc"></div>
2539 </dd>
2540 <dt id="exchangelib.folders.known_folders.DefaultFoldersChangeHistory.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
23452541 <dd>
23462542 <div class="desc"></div>
23472543 </dd>
23852581 </li>
23862582 </ul>
23872583 </dd>
2388 <dt id="exchangelib.folders.known_folders.DeletedItems"><code class="flex name class">
2389 <span>class <span class="ident">DeletedItems</span></span>
2390 <span>(</span><span>**kwargs)</span>
2391 </code></dt>
2392 <dd>
2393 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
2394 <details class="source">
2395 <summary>
2396 <span>Expand source code</span>
2397 </summary>
2398 <pre><code class="python">class DeletedItems(Folder):
2399 DISTINGUISHED_FOLDER_ID = &#34;deleteditems&#34;
2400 CONTAINER_CLASS = &#34;IPF.Note&#34;
2401 supported_item_models = ITEM_CLASSES
2402
2403 LOCALIZED_NAMES = {
2404 &#34;da_DK&#34;: (&#34;Slettet post&#34;,),
2405 &#34;de_DE&#34;: (&#34;Gelöschte Elemente&#34;,),
2406 &#34;en_US&#34;: (&#34;Deleted Items&#34;,),
2407 &#34;es_ES&#34;: (&#34;Elementos eliminados&#34;,),
2408 &#34;fr_CA&#34;: (&#34;Éléments supprimés&#34;,),
2409 &#34;nl_NL&#34;: (&#34;Verwijderde items&#34;,),
2410 &#34;ru_RU&#34;: (&#34;Удаленные&#34;,),
2411 &#34;sv_SE&#34;: (&#34;Borttaget&#34;,),
2412 &#34;zh_CN&#34;: (&#34;已删除邮件&#34;,),
2584 <dt id="exchangelib.folders.known_folders.DeferredAction"><code class="flex name class">
2585 <span>class <span class="ident">DeferredAction</span></span>
2586 <span>(</span><span>**kwargs)</span>
2587 </code></dt>
2588 <dd>
2589 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
2590 <details class="source">
2591 <summary>
2592 <span>Expand source code</span>
2593 </summary>
2594 <pre><code class="python">class DeferredAction(NonDeletableFolderMixin, Folder):
2595 LOCALIZED_NAMES = {
2596 None: (&#34;Deferred Action&#34;,),
24132597 }</code></pre>
24142598 </details>
24152599 <h3>Ancestors</h3>
24162600 <ul class="hlist">
2417 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
2418 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
2419 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
2420 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
2421 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
2422 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
2423 </ul>
2424 <h3>Class variables</h3>
2425 <dl>
2426 <dt id="exchangelib.folders.known_folders.DeletedItems.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
2427 <dd>
2428 <div class="desc"></div>
2429 </dd>
2430 <dt id="exchangelib.folders.known_folders.DeletedItems.DISTINGUISHED_FOLDER_ID"><code class="name">var <span class="ident">DISTINGUISHED_FOLDER_ID</span></code></dt>
2431 <dd>
2432 <div class="desc"></div>
2433 </dd>
2434 <dt id="exchangelib.folders.known_folders.DeletedItems.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
2435 <dd>
2436 <div class="desc"></div>
2437 </dd>
2438 <dt id="exchangelib.folders.known_folders.DeletedItems.supported_item_models"><code class="name">var <span class="ident">supported_item_models</span></code></dt>
2601 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
2602 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
2603 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
2604 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
2605 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
2606 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
2607 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
2608 </ul>
2609 <h3>Class variables</h3>
2610 <dl>
2611 <dt id="exchangelib.folders.known_folders.DeferredAction.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
24392612 <dd>
24402613 <div class="desc"></div>
24412614 </dd>
24792652 </li>
24802653 </ul>
24812654 </dd>
2655 <dt id="exchangelib.folders.known_folders.DeletedItems"><code class="flex name class">
2656 <span>class <span class="ident">DeletedItems</span></span>
2657 <span>(</span><span>**kwargs)</span>
2658 </code></dt>
2659 <dd>
2660 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
2661 <details class="source">
2662 <summary>
2663 <span>Expand source code</span>
2664 </summary>
2665 <pre><code class="python">class DeletedItems(Folder):
2666 DISTINGUISHED_FOLDER_ID = &#34;deleteditems&#34;
2667 CONTAINER_CLASS = &#34;IPF.Note&#34;
2668 supported_item_models = ITEM_CLASSES
2669
2670 LOCALIZED_NAMES = {
2671 &#34;da_DK&#34;: (&#34;Slettet post&#34;,),
2672 &#34;de_DE&#34;: (&#34;Gelöschte Elemente&#34;,),
2673 &#34;en_US&#34;: (&#34;Deleted Items&#34;,),
2674 &#34;es_ES&#34;: (&#34;Elementos eliminados&#34;,),
2675 &#34;fr_CA&#34;: (&#34;Éléments supprimés&#34;,),
2676 &#34;nl_NL&#34;: (&#34;Verwijderde items&#34;,),
2677 &#34;ru_RU&#34;: (&#34;Удаленные&#34;,),
2678 &#34;sv_SE&#34;: (&#34;Borttaget&#34;,),
2679 &#34;zh_CN&#34;: (&#34;已删除邮件&#34;,),
2680 }</code></pre>
2681 </details>
2682 <h3>Ancestors</h3>
2683 <ul class="hlist">
2684 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
2685 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
2686 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
2687 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
2688 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
2689 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
2690 </ul>
2691 <h3>Class variables</h3>
2692 <dl>
2693 <dt id="exchangelib.folders.known_folders.DeletedItems.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
2694 <dd>
2695 <div class="desc"></div>
2696 </dd>
2697 <dt id="exchangelib.folders.known_folders.DeletedItems.DISTINGUISHED_FOLDER_ID"><code class="name">var <span class="ident">DISTINGUISHED_FOLDER_ID</span></code></dt>
2698 <dd>
2699 <div class="desc"></div>
2700 </dd>
2701 <dt id="exchangelib.folders.known_folders.DeletedItems.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
2702 <dd>
2703 <div class="desc"></div>
2704 </dd>
2705 <dt id="exchangelib.folders.known_folders.DeletedItems.supported_item_models"><code class="name">var <span class="ident">supported_item_models</span></code></dt>
2706 <dd>
2707 <div class="desc"></div>
2708 </dd>
2709 </dl>
2710 <h3>Inherited members</h3>
2711 <ul class="hlist">
2712 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
2713 <ul class="hlist">
2714 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
2715 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
2716 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
2717 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
2718 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
2719 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
2720 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
2721 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
2722 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
2723 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
2724 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
2725 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
2726 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
2727 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
2728 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
2729 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
2730 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
2731 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
2732 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
2733 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
2734 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
2735 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
2736 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
2737 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
2738 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
2739 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
2740 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
2741 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
2742 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
2743 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
2744 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
2745 </ul>
2746 </li>
2747 </ul>
2748 </dd>
24822749 <dt id="exchangelib.folders.known_folders.Directory"><code class="flex name class">
24832750 <span>class <span class="ident">Directory</span></span>
24842751 <span>(</span><span>**kwargs)</span>
25532820 </li>
25542821 </ul>
25552822 </dd>
2823 <dt id="exchangelib.folders.known_folders.DlpPolicyEvaluation"><code class="flex name class">
2824 <span>class <span class="ident">DlpPolicyEvaluation</span></span>
2825 <span>(</span><span>**kwargs)</span>
2826 </code></dt>
2827 <dd>
2828 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
2829 <details class="source">
2830 <summary>
2831 <span>Expand source code</span>
2832 </summary>
2833 <pre><code class="python">class DlpPolicyEvaluation(Folder):
2834 CONTAINER_CLASS = &#34;IPF.StoreItem.DlpPolicyEvaluation&#34;</code></pre>
2835 </details>
2836 <h3>Ancestors</h3>
2837 <ul class="hlist">
2838 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
2839 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
2840 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
2841 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
2842 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
2843 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
2844 </ul>
2845 <h3>Class variables</h3>
2846 <dl>
2847 <dt id="exchangelib.folders.known_folders.DlpPolicyEvaluation.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
2848 <dd>
2849 <div class="desc"></div>
2850 </dd>
2851 </dl>
2852 <h3>Inherited members</h3>
2853 <ul class="hlist">
2854 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
2855 <ul class="hlist">
2856 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
2857 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
2858 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
2859 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
2860 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
2861 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
2862 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
2863 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
2864 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
2865 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
2866 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
2867 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
2868 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
2869 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
2870 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
2871 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
2872 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
2873 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
2874 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
2875 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
2876 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
2877 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
2878 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
2879 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
2880 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
2881 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
2882 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
2883 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
2884 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
2885 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
2886 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
2887 </ul>
2888 </li>
2889 </ul>
2890 </dd>
25562891 <dt id="exchangelib.folders.known_folders.Drafts"><code class="flex name class">
25572892 <span>class <span class="ident">Drafts</span></span>
25582893 <span>(</span><span>**kwargs)</span>
28653200 </li>
28663201 </ul>
28673202 </dd>
2868 <dt id="exchangelib.folders.known_folders.FreebusyData"><code class="flex name class">
2869 <span>class <span class="ident">FreebusyData</span></span>
2870 <span>(</span><span>**kwargs)</span>
2871 </code></dt>
2872 <dd>
2873 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
2874 <details class="source">
2875 <summary>
2876 <span>Expand source code</span>
2877 </summary>
2878 <pre><code class="python">class FreebusyData(NonDeletableFolderMixin, Folder):
2879 LOCALIZED_NAMES = {
2880 None: (&#34;Freebusy Data&#34;,),
2881 }</code></pre>
2882 </details>
2883 <h3>Ancestors</h3>
2884 <ul class="hlist">
2885 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
2886 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
2887 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
2888 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
2889 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
2890 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
2891 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
2892 </ul>
2893 <h3>Class variables</h3>
2894 <dl>
2895 <dt id="exchangelib.folders.known_folders.FreebusyData.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3203 <dt id="exchangelib.folders.known_folders.FreeBusyCache"><code class="flex name class">
3204 <span>class <span class="ident">FreeBusyCache</span></span>
3205 <span>(</span><span>**kwargs)</span>
3206 </code></dt>
3207 <dd>
3208 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
3209 <details class="source">
3210 <summary>
3211 <span>Expand source code</span>
3212 </summary>
3213 <pre><code class="python">class FreeBusyCache(Folder):
3214 CONTAINER_CLASS = &#34;IPF.StoreItem.FreeBusyCache&#34;</code></pre>
3215 </details>
3216 <h3>Ancestors</h3>
3217 <ul class="hlist">
3218 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
3219 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
3220 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
3221 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
3222 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
3223 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
3224 </ul>
3225 <h3>Class variables</h3>
3226 <dl>
3227 <dt id="exchangelib.folders.known_folders.FreeBusyCache.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
28963228 <dd>
28973229 <div class="desc"></div>
28983230 </dd>
29363268 </li>
29373269 </ul>
29383270 </dd>
3271 <dt id="exchangelib.folders.known_folders.FreebusyData"><code class="flex name class">
3272 <span>class <span class="ident">FreebusyData</span></span>
3273 <span>(</span><span>**kwargs)</span>
3274 </code></dt>
3275 <dd>
3276 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
3277 <details class="source">
3278 <summary>
3279 <span>Expand source code</span>
3280 </summary>
3281 <pre><code class="python">class FreebusyData(NonDeletableFolderMixin, Folder):
3282 LOCALIZED_NAMES = {
3283 None: (&#34;Freebusy Data&#34;,),
3284 }</code></pre>
3285 </details>
3286 <h3>Ancestors</h3>
3287 <ul class="hlist">
3288 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
3289 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
3290 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
3291 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
3292 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
3293 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
3294 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
3295 </ul>
3296 <h3>Class variables</h3>
3297 <dl>
3298 <dt id="exchangelib.folders.known_folders.FreebusyData.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
3299 <dd>
3300 <div class="desc"></div>
3301 </dd>
3302 </dl>
3303 <h3>Inherited members</h3>
3304 <ul class="hlist">
3305 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
3306 <ul class="hlist">
3307 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
3308 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
3309 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
3310 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
3311 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
3312 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
3313 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
3314 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
3315 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
3316 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
3317 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
3318 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
3319 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
3320 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
3321 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
3322 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
3323 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
3324 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
3325 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
3326 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
3327 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
3328 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
3329 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
3330 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
3331 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
3332 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
3333 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
3334 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
3335 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
3336 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
3337 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
3338 </ul>
3339 </li>
3340 </ul>
3341 </dd>
29393342 <dt id="exchangelib.folders.known_folders.Friends"><code class="flex name class">
29403343 <span>class <span class="ident">Friends</span></span>
29413344 <span>(</span><span>**kwargs)</span>
38084211
38094212 DISTINGUISHED_FOLDER_ID = &#34;msgfolderroot&#34;
38104213 LOCALIZED_NAMES = {
4214 None: (&#34;Top of Information Store&#34;,),
4215 &#34;da_DK&#34;: (&#34;Informationslagerets øverste niveau&#34;,),
38114216 &#34;zh_CN&#34;: (&#34;信息存储顶部&#34;,),
38124217 }</code></pre>
38134218 </details>
40474452 <ul class="hlist">
40484453 <li><a title="exchangelib.folders.known_folders.AllContacts" href="#exchangelib.folders.known_folders.AllContacts">AllContacts</a></li>
40494454 <li><a title="exchangelib.folders.known_folders.AllItems" href="#exchangelib.folders.known_folders.AllItems">AllItems</a></li>
4455 <li><a title="exchangelib.folders.known_folders.ApplicationData" href="#exchangelib.folders.known_folders.ApplicationData">ApplicationData</a></li>
40504456 <li><a title="exchangelib.folders.known_folders.Audits" href="#exchangelib.folders.known_folders.Audits">Audits</a></li>
40514457 <li><a title="exchangelib.folders.known_folders.CalendarLogging" href="#exchangelib.folders.known_folders.CalendarLogging">CalendarLogging</a></li>
40524458 <li><a title="exchangelib.folders.known_folders.CommonViews" href="#exchangelib.folders.known_folders.CommonViews">CommonViews</a></li>
42794685 &#34;de_DE&#34;: (&#34;Postausgang&#34;,),
42804686 &#34;en_US&#34;: (&#34;Outbox&#34;,),
42814687 &#34;es_ES&#34;: (&#34;Bandeja de salida&#34;,),
4282 &#34;fr_CA&#34;: (u&#34;Boîte d&#39;envoi&#34;,),
4688 &#34;fr_CA&#34;: (&#34;Boîte d&#39;envoi&#34;,),
42834689 &#34;nl_NL&#34;: (&#34;Postvak UIT&#34;,),
42844690 &#34;ru_RU&#34;: (&#34;Исходящие&#34;,),
42854691 &#34;sv_SE&#34;: (&#34;Utkorgen&#34;,),
52665672 </li>
52675673 </ul>
52685674 </dd>
5269 <dt id="exchangelib.folders.known_folders.Reminders"><code class="flex name class">
5270 <span>class <span class="ident">Reminders</span></span>
5271 <span>(</span><span>**kwargs)</span>
5272 </code></dt>
5273 <dd>
5274 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
5275 <details class="source">
5276 <summary>
5277 <span>Expand source code</span>
5278 </summary>
5279 <pre><code class="python">class Reminders(NonDeletableFolderMixin, Folder):
5280 CONTAINER_CLASS = &#34;Outlook.Reminder&#34;
5281 LOCALIZED_NAMES = {
5282 &#34;da_DK&#34;: (&#34;Påmindelser&#34;,),
5283 }</code></pre>
5284 </details>
5285 <h3>Ancestors</h3>
5286 <ul class="hlist">
5287 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
5288 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
5289 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
5290 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
5291 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
5292 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
5293 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
5294 </ul>
5295 <h3>Class variables</h3>
5296 <dl>
5297 <dt id="exchangelib.folders.known_folders.Reminders.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
5298 <dd>
5299 <div class="desc"></div>
5300 </dd>
5301 <dt id="exchangelib.folders.known_folders.Reminders.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
5675 <dt id="exchangelib.folders.known_folders.RecoveryPoints"><code class="flex name class">
5676 <span>class <span class="ident">RecoveryPoints</span></span>
5677 <span>(</span><span>**kwargs)</span>
5678 </code></dt>
5679 <dd>
5680 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
5681 <details class="source">
5682 <summary>
5683 <span>Expand source code</span>
5684 </summary>
5685 <pre><code class="python">class RecoveryPoints(Folder):
5686 CONTAINER_CLASS = &#34;IPF.StoreItem.RecoveryPoints&#34;</code></pre>
5687 </details>
5688 <h3>Ancestors</h3>
5689 <ul class="hlist">
5690 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
5691 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
5692 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
5693 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
5694 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
5695 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
5696 </ul>
5697 <h3>Class variables</h3>
5698 <dl>
5699 <dt id="exchangelib.folders.known_folders.RecoveryPoints.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
53025700 <dd>
53035701 <div class="desc"></div>
53045702 </dd>
53425740 </li>
53435741 </ul>
53445742 </dd>
5345 <dt id="exchangelib.folders.known_folders.Schedule"><code class="flex name class">
5346 <span>class <span class="ident">Schedule</span></span>
5743 <dt id="exchangelib.folders.known_folders.Reminders"><code class="flex name class">
5744 <span>class <span class="ident">Reminders</span></span>
53475745 <span>(</span><span>**kwargs)</span>
53485746 </code></dt>
53495747 <dd>
53525750 <summary>
53535751 <span>Expand source code</span>
53545752 </summary>
5355 <pre><code class="python">class Schedule(NonDeletableFolderMixin, Folder):
5356 LOCALIZED_NAMES = {
5357 None: (&#34;Schedule&#34;,),
5753 <pre><code class="python">class Reminders(NonDeletableFolderMixin, Folder):
5754 CONTAINER_CLASS = &#34;Outlook.Reminder&#34;
5755 LOCALIZED_NAMES = {
5756 &#34;da_DK&#34;: (&#34;Påmindelser&#34;,),
53585757 }</code></pre>
53595758 </details>
53605759 <h3>Ancestors</h3>
53695768 </ul>
53705769 <h3>Class variables</h3>
53715770 <dl>
5372 <dt id="exchangelib.folders.known_folders.Schedule.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
5771 <dt id="exchangelib.folders.known_folders.Reminders.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
5772 <dd>
5773 <div class="desc"></div>
5774 </dd>
5775 <dt id="exchangelib.folders.known_folders.Reminders.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
53735776 <dd>
53745777 <div class="desc"></div>
53755778 </dd>
54135816 </li>
54145817 </ul>
54155818 </dd>
5819 <dt id="exchangelib.folders.known_folders.Schedule"><code class="flex name class">
5820 <span>class <span class="ident">Schedule</span></span>
5821 <span>(</span><span>**kwargs)</span>
5822 </code></dt>
5823 <dd>
5824 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
5825 <details class="source">
5826 <summary>
5827 <span>Expand source code</span>
5828 </summary>
5829 <pre><code class="python">class Schedule(NonDeletableFolderMixin, Folder):
5830 LOCALIZED_NAMES = {
5831 None: (&#34;Schedule&#34;,),
5832 }</code></pre>
5833 </details>
5834 <h3>Ancestors</h3>
5835 <ul class="hlist">
5836 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
5837 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
5838 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
5839 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
5840 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
5841 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
5842 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
5843 </ul>
5844 <h3>Class variables</h3>
5845 <dl>
5846 <dt id="exchangelib.folders.known_folders.Schedule.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
5847 <dd>
5848 <div class="desc"></div>
5849 </dd>
5850 </dl>
5851 <h3>Inherited members</h3>
5852 <ul class="hlist">
5853 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
5854 <ul class="hlist">
5855 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
5856 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
5857 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
5858 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
5859 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
5860 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
5861 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
5862 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
5863 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
5864 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
5865 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
5866 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
5867 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
5868 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
5869 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
5870 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
5871 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
5872 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
5873 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
5874 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
5875 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
5876 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
5877 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
5878 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
5879 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
5880 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
5881 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
5882 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
5883 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
5884 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
5885 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
5886 </ul>
5887 </li>
5888 </ul>
5889 </dd>
54165890 <dt id="exchangelib.folders.known_folders.SearchFolders"><code class="flex name class">
54175891 <span>class <span class="ident">SearchFolders</span></span>
54185892 <span>(</span><span>**kwargs)</span>
58646338 </li>
58656339 </ul>
58666340 </dd>
5867 <dt id="exchangelib.folders.known_folders.SmsAndChatsSync"><code class="flex name class">
5868 <span>class <span class="ident">SmsAndChatsSync</span></span>
5869 <span>(</span><span>**kwargs)</span>
5870 </code></dt>
5871 <dd>
5872 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
5873 <details class="source">
5874 <summary>
5875 <span>Expand source code</span>
5876 </summary>
5877 <pre><code class="python">class SmsAndChatsSync(NonDeletableFolderMixin, Folder):
5878 CONTAINER_CLASS = &#34;IPF.SmsAndChatsSync&#34;
5879 LOCALIZED_NAMES = {
5880 None: (&#34;SmsAndChatsSync&#34;,),
6341 <dt id="exchangelib.folders.known_folders.SkypeTeamsMessages"><code class="flex name class">
6342 <span>class <span class="ident">SkypeTeamsMessages</span></span>
6343 <span>(</span><span>**kwargs)</span>
6344 </code></dt>
6345 <dd>
6346 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
6347 <details class="source">
6348 <summary>
6349 <span>Expand source code</span>
6350 </summary>
6351 <pre><code class="python">class SkypeTeamsMessages(Folder):
6352 CONTAINER_CLASS = &#34;IPF.SkypeTeams.Message&#34;
6353 LOCALIZED_NAMES = {
6354 None: (&#34;Team-chat&#34;,),
58816355 }</code></pre>
58826356 </details>
58836357 <h3>Ancestors</h3>
58846358 <ul class="hlist">
5885 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
5886 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
5887 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
5888 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
5889 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
5890 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
5891 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
5892 </ul>
5893 <h3>Class variables</h3>
5894 <dl>
5895 <dt id="exchangelib.folders.known_folders.SmsAndChatsSync.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
5896 <dd>
5897 <div class="desc"></div>
5898 </dd>
5899 <dt id="exchangelib.folders.known_folders.SmsAndChatsSync.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
6359 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
6360 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
6361 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
6362 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
6363 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
6364 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
6365 </ul>
6366 <h3>Class variables</h3>
6367 <dl>
6368 <dt id="exchangelib.folders.known_folders.SkypeTeamsMessages.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
6369 <dd>
6370 <div class="desc"></div>
6371 </dd>
6372 <dt id="exchangelib.folders.known_folders.SkypeTeamsMessages.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
59006373 <dd>
59016374 <div class="desc"></div>
59026375 </dd>
59406413 </li>
59416414 </ul>
59426415 </dd>
5943 <dt id="exchangelib.folders.known_folders.SpoolerQueue"><code class="flex name class">
5944 <span>class <span class="ident">SpoolerQueue</span></span>
6416 <dt id="exchangelib.folders.known_folders.SmsAndChatsSync"><code class="flex name class">
6417 <span>class <span class="ident">SmsAndChatsSync</span></span>
59456418 <span>(</span><span>**kwargs)</span>
59466419 </code></dt>
59476420 <dd>
59506423 <summary>
59516424 <span>Expand source code</span>
59526425 </summary>
5953 <pre><code class="python">class SpoolerQueue(NonDeletableFolderMixin, Folder):
5954 LOCALIZED_NAMES = {
5955 None: (&#34;Spooler Queue&#34;,),
6426 <pre><code class="python">class SmsAndChatsSync(NonDeletableFolderMixin, Folder):
6427 CONTAINER_CLASS = &#34;IPF.SmsAndChatsSync&#34;
6428 LOCALIZED_NAMES = {
6429 None: (&#34;SmsAndChatsSync&#34;,),
59566430 }</code></pre>
59576431 </details>
59586432 <h3>Ancestors</h3>
59676441 </ul>
59686442 <h3>Class variables</h3>
59696443 <dl>
5970 <dt id="exchangelib.folders.known_folders.SpoolerQueue.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
6444 <dt id="exchangelib.folders.known_folders.SmsAndChatsSync.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
6445 <dd>
6446 <div class="desc"></div>
6447 </dd>
6448 <dt id="exchangelib.folders.known_folders.SmsAndChatsSync.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
59716449 <dd>
59726450 <div class="desc"></div>
59736451 </dd>
60116489 </li>
60126490 </ul>
60136491 </dd>
6492 <dt id="exchangelib.folders.known_folders.SpoolerQueue"><code class="flex name class">
6493 <span>class <span class="ident">SpoolerQueue</span></span>
6494 <span>(</span><span>**kwargs)</span>
6495 </code></dt>
6496 <dd>
6497 <div class="desc"><p>A mixin for non-wellknown folders than that are not deletable.</p></div>
6498 <details class="source">
6499 <summary>
6500 <span>Expand source code</span>
6501 </summary>
6502 <pre><code class="python">class SpoolerQueue(NonDeletableFolderMixin, Folder):
6503 LOCALIZED_NAMES = {
6504 None: (&#34;Spooler Queue&#34;,),
6505 }</code></pre>
6506 </details>
6507 <h3>Ancestors</h3>
6508 <ul class="hlist">
6509 <li><a title="exchangelib.folders.known_folders.NonDeletableFolderMixin" href="#exchangelib.folders.known_folders.NonDeletableFolderMixin">NonDeletableFolderMixin</a></li>
6510 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
6511 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
6512 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
6513 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
6514 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
6515 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
6516 </ul>
6517 <h3>Class variables</h3>
6518 <dl>
6519 <dt id="exchangelib.folders.known_folders.SpoolerQueue.LOCALIZED_NAMES"><code class="name">var <span class="ident">LOCALIZED_NAMES</span></code></dt>
6520 <dd>
6521 <div class="desc"></div>
6522 </dd>
6523 </dl>
6524 <h3>Inherited members</h3>
6525 <ul class="hlist">
6526 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
6527 <ul class="hlist">
6528 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
6529 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
6530 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
6531 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
6532 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
6533 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
6534 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
6535 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
6536 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
6537 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
6538 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
6539 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
6540 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
6541 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
6542 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
6543 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
6544 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
6545 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
6546 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
6547 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
6548 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
6549 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
6550 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
6551 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
6552 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
6553 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
6554 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
6555 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
6556 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
6557 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
6558 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
6559 </ul>
6560 </li>
6561 </ul>
6562 </dd>
6563 <dt id="exchangelib.folders.known_folders.SwssItems"><code class="flex name class">
6564 <span>class <span class="ident">SwssItems</span></span>
6565 <span>(</span><span>**kwargs)</span>
6566 </code></dt>
6567 <dd>
6568 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/folder</a></p></div>
6569 <details class="source">
6570 <summary>
6571 <span>Expand source code</span>
6572 </summary>
6573 <pre><code class="python">class SwssItems(Folder):
6574 CONTAINER_CLASS = &#34;IPF.StoreItem.SwssItems&#34;</code></pre>
6575 </details>
6576 <h3>Ancestors</h3>
6577 <ul class="hlist">
6578 <li><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></li>
6579 <li><a title="exchangelib.folders.base.BaseFolder" href="base.html#exchangelib.folders.base.BaseFolder">BaseFolder</a></li>
6580 <li><a title="exchangelib.items.base.RegisterMixIn" href="../items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
6581 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="../properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
6582 <li><a title="exchangelib.properties.EWSElement" href="../properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
6583 <li><a title="exchangelib.queryset.SearchableMixIn" href="../queryset.html#exchangelib.queryset.SearchableMixIn">SearchableMixIn</a></li>
6584 </ul>
6585 <h3>Class variables</h3>
6586 <dl>
6587 <dt id="exchangelib.folders.known_folders.SwssItems.CONTAINER_CLASS"><code class="name">var <span class="ident">CONTAINER_CLASS</span></code></dt>
6588 <dd>
6589 <div class="desc"></div>
6590 </dd>
6591 </dl>
6592 <h3>Inherited members</h3>
6593 <ul class="hlist">
6594 <li><code><b><a title="exchangelib.folders.base.Folder" href="base.html#exchangelib.folders.base.Folder">Folder</a></b></code>:
6595 <ul class="hlist">
6596 <li><code><a title="exchangelib.folders.base.Folder.ID_ELEMENT_CLS" href="base.html#exchangelib.folders.base.BaseFolder.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
6597 <li><code><a title="exchangelib.folders.base.Folder.account" href="base.html#exchangelib.folders.base.BaseFolder.account">account</a></code></li>
6598 <li><code><a title="exchangelib.folders.base.Folder.add_field" href="../properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
6599 <li><code><a title="exchangelib.folders.base.Folder.all" href="../queryset.html#exchangelib.queryset.SearchableMixIn.all">all</a></code></li>
6600 <li><code><a title="exchangelib.folders.base.Folder.deregister" href="../items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
6601 <li><code><a title="exchangelib.folders.base.Folder.exclude" href="../queryset.html#exchangelib.queryset.SearchableMixIn.exclude">exclude</a></code></li>
6602 <li><code><a title="exchangelib.folders.base.Folder.filter" href="../queryset.html#exchangelib.queryset.SearchableMixIn.filter">filter</a></code></li>
6603 <li><code><a title="exchangelib.folders.base.Folder.folder_cls_from_container_class" href="base.html#exchangelib.folders.base.BaseFolder.folder_cls_from_container_class">folder_cls_from_container_class</a></code></li>
6604 <li><code><a title="exchangelib.folders.base.Folder.folder_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.folder_sync_state">folder_sync_state</a></code></li>
6605 <li><code><a title="exchangelib.folders.base.Folder.get" href="../queryset.html#exchangelib.queryset.SearchableMixIn.get">get</a></code></li>
6606 <li><code><a title="exchangelib.folders.base.Folder.get_distinguished" href="base.html#exchangelib.folders.base.Folder.get_distinguished">get_distinguished</a></code></li>
6607 <li><code><a title="exchangelib.folders.base.Folder.get_events" href="base.html#exchangelib.folders.base.BaseFolder.get_events">get_events</a></code></li>
6608 <li><code><a title="exchangelib.folders.base.Folder.get_streaming_events" href="base.html#exchangelib.folders.base.BaseFolder.get_streaming_events">get_streaming_events</a></code></li>
6609 <li><code><a title="exchangelib.folders.base.Folder.is_distinguished" href="base.html#exchangelib.folders.base.BaseFolder.is_distinguished">is_distinguished</a></code></li>
6610 <li><code><a title="exchangelib.folders.base.Folder.item_sync_state" href="base.html#exchangelib.folders.base.BaseFolder.item_sync_state">item_sync_state</a></code></li>
6611 <li><code><a title="exchangelib.folders.base.Folder.none" href="../queryset.html#exchangelib.queryset.SearchableMixIn.none">none</a></code></li>
6612 <li><code><a title="exchangelib.folders.base.Folder.parent" href="base.html#exchangelib.folders.base.BaseFolder.parent">parent</a></code></li>
6613 <li><code><a title="exchangelib.folders.base.Folder.people" href="../queryset.html#exchangelib.queryset.SearchableMixIn.people">people</a></code></li>
6614 <li><code><a title="exchangelib.folders.base.Folder.register" href="../items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
6615 <li><code><a title="exchangelib.folders.base.Folder.remove_field" href="../properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
6616 <li><code><a title="exchangelib.folders.base.Folder.root" href="base.html#exchangelib.folders.base.BaseFolder.root">root</a></code></li>
6617 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_pull" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_pull">subscribe_to_pull</a></code></li>
6618 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_push" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_push">subscribe_to_push</a></code></li>
6619 <li><code><a title="exchangelib.folders.base.Folder.subscribe_to_streaming" href="base.html#exchangelib.folders.base.BaseFolder.subscribe_to_streaming">subscribe_to_streaming</a></code></li>
6620 <li><code><a title="exchangelib.folders.base.Folder.supported_fields" href="../properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
6621 <li><code><a title="exchangelib.folders.base.Folder.sync_hierarchy" href="base.html#exchangelib.folders.base.BaseFolder.sync_hierarchy">sync_hierarchy</a></code></li>
6622 <li><code><a title="exchangelib.folders.base.Folder.sync_items" href="base.html#exchangelib.folders.base.BaseFolder.sync_items">sync_items</a></code></li>
6623 <li><code><a title="exchangelib.folders.base.Folder.test_access" href="base.html#exchangelib.folders.base.BaseFolder.test_access">test_access</a></code></li>
6624 <li><code><a title="exchangelib.folders.base.Folder.tree" href="base.html#exchangelib.folders.base.BaseFolder.tree">tree</a></code></li>
6625 <li><code><a title="exchangelib.folders.base.Folder.unsubscribe" href="base.html#exchangelib.folders.base.BaseFolder.unsubscribe">unsubscribe</a></code></li>
6626 <li><code><a title="exchangelib.folders.base.Folder.validate_field" href="../properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
6627 </ul>
6628 </li>
6629 </ul>
6630 </dd>
60146631 <dt id="exchangelib.folders.known_folders.SyncIssues"><code class="flex name class">
60156632 <span>class <span class="ident">SyncIssues</span></span>
60166633 <span>(</span><span>**kwargs)</span>
68587475 </ul>
68597476 </li>
68607477 <li>
7478 <h4><code><a title="exchangelib.folders.known_folders.ApplicationData" href="#exchangelib.folders.known_folders.ApplicationData">ApplicationData</a></code></h4>
7479 <ul class="">
7480 <li><code><a title="exchangelib.folders.known_folders.ApplicationData.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.ApplicationData.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
7481 </ul>
7482 </li>
7483 <li>
68617484 <h4><code><a title="exchangelib.folders.known_folders.ArchiveDeletedItems" href="#exchangelib.folders.known_folders.ArchiveDeletedItems">ArchiveDeletedItems</a></code></h4>
68627485 <ul class="">
68637486 <li><code><a title="exchangelib.folders.known_folders.ArchiveDeletedItems.DISTINGUISHED_FOLDER_ID" href="#exchangelib.folders.known_folders.ArchiveDeletedItems.DISTINGUISHED_FOLDER_ID">DISTINGUISHED_FOLDER_ID</a></code></li>
69117534 <ul class="">
69127535 <li><code><a title="exchangelib.folders.known_folders.Audits.LOCALIZED_NAMES" href="#exchangelib.folders.known_folders.Audits.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
69137536 <li><code><a title="exchangelib.folders.known_folders.Audits.get_folder_allowed" href="#exchangelib.folders.known_folders.Audits.get_folder_allowed">get_folder_allowed</a></code></li>
7537 </ul>
7538 </li>
7539 <li>
7540 <h4><code><a title="exchangelib.folders.known_folders.Birthdays" href="#exchangelib.folders.known_folders.Birthdays">Birthdays</a></code></h4>
7541 <ul class="">
7542 <li><code><a title="exchangelib.folders.known_folders.Birthdays.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.Birthdays.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
7543 <li><code><a title="exchangelib.folders.known_folders.Birthdays.LOCALIZED_NAMES" href="#exchangelib.folders.known_folders.Birthdays.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
69147544 </ul>
69157545 </li>
69167546 <li>
69757605 </ul>
69767606 </li>
69777607 <li>
7608 <h4><code><a title="exchangelib.folders.known_folders.CrawlerData" href="#exchangelib.folders.known_folders.CrawlerData">CrawlerData</a></code></h4>
7609 <ul class="">
7610 <li><code><a title="exchangelib.folders.known_folders.CrawlerData.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.CrawlerData.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
7611 </ul>
7612 </li>
7613 <li>
69787614 <h4><code><a title="exchangelib.folders.known_folders.DefaultFoldersChangeHistory" href="#exchangelib.folders.known_folders.DefaultFoldersChangeHistory">DefaultFoldersChangeHistory</a></code></h4>
69797615 <ul class="">
69807616 <li><code><a title="exchangelib.folders.known_folders.DefaultFoldersChangeHistory.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.DefaultFoldersChangeHistory.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
70047640 </ul>
70057641 </li>
70067642 <li>
7643 <h4><code><a title="exchangelib.folders.known_folders.DlpPolicyEvaluation" href="#exchangelib.folders.known_folders.DlpPolicyEvaluation">DlpPolicyEvaluation</a></code></h4>
7644 <ul class="">
7645 <li><code><a title="exchangelib.folders.known_folders.DlpPolicyEvaluation.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.DlpPolicyEvaluation.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
7646 </ul>
7647 </li>
7648 <li>
70077649 <h4><code><a title="exchangelib.folders.known_folders.Drafts" href="#exchangelib.folders.known_folders.Drafts">Drafts</a></code></h4>
70087650 <ul class="">
70097651 <li><code><a title="exchangelib.folders.known_folders.Drafts.DISTINGUISHED_FOLDER_ID" href="#exchangelib.folders.known_folders.Drafts.DISTINGUISHED_FOLDER_ID">DISTINGUISHED_FOLDER_ID</a></code></li>
70297671 <ul class="">
70307672 <li><code><a title="exchangelib.folders.known_folders.Files.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.Files.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
70317673 <li><code><a title="exchangelib.folders.known_folders.Files.LOCALIZED_NAMES" href="#exchangelib.folders.known_folders.Files.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
7674 </ul>
7675 </li>
7676 <li>
7677 <h4><code><a title="exchangelib.folders.known_folders.FreeBusyCache" href="#exchangelib.folders.known_folders.FreeBusyCache">FreeBusyCache</a></code></h4>
7678 <ul class="">
7679 <li><code><a title="exchangelib.folders.known_folders.FreeBusyCache.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.FreeBusyCache.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
70327680 </ul>
70337681 </li>
70347682 <li>
72547902 </ul>
72557903 </li>
72567904 <li>
7905 <h4><code><a title="exchangelib.folders.known_folders.RecoveryPoints" href="#exchangelib.folders.known_folders.RecoveryPoints">RecoveryPoints</a></code></h4>
7906 <ul class="">
7907 <li><code><a title="exchangelib.folders.known_folders.RecoveryPoints.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.RecoveryPoints.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
7908 </ul>
7909 </li>
7910 <li>
72577911 <h4><code><a title="exchangelib.folders.known_folders.Reminders" href="#exchangelib.folders.known_folders.Reminders">Reminders</a></code></h4>
72587912 <ul class="">
72597913 <li><code><a title="exchangelib.folders.known_folders.Reminders.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.Reminders.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
73077961 </ul>
73087962 </li>
73097963 <li>
7964 <h4><code><a title="exchangelib.folders.known_folders.SkypeTeamsMessages" href="#exchangelib.folders.known_folders.SkypeTeamsMessages">SkypeTeamsMessages</a></code></h4>
7965 <ul class="">
7966 <li><code><a title="exchangelib.folders.known_folders.SkypeTeamsMessages.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.SkypeTeamsMessages.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
7967 <li><code><a title="exchangelib.folders.known_folders.SkypeTeamsMessages.LOCALIZED_NAMES" href="#exchangelib.folders.known_folders.SkypeTeamsMessages.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
7968 </ul>
7969 </li>
7970 <li>
73107971 <h4><code><a title="exchangelib.folders.known_folders.SmsAndChatsSync" href="#exchangelib.folders.known_folders.SmsAndChatsSync">SmsAndChatsSync</a></code></h4>
73117972 <ul class="">
73127973 <li><code><a title="exchangelib.folders.known_folders.SmsAndChatsSync.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.SmsAndChatsSync.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
73177978 <h4><code><a title="exchangelib.folders.known_folders.SpoolerQueue" href="#exchangelib.folders.known_folders.SpoolerQueue">SpoolerQueue</a></code></h4>
73187979 <ul class="">
73197980 <li><code><a title="exchangelib.folders.known_folders.SpoolerQueue.LOCALIZED_NAMES" href="#exchangelib.folders.known_folders.SpoolerQueue.LOCALIZED_NAMES">LOCALIZED_NAMES</a></code></li>
7981 </ul>
7982 </li>
7983 <li>
7984 <h4><code><a title="exchangelib.folders.known_folders.SwssItems" href="#exchangelib.folders.known_folders.SwssItems">SwssItems</a></code></h4>
7985 <ul class="">
7986 <li><code><a title="exchangelib.folders.known_folders.SwssItems.CONTAINER_CLASS" href="#exchangelib.folders.known_folders.SwssItems.CONTAINER_CLASS">CONTAINER_CLASS</a></code></li>
73207987 </ul>
73217988 </li>
73227989 <li>
3535 from .base import BaseFolder
3636 from .collections import FolderCollection
3737 from .known_folders import (
38 MISC_FOLDERS,
3839 NON_DELETABLE_FOLDERS,
3940 WELLKNOWN_FOLDERS_IN_ARCHIVE_ROOT,
4041 WELLKNOWN_FOLDERS_IN_ROOT,
232233 :param folder_name:
233234 :param locale: a string, e.g. &#39;da_DK&#39;
234235 &#34;&#34;&#34;
235 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS:
236 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS + MISC_FOLDERS:
236237 if folder_name.lower() in folder_cls.localized_names(locale):
237238 return folder_cls
238239 raise KeyError()
983984 :param folder_name:
984985 :param locale: a string, e.g. &#39;da_DK&#39;
985986 &#34;&#34;&#34;
986 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS:
987 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS + MISC_FOLDERS:
987988 if folder_name.lower() in folder_cls.localized_names(locale):
988989 return folder_cls
989990 raise KeyError()
10491050 :param folder_name:
10501051 :param locale: a string, e.g. &#39;da_DK&#39;
10511052 &#34;&#34;&#34;
1052 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS:
1053 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS + MISC_FOLDERS:
10531054 if folder_name.lower() in folder_cls.localized_names(locale):
10541055 return folder_cls
10551056 raise KeyError()</code></pre>
4343 ForwardItem,
4444 Message,
4545 PostItem,
46 PostReplyItem,
4647 ReplyAllToItem,
4748 ReplyToItem,
4849 Task,
5556 from .transport import BASIC, CBA, DIGEST, GSSAPI, NTLM, OAUTH2, SSPI
5657 from .version import Build, Version
5758
58 __version__ = &#34;4.7.2&#34;
59 __version__ = &#34;4.7.6&#34;
5960
6061 __all__ = [
6162 &#34;__version__&#34;,
63 &#34;AcceptItem&#34;,
6264 &#34;Account&#34;,
63 &#34;Identity&#34;,
64 &#34;FileAttachment&#34;,
65 &#34;ItemAttachment&#34;,
66 &#34;discover&#34;,
65 &#34;Attendee&#34;,
66 &#34;BASIC&#34;,
67 &#34;BaseProtocol&#34;,
68 &#34;Body&#34;,
69 &#34;Build&#34;,
70 &#34;CBA&#34;,
71 &#34;CalendarItem&#34;,
72 &#34;CancelCalendarItem&#34;,
6773 &#34;Configuration&#34;,
74 &#34;Contact&#34;,
75 &#34;Credentials&#34;,
76 &#34;DEEP&#34;,
6877 &#34;DELEGATE&#34;,
69 &#34;IMPERSONATION&#34;,
70 &#34;Credentials&#34;,
71 &#34;OAuth2AuthorizationCodeCredentials&#34;,
72 &#34;OAuth2Credentials&#34;,
78 &#34;DIGEST&#34;,
79 &#34;DLMailbox&#34;,
80 &#34;DeclineItem&#34;,
81 &#34;DistributionList&#34;,
7382 &#34;EWSDate&#34;,
7483 &#34;EWSDateTime&#34;,
7584 &#34;EWSTimeZone&#34;,
85 &#34;ExtendedProperty&#34;,
86 &#34;FailFast&#34;,
87 &#34;FaultTolerance&#34;,
88 &#34;FileAttachment&#34;,
89 &#34;Folder&#34;,
90 &#34;FolderCollection&#34;,
91 &#34;ForwardItem&#34;,
92 &#34;GSSAPI&#34;,
93 &#34;HTMLBody&#34;,
94 &#34;IMPERSONATION&#34;,
95 &#34;Identity&#34;,
96 &#34;ItemAttachment&#34;,
97 &#34;ItemId&#34;,
98 &#34;Mailbox&#34;,
99 &#34;Message&#34;,
100 &#34;NTLM&#34;,
101 &#34;NoVerifyHTTPAdapter&#34;,
102 &#34;OAUTH2&#34;,
103 &#34;OAuth2AuthorizationCodeCredentials&#34;,
104 &#34;OAuth2Credentials&#34;,
105 &#34;OofSettings&#34;,
106 &#34;PostItem&#34;,
107 &#34;PostReplyItem&#34;,
108 &#34;Q&#34;,
109 &#34;ReplyAllToItem&#34;,
110 &#34;ReplyToItem&#34;,
111 &#34;Room&#34;,
112 &#34;RoomList&#34;,
113 &#34;RootOfHierarchy&#34;,
114 &#34;SHALLOW&#34;,
115 &#34;SSPI&#34;,
116 &#34;TLSClientAuth&#34;,
117 &#34;Task&#34;,
118 &#34;TentativelyAcceptItem&#34;,
119 &#34;UID&#34;,
76120 &#34;UTC&#34;,
77121 &#34;UTC_NOW&#34;,
78 &#34;ExtendedProperty&#34;,
79 &#34;Folder&#34;,
80 &#34;RootOfHierarchy&#34;,
81 &#34;FolderCollection&#34;,
82 &#34;SHALLOW&#34;,
83 &#34;DEEP&#34;,
84 &#34;AcceptItem&#34;,
85 &#34;TentativelyAcceptItem&#34;,
86 &#34;DeclineItem&#34;,
87 &#34;CalendarItem&#34;,
88 &#34;CancelCalendarItem&#34;,
89 &#34;Contact&#34;,
90 &#34;DistributionList&#34;,
91 &#34;Message&#34;,
92 &#34;PostItem&#34;,
93 &#34;Task&#34;,
94 &#34;ForwardItem&#34;,
95 &#34;ReplyToItem&#34;,
96 &#34;ReplyAllToItem&#34;,
97 &#34;ItemId&#34;,
98 &#34;Mailbox&#34;,
99 &#34;DLMailbox&#34;,
100 &#34;Attendee&#34;,
101 &#34;Room&#34;,
102 &#34;RoomList&#34;,
103 &#34;Body&#34;,
104 &#34;HTMLBody&#34;,
105 &#34;UID&#34;,
106 &#34;FailFast&#34;,
107 &#34;FaultTolerance&#34;,
108 &#34;BaseProtocol&#34;,
109 &#34;NoVerifyHTTPAdapter&#34;,
110 &#34;TLSClientAuth&#34;,
111 &#34;OofSettings&#34;,
112 &#34;Q&#34;,
113 &#34;BASIC&#34;,
114 &#34;DIGEST&#34;,
115 &#34;NTLM&#34;,
116 &#34;GSSAPI&#34;,
117 &#34;SSPI&#34;,
118 &#34;OAUTH2&#34;,
119 &#34;CBA&#34;,
120 &#34;Build&#34;,
121122 &#34;Version&#34;,
122123 &#34;close_connections&#34;,
124 &#34;discover&#34;,
123125 ]
124126
125127 # Set a default user agent, e.g. &#34;exchangelib/3.1.1 (python-requests/2.22.0)&#34;
28672869 session = self.renew_session(session)
28682870 self._session_pool.put(session, block=False)
28692871
2870 @staticmethod
2871 def close_session(session):
2872 def close_session(self, session):
2873 if isinstance(self.credentials, OAuth2Credentials) and not isinstance(
2874 self.credentials, OAuth2AuthorizationCodeCredentials
2875 ):
2876 # Reset token if client is of type BackendApplicationClient
2877 self.credentials.access_token = None
28722878 session.close()
28732879 del session
28742880
29312937 return session
29322938
29332939 def create_oauth2_session(self):
2934 has_token = False
2935 scope = [&#34;https://outlook.office365.com/.default&#34;]
2936 session_params = {}
2940 session_params = {&#34;token&#34;: self.credentials.access_token} # Token may be None
29372941 token_params = {}
29382942
29392943 if isinstance(self.credentials, OAuth2AuthorizationCodeCredentials):
2940 # Ask for a refresh token
2941 scope.append(&#34;offline_access&#34;)
2942
2943 # We don&#39;t know (or need) the Microsoft tenant ID. Use
2944 # common/ to let Microsoft select the appropriate tenant
2945 # for the provided authorization code or refresh token.
2946 #
2947 # Suppress looks-like-password warning from Bandit.
2948 token_url = &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec
2949
2950 client_params = {}
2951 has_token = self.credentials.access_token is not None
2952 if has_token:
2953 session_params[&#34;token&#34;] = self.credentials.access_token
2954 elif self.credentials.authorization_code is not None:
2955 token_params[&#34;code&#34;] = self.credentials.authorization_code
2956 self.credentials.authorization_code = None
2957
2958 if self.credentials.client_id is not None and self.credentials.client_secret is not None:
2959 # If we&#39;re given a client ID and secret, we have enough
2960 # to refresh access tokens ourselves. In other cases the
2961 # session will raise TokenExpiredError and we&#39;ll need to
2962 # ask the calling application to refresh the token (that
2963 # covers cases where the caller doesn&#39;t have access to
2964 # the client secret but is working with a service that
2965 # can provide it refreshed tokens on a limited basis).
2944 token_params[&#34;code&#34;] = self.credentials.authorization_code # Auth code may be None
2945 self.credentials.authorization_code = None # We can only use the code once
2946
2947 if self.credentials.client_id and self.credentials.client_secret:
2948 # If we&#39;re given a client ID and secret, we have enough to refresh access tokens ourselves. In other
2949 # cases the session will raise TokenExpiredError, and we&#39;ll need to ask the calling application to
2950 # refresh the token (that covers cases where the caller doesn&#39;t have access to the client secret but
2951 # is working with a service that can provide it refreshed tokens on a limited basis).
29662952 session_params.update(
29672953 {
29682954 &#34;auto_refresh_kwargs&#34;: {
29692955 &#34;client_id&#34;: self.credentials.client_id,
29702956 &#34;client_secret&#34;: self.credentials.client_secret,
29712957 },
2972 &#34;auto_refresh_url&#34;: token_url,
2958 &#34;auto_refresh_url&#34;: self.credentials.token_url,
29732959 &#34;token_updater&#34;: self.credentials.on_token_auto_refreshed,
29742960 }
29752961 )
2976 client = WebApplicationClient(self.credentials.client_id, **client_params)
2962 client = WebApplicationClient(client_id=self.credentials.client_id)
29772963 else:
2978 token_url = f&#34;https://login.microsoftonline.com/{self.credentials.tenant_id}/oauth2/v2.0/token&#34;
29792964 client = BackendApplicationClient(client_id=self.credentials.client_id)
29802965
29812966 session = self.raw_session(self.service_endpoint, oauth2_client=client, oauth2_session_params=session_params)
2982 if not has_token:
2967 if not session.token:
29832968 # Fetch the token explicitly -- it doesn&#39;t occur implicitly
29842969 token = session.fetch_token(
2985 token_url=token_url,
2970 token_url=self.credentials.token_url,
29862971 client_id=self.credentials.client_id,
29872972 client_secret=self.credentials.client_secret,
2988 scope=scope,
2973 scope=self.credentials.scope,
29892974 timeout=self.TIMEOUT,
29902975 **token_params,
29912976 )
2992 # Allow the credentials object to update its copy of the new
2993 # token, and give the application an opportunity to cache it
2977 # Allow the credentials object to update its copy of the new token, and give the application an opportunity
2978 # to cache it.
29942979 self.credentials.on_token_auto_refreshed(token)
29952980 session.auth = get_auth_instance(auth_type=OAUTH2, client=client)
29962981
30693054 </dl>
30703055 <h3>Static methods</h3>
30713056 <dl>
3072 <dt id="exchangelib.BaseProtocol.close_session"><code class="name flex">
3073 <span>def <span class="ident">close_session</span></span>(<span>session)</span>
3074 </code></dt>
3075 <dd>
3076 <div class="desc"></div>
3077 <details class="source">
3078 <summary>
3079 <span>Expand source code</span>
3080 </summary>
3081 <pre><code class="python">@staticmethod
3082 def close_session(session):
3083 session.close()
3084 del session</code></pre>
3085 </details>
3086 </dd>
30873057 <dt id="exchangelib.BaseProtocol.get_adapter"><code class="name flex">
30883058 <span>def <span class="ident">get_adapter</span></span>(<span>)</span>
30893059 </code></dt>
32263196 break</code></pre>
32273197 </details>
32283198 </dd>
3199 <dt id="exchangelib.BaseProtocol.close_session"><code class="name flex">
3200 <span>def <span class="ident">close_session</span></span>(<span>self, session)</span>
3201 </code></dt>
3202 <dd>
3203 <div class="desc"></div>
3204 <details class="source">
3205 <summary>
3206 <span>Expand source code</span>
3207 </summary>
3208 <pre><code class="python">def close_session(self, session):
3209 if isinstance(self.credentials, OAuth2Credentials) and not isinstance(
3210 self.credentials, OAuth2AuthorizationCodeCredentials
3211 ):
3212 # Reset token if client is of type BackendApplicationClient
3213 self.credentials.access_token = None
3214 session.close()
3215 del session</code></pre>
3216 </details>
3217 </dd>
32293218 <dt id="exchangelib.BaseProtocol.create_oauth2_session"><code class="name flex">
32303219 <span>def <span class="ident">create_oauth2_session</span></span>(<span>self)</span>
32313220 </code></dt>
32363225 <span>Expand source code</span>
32373226 </summary>
32383227 <pre><code class="python">def create_oauth2_session(self):
3239 has_token = False
3240 scope = [&#34;https://outlook.office365.com/.default&#34;]
3241 session_params = {}
3228 session_params = {&#34;token&#34;: self.credentials.access_token} # Token may be None
32423229 token_params = {}
32433230
32443231 if isinstance(self.credentials, OAuth2AuthorizationCodeCredentials):
3245 # Ask for a refresh token
3246 scope.append(&#34;offline_access&#34;)
3247
3248 # We don&#39;t know (or need) the Microsoft tenant ID. Use
3249 # common/ to let Microsoft select the appropriate tenant
3250 # for the provided authorization code or refresh token.
3251 #
3252 # Suppress looks-like-password warning from Bandit.
3253 token_url = &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec
3254
3255 client_params = {}
3256 has_token = self.credentials.access_token is not None
3257 if has_token:
3258 session_params[&#34;token&#34;] = self.credentials.access_token
3259 elif self.credentials.authorization_code is not None:
3260 token_params[&#34;code&#34;] = self.credentials.authorization_code
3261 self.credentials.authorization_code = None
3262
3263 if self.credentials.client_id is not None and self.credentials.client_secret is not None:
3264 # If we&#39;re given a client ID and secret, we have enough
3265 # to refresh access tokens ourselves. In other cases the
3266 # session will raise TokenExpiredError and we&#39;ll need to
3267 # ask the calling application to refresh the token (that
3268 # covers cases where the caller doesn&#39;t have access to
3269 # the client secret but is working with a service that
3270 # can provide it refreshed tokens on a limited basis).
3232 token_params[&#34;code&#34;] = self.credentials.authorization_code # Auth code may be None
3233 self.credentials.authorization_code = None # We can only use the code once
3234
3235 if self.credentials.client_id and self.credentials.client_secret:
3236 # If we&#39;re given a client ID and secret, we have enough to refresh access tokens ourselves. In other
3237 # cases the session will raise TokenExpiredError, and we&#39;ll need to ask the calling application to
3238 # refresh the token (that covers cases where the caller doesn&#39;t have access to the client secret but
3239 # is working with a service that can provide it refreshed tokens on a limited basis).
32713240 session_params.update(
32723241 {
32733242 &#34;auto_refresh_kwargs&#34;: {
32743243 &#34;client_id&#34;: self.credentials.client_id,
32753244 &#34;client_secret&#34;: self.credentials.client_secret,
32763245 },
3277 &#34;auto_refresh_url&#34;: token_url,
3246 &#34;auto_refresh_url&#34;: self.credentials.token_url,
32783247 &#34;token_updater&#34;: self.credentials.on_token_auto_refreshed,
32793248 }
32803249 )
3281 client = WebApplicationClient(self.credentials.client_id, **client_params)
3250 client = WebApplicationClient(client_id=self.credentials.client_id)
32823251 else:
3283 token_url = f&#34;https://login.microsoftonline.com/{self.credentials.tenant_id}/oauth2/v2.0/token&#34;
32843252 client = BackendApplicationClient(client_id=self.credentials.client_id)
32853253
32863254 session = self.raw_session(self.service_endpoint, oauth2_client=client, oauth2_session_params=session_params)
3287 if not has_token:
3255 if not session.token:
32883256 # Fetch the token explicitly -- it doesn&#39;t occur implicitly
32893257 token = session.fetch_token(
3290 token_url=token_url,
3258 token_url=self.credentials.token_url,
32913259 client_id=self.credentials.client_id,
32923260 client_secret=self.credentials.client_secret,
3293 scope=scope,
3261 scope=self.credentials.scope,
32943262 timeout=self.TIMEOUT,
32953263 **token_params,
32963264 )
3297 # Allow the credentials object to update its copy of the new
3298 # token, and give the application an opportunity to cache it
3265 # Allow the credentials object to update its copy of the new token, and give the application an opportunity
3266 # to cache it.
32993267 self.credentials.on_token_auto_refreshed(token)
33003268 session.auth = get_auth_instance(auth_type=OAUTH2, client=client)
33013269
46674635 if auth_type is None:
46684636 # Set a default auth type for the credentials where this makes sense
46694637 auth_type = DEFAULT_AUTH_TYPE.get(type(credentials))
4670 elif credentials is None and auth_type in CREDENTIALS_REQUIRED:
4638 if auth_type is not None and auth_type not in AUTH_TYPE_MAP:
4639 raise InvalidEnumValue(&#34;auth_type&#34;, auth_type, AUTH_TYPE_MAP)
4640 if credentials is None and auth_type in CREDENTIALS_REQUIRED:
46714641 raise ValueError(f&#34;Auth type {auth_type!r} was detected but no credentials were provided&#34;)
46724642 if server and service_endpoint:
46734643 raise AttributeError(&#34;Only one of &#39;server&#39; or &#39;service_endpoint&#39; must be provided&#34;)
4674 if auth_type is not None and auth_type not in AUTH_TYPE_MAP:
4675 raise InvalidEnumValue(&#34;auth_type&#34;, auth_type, AUTH_TYPE_MAP)
46764644 if not retry_policy:
46774645 retry_policy = FailFast()
46784646 if not isinstance(version, (Version, type(None))):
59175885 </details>
59185886 <h3>Ancestors</h3>
59195887 <ul class="hlist">
5920 <li>backports.zoneinfo.ZoneInfo</li>
5888 <li>zoneinfo.ZoneInfo</li>
59215889 <li>datetime.tzinfo</li>
59225890 </ul>
59235891 <h3>Class variables</h3>
71927160 <h3>Subclasses</h3>
71937161 <ul class="hlist">
71947162 <li><a title="exchangelib.folders.known_folders.AllItems" href="folders/known_folders.html#exchangelib.folders.known_folders.AllItems">AllItems</a></li>
7163 <li><a title="exchangelib.folders.known_folders.ApplicationData" href="folders/known_folders.html#exchangelib.folders.known_folders.ApplicationData">ApplicationData</a></li>
71957164 <li><a title="exchangelib.folders.known_folders.Audits" href="folders/known_folders.html#exchangelib.folders.known_folders.Audits">Audits</a></li>
7165 <li><a title="exchangelib.folders.known_folders.Birthdays" href="folders/known_folders.html#exchangelib.folders.known_folders.Birthdays">Birthdays</a></li>
71967166 <li><a title="exchangelib.folders.known_folders.Calendar" href="folders/known_folders.html#exchangelib.folders.known_folders.Calendar">Calendar</a></li>
71977167 <li><a title="exchangelib.folders.known_folders.CalendarLogging" href="folders/known_folders.html#exchangelib.folders.known_folders.CalendarLogging">CalendarLogging</a></li>
71987168 <li><a title="exchangelib.folders.known_folders.CommonViews" href="folders/known_folders.html#exchangelib.folders.known_folders.CommonViews">CommonViews</a></li>
71997169 <li><a title="exchangelib.folders.known_folders.Contacts" href="folders/known_folders.html#exchangelib.folders.known_folders.Contacts">Contacts</a></li>
72007170 <li><a title="exchangelib.folders.known_folders.ConversationSettings" href="folders/known_folders.html#exchangelib.folders.known_folders.ConversationSettings">ConversationSettings</a></li>
7171 <li><a title="exchangelib.folders.known_folders.CrawlerData" href="folders/known_folders.html#exchangelib.folders.known_folders.CrawlerData">CrawlerData</a></li>
72017172 <li><a title="exchangelib.folders.known_folders.DefaultFoldersChangeHistory" href="folders/known_folders.html#exchangelib.folders.known_folders.DefaultFoldersChangeHistory">DefaultFoldersChangeHistory</a></li>
72027173 <li><a title="exchangelib.folders.known_folders.DeferredAction" href="folders/known_folders.html#exchangelib.folders.known_folders.DeferredAction">DeferredAction</a></li>
72037174 <li><a title="exchangelib.folders.known_folders.DeletedItems" href="folders/known_folders.html#exchangelib.folders.known_folders.DeletedItems">DeletedItems</a></li>
7175 <li><a title="exchangelib.folders.known_folders.DlpPolicyEvaluation" href="folders/known_folders.html#exchangelib.folders.known_folders.DlpPolicyEvaluation">DlpPolicyEvaluation</a></li>
72047176 <li><a title="exchangelib.folders.known_folders.ExchangeSyncData" href="folders/known_folders.html#exchangelib.folders.known_folders.ExchangeSyncData">ExchangeSyncData</a></li>
72057177 <li><a title="exchangelib.folders.known_folders.Files" href="folders/known_folders.html#exchangelib.folders.known_folders.Files">Files</a></li>
7178 <li><a title="exchangelib.folders.known_folders.FreeBusyCache" href="folders/known_folders.html#exchangelib.folders.known_folders.FreeBusyCache">FreeBusyCache</a></li>
72067179 <li><a title="exchangelib.folders.known_folders.FreebusyData" href="folders/known_folders.html#exchangelib.folders.known_folders.FreebusyData">FreebusyData</a></li>
72077180 <li><a title="exchangelib.folders.known_folders.GraphAnalytics" href="folders/known_folders.html#exchangelib.folders.known_folders.GraphAnalytics">GraphAnalytics</a></li>
72087181 <li><a title="exchangelib.folders.known_folders.Location" href="folders/known_folders.html#exchangelib.folders.known_folders.Location">Location</a></li>
72127185 <li><a title="exchangelib.folders.known_folders.PassThroughSearchResults" href="folders/known_folders.html#exchangelib.folders.known_folders.PassThroughSearchResults">PassThroughSearchResults</a></li>
72137186 <li><a title="exchangelib.folders.known_folders.PdpProfileV2Secured" href="folders/known_folders.html#exchangelib.folders.known_folders.PdpProfileV2Secured">PdpProfileV2Secured</a></li>
72147187 <li><a title="exchangelib.folders.known_folders.RSSFeeds" href="folders/known_folders.html#exchangelib.folders.known_folders.RSSFeeds">RSSFeeds</a></li>
7188 <li><a title="exchangelib.folders.known_folders.RecoveryPoints" href="folders/known_folders.html#exchangelib.folders.known_folders.RecoveryPoints">RecoveryPoints</a></li>
72157189 <li><a title="exchangelib.folders.known_folders.Reminders" href="folders/known_folders.html#exchangelib.folders.known_folders.Reminders">Reminders</a></li>
72167190 <li><a title="exchangelib.folders.known_folders.Schedule" href="folders/known_folders.html#exchangelib.folders.known_folders.Schedule">Schedule</a></li>
72177191 <li><a title="exchangelib.folders.known_folders.Sharing" href="folders/known_folders.html#exchangelib.folders.known_folders.Sharing">Sharing</a></li>
72187192 <li><a title="exchangelib.folders.known_folders.Shortcuts" href="folders/known_folders.html#exchangelib.folders.known_folders.Shortcuts">Shortcuts</a></li>
72197193 <li><a title="exchangelib.folders.known_folders.Signal" href="folders/known_folders.html#exchangelib.folders.known_folders.Signal">Signal</a></li>
7194 <li><a title="exchangelib.folders.known_folders.SkypeTeamsMessages" href="folders/known_folders.html#exchangelib.folders.known_folders.SkypeTeamsMessages">SkypeTeamsMessages</a></li>
72207195 <li><a title="exchangelib.folders.known_folders.SmsAndChatsSync" href="folders/known_folders.html#exchangelib.folders.known_folders.SmsAndChatsSync">SmsAndChatsSync</a></li>
72217196 <li><a title="exchangelib.folders.known_folders.SpoolerQueue" href="folders/known_folders.html#exchangelib.folders.known_folders.SpoolerQueue">SpoolerQueue</a></li>
7197 <li><a title="exchangelib.folders.known_folders.SwssItems" href="folders/known_folders.html#exchangelib.folders.known_folders.SwssItems">SwssItems</a></li>
72227198 <li><a title="exchangelib.folders.known_folders.System" href="folders/known_folders.html#exchangelib.folders.known_folders.System">System</a></li>
72237199 <li><a title="exchangelib.folders.known_folders.System1" href="folders/known_folders.html#exchangelib.folders.known_folders.System1">System1</a></li>
72247200 <li><a title="exchangelib.folders.known_folders.Tasks" href="folders/known_folders.html#exchangelib.folders.known_folders.Tasks">Tasks</a></li>
89308906 <li><a title="exchangelib.properties.ConversationId" href="properties.html#exchangelib.properties.ConversationId">ConversationId</a></li>
89318907 <li><a title="exchangelib.properties.FolderId" href="properties.html#exchangelib.properties.FolderId">FolderId</a></li>
89328908 <li><a title="exchangelib.properties.MovedItemId" href="properties.html#exchangelib.properties.MovedItemId">MovedItemId</a></li>
8909 <li><a title="exchangelib.properties.OldItemId" href="properties.html#exchangelib.properties.OldItemId">OldItemId</a></li>
89338910 <li><a title="exchangelib.properties.ParentFolderId" href="properties.html#exchangelib.properties.ParentFolderId">ParentFolderId</a></li>
89348911 <li><a title="exchangelib.properties.ParentItemId" href="properties.html#exchangelib.properties.ParentItemId">ParentItemId</a></li>
89358912 <li><a title="exchangelib.properties.PersonaId" href="properties.html#exchangelib.properties.PersonaId">PersonaId</a></li>
91699146 conversation_topic = CharField(field_uri=&#34;message:ConversationTopic&#34;, is_read_only=True)
91709147 # Rename &#39;From&#39; to &#39;author&#39;. We can&#39;t use fieldname &#39;from&#39; since it&#39;s a Python keyword.
91719148 author = MailboxField(field_uri=&#34;message:From&#34;, is_read_only_after_send=True)
9172 message_id = CharField(field_uri=&#34;message:InternetMessageId&#34;, is_read_only_after_send=True)
9149 message_id = TextField(field_uri=&#34;message:InternetMessageId&#34;, is_read_only_after_send=True)
91739150 is_read = BooleanField(field_uri=&#34;message:IsRead&#34;, is_required=True, default=False)
91749151 is_response_requested = BooleanField(field_uri=&#34;message:IsResponseRequested&#34;, default=False, is_required=True)
91759152 references = TextField(field_uri=&#34;message:References&#34;)
93019278 from ..services import MarkAsJunk
93029279
93039280 res = MarkAsJunk(account=self.account).get(
9304 items=[self], is_junk=is_junk, move_item=move_item, expect_result=move_item
9281 items=[self], is_junk=is_junk, move_item=move_item, expect_result=None
93059282 )
93069283 if res is None:
93079284 return
94759452 from ..services import MarkAsJunk
94769453
94779454 res = MarkAsJunk(account=self.account).get(
9478 items=[self], is_junk=is_junk, move_item=move_item, expect_result=move_item
9455 items=[self], is_junk=is_junk, move_item=move_item, expect_result=None
94799456 )
94809457 if res is None:
94819458 return
96719648 </dd>
96729649 <dt id="exchangelib.OAuth2AuthorizationCodeCredentials"><code class="flex name class">
96739650 <span>class <span class="ident">OAuth2AuthorizationCodeCredentials</span></span>
9674 <span>(</span><span>authorization_code=None, access_token=None, **kwargs)</span>
9651 <span>(</span><span>authorization_code=None, access_token=None, client_id=None, client_secret=None, **kwargs)</span>
96759652 </code></dt>
96769653 <dd>
96779654 <div class="desc"><p>Login info for OAuth 2.0 authentication using the authorization code grant type. This can be used in one of
96789655 several ways:
96799656 * Given an authorization code, client ID, and client secret, fetch a token ourselves and refresh it as needed if
96809657 supplied with a refresh token.
9681 * Given an existing access token, refresh token, client ID, and client secret, use the access token until it
9682 expires and then refresh it as needed.
9658 * Given an existing access token, client ID, and client secret, use the access token until it expires and then
9659 refresh it as needed.
96839660 * Given only an existing access token, use it until it expires. This can be used to let the calling application
96849661 refresh tokens itself by subclassing and implementing refresh().</p>
96859662 <p>Unlike the base (client credentials) grant, authorization code credentials don't require a Microsoft tenant ID
97029679 several ways:
97039680 * Given an authorization code, client ID, and client secret, fetch a token ourselves and refresh it as needed if
97049681 supplied with a refresh token.
9705 * Given an existing access token, refresh token, client ID, and client secret, use the access token until it
9706 expires and then refresh it as needed.
9682 * Given an existing access token, client ID, and client secret, use the access token until it expires and then
9683 refresh it as needed.
97079684 * Given only an existing access token, use it until it expires. This can be used to let the calling application
97089685 refresh tokens itself by subclassing and implementing refresh().
97099686
97129689 tenant.
97139690 &#34;&#34;&#34;
97149691
9715 def __init__(self, authorization_code=None, access_token=None, **kwargs):
9692 def __init__(self, authorization_code=None, access_token=None, client_id=None, client_secret=None, **kwargs):
97169693 &#34;&#34;&#34;
97179694
97189695 :param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
97249701 :param access_token: Previously-obtained access token. If a token exists and the application will handle
97259702 refreshing by itself (or opts not to handle it), this parameter alone is sufficient.
97269703 &#34;&#34;&#34;
9727 super().__init__(**kwargs)
9704 super().__init__(client_id=client_id, client_secret=client_secret, **kwargs)
97289705 self.authorization_code = authorization_code
97299706 if access_token is not None and not isinstance(access_token, dict):
97309707 raise InvalidTypeError(&#34;access_token&#34;, access_token, OAuth2Token)
97319708 self.access_token = access_token
9709
9710 @property
9711 def token_url(self):
9712 # We don&#39;t know (or need) the Microsoft tenant ID. Use common/ to let Microsoft select the appropriate
9713 # tenant for the provided authorization code or refresh token.
9714 return &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec
9715
9716 @property
9717 def scope(self):
9718 res = super().scope
9719 res.append(&#34;offline_access&#34;)
9720 return res
97329721
97339722 def __repr__(self):
97349723 return self.__class__.__name__ + repr(
97509739 <li><a title="exchangelib.credentials.OAuth2Credentials" href="credentials.html#exchangelib.credentials.OAuth2Credentials">OAuth2Credentials</a></li>
97519740 <li><a title="exchangelib.credentials.BaseCredentials" href="credentials.html#exchangelib.credentials.BaseCredentials">BaseCredentials</a></li>
97529741 </ul>
9742 <h3>Instance variables</h3>
9743 <dl>
9744 <dt id="exchangelib.OAuth2AuthorizationCodeCredentials.scope"><code class="name">var <span class="ident">scope</span></code></dt>
9745 <dd>
9746 <div class="desc"></div>
9747 <details class="source">
9748 <summary>
9749 <span>Expand source code</span>
9750 </summary>
9751 <pre><code class="python">@property
9752 def scope(self):
9753 res = super().scope
9754 res.append(&#34;offline_access&#34;)
9755 return res</code></pre>
9756 </details>
9757 </dd>
9758 <dt id="exchangelib.OAuth2AuthorizationCodeCredentials.token_url"><code class="name">var <span class="ident">token_url</span></code></dt>
9759 <dd>
9760 <div class="desc"></div>
9761 <details class="source">
9762 <summary>
9763 <span>Expand source code</span>
9764 </summary>
9765 <pre><code class="python">@property
9766 def token_url(self):
9767 # We don&#39;t know (or need) the Microsoft tenant ID. Use common/ to let Microsoft select the appropriate
9768 # tenant for the provided authorization code or refresh token.
9769 return &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec</code></pre>
9770 </details>
9771 </dd>
9772 </dl>
97539773 <h3>Inherited members</h3>
97549774 <ul class="hlist">
97559775 <li><code><b><a title="exchangelib.credentials.OAuth2Credentials" href="credentials.html#exchangelib.credentials.OAuth2Credentials">OAuth2Credentials</a></b></code>:
97629782 </dd>
97639783 <dt id="exchangelib.OAuth2Credentials"><code class="flex name class">
97649784 <span>class <span class="ident">OAuth2Credentials</span></span>
9765 <span>(</span><span>client_id, client_secret, tenant_id=None, identity=None)</span>
9785 <span>(</span><span>client_id, client_secret, tenant_id=None, identity=None, access_token=None)</span>
97669786 </code></dt>
97679787 <dd>
97689788 <div class="desc"><p>Login info for OAuth 2.0 client credentials authentication, as well as a base for other OAuth 2.0 grant types.</p>
97739793 <p>:param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
97749794 :param client_secret: Secret associated with the OAuth application
97759795 :param tenant_id: Microsoft tenant ID of the account to access
9776 :param identity: An Identity object representing the account that these credentials are connected to.</p></div>
9796 :param identity: An Identity object representing the account that these credentials are connected to.
9797 :param access_token: Previously-obtained access token, as a dict or an oauthlib.oauth2.OAuth2Token</p></div>
97779798 <details class="source">
97789799 <summary>
97799800 <span>Expand source code</span>
97879808 the associated auth code grant type for multi-tenant applications.
97889809 &#34;&#34;&#34;
97899810
9790 def __init__(self, client_id, client_secret, tenant_id=None, identity=None):
9811 def __init__(self, client_id, client_secret, tenant_id=None, identity=None, access_token=None):
97919812 &#34;&#34;&#34;
97929813
97939814 :param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
97949815 :param client_secret: Secret associated with the OAuth application
97959816 :param tenant_id: Microsoft tenant ID of the account to access
97969817 :param identity: An Identity object representing the account that these credentials are connected to.
9818 :param access_token: Previously-obtained access token, as a dict or an oauthlib.oauth2.OAuth2Token
97979819 &#34;&#34;&#34;
97989820 super().__init__()
97999821 self.client_id = client_id
98009822 self.client_secret = client_secret
98019823 self.tenant_id = tenant_id
98029824 self.identity = identity
9803 # When set, access_token is a dict (or an oauthlib.oauth2.OAuth2Token, which is also a dict)
9804 self.access_token = None
9825 self.access_token = access_token
98059826
98069827 def refresh(self, session):
98079828 # Creating a new session gets a new access token, so there&#39;s no work here to refresh the credentials. This
98419862 res.append(getattr(self, k))
98429863 return hash(tuple(res))
98439864
9865 @property
9866 def token_url(self):
9867 return f&#34;https://login.microsoftonline.com/{self.tenant_id}/oauth2/v2.0/token&#34;
9868
9869 @property
9870 def scope(self):
9871 return [&#34;https://outlook.office365.com/.default&#34;]
9872
98449873 def __repr__(self):
98459874 return self.__class__.__name__ + repr((self.client_id, &#34;********&#34;))
98469875
98559884 <ul class="hlist">
98569885 <li><a title="exchangelib.credentials.OAuth2AuthorizationCodeCredentials" href="credentials.html#exchangelib.credentials.OAuth2AuthorizationCodeCredentials">OAuth2AuthorizationCodeCredentials</a></li>
98579886 </ul>
9887 <h3>Instance variables</h3>
9888 <dl>
9889 <dt id="exchangelib.OAuth2Credentials.scope"><code class="name">var <span class="ident">scope</span></code></dt>
9890 <dd>
9891 <div class="desc"></div>
9892 <details class="source">
9893 <summary>
9894 <span>Expand source code</span>
9895 </summary>
9896 <pre><code class="python">@property
9897 def scope(self):
9898 return [&#34;https://outlook.office365.com/.default&#34;]</code></pre>
9899 </details>
9900 </dd>
9901 <dt id="exchangelib.OAuth2Credentials.token_url"><code class="name">var <span class="ident">token_url</span></code></dt>
9902 <dd>
9903 <div class="desc"></div>
9904 <details class="source">
9905 <summary>
9906 <span>Expand source code</span>
9907 </summary>
9908 <pre><code class="python">@property
9909 def token_url(self):
9910 return f&#34;https://login.microsoftonline.com/{self.tenant_id}/oauth2/v2.0/token&#34;</code></pre>
9911 </details>
9912 </dd>
9913 </dl>
98589914 <h3>Methods</h3>
98599915 <dl>
98609916 <dt id="exchangelib.OAuth2Credentials.on_token_auto_refreshed"><code class="name flex">
1024410300 <div class="desc"></div>
1024510301 </dd>
1024610302 <dt id="exchangelib.PostItem.sender"><code class="name">var <span class="ident">sender</span></code></dt>
10303 <dd>
10304 <div class="desc"></div>
10305 </dd>
10306 </dl>
10307 <h3>Inherited members</h3>
10308 <ul class="hlist">
10309 <li><code><b><a title="exchangelib.items.item.Item" href="items/item.html#exchangelib.items.item.Item">Item</a></b></code>:
10310 <ul class="hlist">
10311 <li><code><a title="exchangelib.items.item.Item.ID_ELEMENT_CLS" href="items/base.html#exchangelib.items.base.BaseItem.ID_ELEMENT_CLS">ID_ELEMENT_CLS</a></code></li>
10312 <li><code><a title="exchangelib.items.item.Item.account" href="items/base.html#exchangelib.items.base.BaseItem.account">account</a></code></li>
10313 <li><code><a title="exchangelib.items.item.Item.add_field" href="properties.html#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
10314 <li><code><a title="exchangelib.items.item.Item.attach" href="items/item.html#exchangelib.items.item.Item.attach">attach</a></code></li>
10315 <li><code><a title="exchangelib.items.item.Item.deregister" href="items/base.html#exchangelib.items.base.RegisterMixIn.deregister">deregister</a></code></li>
10316 <li><code><a title="exchangelib.items.item.Item.detach" href="items/item.html#exchangelib.items.item.Item.detach">detach</a></code></li>
10317 <li><code><a title="exchangelib.items.item.Item.folder" href="items/base.html#exchangelib.items.base.BaseItem.folder">folder</a></code></li>
10318 <li><code><a title="exchangelib.items.item.Item.register" href="items/base.html#exchangelib.items.base.RegisterMixIn.register">register</a></code></li>
10319 <li><code><a title="exchangelib.items.item.Item.remove_field" href="properties.html#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
10320 <li><code><a title="exchangelib.items.item.Item.supported_fields" href="properties.html#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
10321 <li><code><a title="exchangelib.items.item.Item.validate_field" href="properties.html#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
10322 </ul>
10323 </li>
10324 </ul>
10325 </dd>
10326 <dt id="exchangelib.PostReplyItem"><code class="flex name class">
10327 <span>class <span class="ident">PostReplyItem</span></span>
10328 <span>(</span><span>**kwargs)</span>
10329 </code></dt>
10330 <dd>
10331 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/postreplyitem">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/postreplyitem</a></p>
10332 <p>Pick out optional 'account' and 'folder' kwargs, and pass the rest to the parent class.</p>
10333 <p>:param kwargs:
10334 'account' is optional but allows calling 'send()' and 'delete()'
10335 'folder' is optional but allows calling 'save()'. If 'folder' has an account, and 'account' is not set,
10336 we use folder.account.</p></div>
10337 <details class="source">
10338 <summary>
10339 <span>Expand source code</span>
10340 </summary>
10341 <pre><code class="python">class PostReplyItem(Item):
10342 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/postreplyitem&#34;&#34;&#34;
10343
10344 ELEMENT_NAME = &#34;PostReplyItem&#34;
10345
10346 # This element only has Item fields up to, and including, &#39;culture&#39;
10347 # TDO: Plus all message fields
10348 new_body = BodyField(field_uri=&#34;NewBodyContent&#34;) # Accepts and returns Body or HTMLBody instances
10349
10350 culture_idx = Item.FIELDS.index_by_name(&#34;culture&#34;)
10351 sender_idx = Message.FIELDS.index_by_name(&#34;sender&#34;)
10352 FIELDS = Item.FIELDS[: culture_idx + 1] + Message.FIELDS[sender_idx:]</code></pre>
10353 </details>
10354 <h3>Ancestors</h3>
10355 <ul class="hlist">
10356 <li><a title="exchangelib.items.item.Item" href="items/item.html#exchangelib.items.item.Item">Item</a></li>
10357 <li><a title="exchangelib.items.base.BaseItem" href="items/base.html#exchangelib.items.base.BaseItem">BaseItem</a></li>
10358 <li><a title="exchangelib.items.base.RegisterMixIn" href="items/base.html#exchangelib.items.base.RegisterMixIn">RegisterMixIn</a></li>
10359 <li><a title="exchangelib.properties.IdChangeKeyMixIn" href="properties.html#exchangelib.properties.IdChangeKeyMixIn">IdChangeKeyMixIn</a></li>
10360 <li><a title="exchangelib.properties.EWSElement" href="properties.html#exchangelib.properties.EWSElement">EWSElement</a></li>
10361 </ul>
10362 <h3>Class variables</h3>
10363 <dl>
10364 <dt id="exchangelib.PostReplyItem.ELEMENT_NAME"><code class="name">var <span class="ident">ELEMENT_NAME</span></code></dt>
10365 <dd>
10366 <div class="desc"></div>
10367 </dd>
10368 <dt id="exchangelib.PostReplyItem.FIELDS"><code class="name">var <span class="ident">FIELDS</span></code></dt>
10369 <dd>
10370 <div class="desc"></div>
10371 </dd>
10372 <dt id="exchangelib.PostReplyItem.culture_idx"><code class="name">var <span class="ident">culture_idx</span></code></dt>
10373 <dd>
10374 <div class="desc"></div>
10375 </dd>
10376 <dt id="exchangelib.PostReplyItem.sender_idx"><code class="name">var <span class="ident">sender_idx</span></code></dt>
10377 <dd>
10378 <div class="desc"></div>
10379 </dd>
10380 </dl>
10381 <h3>Instance variables</h3>
10382 <dl>
10383 <dt id="exchangelib.PostReplyItem.author"><code class="name">var <span class="ident">author</span></code></dt>
10384 <dd>
10385 <div class="desc"></div>
10386 </dd>
10387 <dt id="exchangelib.PostReplyItem.bcc_recipients"><code class="name">var <span class="ident">bcc_recipients</span></code></dt>
10388 <dd>
10389 <div class="desc"></div>
10390 </dd>
10391 <dt id="exchangelib.PostReplyItem.cc_recipients"><code class="name">var <span class="ident">cc_recipients</span></code></dt>
10392 <dd>
10393 <div class="desc"></div>
10394 </dd>
10395 <dt id="exchangelib.PostReplyItem.conversation_index"><code class="name">var <span class="ident">conversation_index</span></code></dt>
10396 <dd>
10397 <div class="desc"></div>
10398 </dd>
10399 <dt id="exchangelib.PostReplyItem.conversation_topic"><code class="name">var <span class="ident">conversation_topic</span></code></dt>
10400 <dd>
10401 <div class="desc"></div>
10402 </dd>
10403 <dt id="exchangelib.PostReplyItem.is_delivery_receipt_requested"><code class="name">var <span class="ident">is_delivery_receipt_requested</span></code></dt>
10404 <dd>
10405 <div class="desc"></div>
10406 </dd>
10407 <dt id="exchangelib.PostReplyItem.is_read"><code class="name">var <span class="ident">is_read</span></code></dt>
10408 <dd>
10409 <div class="desc"></div>
10410 </dd>
10411 <dt id="exchangelib.PostReplyItem.is_read_receipt_requested"><code class="name">var <span class="ident">is_read_receipt_requested</span></code></dt>
10412 <dd>
10413 <div class="desc"></div>
10414 </dd>
10415 <dt id="exchangelib.PostReplyItem.is_response_requested"><code class="name">var <span class="ident">is_response_requested</span></code></dt>
10416 <dd>
10417 <div class="desc"></div>
10418 </dd>
10419 <dt id="exchangelib.PostReplyItem.message_id"><code class="name">var <span class="ident">message_id</span></code></dt>
10420 <dd>
10421 <div class="desc"></div>
10422 </dd>
10423 <dt id="exchangelib.PostReplyItem.new_body"><code class="name">var <span class="ident">new_body</span></code></dt>
10424 <dd>
10425 <div class="desc"></div>
10426 </dd>
10427 <dt id="exchangelib.PostReplyItem.received_by"><code class="name">var <span class="ident">received_by</span></code></dt>
10428 <dd>
10429 <div class="desc"></div>
10430 </dd>
10431 <dt id="exchangelib.PostReplyItem.received_representing"><code class="name">var <span class="ident">received_representing</span></code></dt>
10432 <dd>
10433 <div class="desc"></div>
10434 </dd>
10435 <dt id="exchangelib.PostReplyItem.references"><code class="name">var <span class="ident">references</span></code></dt>
10436 <dd>
10437 <div class="desc"></div>
10438 </dd>
10439 <dt id="exchangelib.PostReplyItem.reminder_message_data"><code class="name">var <span class="ident">reminder_message_data</span></code></dt>
10440 <dd>
10441 <div class="desc"></div>
10442 </dd>
10443 <dt id="exchangelib.PostReplyItem.reply_to"><code class="name">var <span class="ident">reply_to</span></code></dt>
10444 <dd>
10445 <div class="desc"></div>
10446 </dd>
10447 <dt id="exchangelib.PostReplyItem.sender"><code class="name">var <span class="ident">sender</span></code></dt>
10448 <dd>
10449 <div class="desc"></div>
10450 </dd>
10451 <dt id="exchangelib.PostReplyItem.to_recipients"><code class="name">var <span class="ident">to_recipients</span></code></dt>
1024710452 <dd>
1024810453 <div class="desc"></div>
1024910454 </dd>
1159611801 :param folder_name:
1159711802 :param locale: a string, e.g. &#39;da_DK&#39;
1159811803 &#34;&#34;&#34;
11599 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS:
11804 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS + MISC_FOLDERS:
1160011805 if folder_name.lower() in folder_cls.localized_names(locale):
1160111806 return folder_cls
1160211807 raise KeyError()
1166211867 :param folder_name:
1166311868 :param locale: a string, e.g. &#39;da_DK&#39;
1166411869 &#34;&#34;&#34;
11665 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS:
11870 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS + MISC_FOLDERS:
1166611871 if folder_name.lower() in folder_cls.localized_names(locale):
1166711872 return folder_cls
1166811873 raise KeyError()</code></pre>
1321913424 </li>
1322013425 <li>
1322113426 <h4><code><a title="exchangelib.OAuth2AuthorizationCodeCredentials" href="#exchangelib.OAuth2AuthorizationCodeCredentials">OAuth2AuthorizationCodeCredentials</a></code></h4>
13427 <ul class="">
13428 <li><code><a title="exchangelib.OAuth2AuthorizationCodeCredentials.scope" href="#exchangelib.OAuth2AuthorizationCodeCredentials.scope">scope</a></code></li>
13429 <li><code><a title="exchangelib.OAuth2AuthorizationCodeCredentials.token_url" href="#exchangelib.OAuth2AuthorizationCodeCredentials.token_url">token_url</a></code></li>
13430 </ul>
1322213431 </li>
1322313432 <li>
1322413433 <h4><code><a title="exchangelib.OAuth2Credentials" href="#exchangelib.OAuth2Credentials">OAuth2Credentials</a></code></h4>
1322513434 <ul class="">
1322613435 <li><code><a title="exchangelib.OAuth2Credentials.on_token_auto_refreshed" href="#exchangelib.OAuth2Credentials.on_token_auto_refreshed">on_token_auto_refreshed</a></code></li>
13436 <li><code><a title="exchangelib.OAuth2Credentials.scope" href="#exchangelib.OAuth2Credentials.scope">scope</a></code></li>
1322713437 <li><code><a title="exchangelib.OAuth2Credentials.sig" href="#exchangelib.OAuth2Credentials.sig">sig</a></code></li>
13438 <li><code><a title="exchangelib.OAuth2Credentials.token_url" href="#exchangelib.OAuth2Credentials.token_url">token_url</a></code></li>
1322813439 </ul>
1322913440 </li>
1323013441 <li>
1326113472 <li><code><a title="exchangelib.PostItem.posted_time" href="#exchangelib.PostItem.posted_time">posted_time</a></code></li>
1326213473 <li><code><a title="exchangelib.PostItem.references" href="#exchangelib.PostItem.references">references</a></code></li>
1326313474 <li><code><a title="exchangelib.PostItem.sender" href="#exchangelib.PostItem.sender">sender</a></code></li>
13475 </ul>
13476 </li>
13477 <li>
13478 <h4><code><a title="exchangelib.PostReplyItem" href="#exchangelib.PostReplyItem">PostReplyItem</a></code></h4>
13479 <ul class="">
13480 <li><code><a title="exchangelib.PostReplyItem.ELEMENT_NAME" href="#exchangelib.PostReplyItem.ELEMENT_NAME">ELEMENT_NAME</a></code></li>
13481 <li><code><a title="exchangelib.PostReplyItem.FIELDS" href="#exchangelib.PostReplyItem.FIELDS">FIELDS</a></code></li>
13482 <li><code><a title="exchangelib.PostReplyItem.author" href="#exchangelib.PostReplyItem.author">author</a></code></li>
13483 <li><code><a title="exchangelib.PostReplyItem.bcc_recipients" href="#exchangelib.PostReplyItem.bcc_recipients">bcc_recipients</a></code></li>
13484 <li><code><a title="exchangelib.PostReplyItem.cc_recipients" href="#exchangelib.PostReplyItem.cc_recipients">cc_recipients</a></code></li>
13485 <li><code><a title="exchangelib.PostReplyItem.conversation_index" href="#exchangelib.PostReplyItem.conversation_index">conversation_index</a></code></li>
13486 <li><code><a title="exchangelib.PostReplyItem.conversation_topic" href="#exchangelib.PostReplyItem.conversation_topic">conversation_topic</a></code></li>
13487 <li><code><a title="exchangelib.PostReplyItem.culture_idx" href="#exchangelib.PostReplyItem.culture_idx">culture_idx</a></code></li>
13488 <li><code><a title="exchangelib.PostReplyItem.is_delivery_receipt_requested" href="#exchangelib.PostReplyItem.is_delivery_receipt_requested">is_delivery_receipt_requested</a></code></li>
13489 <li><code><a title="exchangelib.PostReplyItem.is_read" href="#exchangelib.PostReplyItem.is_read">is_read</a></code></li>
13490 <li><code><a title="exchangelib.PostReplyItem.is_read_receipt_requested" href="#exchangelib.PostReplyItem.is_read_receipt_requested">is_read_receipt_requested</a></code></li>
13491 <li><code><a title="exchangelib.PostReplyItem.is_response_requested" href="#exchangelib.PostReplyItem.is_response_requested">is_response_requested</a></code></li>
13492 <li><code><a title="exchangelib.PostReplyItem.message_id" href="#exchangelib.PostReplyItem.message_id">message_id</a></code></li>
13493 <li><code><a title="exchangelib.PostReplyItem.new_body" href="#exchangelib.PostReplyItem.new_body">new_body</a></code></li>
13494 <li><code><a title="exchangelib.PostReplyItem.received_by" href="#exchangelib.PostReplyItem.received_by">received_by</a></code></li>
13495 <li><code><a title="exchangelib.PostReplyItem.received_representing" href="#exchangelib.PostReplyItem.received_representing">received_representing</a></code></li>
13496 <li><code><a title="exchangelib.PostReplyItem.references" href="#exchangelib.PostReplyItem.references">references</a></code></li>
13497 <li><code><a title="exchangelib.PostReplyItem.reminder_message_data" href="#exchangelib.PostReplyItem.reminder_message_data">reminder_message_data</a></code></li>
13498 <li><code><a title="exchangelib.PostReplyItem.reply_to" href="#exchangelib.PostReplyItem.reply_to">reply_to</a></code></li>
13499 <li><code><a title="exchangelib.PostReplyItem.sender" href="#exchangelib.PostReplyItem.sender">sender</a></code></li>
13500 <li><code><a title="exchangelib.PostReplyItem.sender_idx" href="#exchangelib.PostReplyItem.sender_idx">sender_idx</a></code></li>
13501 <li><code><a title="exchangelib.PostReplyItem.to_recipients" href="#exchangelib.PostReplyItem.to_recipients">to_recipients</a></code></li>
1326413502 </ul>
1326513503 </li>
1326613504 <li>
437437
438438 @require_account
439439 def send(self, message_disposition=SEND_AND_SAVE_COPY):
440 # Some responses contain multiple response IDs, e.g. MeetingRequest.accept(). Return either the single ID or
441 # the list of IDs.
442440 from ..services import CreateItem
443441
444 return CreateItem(account=self.account).get(
445 items=[self],
446 folder=self.folder,
447 message_disposition=message_disposition,
448 send_meeting_invitations=SEND_TO_NONE,
442 res = list(
443 CreateItem(account=self.account).call(
444 items=[self],
445 folder=self.folder,
446 message_disposition=message_disposition,
447 send_meeting_invitations=SEND_TO_NONE,
448 )
449449 )
450 for r in res:
451 if isinstance(r, Exception):
452 raise r
453 # CreateItem may return multiple item IDs when given a meeting reply item. See issue#886. In lack of a better
454 # idea, return either the single ID or the list of IDs here.
455 if len(res) == 1:
456 return res[0]
457 return res
450458
451459
452460 class AcceptItem(BaseMeetingReplyItem):
858866
859867 @require_account
860868 def send(self, message_disposition=SEND_AND_SAVE_COPY):
861 # Some responses contain multiple response IDs, e.g. MeetingRequest.accept(). Return either the single ID or
862 # the list of IDs.
863869 from ..services import CreateItem
864870
865 return CreateItem(account=self.account).get(
866 items=[self],
867 folder=self.folder,
868 message_disposition=message_disposition,
869 send_meeting_invitations=SEND_TO_NONE,
870 )</code></pre>
871 res = list(
872 CreateItem(account=self.account).call(
873 items=[self],
874 folder=self.folder,
875 message_disposition=message_disposition,
876 send_meeting_invitations=SEND_TO_NONE,
877 )
878 )
879 for r in res:
880 if isinstance(r, Exception):
881 raise r
882 # CreateItem may return multiple item IDs when given a meeting reply item. See issue#886. In lack of a better
883 # idea, return either the single ID or the list of IDs here.
884 if len(res) == 1:
885 return res[0]
886 return res</code></pre>
871887 </details>
872888 <h3>Ancestors</h3>
873889 <ul class="hlist">
969985 </summary>
970986 <pre><code class="python">@require_account
971987 def send(self, message_disposition=SEND_AND_SAVE_COPY):
972 # Some responses contain multiple response IDs, e.g. MeetingRequest.accept(). Return either the single ID or
973 # the list of IDs.
974988 from ..services import CreateItem
975989
976 return CreateItem(account=self.account).get(
977 items=[self],
978 folder=self.folder,
979 message_disposition=message_disposition,
980 send_meeting_invitations=SEND_TO_NONE,
981 )</code></pre>
990 res = list(
991 CreateItem(account=self.account).call(
992 items=[self],
993 folder=self.folder,
994 message_disposition=message_disposition,
995 send_meeting_invitations=SEND_TO_NONE,
996 )
997 )
998 for r in res:
999 if isinstance(r, Exception):
1000 raise r
1001 # CreateItem may return multiple item IDs when given a meeting reply item. See issue#886. In lack of a better
1002 # idea, return either the single ID or the list of IDs here.
1003 if len(res) == 1:
1004 return res[0]
1005 return res</code></pre>
9821006 </details>
9831007 </dd>
9841008 </dl>
808808 hobbies = StringAttributedValueField(field_uri=&#34;persona:Hobbies&#34;)
809809 wedding_anniversaries = StringAttributedValueField(field_uri=&#34;persona:WeddingAnniversaries&#34;)
810810 birthdays = StringAttributedValueField(field_uri=&#34;persona:Birthdays&#34;)
811 locations = StringAttributedValueField(field_uri=&#34;persona:Locations&#34;)</code></pre>
811 locations = StringAttributedValueField(field_uri=&#34;persona:Locations&#34;)
812 # This class has an additional field of type &#34;ExtendedPropertyAttributedValueField&#34; and
813 # field_uri &#39;persona:ExtendedProperties&#39;</code></pre>
812814 </details>
813815 <h3>Ancestors</h3>
814816 <ul class="hlist">
30143014 conversation_topic = CharField(field_uri=&#34;message:ConversationTopic&#34;, is_read_only=True)
30153015 # Rename &#39;From&#39; to &#39;author&#39;. We can&#39;t use fieldname &#39;from&#39; since it&#39;s a Python keyword.
30163016 author = MailboxField(field_uri=&#34;message:From&#34;, is_read_only_after_send=True)
3017 message_id = CharField(field_uri=&#34;message:InternetMessageId&#34;, is_read_only_after_send=True)
3017 message_id = TextField(field_uri=&#34;message:InternetMessageId&#34;, is_read_only_after_send=True)
30183018 is_read = BooleanField(field_uri=&#34;message:IsRead&#34;, is_required=True, default=False)
30193019 is_response_requested = BooleanField(field_uri=&#34;message:IsResponseRequested&#34;, default=False, is_required=True)
30203020 references = TextField(field_uri=&#34;message:References&#34;)
31463146 from ..services import MarkAsJunk
31473147
31483148 res = MarkAsJunk(account=self.account).get(
3149 items=[self], is_junk=is_junk, move_item=move_item, expect_result=move_item
3149 items=[self], is_junk=is_junk, move_item=move_item, expect_result=None
31503150 )
31513151 if res is None:
31523152 return
33203320 from ..services import MarkAsJunk
33213321
33223322 res = MarkAsJunk(account=self.account).get(
3323 items=[self], is_junk=is_junk, move_item=move_item, expect_result=move_item
3323 items=[self], is_junk=is_junk, move_item=move_item, expect_result=None
33243324 )
33253325 if res is None:
33263326 return
35753575 hobbies = StringAttributedValueField(field_uri=&#34;persona:Hobbies&#34;)
35763576 wedding_anniversaries = StringAttributedValueField(field_uri=&#34;persona:WeddingAnniversaries&#34;)
35773577 birthdays = StringAttributedValueField(field_uri=&#34;persona:Birthdays&#34;)
3578 locations = StringAttributedValueField(field_uri=&#34;persona:Locations&#34;)</code></pre>
3578 locations = StringAttributedValueField(field_uri=&#34;persona:Locations&#34;)
3579 # This class has an additional field of type &#34;ExtendedPropertyAttributedValueField&#34; and
3580 # field_uri &#39;persona:ExtendedProperties&#39;</code></pre>
35793581 </details>
35803582 <h3>Ancestors</h3>
35813583 <ul class="hlist">
6464 conversation_topic = CharField(field_uri=&#34;message:ConversationTopic&#34;, is_read_only=True)
6565 # Rename &#39;From&#39; to &#39;author&#39;. We can&#39;t use fieldname &#39;from&#39; since it&#39;s a Python keyword.
6666 author = MailboxField(field_uri=&#34;message:From&#34;, is_read_only_after_send=True)
67 message_id = CharField(field_uri=&#34;message:InternetMessageId&#34;, is_read_only_after_send=True)
67 message_id = TextField(field_uri=&#34;message:InternetMessageId&#34;, is_read_only_after_send=True)
6868 is_read = BooleanField(field_uri=&#34;message:IsRead&#34;, is_required=True, default=False)
6969 is_response_requested = BooleanField(field_uri=&#34;message:IsResponseRequested&#34;, default=False, is_required=True)
7070 references = TextField(field_uri=&#34;message:References&#34;)
196196 from ..services import MarkAsJunk
197197
198198 res = MarkAsJunk(account=self.account).get(
199 items=[self], is_junk=is_junk, move_item=move_item, expect_result=move_item
199 items=[self], is_junk=is_junk, move_item=move_item, expect_result=None
200200 )
201201 if res is None:
202202 return
315315 conversation_topic = CharField(field_uri=&#34;message:ConversationTopic&#34;, is_read_only=True)
316316 # Rename &#39;From&#39; to &#39;author&#39;. We can&#39;t use fieldname &#39;from&#39; since it&#39;s a Python keyword.
317317 author = MailboxField(field_uri=&#34;message:From&#34;, is_read_only_after_send=True)
318 message_id = CharField(field_uri=&#34;message:InternetMessageId&#34;, is_read_only_after_send=True)
318 message_id = TextField(field_uri=&#34;message:InternetMessageId&#34;, is_read_only_after_send=True)
319319 is_read = BooleanField(field_uri=&#34;message:IsRead&#34;, is_required=True, default=False)
320320 is_response_requested = BooleanField(field_uri=&#34;message:IsResponseRequested&#34;, default=False, is_required=True)
321321 references = TextField(field_uri=&#34;message:References&#34;)
447447 from ..services import MarkAsJunk
448448
449449 res = MarkAsJunk(account=self.account).get(
450 items=[self], is_junk=is_junk, move_item=move_item, expect_result=move_item
450 items=[self], is_junk=is_junk, move_item=move_item, expect_result=None
451451 )
452452 if res is None:
453453 return
621621 from ..services import MarkAsJunk
622622
623623 res = MarkAsJunk(account=self.account).get(
624 items=[self], is_junk=is_junk, move_item=move_item, expect_result=move_item
624 items=[self], is_junk=is_junk, move_item=move_item, expect_result=None
625625 )
626626 if res is None:
627627 return
3434 from inspect import getmro
3535 from threading import Lock
3636
37 from .errors import InvalidTypeError, TimezoneDefinitionInvalidForYear
37 from .errors import InvalidTypeError
3838 from .fields import (
3939 WEEKDAY_NAMES,
4040 AssociatedCalendarItemIdField,
246246 # Folder class, making the custom field available for subclasses).
247247 if local_fields:
248248 kwargs[&#34;FIELDS&#34;] = fields
249 cls = super().__new__(mcs, name, bases, kwargs)
250 cls._slots_keys = mcs._get_slots_keys(cls)
251 return cls
249 klass = super().__new__(mcs, name, bases, kwargs)
250 klass._slots_keys = mcs._get_slots_keys(klass)
251 return klass
252252
253253 @staticmethod
254 def _get_slots_keys(cls):
254 def _get_slots_keys(klass):
255255 seen = set()
256256 keys = []
257 for c in reversed(getmro(cls)):
257 for c in reversed(getmro(klass)):
258258 if not hasattr(c, &#34;__slots__&#34;):
259259 continue
260260 for k in c.__slots__:
607607 def id_from_xml(cls, elem):
608608 item = cls.from_xml(elem=elem, account=None)
609609 return item.id, item.changekey
610
611
612 class OldItemId(ItemId):
613 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldfolderid&#34;&#34;&#34;
614
615 ELEMENT_NAME = &#34;OldItemId&#34;
616
617
618 class OldFolderId(FolderId):
619 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/olditemid&#34;&#34;&#34;
620
621 ELEMENT_NAME = &#34;OldFolderId&#34;
622
623
624 class OldParentFolderId(ParentFolderId):
625 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldparentfolderid&#34;&#34;&#34;
626
627 ELEMENT_NAME = &#34;OldParentFolderId&#34;
610628
611629
612630 class Mailbox(EWSElement):
14361454 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/responseobjects&#34;&#34;&#34;
14371455
14381456 ELEMENT_NAME = &#34;ResponseObjects&#34;
1439 NAMESPACE = EWSElement.NAMESPACE
1440
1441 accept_item = EWSElementField(field_uri=&#34;AcceptItem&#34;, value_cls=&#34;AcceptItem&#34;, namespace=NAMESPACE)
1457
1458 accept_item = EWSElementField(field_uri=&#34;AcceptItem&#34;, value_cls=&#34;AcceptItem&#34;, namespace=TNS)
14421459 tentatively_accept_item = EWSElementField(
1443 field_uri=&#34;TentativelyAcceptItem&#34;, value_cls=&#34;TentativelyAcceptItem&#34;, namespace=NAMESPACE
1460 field_uri=&#34;TentativelyAcceptItem&#34;, value_cls=&#34;TentativelyAcceptItem&#34;, namespace=TNS
14441461 )
1445 decline_item = EWSElementField(field_uri=&#34;DeclineItem&#34;, value_cls=&#34;DeclineItem&#34;, namespace=NAMESPACE)
1446 reply_to_item = EWSElementField(field_uri=&#34;ReplyToItem&#34;, value_cls=&#34;ReplyToItem&#34;, namespace=NAMESPACE)
1447 forward_item = EWSElementField(field_uri=&#34;ForwardItem&#34;, value_cls=&#34;ForwardItem&#34;, namespace=NAMESPACE)
1448 reply_all_to_item = EWSElementField(field_uri=&#34;ReplyAllToItem&#34;, value_cls=&#34;ReplyAllToItem&#34;, namespace=NAMESPACE)
1462 decline_item = EWSElementField(field_uri=&#34;DeclineItem&#34;, value_cls=&#34;DeclineItem&#34;, namespace=TNS)
1463 reply_to_item = EWSElementField(field_uri=&#34;ReplyToItem&#34;, value_cls=&#34;ReplyToItem&#34;, namespace=TNS)
1464 forward_item = EWSElementField(field_uri=&#34;ForwardItem&#34;, value_cls=&#34;ForwardItem&#34;, namespace=TNS)
1465 reply_all_to_item = EWSElementField(field_uri=&#34;ReplyAllToItem&#34;, value_cls=&#34;ReplyAllToItem&#34;, namespace=TNS)
14491466 cancel_calendar_item = EWSElementField(
1450 field_uri=&#34;CancelCalendarItem&#34;, value_cls=&#34;CancelCalendarItem&#34;, namespace=NAMESPACE
1467 field_uri=&#34;CancelCalendarItem&#34;, value_cls=&#34;CancelCalendarItem&#34;, namespace=TNS
14511468 )
14521469 remove_item = EWSElementField(field_uri=&#34;RemoveItem&#34;, value_cls=RemoveItem)
1453 post_reply_item = EWSElementField(
1454 field_uri=&#34;PostReplyItem&#34;, value_cls=&#34;PostReplyItem&#34;, namespace=EWSElement.NAMESPACE
1455 )
1470 post_reply_item = EWSElementField(field_uri=&#34;PostReplyItem&#34;, value_cls=&#34;PostReplyItem&#34;, namespace=TNS)
14561471 success_read_receipt = EWSElementField(field_uri=&#34;SuppressReadReceipt&#34;, value_cls=SuppressReadReceipt)
14571472 accept_sharing_invitation = EWSElementField(field_uri=&#34;AcceptSharingInvitation&#34;, value_cls=AcceptSharingInvitation)
14581473
17321747 ITEM = &#34;item&#34;
17331748
17341749 timestamp = DateTimeField(field_uri=&#34;TimeStamp&#34;)
1735 item_id = EWSElementField(field_uri=&#34;ItemId&#34;, value_cls=ItemId)
1736 folder_id = EWSElementField(field_uri=&#34;FolderId&#34;, value_cls=FolderId)
1737 parent_folder_id = EWSElementField(field_uri=&#34;ParentFolderId&#34;, value_cls=ParentFolderId)
1750 item_id = EWSElementField(value_cls=ItemId)
1751 folder_id = EWSElementField(value_cls=FolderId)
1752 parent_folder_id = EWSElementField(value_cls=ParentFolderId)
17381753
17391754 @property
17401755 def event_type(self):
17481763 class OldTimestampEvent(TimestampEvent, metaclass=EWSMeta):
17491764 &#34;&#34;&#34;Base class for both item and folder copy/move events.&#34;&#34;&#34;
17501765
1751 old_item_id = EWSElementField(field_uri=&#34;OldItemId&#34;, value_cls=ItemId)
1752 old_folder_id = EWSElementField(field_uri=&#34;OldFolderId&#34;, value_cls=FolderId)
1753 old_parent_folder_id = EWSElementField(field_uri=&#34;OldParentFolderId&#34;, value_cls=ParentFolderId)
1766 old_item_id = EWSElementField(value_cls=OldItemId)
1767 old_folder_id = EWSElementField(value_cls=OldFolderId)
1768 old_parent_folder_id = EWSElementField(value_cls=OldParentFolderId)
17541769
17551770
17561771 class CopiedEvent(OldTimestampEvent):
18911906 name = CharField(field_uri=&#34;Name&#34;, is_attribute=True)
18921907 bias = TimeDeltaField(field_uri=&#34;Bias&#34;, is_attribute=True)
18931908
1894 def _split_id(self):
1895 to_year, to_type = self.id.rsplit(&#34;/&#34;, 1)[1].split(&#34;-&#34;)
1896 return int(to_year), to_type
1897
1898 @property
1899 def year(self):
1900 return self._split_id()[0]
1901
1902 @property
1903 def type(self):
1904 return self._split_id()[1]
1905
19061909 @property
19071910 def bias_in_minutes(self):
19081911 return int(self.bias.total_seconds()) // 60 # Convert to minutes
19331936 def from_xml(cls, elem, account):
19341937 return super().from_xml(elem, account)
19351938
1936 def _get_standard_period(self, for_year):
1937 # Look through periods and pick a relevant period according to the &#39;for_year&#39; value
1938 valid_period = None
1939 for period in sorted(self.periods, key=lambda p: (p.year, p.type)):
1940 if period.year &gt; for_year:
1941 break
1942 if period.type != &#34;Standard&#34;:
1939 def _get_standard_period(self, transitions_group):
1940 # Find the first standard period referenced from transitions_group
1941 standard_periods_map = {p.id: p for p in self.periods if p.name == &#34;Standard&#34;}
1942 for transition in transitions_group.transitions:
1943 try:
1944 return standard_periods_map[transition.to]
1945 except KeyError:
19431946 continue
1944 valid_period = period
1945 if valid_period is None:
1946 raise TimezoneDefinitionInvalidForYear(f&#34;Year {for_year} not included in periods {self.periods}&#34;)
1947 return valid_period
1947 raise ValueError(f&#34;No standard period matching any transition in {transitions_group}&#34;)
19481948
19491949 def _get_transitions_group(self, for_year):
19501950 # Look through the transitions, and pick the relevant transition group according to the &#39;for_year&#39; value
19661966 if not 0 &lt;= len(transitions_group.transitions) &lt;= 2:
19671967 raise ValueError(f&#34;Expected 0-2 transitions in transitions group {transitions_group}&#34;)
19681968
1969 standard_period = self._get_standard_period(for_year)
1969 standard_period = self._get_standard_period(transitions_group)
19701970 periods_map = {p.id: p for p in self.periods}
19711971 standard_time, daylight_time = None, None
19721972 if len(transitions_group.transitions) == 1:
35343534 <pre><code class="python">class ConversationId(ItemId):
35353535 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/conversationid&#34;&#34;&#34;
35363536
3537 ELEMENT_NAME = &#34;ConversationId&#34;</code></pre>
3537 ELEMENT_NAME = &#34;ConversationId&#34;
3538
3539 # ChangeKey attribute is sometimes required, see MSDN link</code></pre>
35383540 </details>
35393541 <h3>Ancestors</h3>
35403542 <ul class="hlist">
46144616 <span>(</span><span>*args, **kwargs)</span>
46154617 </code></dt>
46164618 <dd>
4617 <div class="desc"><p>type(object_or_name, bases, dict)
4618 type(object) -&gt; the object's type
4619 type(name, bases, dict) -&gt; a new type</p></div>
4619 <div class="desc"><p>type(object) -&gt; the object's type
4620 type(name, bases, dict, **kwds) -&gt; a new type</p></div>
46204621 <details class="source">
46214622 <summary>
46224623 <span>Expand source code</span>
46524653 # Folder class, making the custom field available for subclasses).
46534654 if local_fields:
46544655 kwargs[&#34;FIELDS&#34;] = fields
4655 cls = super().__new__(mcs, name, bases, kwargs)
4656 cls._slots_keys = mcs._get_slots_keys(cls)
4657 return cls
4656 klass = super().__new__(mcs, name, bases, kwargs)
4657 klass._slots_keys = mcs._get_slots_keys(klass)
4658 return klass
46584659
46594660 @staticmethod
4660 def _get_slots_keys(cls):
4661 def _get_slots_keys(klass):
46614662 seen = set()
46624663 keys = []
4663 for c in reversed(getmro(cls)):
4664 for c in reversed(getmro(klass)):
46644665 if not hasattr(c, &#34;__slots__&#34;):
46654666 continue
46664667 for k in c.__slots__:
54345435 <h3>Subclasses</h3>
54355436 <ul class="hlist">
54365437 <li><a title="exchangelib.properties.DistinguishedFolderId" href="#exchangelib.properties.DistinguishedFolderId">DistinguishedFolderId</a></li>
5438 <li><a title="exchangelib.properties.OldFolderId" href="#exchangelib.properties.OldFolderId">OldFolderId</a></li>
54375439 </ul>
54385440 <h3>Class variables</h3>
54395441 <dl>
60226024 <li><a title="exchangelib.properties.ConversationId" href="#exchangelib.properties.ConversationId">ConversationId</a></li>
60236025 <li><a title="exchangelib.properties.FolderId" href="#exchangelib.properties.FolderId">FolderId</a></li>
60246026 <li><a title="exchangelib.properties.MovedItemId" href="#exchangelib.properties.MovedItemId">MovedItemId</a></li>
6027 <li><a title="exchangelib.properties.OldItemId" href="#exchangelib.properties.OldItemId">OldItemId</a></li>
60256028 <li><a title="exchangelib.properties.ParentFolderId" href="#exchangelib.properties.ParentFolderId">ParentFolderId</a></li>
60266029 <li><a title="exchangelib.properties.ParentItemId" href="#exchangelib.properties.ParentItemId">ParentItemId</a></li>
60276030 <li><a title="exchangelib.properties.PersonaId" href="#exchangelib.properties.PersonaId">PersonaId</a></li>
68586861 </li>
68596862 </ul>
68606863 </dd>
6864 <dt id="exchangelib.properties.OldFolderId"><code class="flex name class">
6865 <span>class <span class="ident">OldFolderId</span></span>
6866 <span>(</span><span>*args, **kwargs)</span>
6867 </code></dt>
6868 <dd>
6869 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/olditemid">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/olditemid</a></p></div>
6870 <details class="source">
6871 <summary>
6872 <span>Expand source code</span>
6873 </summary>
6874 <pre><code class="python">class OldFolderId(FolderId):
6875 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/olditemid&#34;&#34;&#34;
6876
6877 ELEMENT_NAME = &#34;OldFolderId&#34;</code></pre>
6878 </details>
6879 <h3>Ancestors</h3>
6880 <ul class="hlist">
6881 <li><a title="exchangelib.properties.FolderId" href="#exchangelib.properties.FolderId">FolderId</a></li>
6882 <li><a title="exchangelib.properties.ItemId" href="#exchangelib.properties.ItemId">ItemId</a></li>
6883 <li><a title="exchangelib.properties.BaseItemId" href="#exchangelib.properties.BaseItemId">BaseItemId</a></li>
6884 <li><a title="exchangelib.properties.EWSElement" href="#exchangelib.properties.EWSElement">EWSElement</a></li>
6885 </ul>
6886 <h3>Class variables</h3>
6887 <dl>
6888 <dt id="exchangelib.properties.OldFolderId.ELEMENT_NAME"><code class="name">var <span class="ident">ELEMENT_NAME</span></code></dt>
6889 <dd>
6890 <div class="desc"></div>
6891 </dd>
6892 </dl>
6893 <h3>Inherited members</h3>
6894 <ul class="hlist">
6895 <li><code><b><a title="exchangelib.properties.FolderId" href="#exchangelib.properties.FolderId">FolderId</a></b></code>:
6896 <ul class="hlist">
6897 <li><code><a title="exchangelib.properties.FolderId.add_field" href="#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
6898 <li><code><a title="exchangelib.properties.FolderId.remove_field" href="#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
6899 <li><code><a title="exchangelib.properties.FolderId.supported_fields" href="#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
6900 <li><code><a title="exchangelib.properties.FolderId.validate_field" href="#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
6901 </ul>
6902 </li>
6903 </ul>
6904 </dd>
6905 <dt id="exchangelib.properties.OldItemId"><code class="flex name class">
6906 <span>class <span class="ident">OldItemId</span></span>
6907 <span>(</span><span>*args, **kwargs)</span>
6908 </code></dt>
6909 <dd>
6910 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldfolderid">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldfolderid</a></p></div>
6911 <details class="source">
6912 <summary>
6913 <span>Expand source code</span>
6914 </summary>
6915 <pre><code class="python">class OldItemId(ItemId):
6916 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldfolderid&#34;&#34;&#34;
6917
6918 ELEMENT_NAME = &#34;OldItemId&#34;</code></pre>
6919 </details>
6920 <h3>Ancestors</h3>
6921 <ul class="hlist">
6922 <li><a title="exchangelib.properties.ItemId" href="#exchangelib.properties.ItemId">ItemId</a></li>
6923 <li><a title="exchangelib.properties.BaseItemId" href="#exchangelib.properties.BaseItemId">BaseItemId</a></li>
6924 <li><a title="exchangelib.properties.EWSElement" href="#exchangelib.properties.EWSElement">EWSElement</a></li>
6925 </ul>
6926 <h3>Class variables</h3>
6927 <dl>
6928 <dt id="exchangelib.properties.OldItemId.ELEMENT_NAME"><code class="name">var <span class="ident">ELEMENT_NAME</span></code></dt>
6929 <dd>
6930 <div class="desc"></div>
6931 </dd>
6932 </dl>
6933 <h3>Inherited members</h3>
6934 <ul class="hlist">
6935 <li><code><b><a title="exchangelib.properties.ItemId" href="#exchangelib.properties.ItemId">ItemId</a></b></code>:
6936 <ul class="hlist">
6937 <li><code><a title="exchangelib.properties.ItemId.add_field" href="#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
6938 <li><code><a title="exchangelib.properties.ItemId.remove_field" href="#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
6939 <li><code><a title="exchangelib.properties.ItemId.supported_fields" href="#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
6940 <li><code><a title="exchangelib.properties.ItemId.validate_field" href="#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
6941 </ul>
6942 </li>
6943 </ul>
6944 </dd>
6945 <dt id="exchangelib.properties.OldParentFolderId"><code class="flex name class">
6946 <span>class <span class="ident">OldParentFolderId</span></span>
6947 <span>(</span><span>*args, **kwargs)</span>
6948 </code></dt>
6949 <dd>
6950 <div class="desc"><p>MSDN: <a href="https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldparentfolderid">https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldparentfolderid</a></p></div>
6951 <details class="source">
6952 <summary>
6953 <span>Expand source code</span>
6954 </summary>
6955 <pre><code class="python">class OldParentFolderId(ParentFolderId):
6956 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldparentfolderid&#34;&#34;&#34;
6957
6958 ELEMENT_NAME = &#34;OldParentFolderId&#34;</code></pre>
6959 </details>
6960 <h3>Ancestors</h3>
6961 <ul class="hlist">
6962 <li><a title="exchangelib.properties.ParentFolderId" href="#exchangelib.properties.ParentFolderId">ParentFolderId</a></li>
6963 <li><a title="exchangelib.properties.ItemId" href="#exchangelib.properties.ItemId">ItemId</a></li>
6964 <li><a title="exchangelib.properties.BaseItemId" href="#exchangelib.properties.BaseItemId">BaseItemId</a></li>
6965 <li><a title="exchangelib.properties.EWSElement" href="#exchangelib.properties.EWSElement">EWSElement</a></li>
6966 </ul>
6967 <h3>Class variables</h3>
6968 <dl>
6969 <dt id="exchangelib.properties.OldParentFolderId.ELEMENT_NAME"><code class="name">var <span class="ident">ELEMENT_NAME</span></code></dt>
6970 <dd>
6971 <div class="desc"></div>
6972 </dd>
6973 </dl>
6974 <h3>Inherited members</h3>
6975 <ul class="hlist">
6976 <li><code><b><a title="exchangelib.properties.ParentFolderId" href="#exchangelib.properties.ParentFolderId">ParentFolderId</a></b></code>:
6977 <ul class="hlist">
6978 <li><code><a title="exchangelib.properties.ParentFolderId.add_field" href="#exchangelib.properties.EWSElement.add_field">add_field</a></code></li>
6979 <li><code><a title="exchangelib.properties.ParentFolderId.remove_field" href="#exchangelib.properties.EWSElement.remove_field">remove_field</a></code></li>
6980 <li><code><a title="exchangelib.properties.ParentFolderId.supported_fields" href="#exchangelib.properties.EWSElement.supported_fields">supported_fields</a></code></li>
6981 <li><code><a title="exchangelib.properties.ParentFolderId.validate_field" href="#exchangelib.properties.EWSElement.validate_field">validate_field</a></code></li>
6982 </ul>
6983 </li>
6984 </ul>
6985 </dd>
68616986 <dt id="exchangelib.properties.OldTimestampEvent"><code class="flex name class">
68626987 <span>class <span class="ident">OldTimestampEvent</span></span>
68636988 <span>(</span><span>**kwargs)</span>
68716996 <pre><code class="python">class OldTimestampEvent(TimestampEvent, metaclass=EWSMeta):
68726997 &#34;&#34;&#34;Base class for both item and folder copy/move events.&#34;&#34;&#34;
68736998
6874 old_item_id = EWSElementField(field_uri=&#34;OldItemId&#34;, value_cls=ItemId)
6875 old_folder_id = EWSElementField(field_uri=&#34;OldFolderId&#34;, value_cls=FolderId)
6876 old_parent_folder_id = EWSElementField(field_uri=&#34;OldParentFolderId&#34;, value_cls=ParentFolderId)</code></pre>
6999 old_item_id = EWSElementField(value_cls=OldItemId)
7000 old_folder_id = EWSElementField(value_cls=OldFolderId)
7001 old_parent_folder_id = EWSElementField(value_cls=OldParentFolderId)</code></pre>
68777002 </details>
68787003 <h3>Ancestors</h3>
68797004 <ul class="hlist">
70657190 <li><a title="exchangelib.properties.BaseItemId" href="#exchangelib.properties.BaseItemId">BaseItemId</a></li>
70667191 <li><a title="exchangelib.properties.EWSElement" href="#exchangelib.properties.EWSElement">EWSElement</a></li>
70677192 </ul>
7193 <h3>Subclasses</h3>
7194 <ul class="hlist">
7195 <li><a title="exchangelib.properties.OldParentFolderId" href="#exchangelib.properties.OldParentFolderId">OldParentFolderId</a></li>
7196 </ul>
70687197 <h3>Class variables</h3>
70697198 <dl>
70707199 <dt id="exchangelib.properties.ParentFolderId.ELEMENT_NAME"><code class="name">var <span class="ident">ELEMENT_NAME</span></code></dt>
71487277 name = CharField(field_uri=&#34;Name&#34;, is_attribute=True)
71497278 bias = TimeDeltaField(field_uri=&#34;Bias&#34;, is_attribute=True)
71507279
7151 def _split_id(self):
7152 to_year, to_type = self.id.rsplit(&#34;/&#34;, 1)[1].split(&#34;-&#34;)
7153 return int(to_year), to_type
7154
7155 @property
7156 def year(self):
7157 return self._split_id()[0]
7158
7159 @property
7160 def type(self):
7161 return self._split_id()[1]
7162
71637280 @property
71647281 def bias_in_minutes(self):
71657282 return int(self.bias.total_seconds()) // 60 # Convert to minutes</code></pre>
72047321 <dt id="exchangelib.properties.Period.name"><code class="name">var <span class="ident">name</span></code></dt>
72057322 <dd>
72067323 <div class="desc"></div>
7207 </dd>
7208 <dt id="exchangelib.properties.Period.type"><code class="name">var <span class="ident">type</span></code></dt>
7209 <dd>
7210 <div class="desc"></div>
7211 <details class="source">
7212 <summary>
7213 <span>Expand source code</span>
7214 </summary>
7215 <pre><code class="python">@property
7216 def type(self):
7217 return self._split_id()[1]</code></pre>
7218 </details>
7219 </dd>
7220 <dt id="exchangelib.properties.Period.year"><code class="name">var <span class="ident">year</span></code></dt>
7221 <dd>
7222 <div class="desc"></div>
7223 <details class="source">
7224 <summary>
7225 <span>Expand source code</span>
7226 </summary>
7227 <pre><code class="python">@property
7228 def year(self):
7229 return self._split_id()[0]</code></pre>
7230 </details>
72317324 </dd>
72327325 </dl>
72337326 <h3>Inherited members</h3>
82548347 &#34;&#34;&#34;MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/responseobjects&#34;&#34;&#34;
82558348
82568349 ELEMENT_NAME = &#34;ResponseObjects&#34;
8257 NAMESPACE = EWSElement.NAMESPACE
8258
8259 accept_item = EWSElementField(field_uri=&#34;AcceptItem&#34;, value_cls=&#34;AcceptItem&#34;, namespace=NAMESPACE)
8350
8351 accept_item = EWSElementField(field_uri=&#34;AcceptItem&#34;, value_cls=&#34;AcceptItem&#34;, namespace=TNS)
82608352 tentatively_accept_item = EWSElementField(
8261 field_uri=&#34;TentativelyAcceptItem&#34;, value_cls=&#34;TentativelyAcceptItem&#34;, namespace=NAMESPACE
8353 field_uri=&#34;TentativelyAcceptItem&#34;, value_cls=&#34;TentativelyAcceptItem&#34;, namespace=TNS
82628354 )
8263 decline_item = EWSElementField(field_uri=&#34;DeclineItem&#34;, value_cls=&#34;DeclineItem&#34;, namespace=NAMESPACE)
8264 reply_to_item = EWSElementField(field_uri=&#34;ReplyToItem&#34;, value_cls=&#34;ReplyToItem&#34;, namespace=NAMESPACE)
8265 forward_item = EWSElementField(field_uri=&#34;ForwardItem&#34;, value_cls=&#34;ForwardItem&#34;, namespace=NAMESPACE)
8266 reply_all_to_item = EWSElementField(field_uri=&#34;ReplyAllToItem&#34;, value_cls=&#34;ReplyAllToItem&#34;, namespace=NAMESPACE)
8355 decline_item = EWSElementField(field_uri=&#34;DeclineItem&#34;, value_cls=&#34;DeclineItem&#34;, namespace=TNS)
8356 reply_to_item = EWSElementField(field_uri=&#34;ReplyToItem&#34;, value_cls=&#34;ReplyToItem&#34;, namespace=TNS)
8357 forward_item = EWSElementField(field_uri=&#34;ForwardItem&#34;, value_cls=&#34;ForwardItem&#34;, namespace=TNS)
8358 reply_all_to_item = EWSElementField(field_uri=&#34;ReplyAllToItem&#34;, value_cls=&#34;ReplyAllToItem&#34;, namespace=TNS)
82678359 cancel_calendar_item = EWSElementField(
8268 field_uri=&#34;CancelCalendarItem&#34;, value_cls=&#34;CancelCalendarItem&#34;, namespace=NAMESPACE
8360 field_uri=&#34;CancelCalendarItem&#34;, value_cls=&#34;CancelCalendarItem&#34;, namespace=TNS
82698361 )
82708362 remove_item = EWSElementField(field_uri=&#34;RemoveItem&#34;, value_cls=RemoveItem)
8271 post_reply_item = EWSElementField(
8272 field_uri=&#34;PostReplyItem&#34;, value_cls=&#34;PostReplyItem&#34;, namespace=EWSElement.NAMESPACE
8273 )
8363 post_reply_item = EWSElementField(field_uri=&#34;PostReplyItem&#34;, value_cls=&#34;PostReplyItem&#34;, namespace=TNS)
82748364 success_read_receipt = EWSElementField(field_uri=&#34;SuppressReadReceipt&#34;, value_cls=SuppressReadReceipt)
82758365 accept_sharing_invitation = EWSElementField(field_uri=&#34;AcceptSharingInvitation&#34;, value_cls=AcceptSharingInvitation)</code></pre>
82768366 </details>
82858375 <div class="desc"></div>
82868376 </dd>
82878377 <dt id="exchangelib.properties.ResponseObjects.FIELDS"><code class="name">var <span class="ident">FIELDS</span></code></dt>
8288 <dd>
8289 <div class="desc"></div>
8290 </dd>
8291 <dt id="exchangelib.properties.ResponseObjects.NAMESPACE"><code class="name">var <span class="ident">NAMESPACE</span></code></dt>
82928378 <dd>
82938379 <div class="desc"></div>
82948380 </dd>
92359321 def from_xml(cls, elem, account):
92369322 return super().from_xml(elem, account)
92379323
9238 def _get_standard_period(self, for_year):
9239 # Look through periods and pick a relevant period according to the &#39;for_year&#39; value
9240 valid_period = None
9241 for period in sorted(self.periods, key=lambda p: (p.year, p.type)):
9242 if period.year &gt; for_year:
9243 break
9244 if period.type != &#34;Standard&#34;:
9324 def _get_standard_period(self, transitions_group):
9325 # Find the first standard period referenced from transitions_group
9326 standard_periods_map = {p.id: p for p in self.periods if p.name == &#34;Standard&#34;}
9327 for transition in transitions_group.transitions:
9328 try:
9329 return standard_periods_map[transition.to]
9330 except KeyError:
92459331 continue
9246 valid_period = period
9247 if valid_period is None:
9248 raise TimezoneDefinitionInvalidForYear(f&#34;Year {for_year} not included in periods {self.periods}&#34;)
9249 return valid_period
9332 raise ValueError(f&#34;No standard period matching any transition in {transitions_group}&#34;)
92509333
92519334 def _get_transitions_group(self, for_year):
92529335 # Look through the transitions, and pick the relevant transition group according to the &#39;for_year&#39; value
92689351 if not 0 &lt;= len(transitions_group.transitions) &lt;= 2:
92699352 raise ValueError(f&#34;Expected 0-2 transitions in transitions group {transitions_group}&#34;)
92709353
9271 standard_period = self._get_standard_period(for_year)
9354 standard_period = self._get_standard_period(transitions_group)
92729355 periods_map = {p.id: p for p in self.periods}
92739356 standard_time, daylight_time = None, None
92749357 if len(transitions_group.transitions) == 1:
93729455 if not 0 &lt;= len(transitions_group.transitions) &lt;= 2:
93739456 raise ValueError(f&#34;Expected 0-2 transitions in transitions group {transitions_group}&#34;)
93749457
9375 standard_period = self._get_standard_period(for_year)
9458 standard_period = self._get_standard_period(transitions_group)
93769459 periods_map = {p.id: p for p in self.periods}
93779460 standard_time, daylight_time = None, None
93789461 if len(transitions_group.transitions) == 1:
95629645 ITEM = &#34;item&#34;
95639646
95649647 timestamp = DateTimeField(field_uri=&#34;TimeStamp&#34;)
9565 item_id = EWSElementField(field_uri=&#34;ItemId&#34;, value_cls=ItemId)
9566 folder_id = EWSElementField(field_uri=&#34;FolderId&#34;, value_cls=FolderId)
9567 parent_folder_id = EWSElementField(field_uri=&#34;ParentFolderId&#34;, value_cls=ParentFolderId)
9648 item_id = EWSElementField(value_cls=ItemId)
9649 folder_id = EWSElementField(value_cls=FolderId)
9650 parent_folder_id = EWSElementField(value_cls=ParentFolderId)
95689651
95699652 @property
95709653 def event_type(self):
1082910912 </ul>
1083010913 </li>
1083110914 <li>
10915 <h4><code><a title="exchangelib.properties.OldFolderId" href="#exchangelib.properties.OldFolderId">OldFolderId</a></code></h4>
10916 <ul class="">
10917 <li><code><a title="exchangelib.properties.OldFolderId.ELEMENT_NAME" href="#exchangelib.properties.OldFolderId.ELEMENT_NAME">ELEMENT_NAME</a></code></li>
10918 </ul>
10919 </li>
10920 <li>
10921 <h4><code><a title="exchangelib.properties.OldItemId" href="#exchangelib.properties.OldItemId">OldItemId</a></code></h4>
10922 <ul class="">
10923 <li><code><a title="exchangelib.properties.OldItemId.ELEMENT_NAME" href="#exchangelib.properties.OldItemId.ELEMENT_NAME">ELEMENT_NAME</a></code></li>
10924 </ul>
10925 </li>
10926 <li>
10927 <h4><code><a title="exchangelib.properties.OldParentFolderId" href="#exchangelib.properties.OldParentFolderId">OldParentFolderId</a></code></h4>
10928 <ul class="">
10929 <li><code><a title="exchangelib.properties.OldParentFolderId.ELEMENT_NAME" href="#exchangelib.properties.OldParentFolderId.ELEMENT_NAME">ELEMENT_NAME</a></code></li>
10930 </ul>
10931 </li>
10932 <li>
1083210933 <h4><code><a title="exchangelib.properties.OldTimestampEvent" href="#exchangelib.properties.OldTimestampEvent">OldTimestampEvent</a></code></h4>
1083310934 <ul class="">
1083410935 <li><code><a title="exchangelib.properties.OldTimestampEvent.FIELDS" href="#exchangelib.properties.OldTimestampEvent.FIELDS">FIELDS</a></code></li>
1087110972 <li><code><a title="exchangelib.properties.Period.bias_in_minutes" href="#exchangelib.properties.Period.bias_in_minutes">bias_in_minutes</a></code></li>
1087210973 <li><code><a title="exchangelib.properties.Period.id" href="#exchangelib.properties.Period.id">id</a></code></li>
1087310974 <li><code><a title="exchangelib.properties.Period.name" href="#exchangelib.properties.Period.name">name</a></code></li>
10874 <li><code><a title="exchangelib.properties.Period.type" href="#exchangelib.properties.Period.type">type</a></code></li>
10875 <li><code><a title="exchangelib.properties.Period.year" href="#exchangelib.properties.Period.year">year</a></code></li>
1087610975 </ul>
1087710976 </li>
1087810977 <li>
1103011129 <ul class="">
1103111130 <li><code><a title="exchangelib.properties.ResponseObjects.ELEMENT_NAME" href="#exchangelib.properties.ResponseObjects.ELEMENT_NAME">ELEMENT_NAME</a></code></li>
1103211131 <li><code><a title="exchangelib.properties.ResponseObjects.FIELDS" href="#exchangelib.properties.ResponseObjects.FIELDS">FIELDS</a></code></li>
11033 <li><code><a title="exchangelib.properties.ResponseObjects.NAMESPACE" href="#exchangelib.properties.ResponseObjects.NAMESPACE">NAMESPACE</a></code></li>
1103411132 <li><code><a title="exchangelib.properties.ResponseObjects.accept_item" href="#exchangelib.properties.ResponseObjects.accept_item">accept_item</a></code></li>
1103511133 <li><code><a title="exchangelib.properties.ResponseObjects.accept_sharing_invitation" href="#exchangelib.properties.ResponseObjects.accept_sharing_invitation">accept_sharing_invitation</a></code></li>
1103611134 <li><code><a title="exchangelib.properties.ResponseObjects.cancel_calendar_item" href="#exchangelib.properties.ResponseObjects.cancel_calendar_item">cancel_calendar_item</a></code></li>
275275 session = self.renew_session(session)
276276 self._session_pool.put(session, block=False)
277277
278 @staticmethod
279 def close_session(session):
278 def close_session(self, session):
279 if isinstance(self.credentials, OAuth2Credentials) and not isinstance(
280 self.credentials, OAuth2AuthorizationCodeCredentials
281 ):
282 # Reset token if client is of type BackendApplicationClient
283 self.credentials.access_token = None
280284 session.close()
281285 del session
282286
339343 return session
340344
341345 def create_oauth2_session(self):
342 has_token = False
343 scope = [&#34;https://outlook.office365.com/.default&#34;]
344 session_params = {}
346 session_params = {&#34;token&#34;: self.credentials.access_token} # Token may be None
345347 token_params = {}
346348
347349 if isinstance(self.credentials, OAuth2AuthorizationCodeCredentials):
348 # Ask for a refresh token
349 scope.append(&#34;offline_access&#34;)
350
351 # We don&#39;t know (or need) the Microsoft tenant ID. Use
352 # common/ to let Microsoft select the appropriate tenant
353 # for the provided authorization code or refresh token.
354 #
355 # Suppress looks-like-password warning from Bandit.
356 token_url = &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec
357
358 client_params = {}
359 has_token = self.credentials.access_token is not None
360 if has_token:
361 session_params[&#34;token&#34;] = self.credentials.access_token
362 elif self.credentials.authorization_code is not None:
363 token_params[&#34;code&#34;] = self.credentials.authorization_code
364 self.credentials.authorization_code = None
365
366 if self.credentials.client_id is not None and self.credentials.client_secret is not None:
367 # If we&#39;re given a client ID and secret, we have enough
368 # to refresh access tokens ourselves. In other cases the
369 # session will raise TokenExpiredError and we&#39;ll need to
370 # ask the calling application to refresh the token (that
371 # covers cases where the caller doesn&#39;t have access to
372 # the client secret but is working with a service that
373 # can provide it refreshed tokens on a limited basis).
350 token_params[&#34;code&#34;] = self.credentials.authorization_code # Auth code may be None
351 self.credentials.authorization_code = None # We can only use the code once
352
353 if self.credentials.client_id and self.credentials.client_secret:
354 # If we&#39;re given a client ID and secret, we have enough to refresh access tokens ourselves. In other
355 # cases the session will raise TokenExpiredError, and we&#39;ll need to ask the calling application to
356 # refresh the token (that covers cases where the caller doesn&#39;t have access to the client secret but
357 # is working with a service that can provide it refreshed tokens on a limited basis).
374358 session_params.update(
375359 {
376360 &#34;auto_refresh_kwargs&#34;: {
377361 &#34;client_id&#34;: self.credentials.client_id,
378362 &#34;client_secret&#34;: self.credentials.client_secret,
379363 },
380 &#34;auto_refresh_url&#34;: token_url,
364 &#34;auto_refresh_url&#34;: self.credentials.token_url,
381365 &#34;token_updater&#34;: self.credentials.on_token_auto_refreshed,
382366 }
383367 )
384 client = WebApplicationClient(self.credentials.client_id, **client_params)
368 client = WebApplicationClient(client_id=self.credentials.client_id)
385369 else:
386 token_url = f&#34;https://login.microsoftonline.com/{self.credentials.tenant_id}/oauth2/v2.0/token&#34;
387370 client = BackendApplicationClient(client_id=self.credentials.client_id)
388371
389372 session = self.raw_session(self.service_endpoint, oauth2_client=client, oauth2_session_params=session_params)
390 if not has_token:
373 if not session.token:
391374 # Fetch the token explicitly -- it doesn&#39;t occur implicitly
392375 token = session.fetch_token(
393 token_url=token_url,
376 token_url=self.credentials.token_url,
394377 client_id=self.credentials.client_id,
395378 client_secret=self.credentials.client_secret,
396 scope=scope,
379 scope=self.credentials.scope,
397380 timeout=self.TIMEOUT,
398381 **token_params,
399382 )
400 # Allow the credentials object to update its copy of the new
401 # token, and give the application an opportunity to cache it
383 # Allow the credentials object to update its copy of the new token, and give the application an opportunity
384 # to cache it.
402385 self.credentials.on_token_auto_refreshed(token)
403386 session.auth = get_auth_instance(auth_type=OAUTH2, client=client)
404387
553536
554537 tz_definition = list(self.get_timezones(timezones=[start.tzinfo], return_full_timezone_data=True))[0]
555538 return GetUserAvailability(self).call(
556 timezone=TimeZone.from_server_timezone(tz_definition=tz_definition, for_year=start.year),
557539 mailbox_data=[
558540 MailboxData(
559541 email=account.primary_smtp_address if isinstance(account, Account) else account,
562544 )
563545 for account, attendee_type, exclude_conflicts in accounts
564546 ],
547 timezone=TimeZone.from_server_timezone(tz_definition=tz_definition, for_year=start.year),
565548 free_busy_view_options=FreeBusyViewOptions(
566549 time_window=TimeWindow(start=start, end=end),
567550 merged_free_busy_interval=merged_free_busy_interval,
10741057 session = self.renew_session(session)
10751058 self._session_pool.put(session, block=False)
10761059
1077 @staticmethod
1078 def close_session(session):
1060 def close_session(self, session):
1061 if isinstance(self.credentials, OAuth2Credentials) and not isinstance(
1062 self.credentials, OAuth2AuthorizationCodeCredentials
1063 ):
1064 # Reset token if client is of type BackendApplicationClient
1065 self.credentials.access_token = None
10791066 session.close()
10801067 del session
10811068
11381125 return session
11391126
11401127 def create_oauth2_session(self):
1141 has_token = False
1142 scope = [&#34;https://outlook.office365.com/.default&#34;]
1143 session_params = {}
1128 session_params = {&#34;token&#34;: self.credentials.access_token} # Token may be None
11441129 token_params = {}
11451130
11461131 if isinstance(self.credentials, OAuth2AuthorizationCodeCredentials):
1147 # Ask for a refresh token
1148 scope.append(&#34;offline_access&#34;)
1149
1150 # We don&#39;t know (or need) the Microsoft tenant ID. Use
1151 # common/ to let Microsoft select the appropriate tenant
1152 # for the provided authorization code or refresh token.
1153 #
1154 # Suppress looks-like-password warning from Bandit.
1155 token_url = &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec
1156
1157 client_params = {}
1158 has_token = self.credentials.access_token is not None
1159 if has_token:
1160 session_params[&#34;token&#34;] = self.credentials.access_token
1161 elif self.credentials.authorization_code is not None:
1162 token_params[&#34;code&#34;] = self.credentials.authorization_code
1163 self.credentials.authorization_code = None
1164
1165 if self.credentials.client_id is not None and self.credentials.client_secret is not None:
1166 # If we&#39;re given a client ID and secret, we have enough
1167 # to refresh access tokens ourselves. In other cases the
1168 # session will raise TokenExpiredError and we&#39;ll need to
1169 # ask the calling application to refresh the token (that
1170 # covers cases where the caller doesn&#39;t have access to
1171 # the client secret but is working with a service that
1172 # can provide it refreshed tokens on a limited basis).
1132 token_params[&#34;code&#34;] = self.credentials.authorization_code # Auth code may be None
1133 self.credentials.authorization_code = None # We can only use the code once
1134
1135 if self.credentials.client_id and self.credentials.client_secret:
1136 # If we&#39;re given a client ID and secret, we have enough to refresh access tokens ourselves. In other
1137 # cases the session will raise TokenExpiredError, and we&#39;ll need to ask the calling application to
1138 # refresh the token (that covers cases where the caller doesn&#39;t have access to the client secret but
1139 # is working with a service that can provide it refreshed tokens on a limited basis).
11731140 session_params.update(
11741141 {
11751142 &#34;auto_refresh_kwargs&#34;: {
11761143 &#34;client_id&#34;: self.credentials.client_id,
11771144 &#34;client_secret&#34;: self.credentials.client_secret,
11781145 },
1179 &#34;auto_refresh_url&#34;: token_url,
1146 &#34;auto_refresh_url&#34;: self.credentials.token_url,
11801147 &#34;token_updater&#34;: self.credentials.on_token_auto_refreshed,
11811148 }
11821149 )
1183 client = WebApplicationClient(self.credentials.client_id, **client_params)
1150 client = WebApplicationClient(client_id=self.credentials.client_id)
11841151 else:
1185 token_url = f&#34;https://login.microsoftonline.com/{self.credentials.tenant_id}/oauth2/v2.0/token&#34;
11861152 client = BackendApplicationClient(client_id=self.credentials.client_id)
11871153
11881154 session = self.raw_session(self.service_endpoint, oauth2_client=client, oauth2_session_params=session_params)
1189 if not has_token:
1155 if not session.token:
11901156 # Fetch the token explicitly -- it doesn&#39;t occur implicitly
11911157 token = session.fetch_token(
1192 token_url=token_url,
1158 token_url=self.credentials.token_url,
11931159 client_id=self.credentials.client_id,
11941160 client_secret=self.credentials.client_secret,
1195 scope=scope,
1161 scope=self.credentials.scope,
11961162 timeout=self.TIMEOUT,
11971163 **token_params,
11981164 )
1199 # Allow the credentials object to update its copy of the new
1200 # token, and give the application an opportunity to cache it
1165 # Allow the credentials object to update its copy of the new token, and give the application an opportunity
1166 # to cache it.
12011167 self.credentials.on_token_auto_refreshed(token)
12021168 session.auth = get_auth_instance(auth_type=OAUTH2, client=client)
12031169
12761242 </dl>
12771243 <h3>Static methods</h3>
12781244 <dl>
1279 <dt id="exchangelib.protocol.BaseProtocol.close_session"><code class="name flex">
1280 <span>def <span class="ident">close_session</span></span>(<span>session)</span>
1281 </code></dt>
1282 <dd>
1283 <div class="desc"></div>
1284 <details class="source">
1285 <summary>
1286 <span>Expand source code</span>
1287 </summary>
1288 <pre><code class="python">@staticmethod
1289 def close_session(session):
1290 session.close()
1291 del session</code></pre>
1292 </details>
1293 </dd>
12941245 <dt id="exchangelib.protocol.BaseProtocol.get_adapter"><code class="name flex">
12951246 <span>def <span class="ident">get_adapter</span></span>(<span>)</span>
12961247 </code></dt>
14331384 break</code></pre>
14341385 </details>
14351386 </dd>
1387 <dt id="exchangelib.protocol.BaseProtocol.close_session"><code class="name flex">
1388 <span>def <span class="ident">close_session</span></span>(<span>self, session)</span>
1389 </code></dt>
1390 <dd>
1391 <div class="desc"></div>
1392 <details class="source">
1393 <summary>
1394 <span>Expand source code</span>
1395 </summary>
1396 <pre><code class="python">def close_session(self, session):
1397 if isinstance(self.credentials, OAuth2Credentials) and not isinstance(
1398 self.credentials, OAuth2AuthorizationCodeCredentials
1399 ):
1400 # Reset token if client is of type BackendApplicationClient
1401 self.credentials.access_token = None
1402 session.close()
1403 del session</code></pre>
1404 </details>
1405 </dd>
14361406 <dt id="exchangelib.protocol.BaseProtocol.create_oauth2_session"><code class="name flex">
14371407 <span>def <span class="ident">create_oauth2_session</span></span>(<span>self)</span>
14381408 </code></dt>
14431413 <span>Expand source code</span>
14441414 </summary>
14451415 <pre><code class="python">def create_oauth2_session(self):
1446 has_token = False
1447 scope = [&#34;https://outlook.office365.com/.default&#34;]
1448 session_params = {}
1416 session_params = {&#34;token&#34;: self.credentials.access_token} # Token may be None
14491417 token_params = {}
14501418
14511419 if isinstance(self.credentials, OAuth2AuthorizationCodeCredentials):
1452 # Ask for a refresh token
1453 scope.append(&#34;offline_access&#34;)
1454
1455 # We don&#39;t know (or need) the Microsoft tenant ID. Use
1456 # common/ to let Microsoft select the appropriate tenant
1457 # for the provided authorization code or refresh token.
1458 #
1459 # Suppress looks-like-password warning from Bandit.
1460 token_url = &#34;https://login.microsoftonline.com/common/oauth2/v2.0/token&#34; # nosec
1461
1462 client_params = {}
1463 has_token = self.credentials.access_token is not None
1464 if has_token:
1465 session_params[&#34;token&#34;] = self.credentials.access_token
1466 elif self.credentials.authorization_code is not None:
1467 token_params[&#34;code&#34;] = self.credentials.authorization_code
1468 self.credentials.authorization_code = None
1469
1470 if self.credentials.client_id is not None and self.credentials.client_secret is not None:
1471 # If we&#39;re given a client ID and secret, we have enough
1472 # to refresh access tokens ourselves. In other cases the
1473 # session will raise TokenExpiredError and we&#39;ll need to
1474 # ask the calling application to refresh the token (that
1475 # covers cases where the caller doesn&#39;t have access to
1476 # the client secret but is working with a service that
1477 # can provide it refreshed tokens on a limited basis).
1420 token_params[&#34;code&#34;] = self.credentials.authorization_code # Auth code may be None
1421 self.credentials.authorization_code = None # We can only use the code once
1422
1423 if self.credentials.client_id and self.credentials.client_secret:
1424 # If we&#39;re given a client ID and secret, we have enough to refresh access tokens ourselves. In other
1425 # cases the session will raise TokenExpiredError, and we&#39;ll need to ask the calling application to
1426 # refresh the token (that covers cases where the caller doesn&#39;t have access to the client secret but
1427 # is working with a service that can provide it refreshed tokens on a limited basis).
14781428 session_params.update(
14791429 {
14801430 &#34;auto_refresh_kwargs&#34;: {
14811431 &#34;client_id&#34;: self.credentials.client_id,
14821432 &#34;client_secret&#34;: self.credentials.client_secret,
14831433 },
1484 &#34;auto_refresh_url&#34;: token_url,
1434 &#34;auto_refresh_url&#34;: self.credentials.token_url,
14851435 &#34;token_updater&#34;: self.credentials.on_token_auto_refreshed,
14861436 }
14871437 )
1488 client = WebApplicationClient(self.credentials.client_id, **client_params)
1438 client = WebApplicationClient(client_id=self.credentials.client_id)
14891439 else:
1490 token_url = f&#34;https://login.microsoftonline.com/{self.credentials.tenant_id}/oauth2/v2.0/token&#34;
14911440 client = BackendApplicationClient(client_id=self.credentials.client_id)
14921441
14931442 session = self.raw_session(self.service_endpoint, oauth2_client=client, oauth2_session_params=session_params)
1494 if not has_token:
1443 if not session.token:
14951444 # Fetch the token explicitly -- it doesn&#39;t occur implicitly
14961445 token = session.fetch_token(
1497 token_url=token_url,
1446 token_url=self.credentials.token_url,
14981447 client_id=self.credentials.client_id,
14991448 client_secret=self.credentials.client_secret,
1500 scope=scope,
1449 scope=self.credentials.scope,
15011450 timeout=self.TIMEOUT,
15021451 **token_params,
15031452 )
1504 # Allow the credentials object to update its copy of the new
1505 # token, and give the application an opportunity to cache it
1453 # Allow the credentials object to update its copy of the new token, and give the application an opportunity
1454 # to cache it.
15061455 self.credentials.on_token_auto_refreshed(token)
15071456 session.auth = get_auth_instance(auth_type=OAUTH2, client=client)
15081457
21652114
21662115 tz_definition = list(self.get_timezones(timezones=[start.tzinfo], return_full_timezone_data=True))[0]
21672116 return GetUserAvailability(self).call(
2168 timezone=TimeZone.from_server_timezone(tz_definition=tz_definition, for_year=start.year),
21692117 mailbox_data=[
21702118 MailboxData(
21712119 email=account.primary_smtp_address if isinstance(account, Account) else account,
21742122 )
21752123 for account, attendee_type, exclude_conflicts in accounts
21762124 ],
2125 timezone=TimeZone.from_server_timezone(tz_definition=tz_definition, for_year=start.year),
21772126 free_busy_view_options=FreeBusyViewOptions(
21782127 time_window=TimeWindow(start=start, end=end),
21792128 merged_free_busy_interval=merged_free_busy_interval,
23812330
23822331 tz_definition = list(self.get_timezones(timezones=[start.tzinfo], return_full_timezone_data=True))[0]
23832332 return GetUserAvailability(self).call(
2384 timezone=TimeZone.from_server_timezone(tz_definition=tz_definition, for_year=start.year),
23852333 mailbox_data=[
23862334 MailboxData(
23872335 email=account.primary_smtp_address if isinstance(account, Account) else account,
23902338 )
23912339 for account, attendee_type, exclude_conflicts in accounts
23922340 ],
2341 timezone=TimeZone.from_server_timezone(tz_definition=tz_definition, for_year=start.year),
23932342 free_busy_view_options=FreeBusyViewOptions(
23942343 time_window=TimeWindow(start=start, end=end),
23952344 merged_free_busy_interval=merged_free_busy_interval,
2727 </summary>
2828 <pre><code class="python">import abc
2929 import logging
30 import traceback
3130 from itertools import chain
3231
3332 from .. import errors
3433 from ..attachments import AttachmentId
3534 from ..credentials import IMPERSONATION, OAuth2Credentials
3635 from ..errors import (
37 ErrorAccessDenied,
38 ErrorADUnavailable,
3936 ErrorBatchProcessingStopped,
4037 ErrorCannotDeleteObject,
4138 ErrorCannotDeleteTaskOccurrence,
42 ErrorCannotEmptyFolder,
43 ErrorConnectionFailed,
44 ErrorConnectionFailedTransientError,
4539 ErrorCorruptData,
46 ErrorCreateItemAccessDenied,
47 ErrorDelegateNoUser,
48 ErrorDeleteDistinguishedFolder,
4940 ErrorExceededConnectionCount,
50 ErrorFolderNotFound,
51 ErrorImpersonateUserDenied,
52 ErrorImpersonationFailed,
5341 ErrorIncorrectSchemaVersion,
54 ErrorInternalServerError,
55 ErrorInternalServerTransientError,
5642 ErrorInvalidChangeKey,
5743 ErrorInvalidIdMalformed,
58 ErrorInvalidLicense,
5944 ErrorInvalidRequest,
6045 ErrorInvalidSchemaVersionForMailboxVersion,
6146 ErrorInvalidServerVersion,
62 ErrorInvalidSubscription,
63 ErrorInvalidSyncStateData,
64 ErrorInvalidWatermark,
6547 ErrorItemCorrupt,
6648 ErrorItemNotFound,
6749 ErrorItemSave,
68 ErrorMailboxMoveInProgress,
69 ErrorMailboxStoreUnavailable,
50 ErrorMailRecipientNotFound,
7051 ErrorMessageSizeExceeded,
7152 ErrorMimeContentConversionFailed,
72 ErrorNameResolutionMultipleResults,
73 ErrorNameResolutionNoResults,
74 ErrorNonExistentMailbox,
75 ErrorNoPublicFolderReplicaAvailable,
76 ErrorNoRespondingCASInDestinationSite,
77 ErrorNotDelegate,
78 ErrorQuotaExceeded,
7953 ErrorRecurrenceHasNoOccurrence,
8054 ErrorServerBusy,
8155 ErrorTimeoutExpired,
8357 EWSWarning,
8458 InvalidTypeError,
8559 MalformedResponseError,
86 RateLimitError,
8760 SessionPoolMinSizeReached,
8861 SOAPError,
8962 TransportError,
90 UnauthorizedError,
9163 )
9264 from ..folders import BaseFolder, Folder, RootOfHierarchy
9365 from ..items import BaseItem
12597 PAGE_SIZE = 100 # A default page size for all paging services. This is the number of items we request per page
12698 CHUNK_SIZE = 100 # A default chunk size for all services. This is the number of items we send in a single request
12799
128 KNOWN_EXCEPTIONS = (
129 ErrorAccessDenied,
130 ErrorADUnavailable,
131 ErrorBatchProcessingStopped,
132 ErrorCannotDeleteObject,
133 ErrorCannotEmptyFolder,
134 ErrorConnectionFailed,
135 ErrorConnectionFailedTransientError,
136 ErrorCreateItemAccessDenied,
137 ErrorDelegateNoUser,
138 ErrorDeleteDistinguishedFolder,
139 ErrorExceededConnectionCount,
140 ErrorFolderNotFound,
141 ErrorImpersonateUserDenied,
142 ErrorImpersonationFailed,
143 ErrorInternalServerError,
144 ErrorInternalServerTransientError,
145 ErrorInvalidChangeKey,
146 ErrorInvalidLicense,
147 ErrorInvalidSubscription,
148 ErrorInvalidSyncStateData,
149 ErrorInvalidWatermark,
150 ErrorItemCorrupt,
151 ErrorItemNotFound,
152 ErrorMailboxMoveInProgress,
153 ErrorMailboxStoreUnavailable,
154 ErrorNameResolutionMultipleResults,
155 ErrorNameResolutionNoResults,
156 ErrorNonExistentMailbox,
157 ErrorNoPublicFolderReplicaAvailable,
158 ErrorNoRespondingCASInDestinationSite,
159 ErrorNotDelegate,
160 ErrorQuotaExceeded,
161 ErrorTimeoutExpired,
162 RateLimitError,
163 UnauthorizedError,
164 )
165
166100
167101 class EWSService(metaclass=abc.ABCMeta):
168102 &#34;&#34;&#34;Base class for all EWS services.&#34;&#34;&#34;
185119 ErrorRecurrenceHasNoOccurrence,
186120 ErrorCorruptData,
187121 ErrorItemCorrupt,
122 ErrorMailRecipientNotFound,
188123 )
189124 # Similarly, define the warnings we want to return unraised
190125 WARNINGS_TO_CATCH_IN_RESPONSE = ErrorBatchProcessingStopped
359294 except ErrorServerBusy as e:
360295 self._handle_backoff(e)
361296 continue
362 except KNOWN_EXCEPTIONS:
363 # These are known and understood, and don&#39;t require a backtrace.
364 raise
365297 except (ErrorTooManyObjectsOpened, ErrorTimeoutExpired) as e:
366298 # ErrorTooManyObjectsOpened means there are too many connections to the Exchange database. This is very
367299 # often a symptom of sending too many requests.
376308
377309 # Re-raise as an ErrorServerBusy with a default delay of 5 minutes
378310 raise ErrorServerBusy(f&#34;Reraised from {e.__class__.__name__}({e})&#34;)
379 except Exception:
380 # This may run in a thread, which obfuscates the stack trace. Print trace immediately.
381 account = self.account if isinstance(self, EWSAccountService) else None
382 log.warning(&#34;Account %s: Exception in _get_elements: %s&#34;, account, traceback.format_exc(20))
383 raise
384311 finally:
385312 if self.streaming:
386313 self.stop_streaming()
808735 def _account_to_impersonate(self):
809736 if self.account.access_type == IMPERSONATION:
810737 return self.account.identity
811 return None
738 return super()._account_to_impersonate
812739
813740 @property
814741 def _timezone(self):
12311158 def _account_to_impersonate(self):
12321159 if self.account.access_type == IMPERSONATION:
12331160 return self.account.identity
1234 return None
1161 return super()._account_to_impersonate
12351162
12361163 @property
12371164 def _timezone(self):
15031430 ErrorRecurrenceHasNoOccurrence,
15041431 ErrorCorruptData,
15051432 ErrorItemCorrupt,
1433 ErrorMailRecipientNotFound,
15061434 )
15071435 # Similarly, define the warnings we want to return unraised
15081436 WARNINGS_TO_CATCH_IN_RESPONSE = ErrorBatchProcessingStopped
16771605 except ErrorServerBusy as e:
16781606 self._handle_backoff(e)
16791607 continue
1680 except KNOWN_EXCEPTIONS:
1681 # These are known and understood, and don&#39;t require a backtrace.
1682 raise
16831608 except (ErrorTooManyObjectsOpened, ErrorTimeoutExpired) as e:
16841609 # ErrorTooManyObjectsOpened means there are too many connections to the Exchange database. This is very
16851610 # often a symptom of sending too many requests.
16941619
16951620 # Re-raise as an ErrorServerBusy with a default delay of 5 minutes
16961621 raise ErrorServerBusy(f&#34;Reraised from {e.__class__.__name__}({e})&#34;)
1697 except Exception:
1698 # This may run in a thread, which obfuscates the stack trace. Print trace immediately.
1699 account = self.account if isinstance(self, EWSAccountService) else None
1700 log.warning(&#34;Account %s: Exception in _get_elements: %s&#34;, account, traceback.format_exc(20))
1701 raise
17021622 finally:
17031623 if self.streaming:
17041624 self.stop_streaming()
3838
3939 SERVICE_NAME = &#34;GetUserAvailability&#34;
4040
41 def call(self, timezone, mailbox_data, free_busy_view_options):
41 def call(self, mailbox_data, timezone, free_busy_view_options):
4242 # TODO: Also supports SuggestionsViewOptions, see
4343 # https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/suggestionsviewoptions
4444 return self._elems_to_objs(
45 self._get_elements(
46 payload=self.get_payload(
47 timezone=timezone, mailbox_data=mailbox_data, free_busy_view_options=free_busy_view_options
48 )
45 self._chunked_get_elements(
46 self.get_payload,
47 items=mailbox_data,
48 timezone=timezone,
49 free_busy_view_options=free_busy_view_options,
4950 )
5051 )
5152
5253 def _elem_to_obj(self, elem):
5354 return FreeBusyView.from_xml(elem=elem, account=None)
5455
55 def get_payload(self, timezone, mailbox_data, free_busy_view_options):
56 def get_payload(self, mailbox_data, timezone, free_busy_view_options):
5657 payload = create_element(f&#34;m:{self.SERVICE_NAME}Request&#34;)
5758 set_xml_value(payload, timezone, version=self.protocol.version)
5859 mailbox_data_array = create_element(&#34;m:MailboxDataArray&#34;)
7071
7172 def _get_elements_in_response(self, response):
7273 for msg in response:
73 # Just check the response code and raise errors
74 self._get_element_container(message=msg.find(f&#34;{{{MNS}}}ResponseMessage&#34;))
75 yield from self._get_elements_in_container(container=msg)
74 container_or_exc = self._get_element_container(message=msg.find(f&#34;{{{MNS}}}ResponseMessage&#34;))
75 if isinstance(container_or_exc, Exception):
76 yield container_or_exc
77 else:
78 yield from self._get_elements_in_container(container=msg)
7679
7780 @classmethod
7881 def _get_elements_in_container(cls, container):
108111
109112 SERVICE_NAME = &#34;GetUserAvailability&#34;
110113
111 def call(self, timezone, mailbox_data, free_busy_view_options):
114 def call(self, mailbox_data, timezone, free_busy_view_options):
112115 # TODO: Also supports SuggestionsViewOptions, see
113116 # https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/suggestionsviewoptions
114117 return self._elems_to_objs(
115 self._get_elements(
116 payload=self.get_payload(
117 timezone=timezone, mailbox_data=mailbox_data, free_busy_view_options=free_busy_view_options
118 )
118 self._chunked_get_elements(
119 self.get_payload,
120 items=mailbox_data,
121 timezone=timezone,
122 free_busy_view_options=free_busy_view_options,
119123 )
120124 )
121125
122126 def _elem_to_obj(self, elem):
123127 return FreeBusyView.from_xml(elem=elem, account=None)
124128
125 def get_payload(self, timezone, mailbox_data, free_busy_view_options):
129 def get_payload(self, mailbox_data, timezone, free_busy_view_options):
126130 payload = create_element(f&#34;m:{self.SERVICE_NAME}Request&#34;)
127131 set_xml_value(payload, timezone, version=self.protocol.version)
128132 mailbox_data_array = create_element(&#34;m:MailboxDataArray&#34;)
140144
141145 def _get_elements_in_response(self, response):
142146 for msg in response:
143 # Just check the response code and raise errors
144 self._get_element_container(message=msg.find(f&#34;{{{MNS}}}ResponseMessage&#34;))
145 yield from self._get_elements_in_container(container=msg)
147 container_or_exc = self._get_element_container(message=msg.find(f&#34;{{{MNS}}}ResponseMessage&#34;))
148 if isinstance(container_or_exc, Exception):
149 yield container_or_exc
150 else:
151 yield from self._get_elements_in_container(container=msg)
146152
147153 @classmethod
148154 def _get_elements_in_container(cls, container):
162168 <h3>Methods</h3>
163169 <dl>
164170 <dt id="exchangelib.services.get_user_availability.GetUserAvailability.call"><code class="name flex">
165 <span>def <span class="ident">call</span></span>(<span>self, timezone, mailbox_data, free_busy_view_options)</span>
171 <span>def <span class="ident">call</span></span>(<span>self, mailbox_data, timezone, free_busy_view_options)</span>
166172 </code></dt>
167173 <dd>
168174 <div class="desc"></div>
170176 <summary>
171177 <span>Expand source code</span>
172178 </summary>
173 <pre><code class="python">def call(self, timezone, mailbox_data, free_busy_view_options):
179 <pre><code class="python">def call(self, mailbox_data, timezone, free_busy_view_options):
174180 # TODO: Also supports SuggestionsViewOptions, see
175181 # https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/suggestionsviewoptions
176182 return self._elems_to_objs(
177 self._get_elements(
178 payload=self.get_payload(
179 timezone=timezone, mailbox_data=mailbox_data, free_busy_view_options=free_busy_view_options
180 )
183 self._chunked_get_elements(
184 self.get_payload,
185 items=mailbox_data,
186 timezone=timezone,
187 free_busy_view_options=free_busy_view_options,
181188 )
182189 )</code></pre>
183190 </details>
184191 </dd>
185192 <dt id="exchangelib.services.get_user_availability.GetUserAvailability.get_payload"><code class="name flex">
186 <span>def <span class="ident">get_payload</span></span>(<span>self, timezone, mailbox_data, free_busy_view_options)</span>
193 <span>def <span class="ident">get_payload</span></span>(<span>self, mailbox_data, timezone, free_busy_view_options)</span>
187194 </code></dt>
188195 <dd>
189196 <div class="desc"></div>
191198 <summary>
192199 <span>Expand source code</span>
193200 </summary>
194 <pre><code class="python">def get_payload(self, timezone, mailbox_data, free_busy_view_options):
201 <pre><code class="python">def get_payload(self, mailbox_data, timezone, free_busy_view_options):
195202 payload = create_element(f&#34;m:{self.SERVICE_NAME}Request&#34;)
196203 set_xml_value(payload, timezone, version=self.protocol.version)
197204 mailbox_data_array = create_element(&#34;m:MailboxDataArray&#34;)
41924192
41934193 SERVICE_NAME = &#34;GetUserAvailability&#34;
41944194
4195 def call(self, timezone, mailbox_data, free_busy_view_options):
4195 def call(self, mailbox_data, timezone, free_busy_view_options):
41964196 # TODO: Also supports SuggestionsViewOptions, see
41974197 # https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/suggestionsviewoptions
41984198 return self._elems_to_objs(
4199 self._get_elements(
4200 payload=self.get_payload(
4201 timezone=timezone, mailbox_data=mailbox_data, free_busy_view_options=free_busy_view_options
4202 )
4199 self._chunked_get_elements(
4200 self.get_payload,
4201 items=mailbox_data,
4202 timezone=timezone,
4203 free_busy_view_options=free_busy_view_options,
42034204 )
42044205 )
42054206
42064207 def _elem_to_obj(self, elem):
42074208 return FreeBusyView.from_xml(elem=elem, account=None)
42084209
4209 def get_payload(self, timezone, mailbox_data, free_busy_view_options):
4210 def get_payload(self, mailbox_data, timezone, free_busy_view_options):
42104211 payload = create_element(f&#34;m:{self.SERVICE_NAME}Request&#34;)
42114212 set_xml_value(payload, timezone, version=self.protocol.version)
42124213 mailbox_data_array = create_element(&#34;m:MailboxDataArray&#34;)
42244225
42254226 def _get_elements_in_response(self, response):
42264227 for msg in response:
4227 # Just check the response code and raise errors
4228 self._get_element_container(message=msg.find(f&#34;{{{MNS}}}ResponseMessage&#34;))
4229 yield from self._get_elements_in_container(container=msg)
4228 container_or_exc = self._get_element_container(message=msg.find(f&#34;{{{MNS}}}ResponseMessage&#34;))
4229 if isinstance(container_or_exc, Exception):
4230 yield container_or_exc
4231 else:
4232 yield from self._get_elements_in_container(container=msg)
42304233
42314234 @classmethod
42324235 def _get_elements_in_container(cls, container):
42464249 <h3>Methods</h3>
42474250 <dl>
42484251 <dt id="exchangelib.services.GetUserAvailability.call"><code class="name flex">
4249 <span>def <span class="ident">call</span></span>(<span>self, timezone, mailbox_data, free_busy_view_options)</span>
4250 </code></dt>
4251 <dd>
4252 <div class="desc"></div>
4253 <details class="source">
4254 <summary>
4255 <span>Expand source code</span>
4256 </summary>
4257 <pre><code class="python">def call(self, timezone, mailbox_data, free_busy_view_options):
4252 <span>def <span class="ident">call</span></span>(<span>self, mailbox_data, timezone, free_busy_view_options)</span>
4253 </code></dt>
4254 <dd>
4255 <div class="desc"></div>
4256 <details class="source">
4257 <summary>
4258 <span>Expand source code</span>
4259 </summary>
4260 <pre><code class="python">def call(self, mailbox_data, timezone, free_busy_view_options):
42584261 # TODO: Also supports SuggestionsViewOptions, see
42594262 # https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/suggestionsviewoptions
42604263 return self._elems_to_objs(
4261 self._get_elements(
4262 payload=self.get_payload(
4263 timezone=timezone, mailbox_data=mailbox_data, free_busy_view_options=free_busy_view_options
4264 )
4264 self._chunked_get_elements(
4265 self.get_payload,
4266 items=mailbox_data,
4267 timezone=timezone,
4268 free_busy_view_options=free_busy_view_options,
42654269 )
42664270 )</code></pre>
42674271 </details>
42684272 </dd>
42694273 <dt id="exchangelib.services.GetUserAvailability.get_payload"><code class="name flex">
4270 <span>def <span class="ident">get_payload</span></span>(<span>self, timezone, mailbox_data, free_busy_view_options)</span>
4271 </code></dt>
4272 <dd>
4273 <div class="desc"></div>
4274 <details class="source">
4275 <summary>
4276 <span>Expand source code</span>
4277 </summary>
4278 <pre><code class="python">def get_payload(self, timezone, mailbox_data, free_busy_view_options):
4274 <span>def <span class="ident">get_payload</span></span>(<span>self, mailbox_data, timezone, free_busy_view_options)</span>
4275 </code></dt>
4276 <dd>
4277 <div class="desc"></div>
4278 <details class="source">
4279 <summary>
4280 <span>Expand source code</span>
4281 </summary>
4282 <pre><code class="python">def get_payload(self, mailbox_data, timezone, free_busy_view_options):
42794283 payload = create_element(f&#34;m:{self.SERVICE_NAME}Request&#34;)
42804284 set_xml_value(payload, timezone, version=self.protocol.version)
42814285 mailbox_data_array = create_element(&#34;m:MailboxDataArray&#34;)
48114815 ERRORS_TO_CATCH_IN_RESPONSE = ErrorNameResolutionNoResults
48124816 WARNINGS_TO_IGNORE_IN_RESPONSE = ErrorNameResolutionMultipleResults
48134817 # Note: paging information is returned as attrs on the &#39;ResolutionSet&#39; element, but this service does not
4814 # support the &#39;IndexedPageItemView&#39; element, so it&#39;s not really a paging service. According to docs, at most
4815 # 100 candidates are returned for a lookup.
4818 # support the &#39;IndexedPageItemView&#39; element, so it&#39;s not really a paging service.
48164819 supports_paging = False
4820 # According to the &#39;Remarks&#39; section of the MSDN documentation referenced above, at most 100 candidates are
4821 # returned for a lookup.
4822 candidates_limit = 100
48174823
48184824 def __init__(self, *args, **kwargs):
48194825 super().__init__(*args, **kwargs)
48484854 )
48494855 )
48504856
4857 def _get_element_container(self, message, name=None):
4858 container_or_exc = super()._get_element_container(message=message, name=name)
4859 if isinstance(container_or_exc, Exception):
4860 return container_or_exc
4861 is_last_page = container_or_exc.get(&#34;IncludesLastItemInRange&#34;).lower() in (&#34;true&#34;, &#34;0&#34;)
4862 log.debug(&#34;Includes last item in range: %s&#34;, is_last_page)
4863 if not is_last_page:
4864 warnings.warn(
4865 f&#34;The {self.__class__.__name__} service returns at most {self.candidates_limit} candidates and does &#34;
4866 f&#34;not support paging. You have reached this limit and have not received the exhaustive list of &#34;
4867 f&#34;candidates.&#34;
4868 )
4869 return container_or_exc
4870
48514871 def _elem_to_obj(self, elem):
48524872 if self.return_full_contact_data:
48534873 mailbox_elem = elem.find(Mailbox.response_tag())
48964916 <dt id="exchangelib.services.ResolveNames.WARNINGS_TO_IGNORE_IN_RESPONSE"><code class="name">var <span class="ident">WARNINGS_TO_IGNORE_IN_RESPONSE</span></code></dt>
48974917 <dd>
48984918 <div class="desc"><p>Global error type within this module.</p></div>
4919 </dd>
4920 <dt id="exchangelib.services.ResolveNames.candidates_limit"><code class="name">var <span class="ident">candidates_limit</span></code></dt>
4921 <dd>
4922 <div class="desc"></div>
48994923 </dd>
49004924 <dt id="exchangelib.services.ResolveNames.element_container_name"><code class="name">var <span class="ident">element_container_name</span></code></dt>
49014925 <dd>
70057029 <li><code><a title="exchangelib.services.ResolveNames.SERVICE_NAME" href="#exchangelib.services.ResolveNames.SERVICE_NAME">SERVICE_NAME</a></code></li>
70067030 <li><code><a title="exchangelib.services.ResolveNames.WARNINGS_TO_IGNORE_IN_RESPONSE" href="#exchangelib.services.ResolveNames.WARNINGS_TO_IGNORE_IN_RESPONSE">WARNINGS_TO_IGNORE_IN_RESPONSE</a></code></li>
70077031 <li><code><a title="exchangelib.services.ResolveNames.call" href="#exchangelib.services.ResolveNames.call">call</a></code></li>
7032 <li><code><a title="exchangelib.services.ResolveNames.candidates_limit" href="#exchangelib.services.ResolveNames.candidates_limit">candidates_limit</a></code></li>
70087033 <li><code><a title="exchangelib.services.ResolveNames.element_container_name" href="#exchangelib.services.ResolveNames.element_container_name">element_container_name</a></code></li>
70097034 <li><code><a title="exchangelib.services.ResolveNames.get_payload" href="#exchangelib.services.ResolveNames.get_payload">get_payload</a></code></li>
70107035 <li><code><a title="exchangelib.services.ResolveNames.supports_paging" href="#exchangelib.services.ResolveNames.supports_paging">supports_paging</a></code></li>
2626 <span>Expand source code</span>
2727 </summary>
2828 <pre><code class="python">import logging
29 import warnings
2930
3031 from ..errors import ErrorNameResolutionMultipleResults, ErrorNameResolutionNoResults, InvalidEnumValue
3132 from ..items import SEARCH_SCOPE_CHOICES, SHAPE_CHOICES, Contact
4546 ERRORS_TO_CATCH_IN_RESPONSE = ErrorNameResolutionNoResults
4647 WARNINGS_TO_IGNORE_IN_RESPONSE = ErrorNameResolutionMultipleResults
4748 # Note: paging information is returned as attrs on the &#39;ResolutionSet&#39; element, but this service does not
48 # support the &#39;IndexedPageItemView&#39; element, so it&#39;s not really a paging service. According to docs, at most
49 # 100 candidates are returned for a lookup.
49 # support the &#39;IndexedPageItemView&#39; element, so it&#39;s not really a paging service.
5050 supports_paging = False
51 # According to the &#39;Remarks&#39; section of the MSDN documentation referenced above, at most 100 candidates are
52 # returned for a lookup.
53 candidates_limit = 100
5154
5255 def __init__(self, *args, **kwargs):
5356 super().__init__(*args, **kwargs)
8184 contact_data_shape=contact_data_shape,
8285 )
8386 )
87
88 def _get_element_container(self, message, name=None):
89 container_or_exc = super()._get_element_container(message=message, name=name)
90 if isinstance(container_or_exc, Exception):
91 return container_or_exc
92 is_last_page = container_or_exc.get(&#34;IncludesLastItemInRange&#34;).lower() in (&#34;true&#34;, &#34;0&#34;)
93 log.debug(&#34;Includes last item in range: %s&#34;, is_last_page)
94 if not is_last_page:
95 warnings.warn(
96 f&#34;The {self.__class__.__name__} service returns at most {self.candidates_limit} candidates and does &#34;
97 f&#34;not support paging. You have reached this limit and have not received the exhaustive list of &#34;
98 f&#34;candidates.&#34;
99 )
100 return container_or_exc
84101
85102 def _elem_to_obj(self, elem):
86103 if self.return_full_contact_data:
141158 ERRORS_TO_CATCH_IN_RESPONSE = ErrorNameResolutionNoResults
142159 WARNINGS_TO_IGNORE_IN_RESPONSE = ErrorNameResolutionMultipleResults
143160 # Note: paging information is returned as attrs on the &#39;ResolutionSet&#39; element, but this service does not
144 # support the &#39;IndexedPageItemView&#39; element, so it&#39;s not really a paging service. According to docs, at most
145 # 100 candidates are returned for a lookup.
161 # support the &#39;IndexedPageItemView&#39; element, so it&#39;s not really a paging service.
146162 supports_paging = False
163 # According to the &#39;Remarks&#39; section of the MSDN documentation referenced above, at most 100 candidates are
164 # returned for a lookup.
165 candidates_limit = 100
147166
148167 def __init__(self, *args, **kwargs):
149168 super().__init__(*args, **kwargs)
177196 contact_data_shape=contact_data_shape,
178197 )
179198 )
199
200 def _get_element_container(self, message, name=None):
201 container_or_exc = super()._get_element_container(message=message, name=name)
202 if isinstance(container_or_exc, Exception):
203 return container_or_exc
204 is_last_page = container_or_exc.get(&#34;IncludesLastItemInRange&#34;).lower() in (&#34;true&#34;, &#34;0&#34;)
205 log.debug(&#34;Includes last item in range: %s&#34;, is_last_page)
206 if not is_last_page:
207 warnings.warn(
208 f&#34;The {self.__class__.__name__} service returns at most {self.candidates_limit} candidates and does &#34;
209 f&#34;not support paging. You have reached this limit and have not received the exhaustive list of &#34;
210 f&#34;candidates.&#34;
211 )
212 return container_or_exc
180213
181214 def _elem_to_obj(self, elem):
182215 if self.return_full_contact_data:
226259 <dt id="exchangelib.services.resolve_names.ResolveNames.WARNINGS_TO_IGNORE_IN_RESPONSE"><code class="name">var <span class="ident">WARNINGS_TO_IGNORE_IN_RESPONSE</span></code></dt>
227260 <dd>
228261 <div class="desc"><p>Global error type within this module.</p></div>
262 </dd>
263 <dt id="exchangelib.services.resolve_names.ResolveNames.candidates_limit"><code class="name">var <span class="ident">candidates_limit</span></code></dt>
264 <dd>
265 <div class="desc"></div>
229266 </dd>
230267 <dt id="exchangelib.services.resolve_names.ResolveNames.element_container_name"><code class="name">var <span class="ident">element_container_name</span></code></dt>
231268 <dd>
344381 <li><code><a title="exchangelib.services.resolve_names.ResolveNames.SERVICE_NAME" href="#exchangelib.services.resolve_names.ResolveNames.SERVICE_NAME">SERVICE_NAME</a></code></li>
345382 <li><code><a title="exchangelib.services.resolve_names.ResolveNames.WARNINGS_TO_IGNORE_IN_RESPONSE" href="#exchangelib.services.resolve_names.ResolveNames.WARNINGS_TO_IGNORE_IN_RESPONSE">WARNINGS_TO_IGNORE_IN_RESPONSE</a></code></li>
346383 <li><code><a title="exchangelib.services.resolve_names.ResolveNames.call" href="#exchangelib.services.resolve_names.ResolveNames.call">call</a></code></li>
384 <li><code><a title="exchangelib.services.resolve_names.ResolveNames.candidates_limit" href="#exchangelib.services.resolve_names.ResolveNames.candidates_limit">candidates_limit</a></code></li>
347385 <li><code><a title="exchangelib.services.resolve_names.ResolveNames.element_container_name" href="#exchangelib.services.resolve_names.ResolveNames.element_container_name">element_container_name</a></code></li>
348386 <li><code><a title="exchangelib.services.resolve_names.ResolveNames.get_payload" href="#exchangelib.services.resolve_names.ResolveNames.get_payload">get_payload</a></code></li>
349387 <li><code><a title="exchangelib.services.resolve_names.ResolveNames.supports_paging" href="#exchangelib.services.resolve_names.ResolveNames.supports_paging">supports_paging</a></code></li>
4949 from pygments import highlight
5050 from pygments.formatters.terminal import TerminalFormatter
5151 from pygments.lexers.html import XmlLexer
52 from requests_oauthlib import OAuth2Session
5253
5354 from .errors import (
5455 InvalidTypeError,
600601 class PrettyXmlHandler(logging.StreamHandler):
601602 &#34;&#34;&#34;A steaming log handler that prettifies log statements containing XML when output is a terminal.&#34;&#34;&#34;
602603
603 @staticmethod
604 def parse_bytes(xml_bytes):
604 def parse_bytes(self, xml_bytes):
605605 return to_xml(xml_bytes)
606606
607 @classmethod
608 def prettify_xml(cls, xml_bytes):
607 def prettify_xml(self, xml_bytes):
609608 &#34;&#34;&#34;Re-format an XML document to a consistent style.&#34;&#34;&#34;
610609 return (
611 lxml.etree.tostring(cls.parse_bytes(xml_bytes), xml_declaration=True, encoding=&#34;utf-8&#34;, pretty_print=True)
610 lxml.etree.tostring(self.parse_bytes(xml_bytes), xml_declaration=True, encoding=&#34;utf-8&#34;, pretty_print=True)
612611 .replace(b&#34;\t&#34;, b&#34; &#34;)
613612 .replace(b&#34; xmlns:&#34;, b&#34;\n xmlns:&#34;)
614613 )
866865 d_start = time.monotonic()
867866 # Always create a dummy response for logging purposes, in case we fail in the following
868867 r = DummyResponse(url=url, request_headers=headers)
868 kwargs = dict(url=url, headers=headers, data=data, allow_redirects=False, timeout=timeout, stream=stream)
869 if isinstance(session, OAuth2Session):
870 # Fix token refreshing bug. Reported as https://github.com/requests/requests-oauthlib/issues/498
871 kwargs.update(session.auto_refresh_kwargs)
869872 try:
870 r = session.post(
871 url=url, headers=headers, data=data, allow_redirects=False, timeout=timeout, stream=stream
872 )
873 r = session.post(**kwargs)
873874 except TLS_ERRORS as e:
874875 # Don&#39;t retry on TLS errors. They will most likely be persistent.
875876 raise TransportError(str(e))
13901391 d_start = time.monotonic()
13911392 # Always create a dummy response for logging purposes, in case we fail in the following
13921393 r = DummyResponse(url=url, request_headers=headers)
1394 kwargs = dict(url=url, headers=headers, data=data, allow_redirects=False, timeout=timeout, stream=stream)
1395 if isinstance(session, OAuth2Session):
1396 # Fix token refreshing bug. Reported as https://github.com/requests/requests-oauthlib/issues/498
1397 kwargs.update(session.auto_refresh_kwargs)
13931398 try:
1394 r = session.post(
1395 url=url, headers=headers, data=data, allow_redirects=False, timeout=timeout, stream=stream
1396 )
1399 r = session.post(**kwargs)
13971400 except TLS_ERRORS as e:
13981401 # Don&#39;t retry on TLS errors. They will most likely be persistent.
13991402 raise TransportError(str(e))
22232226 <pre><code class="python">class PrettyXmlHandler(logging.StreamHandler):
22242227 &#34;&#34;&#34;A steaming log handler that prettifies log statements containing XML when output is a terminal.&#34;&#34;&#34;
22252228
2226 @staticmethod
2227 def parse_bytes(xml_bytes):
2229 def parse_bytes(self, xml_bytes):
22282230 return to_xml(xml_bytes)
22292231
2230 @classmethod
2231 def prettify_xml(cls, xml_bytes):
2232 def prettify_xml(self, xml_bytes):
22322233 &#34;&#34;&#34;Re-format an XML document to a consistent style.&#34;&#34;&#34;
22332234 return (
2234 lxml.etree.tostring(cls.parse_bytes(xml_bytes), xml_declaration=True, encoding=&#34;utf-8&#34;, pretty_print=True)
2235 lxml.etree.tostring(self.parse_bytes(xml_bytes), xml_declaration=True, encoding=&#34;utf-8&#34;, pretty_print=True)
22352236 .replace(b&#34;\t&#34;, b&#34; &#34;)
22362237 .replace(b&#34; xmlns:&#34;, b&#34;\n xmlns:&#34;)
22372238 )
22982299 return highlight(xml_str, XmlLexer(), TerminalFormatter()).rstrip()</code></pre>
22992300 </details>
23002301 </dd>
2301 <dt id="exchangelib.util.PrettyXmlHandler.parse_bytes"><code class="name flex">
2302 <span>def <span class="ident">parse_bytes</span></span>(<span>xml_bytes)</span>
2303 </code></dt>
2304 <dd>
2305 <div class="desc"></div>
2306 <details class="source">
2307 <summary>
2308 <span>Expand source code</span>
2309 </summary>
2310 <pre><code class="python">@staticmethod
2311 def parse_bytes(xml_bytes):
2312 return to_xml(xml_bytes)</code></pre>
2313 </details>
2314 </dd>
2315 <dt id="exchangelib.util.PrettyXmlHandler.prettify_xml"><code class="name flex">
2316 <span>def <span class="ident">prettify_xml</span></span>(<span>xml_bytes)</span>
2317 </code></dt>
2318 <dd>
2319 <div class="desc"><p>Re-format an XML document to a consistent style.</p></div>
2320 <details class="source">
2321 <summary>
2322 <span>Expand source code</span>
2323 </summary>
2324 <pre><code class="python">@classmethod
2325 def prettify_xml(cls, xml_bytes):
2326 &#34;&#34;&#34;Re-format an XML document to a consistent style.&#34;&#34;&#34;
2327 return (
2328 lxml.etree.tostring(cls.parse_bytes(xml_bytes), xml_declaration=True, encoding=&#34;utf-8&#34;, pretty_print=True)
2329 .replace(b&#34;\t&#34;, b&#34; &#34;)
2330 .replace(b&#34; xmlns:&#34;, b&#34;\n xmlns:&#34;)
2331 )</code></pre>
2332 </details>
2333 </dd>
23342302 </dl>
23352303 <h3>Methods</h3>
23362304 <dl>
23862354 return self.stream.isatty()
23872355 except AttributeError:
23882356 return False</code></pre>
2357 </details>
2358 </dd>
2359 <dt id="exchangelib.util.PrettyXmlHandler.parse_bytes"><code class="name flex">
2360 <span>def <span class="ident">parse_bytes</span></span>(<span>self, xml_bytes)</span>
2361 </code></dt>
2362 <dd>
2363 <div class="desc"></div>
2364 <details class="source">
2365 <summary>
2366 <span>Expand source code</span>
2367 </summary>
2368 <pre><code class="python">def parse_bytes(self, xml_bytes):
2369 return to_xml(xml_bytes)</code></pre>
2370 </details>
2371 </dd>
2372 <dt id="exchangelib.util.PrettyXmlHandler.prettify_xml"><code class="name flex">
2373 <span>def <span class="ident">prettify_xml</span></span>(<span>self, xml_bytes)</span>
2374 </code></dt>
2375 <dd>
2376 <div class="desc"><p>Re-format an XML document to a consistent style.</p></div>
2377 <details class="source">
2378 <summary>
2379 <span>Expand source code</span>
2380 </summary>
2381 <pre><code class="python">def prettify_xml(self, xml_bytes):
2382 &#34;&#34;&#34;Re-format an XML document to a consistent style.&#34;&#34;&#34;
2383 return (
2384 lxml.etree.tostring(self.parse_bytes(xml_bytes), xml_declaration=True, encoding=&#34;utf-8&#34;, pretty_print=True)
2385 .replace(b&#34;\t&#34;, b&#34; &#34;)
2386 .replace(b&#34; xmlns:&#34;, b&#34;\n xmlns:&#34;)
2387 )</code></pre>
23892388 </details>
23902389 </dd>
23912390 </dl>
2323 * [Kerberos and SSPI authentication](#kerberos-and-sspi-authentication)
2424 * [Certificate Based Authentication (CBA)](#certificate-based-authentication-cba)
2525 * [OAuth authentication](#oauth-authentication)
26 * [OAuth on Office 365](#oauth-on-office-365)
2627 * [Caching autodiscover results](#caching-autodiscover-results)
2728 * [Proxies and custom TLS validation](#proxies-and-custom-tls-validation)
2829 * [User-Agent](#user-agent)
163164
164165 # Set up a target account and do an autodiscover lookup to find the EWS endpoint
165166 account = Account(
166 primary_smtp_address='john@example.com', credentials=credentials,
167 primary_smtp_address='john@example.com', credentials=credentials,
167168 autodiscover=True, access_type=DELEGATE
168169 )
169170
170171 # If your credentials have been given impersonation access to the target
171172 # account, set a different 'access_type':
172173 johns_account = Account(
173 primary_smtp_address='john@example.com', credentials=credentials,
174 primary_smtp_address='john@example.com', credentials=credentials,
174175 autodiscover=True, access_type=IMPERSONATION
175176 )
176177 ```
324325 from oauthlib.oauth2 import OAuth2Token
325326
326327 credentials = OAuth2Credentials(
327 ..., identity=Identity(primary_smtp_address='svc_acct@example.com')
328 ..., identity=Identity(primary_smtp_address='svc_acct@example.com')
328329 )
329330 credentials = OAuth2AuthorizationCodeCredentials(
330 ..., identity=Identity(upn='svc_acct@subdomain.example.com')
331 ..., identity=Identity(upn='svc_acct@subdomain.example.com')
331332 )
332333
333334 credentials = OAuth2AuthorizationCodeCredentials(
334 client_id='MY_ID', client_secret='MY_SECRET', authorization_code='AUTH_CODE'
335 client_id='MY_ID', client_secret='MY_SECRET', authorization_code='AUTH_CODE'
335336 )
336337 credentials = OAuth2AuthorizationCodeCredentials(
337338 client_id='MY_ID', client_secret='MY_SECRET',
338 access_token=OAuth2Token(access_token='EXISTING_TOKEN')
339 access_token=OAuth2Token(access_token='EXISTING_TOKEN')
339340 )
340341 config = Configuration(credentials=credentials, auth_type=OAUTH2)
341342 ```
363364 def refresh(self):
364365 self.access_token = ...
365366 ```
367
368 ### OAuth on Office 365
369 Office 365 is deprecating Basic authentication and switching to MFA for end
370 users and OAuth for everything else. Here's one way to set up an app that can
371 access accounts in your organization. First, log into the
372 [https://admin.microsoft.com](Microsoft 365 Administration) page. Find the link
373 to `Azure Active Directory`. Register a new app, and note down the Directory
374 (tenant) ID, Application (client) ID, and the secret:
375 ![App registration](/exchangelib/assets/img/app_registration.png)
376
377 Continue to the `API permissions` page, and add the `full_access_as_app`
378 permission:
379 ![API permissions](/exchangelib/assets/img/api_permissions.png)
380
381 Finally, continue to the `Enterprise applications` page, select your app,
382 continue to the `Permissions` page, and check that your app has the
383 `full_access_as_app` permission:
384 ![API permissions](/exchangelib/assets/img/permissions.png)
385
386 You should now be able to connect to an account using the `OAuth2Credentials`
387 class as shown above.
388
366389
367390 ### Caching autodiscover results
368391 If you're connecting to the same account very often, you can cache the
386409 version=version
387410 )
388411 account = Account(
389 primary_smtp_address=primary_smtp_address,
390 config=config, autodiscover=False,
412 primary_smtp_address=primary_smtp_address,
413 config=config, autodiscover=False,
391414 access_type=DELEGATE,
392415 )
393416 ```
749772 m.reply_all(subject='Re: Daily motivation', body='I agree')
750773 m.forward(
751774 subject='Fwd: Daily motivation',
752 body='Hey, look at this!',
775 body='Hey, look at this!',
753776 to_recipients=['carl@example.com', 'denice@example.com']
754777 )
755778 ```
9931016 # Returns items where subject is exactly 'foo'. Case-sensitive
9941017 qs.filter(subject='foo')
9951018 # Returns items within range
996 qs.filter(start__range=(start, end))
1019 qs.filter(start__range=(start, end))
9971020 # Return items where subject is either 'foo' or 'bar'
9981021 qs.filter(subject__in=('foo', 'bar'))
9991022 # Returns items where subject is not 'foo'
13511374 property_id = 0x00008524
13521375 property_type = 'String'
13531376 ```
1354
1377
13551378 Extended properties also work with folders. For folders, it's only possible to
13561379 register custom fields on all folder types at once. This is because it's
13571380 difficult to provide a consistent API when some folders have custom fields and
15561579 ):
15571580 # Delete or update random occurrences. This will affect
15581581 # 'modified_occurrences' and 'deleted_occurrences' of the master item.
1559 if occurrence.start.milliseconds % 2:
1582 if occurrence.start.microsecond % 2:
15601583 # We receive timestamps as UTC but want to write back as local timezone
15611584 occurrence.start = occurrence.start.astimezone(a.default_timezone)
15621585 occurrence.start += datetime.timedelta(minutes=30)
15771600 third_occurrence.save(update_fields=['start'])
15781601
15791602 # Similarly, you can reach the master recurrence from the occurrence
1580 master = third_occurrence.master_recurrence()
1603 master = third_occurrence.recurring_master()
15811604 master.subject = 'An update'
15821605 master.save(update_fields=['subject'])
15831606 ```
16981721 # SyncFolderItems.CHANGE_TYPES
16991722 pass
17001723 # The next time you call a.inbox.sync_items(), you will only get item changes
1701 # since the last .sync_items() call. The sync status is stored in
1724 # since the last .sync_items() call. The sync status is stored in
17021725 # a.inbox.item_sync_state.
17031726 ```
17041727
19541977 You can run either the entire test suite or individual tests.
19551978
19561979 ```bash
1980 # Install dependencies
1981 python -m pip install -r test-requirements.txt
1982
19571983 # Full test suite
19581984 python -m unittest
19591985
19601986 # Single test class or test case
19611987 python -m unittest -k test_folder.FolderTest.test_refresh
1988
19621989 # If you want extreme levels of debug output:
19631990 DEBUG=1 python -m unittest -k test_folder.FolderTest.test_refresh
1964 # Tests can be run in parallel if you install the 'unittest-parallel' package
1991
1992 # Running tests in parallel using the 'unittest-parallel' dependency
19651993 unittest-parallel -j 4 --class-fixtures
19661994 ```
1515 ForwardItem,
1616 Message,
1717 PostItem,
18 PostReplyItem,
1819 ReplyAllToItem,
1920 ReplyToItem,
2021 Task,
2728 from .transport import BASIC, CBA, DIGEST, GSSAPI, NTLM, OAUTH2, SSPI
2829 from .version import Build, Version
2930
30 __version__ = "4.7.2"
31 __version__ = "4.7.6"
3132
3233 __all__ = [
3334 "__version__",
35 "AcceptItem",
3436 "Account",
35 "Identity",
36 "FileAttachment",
37 "ItemAttachment",
38 "discover",
37 "Attendee",
38 "BASIC",
39 "BaseProtocol",
40 "Body",
41 "Build",
42 "CBA",
43 "CalendarItem",
44 "CancelCalendarItem",
3945 "Configuration",
46 "Contact",
47 "Credentials",
48 "DEEP",
4049 "DELEGATE",
41 "IMPERSONATION",
42 "Credentials",
43 "OAuth2AuthorizationCodeCredentials",
44 "OAuth2Credentials",
50 "DIGEST",
51 "DLMailbox",
52 "DeclineItem",
53 "DistributionList",
4554 "EWSDate",
4655 "EWSDateTime",
4756 "EWSTimeZone",
57 "ExtendedProperty",
58 "FailFast",
59 "FaultTolerance",
60 "FileAttachment",
61 "Folder",
62 "FolderCollection",
63 "ForwardItem",
64 "GSSAPI",
65 "HTMLBody",
66 "IMPERSONATION",
67 "Identity",
68 "ItemAttachment",
69 "ItemId",
70 "Mailbox",
71 "Message",
72 "NTLM",
73 "NoVerifyHTTPAdapter",
74 "OAUTH2",
75 "OAuth2AuthorizationCodeCredentials",
76 "OAuth2Credentials",
77 "OofSettings",
78 "PostItem",
79 "PostReplyItem",
80 "Q",
81 "ReplyAllToItem",
82 "ReplyToItem",
83 "Room",
84 "RoomList",
85 "RootOfHierarchy",
86 "SHALLOW",
87 "SSPI",
88 "TLSClientAuth",
89 "Task",
90 "TentativelyAcceptItem",
91 "UID",
4892 "UTC",
4993 "UTC_NOW",
50 "ExtendedProperty",
51 "Folder",
52 "RootOfHierarchy",
53 "FolderCollection",
54 "SHALLOW",
55 "DEEP",
56 "AcceptItem",
57 "TentativelyAcceptItem",
58 "DeclineItem",
59 "CalendarItem",
60 "CancelCalendarItem",
61 "Contact",
62 "DistributionList",
63 "Message",
64 "PostItem",
65 "Task",
66 "ForwardItem",
67 "ReplyToItem",
68 "ReplyAllToItem",
69 "ItemId",
70 "Mailbox",
71 "DLMailbox",
72 "Attendee",
73 "Room",
74 "RoomList",
75 "Body",
76 "HTMLBody",
77 "UID",
78 "FailFast",
79 "FaultTolerance",
80 "BaseProtocol",
81 "NoVerifyHTTPAdapter",
82 "TLSClientAuth",
83 "OofSettings",
84 "Q",
85 "BASIC",
86 "DIGEST",
87 "NTLM",
88 "GSSAPI",
89 "SSPI",
90 "OAUTH2",
91 "CBA",
92 "Build",
9394 "Version",
9495 "close_connections",
96 "discover",
9597 ]
9698
9799 # Set a default user agent, e.g. "exchangelib/3.1.1 (python-requests/2.22.0)"
2525
2626 log = logging.getLogger(__name__)
2727
28 DNS_LOOKUP_ERRORS = (
29 dns.name.EmptyLabel,
30 dns.resolver.NXDOMAIN,
31 dns.resolver.NoAnswer,
32 dns.resolver.NoNameservers,
33 )
34
2835
2936 def discover(email, credentials=None, auth_type=None, retry_policy=None):
3037 ad_response, protocol = Autodiscovery(email=email, credentials=credentials).discover()
8087 MAX_REDIRECTS = 10 # Maximum number of URL redirects before we give up
8188 DNS_RESOLVER_KWARGS = {}
8289 DNS_RESOLVER_ATTRS = {
83 "timeout": AutodiscoverProtocol.TIMEOUT,
90 "timeout": AutodiscoverProtocol.TIMEOUT / 2.5, # Timeout for query to a single nameserver
8491 }
92 DNS_RESOLVER_LIFETIME = AutodiscoverProtocol.TIMEOUT # Total timeout for a query in case of multiple nameservers
8593
8694 def __init__(self, email, credentials=None):
8795 """
356364 def _is_valid_hostname(self, hostname):
357365 log.debug("Checking if %s can be looked up in DNS", hostname)
358366 try:
359 self.resolver.resolve(hostname)
360 except (dns.resolver.NoNameservers, dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.name.EmptyLabel):
367 self.resolver.resolve(f"{hostname}.", "A", lifetime=self.DNS_RESOLVER_LIFETIME)
368 except DNS_LOOKUP_ERRORS as e:
369 log.debug("DNS A lookup failure: %s", e)
361370 return False
362371 return True
363372
377386 log.debug("Attempting to get SRV records for %s", hostname)
378387 records = []
379388 try:
380 answers = self.resolver.resolve(f"{hostname}.", "SRV")
381 except (dns.resolver.NoNameservers, dns.resolver.NoAnswer, dns.resolver.NXDOMAIN) as e:
382 log.debug("DNS lookup failure: %s", e)
389 answers = self.resolver.resolve(f"{hostname}.", "SRV", lifetime=self.DNS_RESOLVER_LIFETIME)
390 except DNS_LOOKUP_ERRORS as e:
391 log.debug("DNS SRV lookup failure: %s", e)
383392 return records
384393 for rdata in answers:
385394 try:
6060 if auth_type is None:
6161 # Set a default auth type for the credentials where this makes sense
6262 auth_type = DEFAULT_AUTH_TYPE.get(type(credentials))
63 elif credentials is None and auth_type in CREDENTIALS_REQUIRED:
63 if auth_type is not None and auth_type not in AUTH_TYPE_MAP:
64 raise InvalidEnumValue("auth_type", auth_type, AUTH_TYPE_MAP)
65 if credentials is None and auth_type in CREDENTIALS_REQUIRED:
6466 raise ValueError(f"Auth type {auth_type!r} was detected but no credentials were provided")
6567 if server and service_endpoint:
6668 raise AttributeError("Only one of 'server' or 'service_endpoint' must be provided")
67 if auth_type is not None and auth_type not in AUTH_TYPE_MAP:
68 raise InvalidEnumValue("auth_type", auth_type, AUTH_TYPE_MAP)
6969 if not retry_policy:
7070 retry_policy = FailFast()
7171 if not isinstance(version, (Version, type(None))):
107107 the associated auth code grant type for multi-tenant applications.
108108 """
109109
110 def __init__(self, client_id, client_secret, tenant_id=None, identity=None):
110 def __init__(self, client_id, client_secret, tenant_id=None, identity=None, access_token=None):
111111 """
112112
113113 :param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
114114 :param client_secret: Secret associated with the OAuth application
115115 :param tenant_id: Microsoft tenant ID of the account to access
116116 :param identity: An Identity object representing the account that these credentials are connected to.
117 :param access_token: Previously-obtained access token, as a dict or an oauthlib.oauth2.OAuth2Token
117118 """
118119 super().__init__()
119120 self.client_id = client_id
120121 self.client_secret = client_secret
121122 self.tenant_id = tenant_id
122123 self.identity = identity
123 # When set, access_token is a dict (or an oauthlib.oauth2.OAuth2Token, which is also a dict)
124 self.access_token = None
124 self.access_token = access_token
125125
126126 def refresh(self, session):
127127 # Creating a new session gets a new access token, so there's no work here to refresh the credentials. This
161161 res.append(getattr(self, k))
162162 return hash(tuple(res))
163163
164 @property
165 def token_url(self):
166 return f"https://login.microsoftonline.com/{self.tenant_id}/oauth2/v2.0/token"
167
168 @property
169 def scope(self):
170 return ["https://outlook.office365.com/.default"]
171
164172 def __repr__(self):
165173 return self.__class__.__name__ + repr((self.client_id, "********"))
166174
173181 several ways:
174182 * Given an authorization code, client ID, and client secret, fetch a token ourselves and refresh it as needed if
175183 supplied with a refresh token.
176 * Given an existing access token, refresh token, client ID, and client secret, use the access token until it
177 expires and then refresh it as needed.
184 * Given an existing access token, client ID, and client secret, use the access token until it expires and then
185 refresh it as needed.
178186 * Given only an existing access token, use it until it expires. This can be used to let the calling application
179187 refresh tokens itself by subclassing and implementing refresh().
180188
183191 tenant.
184192 """
185193
186 def __init__(self, authorization_code=None, access_token=None, **kwargs):
194 def __init__(self, authorization_code=None, access_token=None, client_id=None, client_secret=None, **kwargs):
187195 """
188196
189197 :param client_id: ID of an authorized OAuth application, required for automatic token fetching and refreshing
195203 :param access_token: Previously-obtained access token. If a token exists and the application will handle
196204 refreshing by itself (or opts not to handle it), this parameter alone is sufficient.
197205 """
198 super().__init__(**kwargs)
206 super().__init__(client_id=client_id, client_secret=client_secret, **kwargs)
199207 self.authorization_code = authorization_code
200208 if access_token is not None and not isinstance(access_token, dict):
201209 raise InvalidTypeError("access_token", access_token, OAuth2Token)
202210 self.access_token = access_token
211
212 @property
213 def token_url(self):
214 # We don't know (or need) the Microsoft tenant ID. Use common/ to let Microsoft select the appropriate
215 # tenant for the provided authorization code or refresh token.
216 return "https://login.microsoftonline.com/common/oauth2/v2.0/token" # nosec
217
218 @property
219 def scope(self):
220 res = super().scope
221 res.append("offline_access")
222 return res
203223
204224 def __repr__(self):
205225 return self.__class__.__name__ + repr(
4343
4444 def __eq__(self, other):
4545 return repr(self) == repr(other)
46
47 def __hash__(self):
48 return hash(str(self))
4649
4750
4851 # Warnings
119122 pass
120123
121124
122 class TimezoneDefinitionInvalidForYear(EWSError):
123 pass
124
125
126125 class SessionPoolMinSizeReached(EWSError):
127126 pass
128127
14161415 pass
14171416
14181417
1418 class ErrorRecoverableItemsAccessDenied(ResponseMessageError):
1419 pass
1420
1421
14191422 class ErrorRecurrenceEndDateTooBig(ResponseMessageError):
14201423 pass
14211424
16901693 pass
16911694
16921695
1693 # Microsoft recommends to cache the autodiscover data around 24 hours and perform autodiscover
1696 # Microsoft recommends caching the autodiscover data around 24 hours and perform autodiscover
16941697 # immediately following certain error responses from EWS. See more at
16951698 # http://blogs.msdn.com/b/mstehle/archive/2010/11/09/ews-best-practices-use-autodiscover.aspx
16961699
55 AdminAuditLogs,
66 AllContacts,
77 AllItems,
8 ApplicationData,
89 ArchiveDeletedItems,
910 ArchiveInbox,
1011 ArchiveMsgFolderRoot,
1314 ArchiveRecoverableItemsRoot,
1415 ArchiveRecoverableItemsVersions,
1516 Audits,
17 Birthdays,
1618 Calendar,
1719 CalendarLogging,
1820 CommonViews,
2123 Contacts,
2224 ConversationHistory,
2325 ConversationSettings,
26 CrawlerData,
2427 DefaultFoldersChangeHistory,
2528 DeferredAction,
2629 DeletedItems,
2730 Directory,
31 DlpPolicyEvaluation,
2832 Drafts,
2933 ExchangeSyncData,
3034 Favorites,
3135 Files,
36 FreeBusyCache,
3237 FreebusyData,
3338 Friends,
3439 GALContacts,
5964 RecoverableItemsPurges,
6065 RecoverableItemsRoot,
6166 RecoverableItemsVersions,
67 RecoveryPoints,
6268 Reminders,
6369 RSSFeeds,
6470 Schedule,
6874 Sharing,
6975 Shortcuts,
7076 Signal,
77 SkypeTeamsMessages,
7178 SmsAndChatsSync,
7279 SpoolerQueue,
80 SwssItems,
7381 SyncIssues,
7482 System,
7583 Tasks,
8492 from .roots import ArchiveRoot, PublicFoldersRoot, Root, RootOfHierarchy
8593
8694 __all__ = [
87 "FolderId",
88 "DistinguishedFolderId",
89 "FolderCollection",
90 "BaseFolder",
91 "Folder",
9295 "AdminAuditLogs",
9396 "AllContacts",
9497 "AllItems",
98 "ApplicationData",
9599 "ArchiveDeletedItems",
96100 "ArchiveInbox",
97101 "ArchiveMsgFolderRoot",
99103 "ArchiveRecoverableItemsPurges",
100104 "ArchiveRecoverableItemsRoot",
101105 "ArchiveRecoverableItemsVersions",
106 "ArchiveRoot",
102107 "Audits",
108 "BaseFolder",
109 "Birthdays",
103110 "Calendar",
104111 "CalendarLogging",
105112 "CommonViews",
113 "Companies",
106114 "Conflicts",
107115 "Contacts",
108116 "ConversationHistory",
109117 "ConversationSettings",
118 "CrawlerData",
119 "DEEP",
110120 "DefaultFoldersChangeHistory",
111121 "DeferredAction",
112122 "DeletedItems",
113123 "Directory",
124 "DistinguishedFolderId",
125 "DlpPolicyEvaluation",
114126 "Drafts",
115127 "ExchangeSyncData",
128 "FOLDER_TRAVERSAL_CHOICES",
116129 "Favorites",
117130 "Files",
131 "Folder",
132 "FolderCollection",
133 "FolderId",
134 "FolderQuerySet",
135 "FreeBusyCache",
118136 "FreebusyData",
119137 "Friends",
120138 "GALContacts",
130148 "MsgFolderRoot",
131149 "MyContacts",
132150 "MyContactsExtended",
151 "NON_DELETABLE_FOLDERS",
133152 "NonDeletableFolderMixin",
134153 "Notes",
154 "OrganizationalContacts",
135155 "Outbox",
136156 "ParkedMessages",
137157 "PassThroughSearchResults",
138158 "PdpProfileV2Secured",
159 "PeopleCentricConversationBuddies",
139160 "PeopleConnect",
161 "PublicFoldersRoot",
140162 "QuickContacts",
141163 "RSSFeeds",
142164 "RecipientCache",
144166 "RecoverableItemsPurges",
145167 "RecoverableItemsRoot",
146168 "RecoverableItemsVersions",
169 "RecoveryPoints",
147170 "Reminders",
171 "Root",
172 "RootOfHierarchy",
173 "SHALLOW",
174 "SOFT_DELETED",
148175 "Schedule",
149176 "SearchFolders",
150177 "SentItems",
152179 "Sharing",
153180 "Shortcuts",
154181 "Signal",
182 "SingleFolderQuerySet",
183 "SkypeTeamsMessages",
155184 "SmsAndChatsSync",
156185 "SpoolerQueue",
186 "SwssItems",
157187 "SyncIssues",
158188 "System",
159189 "Tasks",
163193 "VoiceMail",
164194 "WellknownFolder",
165195 "WorkingSet",
166 "Companies",
167 "OrganizationalContacts",
168 "PeopleCentricConversationBuddies",
169 "NON_DELETABLE_FOLDERS",
170 "FolderQuerySet",
171 "SingleFolderQuerySet",
172 "FOLDER_TRAVERSAL_CHOICES",
173 "SHALLOW",
174 "DEEP",
175 "SOFT_DELETED",
176 "Root",
177 "ArchiveRoot",
178 "PublicFoldersRoot",
179 "RootOfHierarchy",
180196 ]
99 ErrorDeleteDistinguishedFolder,
1010 ErrorFolderNotFound,
1111 ErrorItemNotFound,
12 ErrorRecoverableItemsAccessDenied,
1213 InvalidTypeError,
1314 )
1415 from ..fields import (
4647
4748 log = logging.getLogger(__name__)
4849
50 DELETE_FOLDER_ERRORS = (
51 ErrorAccessDenied,
52 ErrorCannotDeleteObject,
53 ErrorCannotEmptyFolder,
54 ErrorItemNotFound,
55 )
56
4957
5058 class BaseFolder(RegisterMixIn, SearchableMixIn, metaclass=EWSMeta):
5159 """Base class for all classes that implement a folder."""
228236 :return:
229237 """
230238 from .known_folders import (
239 ApplicationData,
231240 Calendar,
232241 Contacts,
233242 ConversationSettings,
243 CrawlerData,
244 DlpPolicyEvaluation,
245 FreeBusyCache,
234246 GALContacts,
235247 Messages,
236248 RecipientCache,
249 RecoveryPoints,
237250 Reminders,
238251 RSSFeeds,
252 Signal,
253 SwssItems,
239254 Tasks,
240255 )
241256
242257 for folder_cls in (
258 ApplicationData,
259 Calendar,
260 Contacts,
261 ConversationSettings,
262 CrawlerData,
263 DlpPolicyEvaluation,
264 FreeBusyCache,
265 GALContacts,
243266 Messages,
267 RSSFeeds,
268 RecipientCache,
269 RecoveryPoints,
270 Reminders,
271 Signal,
272 SwssItems,
244273 Tasks,
245 Calendar,
246 ConversationSettings,
247 Contacts,
248 GALContacts,
249 Reminders,
250 RecipientCache,
251 RSSFeeds,
252274 ):
253275 if folder_cls.CONTAINER_CLASS == container_class:
254276 return folder_cls
401423 def wipe(self, page_size=None, chunk_size=None, _seen=None, _level=0):
402424 # Recursively deletes all items in this folder, and all subfolders and their content. Attempts to protect
403425 # distinguished folders from being deleted. Use with caution!
426 from .known_folders import Audits
427
404428 _seen = _seen or set()
405429 if self.id in _seen:
406430 raise RecursionError(f"We already tried to wipe {self}")
407431 if _level > 16:
408432 raise RecursionError(f"Max recursion level reached: {_level}")
409433 _seen.add(self.id)
434 if isinstance(self, Audits):
435 # Shortcircuit because this folder can have many items that are all non-deletable
436 log.warning("Cannot wipe audits folder %s", self)
437 return
438 if self.is_distinguished and "recoverableitems" in self.DISTINGUISHED_FOLDER_ID:
439 log.warning("Cannot wipe recoverable items folder %s", self)
440 return
410441 log.warning("Wiping %s", self)
411442 has_distinguished_subfolders = any(f.is_distinguished for f in self.children)
412443 try:
414445 self.empty(delete_sub_folders=False)
415446 else:
416447 self.empty(delete_sub_folders=True)
417 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
448 except ErrorRecoverableItemsAccessDenied:
449 log.warning("Access denied to %s. Skipping", self)
450 return
451 except DELETE_FOLDER_ERRORS:
418452 try:
419453 if has_distinguished_subfolders:
420454 raise # We already tried this
421455 self.empty(delete_sub_folders=False)
422 except (ErrorAccessDenied, ErrorCannotEmptyFolder, ErrorItemNotFound):
456 except DELETE_FOLDER_ERRORS:
423457 log.warning("Not allowed to empty %s. Trying to delete items instead", self)
424458 kwargs = {}
425459 if page_size is not None:
428462 kwargs["chunk_size"] = chunk_size
429463 try:
430464 self.all().delete(**kwargs)
431 except (ErrorAccessDenied, ErrorCannotDeleteObject, ErrorItemNotFound):
465 except DELETE_FOLDER_ERRORS:
432466 log.warning("Not allowed to delete items in %s", self)
433467 _level += 1
434468 for f in self.children:
6161 supported_item_models = (Message, MeetingRequest, MeetingResponse, MeetingCancellation)
6262
6363
64 class CrawlerData(Folder):
65 CONTAINER_CLASS = "IPF.StoreItem.CrawlerData"
66
67
68 class DlpPolicyEvaluation(Folder):
69 CONTAINER_CLASS = "IPF.StoreItem.DlpPolicyEvaluation"
70
71
72 class FreeBusyCache(Folder):
73 CONTAINER_CLASS = "IPF.StoreItem.FreeBusyCache"
74
75
76 class RecoveryPoints(Folder):
77 CONTAINER_CLASS = "IPF.StoreItem.RecoveryPoints"
78
79
80 class SwssItems(Folder):
81 CONTAINER_CLASS = "IPF.StoreItem.SwssItems"
82
83
84 class SkypeTeamsMessages(Folder):
85 CONTAINER_CLASS = "IPF.SkypeTeams.Message"
86 LOCALIZED_NAMES = {
87 None: ("Team-chat",),
88 }
89
90
91 class Birthdays(Folder):
92 CONTAINER_CLASS = "IPF.Appointment.Birthday"
93 LOCALIZED_NAMES = {
94 None: ("Birthdays",),
95 "da_DK": ("Fødselsdage",),
96 }
97
98
6499 class Drafts(Messages):
65100 DISTINGUISHED_FOLDER_ID = "drafts"
66101
101136 "de_DE": ("Postausgang",),
102137 "en_US": ("Outbox",),
103138 "es_ES": ("Bandeja de salida",),
104 "fr_CA": (u"Boîte d'envoi",),
139 "fr_CA": ("Boîte d'envoi",),
105140 "nl_NL": ("Postvak UIT",),
106141 "ru_RU": ("Исходящие",),
107142 "sv_SE": ("Utkorgen",),
266301
267302 DISTINGUISHED_FOLDER_ID = "msgfolderroot"
268303 LOCALIZED_NAMES = {
304 None: ("Top of Information Store",),
305 "da_DK": ("Informationslagerets øverste niveau",),
269306 "zh_CN": ("信息存储顶部",),
270307 }
271308
380417 }
381418
382419
420 class ApplicationData(NonDeletableFolderMixin, Folder):
421 CONTAINER_CLASS = "IPM.ApplicationData"
422
423
383424 class Audits(NonDeletableFolderMixin, Folder):
384425 LOCALIZED_NAMES = {
385426 None: ("Audits",),
405446 CONTAINTER_CLASS = "IPF.Contact.Company"
406447 LOCALIZED_NAMES = {
407448 None: ("Companies",),
449 "da_DK": ("Firmaer",),
408450 }
409451
410452
618660 NON_DELETABLE_FOLDERS = [
619661 AllContacts,
620662 AllItems,
663 ApplicationData,
621664 Audits,
622665 CalendarLogging,
623666 CommonViews,
698741 ArchiveRecoverableItemsRoot,
699742 ArchiveRecoverableItemsVersions,
700743 ]
744
745 MISC_FOLDERS = [
746 CrawlerData,
747 DlpPolicyEvaluation,
748 FreeBusyCache,
749 RecoveryPoints,
750 SwssItems,
751 SkypeTeamsMessages,
752 Birthdays,
753 ]
77 from .base import BaseFolder
88 from .collections import FolderCollection
99 from .known_folders import (
10 MISC_FOLDERS,
1011 NON_DELETABLE_FOLDERS,
1112 WELLKNOWN_FOLDERS_IN_ARCHIVE_ROOT,
1213 WELLKNOWN_FOLDERS_IN_ROOT,
204205 :param folder_name:
205206 :param locale: a string, e.g. 'da_DK'
206207 """
207 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS:
208 for folder_cls in cls.WELLKNOWN_FOLDERS + NON_DELETABLE_FOLDERS + MISC_FOLDERS:
208209 if folder_name.lower() in folder_cls.localized_names(locale):
209210 return folder_cls
210211 raise KeyError()
409409
410410 @require_account
411411 def send(self, message_disposition=SEND_AND_SAVE_COPY):
412 # Some responses contain multiple response IDs, e.g. MeetingRequest.accept(). Return either the single ID or
413 # the list of IDs.
414412 from ..services import CreateItem
415413
416 return CreateItem(account=self.account).get(
417 items=[self],
418 folder=self.folder,
419 message_disposition=message_disposition,
420 send_meeting_invitations=SEND_TO_NONE,
414 res = list(
415 CreateItem(account=self.account).call(
416 items=[self],
417 folder=self.folder,
418 message_disposition=message_disposition,
419 send_meeting_invitations=SEND_TO_NONE,
420 )
421421 )
422 for r in res:
423 if isinstance(r, Exception):
424 raise r
425 # CreateItem may return multiple item IDs when given a meeting reply item. See issue#886. In lack of a better
426 # idea, return either the single ID or the list of IDs here.
427 if len(res) == 1:
428 return res[0]
429 return res
422430
423431
424432 class AcceptItem(BaseMeetingReplyItem):
3636 conversation_topic = CharField(field_uri="message:ConversationTopic", is_read_only=True)
3737 # Rename 'From' to 'author'. We can't use fieldname 'from' since it's a Python keyword.
3838 author = MailboxField(field_uri="message:From", is_read_only_after_send=True)
39 message_id = CharField(field_uri="message:InternetMessageId", is_read_only_after_send=True)
39 message_id = TextField(field_uri="message:InternetMessageId", is_read_only_after_send=True)
4040 is_read = BooleanField(field_uri="message:IsRead", is_required=True, default=False)
4141 is_response_requested = BooleanField(field_uri="message:IsResponseRequested", default=False, is_required=True)
4242 references = TextField(field_uri="message:References")
168168 from ..services import MarkAsJunk
169169
170170 res = MarkAsJunk(account=self.account).get(
171 items=[self], is_junk=is_junk, move_item=move_item, expect_result=move_item
171 items=[self], is_junk=is_junk, move_item=move_item, expect_result=None
172172 )
173173 if res is None:
174174 return
66 from inspect import getmro
77 from threading import Lock
88
9 from .errors import InvalidTypeError, TimezoneDefinitionInvalidForYear
9 from .errors import InvalidTypeError
1010 from .fields import (
1111 WEEKDAY_NAMES,
1212 AssociatedCalendarItemIdField,
218218 # Folder class, making the custom field available for subclasses).
219219 if local_fields:
220220 kwargs["FIELDS"] = fields
221 cls = super().__new__(mcs, name, bases, kwargs)
222 cls._slots_keys = mcs._get_slots_keys(cls)
223 return cls
221 klass = super().__new__(mcs, name, bases, kwargs)
222 klass._slots_keys = mcs._get_slots_keys(klass)
223 return klass
224224
225225 @staticmethod
226 def _get_slots_keys(cls):
226 def _get_slots_keys(klass):
227227 seen = set()
228228 keys = []
229 for c in reversed(getmro(cls)):
229 for c in reversed(getmro(klass)):
230230 if not hasattr(c, "__slots__"):
231231 continue
232232 for k in c.__slots__:
579579 def id_from_xml(cls, elem):
580580 item = cls.from_xml(elem=elem, account=None)
581581 return item.id, item.changekey
582
583
584 class OldItemId(ItemId):
585 """MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldfolderid"""
586
587 ELEMENT_NAME = "OldItemId"
588
589
590 class OldFolderId(FolderId):
591 """MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/olditemid"""
592
593 ELEMENT_NAME = "OldFolderId"
594
595
596 class OldParentFolderId(ParentFolderId):
597 """MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/oldparentfolderid"""
598
599 ELEMENT_NAME = "OldParentFolderId"
582600
583601
584602 class Mailbox(EWSElement):
14081426 """MSDN: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/responseobjects"""
14091427
14101428 ELEMENT_NAME = "ResponseObjects"
1411 NAMESPACE = EWSElement.NAMESPACE
1412
1413 accept_item = EWSElementField(field_uri="AcceptItem", value_cls="AcceptItem", namespace=NAMESPACE)
1429
1430 accept_item = EWSElementField(field_uri="AcceptItem", value_cls="AcceptItem", namespace=TNS)
14141431 tentatively_accept_item = EWSElementField(
1415 field_uri="TentativelyAcceptItem", value_cls="TentativelyAcceptItem", namespace=NAMESPACE
1416 )
1417 decline_item = EWSElementField(field_uri="DeclineItem", value_cls="DeclineItem", namespace=NAMESPACE)
1418 reply_to_item = EWSElementField(field_uri="ReplyToItem", value_cls="ReplyToItem", namespace=NAMESPACE)
1419 forward_item = EWSElementField(field_uri="ForwardItem", value_cls="ForwardItem", namespace=NAMESPACE)
1420 reply_all_to_item = EWSElementField(field_uri="ReplyAllToItem", value_cls="ReplyAllToItem", namespace=NAMESPACE)
1432 field_uri="TentativelyAcceptItem", value_cls="TentativelyAcceptItem", namespace=TNS
1433 )
1434 decline_item = EWSElementField(field_uri="DeclineItem", value_cls="DeclineItem", namespace=TNS)
1435 reply_to_item = EWSElementField(field_uri="ReplyToItem", value_cls="ReplyToItem", namespace=TNS)
1436 forward_item = EWSElementField(field_uri="ForwardItem", value_cls="ForwardItem", namespace=TNS)
1437 reply_all_to_item = EWSElementField(field_uri="ReplyAllToItem", value_cls="ReplyAllToItem", namespace=TNS)
14211438 cancel_calendar_item = EWSElementField(
1422 field_uri="CancelCalendarItem", value_cls="CancelCalendarItem", namespace=NAMESPACE
1439 field_uri="CancelCalendarItem", value_cls="CancelCalendarItem", namespace=TNS
14231440 )
14241441 remove_item = EWSElementField(field_uri="RemoveItem", value_cls=RemoveItem)
1425 post_reply_item = EWSElementField(
1426 field_uri="PostReplyItem", value_cls="PostReplyItem", namespace=EWSElement.NAMESPACE
1427 )
1442 post_reply_item = EWSElementField(field_uri="PostReplyItem", value_cls="PostReplyItem", namespace=TNS)
14281443 success_read_receipt = EWSElementField(field_uri="SuppressReadReceipt", value_cls=SuppressReadReceipt)
14291444 accept_sharing_invitation = EWSElementField(field_uri="AcceptSharingInvitation", value_cls=AcceptSharingInvitation)
14301445
17041719 ITEM = "item"
17051720
17061721 timestamp = DateTimeField(field_uri="TimeStamp")
1707 item_id = EWSElementField(field_uri="ItemId", value_cls=ItemId)
1708 folder_id = EWSElementField(field_uri="FolderId", value_cls=FolderId)
1709 parent_folder_id = EWSElementField(field_uri="ParentFolderId", value_cls=ParentFolderId)
1722 item_id = EWSElementField(value_cls=ItemId)
1723 folder_id = EWSElementField(value_cls=FolderId)
1724 parent_folder_id = EWSElementField(value_cls=ParentFolderId)
17101725
17111726 @property
17121727 def event_type(self):
17201735 class OldTimestampEvent(TimestampEvent, metaclass=EWSMeta):
17211736 """Base class for both item and folder copy/move events."""
17221737
1723 old_item_id = EWSElementField(field_uri="OldItemId", value_cls=ItemId)
1724 old_folder_id = EWSElementField(field_uri="OldFolderId", value_cls=FolderId)
1725 old_parent_folder_id = EWSElementField(field_uri="OldParentFolderId", value_cls=ParentFolderId)
1738 old_item_id = EWSElementField(value_cls=OldItemId)
1739 old_folder_id = EWSElementField(value_cls=OldFolderId)
1740 old_parent_folder_id = EWSElementField(value_cls=OldParentFolderId)
17261741
17271742
17281743 class CopiedEvent(OldTimestampEvent):
18631878 name = CharField(field_uri="Name", is_attribute=True)
18641879 bias = TimeDeltaField(field_uri="Bias", is_attribute=True)
18651880
1866 def _split_id(self):
1867 to_year, to_type = self.id.rsplit("/", 1)[1].split("-")
1868 return int(to_year), to_type
1869
1870 @property
1871 def year(self):
1872 return self._split_id()[0]
1873
1874 @property
1875 def type(self):
1876 return self._split_id()[1]
1877
18781881 @property
18791882 def bias_in_minutes(self):
18801883 return int(self.bias.total_seconds()) // 60 # Convert to minutes
19051908 def from_xml(cls, elem, account):
19061909 return super().from_xml(elem, account)
19071910
1908 def _get_standard_period(self, for_year):
1909 # Look through periods and pick a relevant period according to the 'for_year' value
1910 valid_period = None
1911 for period in sorted(self.periods, key=lambda p: (p.year, p.type)):
1912 if period.year > for_year:
1913 break
1914 if period.type != "Standard":
1911 def _get_standard_period(self, transitions_group):
1912 # Find the first standard period referenced from transitions_group
1913 standard_periods_map = {p.id: p for p in self.periods if p.name == "Standard"}
1914 for transition in transitions_group.transitions:
1915 try:
1916 return standard_periods_map[transition.to]
1917 except KeyError:
19151918 continue
1916 valid_period = period
1917 if valid_period is None:
1918 raise TimezoneDefinitionInvalidForYear(f"Year {for_year} not included in periods {self.periods}")
1919 return valid_period
1919 raise ValueError(f"No standard period matching any transition in {transitions_group}")
19201920
19211921 def _get_transitions_group(self, for_year):
19221922 # Look through the transitions, and pick the relevant transition group according to the 'for_year' value
19381938 if not 0 <= len(transitions_group.transitions) <= 2:
19391939 raise ValueError(f"Expected 0-2 transitions in transitions group {transitions_group}")
19401940
1941 standard_period = self._get_standard_period(for_year)
1941 standard_period = self._get_standard_period(transitions_group)
19421942 periods_map = {p.id: p for p in self.periods}
19431943 standard_time, daylight_time = None, None
19441944 if len(transitions_group.transitions) == 1:
244244 session = self.renew_session(session)
245245 self._session_pool.put(session, block=False)
246246
247 @staticmethod
248 def close_session(session):
247 def close_session(self, session):
248 if isinstance(self.credentials, OAuth2Credentials) and not isinstance(
249 self.credentials, OAuth2AuthorizationCodeCredentials
250 ):
251 # Reset token if client is of type BackendApplicationClient
252 self.credentials.access_token = None
249253 session.close()
250254 del session
251255
308312 return session
309313
310314 def create_oauth2_session(self):
311 has_token = False
312 scope = ["https://outlook.office365.com/.default"]
313 session_params = {}
315 session_params = {"token": self.credentials.access_token} # Token may be None
314316 token_params = {}
315317
316318 if isinstance(self.credentials, OAuth2AuthorizationCodeCredentials):
317 # Ask for a refresh token
318 scope.append("offline_access")
319
320 # We don't know (or need) the Microsoft tenant ID. Use
321 # common/ to let Microsoft select the appropriate tenant
322 # for the provided authorization code or refresh token.
323 #
324 # Suppress looks-like-password warning from Bandit.
325 token_url = "https://login.microsoftonline.com/common/oauth2/v2.0/token" # nosec
326
327 client_params = {}
328 has_token = self.credentials.access_token is not None
329 if has_token:
330 session_params["token"] = self.credentials.access_token
331 elif self.credentials.authorization_code is not None:
332 token_params["code"] = self.credentials.authorization_code
333 self.credentials.authorization_code = None
334
335 if self.credentials.client_id is not None and self.credentials.client_secret is not None:
336 # If we're given a client ID and secret, we have enough
337 # to refresh access tokens ourselves. In other cases the
338 # session will raise TokenExpiredError and we'll need to
339 # ask the calling application to refresh the token (that
340 # covers cases where the caller doesn't have access to
341 # the client secret but is working with a service that
342 # can provide it refreshed tokens on a limited basis).
319 token_params["code"] = self.credentials.authorization_code # Auth code may be None
320 self.credentials.authorization_code = None # We can only use the code once
321
322 if self.credentials.client_id and self.credentials.client_secret:
323 # If we're given a client ID and secret, we have enough to refresh access tokens ourselves. In other
324 # cases the session will raise TokenExpiredError, and we'll need to ask the calling application to
325 # refresh the token (that covers cases where the caller doesn't have access to the client secret but
326 # is working with a service that can provide it refreshed tokens on a limited basis).
343327 session_params.update(
344328 {
345329 "auto_refresh_kwargs": {
346330 "client_id": self.credentials.client_id,
347331 "client_secret": self.credentials.client_secret,
348332 },
349 "auto_refresh_url": token_url,
333 "auto_refresh_url": self.credentials.token_url,
350334 "token_updater": self.credentials.on_token_auto_refreshed,
351335 }
352336 )
353 client = WebApplicationClient(self.credentials.client_id, **client_params)
337 client = WebApplicationClient(client_id=self.credentials.client_id)
354338 else:
355 token_url = f"https://login.microsoftonline.com/{self.credentials.tenant_id}/oauth2/v2.0/token"
356339 client = BackendApplicationClient(client_id=self.credentials.client_id)
357340
358341 session = self.raw_session(self.service_endpoint, oauth2_client=client, oauth2_session_params=session_params)
359 if not has_token:
342 if not session.token:
360343 # Fetch the token explicitly -- it doesn't occur implicitly
361344 token = session.fetch_token(
362 token_url=token_url,
345 token_url=self.credentials.token_url,
363346 client_id=self.credentials.client_id,
364347 client_secret=self.credentials.client_secret,
365 scope=scope,
348 scope=self.credentials.scope,
366349 timeout=self.TIMEOUT,
367350 **token_params,
368351 )
369 # Allow the credentials object to update its copy of the new
370 # token, and give the application an opportunity to cache it
352 # Allow the credentials object to update its copy of the new token, and give the application an opportunity
353 # to cache it.
371354 self.credentials.on_token_auto_refreshed(token)
372355 session.auth = get_auth_instance(auth_type=OAUTH2, client=client)
373356
522505
523506 tz_definition = list(self.get_timezones(timezones=[start.tzinfo], return_full_timezone_data=True))[0]
524507 return GetUserAvailability(self).call(
525 timezone=TimeZone.from_server_timezone(tz_definition=tz_definition, for_year=start.year),
526508 mailbox_data=[
527509 MailboxData(
528510 email=account.primary_smtp_address if isinstance(account, Account) else account,
531513 )
532514 for account, attendee_type, exclude_conflicts in accounts
533515 ],
516 timezone=TimeZone.from_server_timezone(tz_definition=tz_definition, for_year=start.year),
534517 free_busy_view_options=FreeBusyViewOptions(
535518 time_window=TimeWindow(start=start, end=end),
536519 merged_free_busy_interval=merged_free_busy_interval,
00 import abc
11 import logging
2 import traceback
32 from itertools import chain
43
54 from .. import errors
65 from ..attachments import AttachmentId
76 from ..credentials import IMPERSONATION, OAuth2Credentials
87 from ..errors import (
9 ErrorAccessDenied,
10 ErrorADUnavailable,
118 ErrorBatchProcessingStopped,
129 ErrorCannotDeleteObject,
1310 ErrorCannotDeleteTaskOccurrence,
14 ErrorCannotEmptyFolder,
15 ErrorConnectionFailed,
16 ErrorConnectionFailedTransientError,
1711 ErrorCorruptData,
18 ErrorCreateItemAccessDenied,
19 ErrorDelegateNoUser,
20 ErrorDeleteDistinguishedFolder,
2112 ErrorExceededConnectionCount,
22 ErrorFolderNotFound,
23 ErrorImpersonateUserDenied,
24 ErrorImpersonationFailed,
2513 ErrorIncorrectSchemaVersion,
26 ErrorInternalServerError,
27 ErrorInternalServerTransientError,
2814 ErrorInvalidChangeKey,
2915 ErrorInvalidIdMalformed,
30 ErrorInvalidLicense,
3116 ErrorInvalidRequest,
3217 ErrorInvalidSchemaVersionForMailboxVersion,
3318 ErrorInvalidServerVersion,
34 ErrorInvalidSubscription,
35 ErrorInvalidSyncStateData,
36 ErrorInvalidWatermark,
3719 ErrorItemCorrupt,
3820 ErrorItemNotFound,
3921 ErrorItemSave,
40 ErrorMailboxMoveInProgress,
41 ErrorMailboxStoreUnavailable,
22 ErrorMailRecipientNotFound,
4223 ErrorMessageSizeExceeded,
4324 ErrorMimeContentConversionFailed,
44 ErrorNameResolutionMultipleResults,
45 ErrorNameResolutionNoResults,
46 ErrorNonExistentMailbox,
47 ErrorNoPublicFolderReplicaAvailable,
48 ErrorNoRespondingCASInDestinationSite,
49 ErrorNotDelegate,
50 ErrorQuotaExceeded,
5125 ErrorRecurrenceHasNoOccurrence,
5226 ErrorServerBusy,
5327 ErrorTimeoutExpired,
5529 EWSWarning,
5630 InvalidTypeError,
5731 MalformedResponseError,
58 RateLimitError,
5932 SessionPoolMinSizeReached,
6033 SOAPError,
6134 TransportError,
62 UnauthorizedError,
6335 )
6436 from ..folders import BaseFolder, Folder, RootOfHierarchy
6537 from ..items import BaseItem
9769 PAGE_SIZE = 100 # A default page size for all paging services. This is the number of items we request per page
9870 CHUNK_SIZE = 100 # A default chunk size for all services. This is the number of items we send in a single request
9971
100 KNOWN_EXCEPTIONS = (
101 ErrorAccessDenied,
102 ErrorADUnavailable,
103 ErrorBatchProcessingStopped,
104 ErrorCannotDeleteObject,
105 ErrorCannotEmptyFolder,
106 ErrorConnectionFailed,
107 ErrorConnectionFailedTransientError,
108 ErrorCreateItemAccessDenied,
109 ErrorDelegateNoUser,
110 ErrorDeleteDistinguishedFolder,
111 ErrorExceededConnectionCount,
112 ErrorFolderNotFound,
113 ErrorImpersonateUserDenied,
114 ErrorImpersonationFailed,
115 ErrorInternalServerError,
116 ErrorInternalServerTransientError,
117 ErrorInvalidChangeKey,
118 ErrorInvalidLicense,
119 ErrorInvalidSubscription,
120 ErrorInvalidSyncStateData,
121 ErrorInvalidWatermark,
122 ErrorItemCorrupt,
123 ErrorItemNotFound,
124 ErrorMailboxMoveInProgress,
125 ErrorMailboxStoreUnavailable,
126 ErrorNameResolutionMultipleResults,
127 ErrorNameResolutionNoResults,
128 ErrorNonExistentMailbox,
129 ErrorNoPublicFolderReplicaAvailable,
130 ErrorNoRespondingCASInDestinationSite,
131 ErrorNotDelegate,
132 ErrorQuotaExceeded,
133 ErrorTimeoutExpired,
134 RateLimitError,
135 UnauthorizedError,
136 )
137
13872
13973 class EWSService(metaclass=abc.ABCMeta):
14074 """Base class for all EWS services."""
15791 ErrorRecurrenceHasNoOccurrence,
15892 ErrorCorruptData,
15993 ErrorItemCorrupt,
94 ErrorMailRecipientNotFound,
16095 )
16196 # Similarly, define the warnings we want to return unraised
16297 WARNINGS_TO_CATCH_IN_RESPONSE = ErrorBatchProcessingStopped
331266 except ErrorServerBusy as e:
332267 self._handle_backoff(e)
333268 continue
334 except KNOWN_EXCEPTIONS:
335 # These are known and understood, and don't require a backtrace.
336 raise
337269 except (ErrorTooManyObjectsOpened, ErrorTimeoutExpired) as e:
338270 # ErrorTooManyObjectsOpened means there are too many connections to the Exchange database. This is very
339271 # often a symptom of sending too many requests.
348280
349281 # Re-raise as an ErrorServerBusy with a default delay of 5 minutes
350282 raise ErrorServerBusy(f"Reraised from {e.__class__.__name__}({e})")
351 except Exception:
352 # This may run in a thread, which obfuscates the stack trace. Print trace immediately.
353 account = self.account if isinstance(self, EWSAccountService) else None
354 log.warning("Account %s: Exception in _get_elements: %s", account, traceback.format_exc(20))
355 raise
356283 finally:
357284 if self.streaming:
358285 self.stop_streaming()
780707 def _account_to_impersonate(self):
781708 if self.account.access_type == IMPERSONATION:
782709 return self.account.identity
783 return None
710 return super()._account_to_impersonate
784711
785712 @property
786713 def _timezone(self):
1010
1111 SERVICE_NAME = "GetUserAvailability"
1212
13 def call(self, timezone, mailbox_data, free_busy_view_options):
13 def call(self, mailbox_data, timezone, free_busy_view_options):
1414 # TODO: Also supports SuggestionsViewOptions, see
1515 # https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/suggestionsviewoptions
1616 return self._elems_to_objs(
17 self._get_elements(
18 payload=self.get_payload(
19 timezone=timezone, mailbox_data=mailbox_data, free_busy_view_options=free_busy_view_options
20 )
17 self._chunked_get_elements(
18 self.get_payload,
19 items=mailbox_data,
20 timezone=timezone,
21 free_busy_view_options=free_busy_view_options,
2122 )
2223 )
2324
2425 def _elem_to_obj(self, elem):
2526 return FreeBusyView.from_xml(elem=elem, account=None)
2627
27 def get_payload(self, timezone, mailbox_data, free_busy_view_options):
28 def get_payload(self, mailbox_data, timezone, free_busy_view_options):
2829 payload = create_element(f"m:{self.SERVICE_NAME}Request")
2930 set_xml_value(payload, timezone, version=self.protocol.version)
3031 mailbox_data_array = create_element("m:MailboxDataArray")
4243
4344 def _get_elements_in_response(self, response):
4445 for msg in response:
45 # Just check the response code and raise errors
46 self._get_element_container(message=msg.find(f"{{{MNS}}}ResponseMessage"))
47 yield from self._get_elements_in_container(container=msg)
46 container_or_exc = self._get_element_container(message=msg.find(f"{{{MNS}}}ResponseMessage"))
47 if isinstance(container_or_exc, Exception):
48 yield container_or_exc
49 else:
50 yield from self._get_elements_in_container(container=msg)
4851
4952 @classmethod
5053 def _get_elements_in_container(cls, container):
00 import logging
1 import warnings
12
23 from ..errors import ErrorNameResolutionMultipleResults, ErrorNameResolutionNoResults, InvalidEnumValue
34 from ..items import SEARCH_SCOPE_CHOICES, SHAPE_CHOICES, Contact
1718 ERRORS_TO_CATCH_IN_RESPONSE = ErrorNameResolutionNoResults
1819 WARNINGS_TO_IGNORE_IN_RESPONSE = ErrorNameResolutionMultipleResults
1920 # Note: paging information is returned as attrs on the 'ResolutionSet' element, but this service does not
20 # support the 'IndexedPageItemView' element, so it's not really a paging service. According to docs, at most
21 # 100 candidates are returned for a lookup.
21 # support the 'IndexedPageItemView' element, so it's not really a paging service.
2222 supports_paging = False
23 # According to the 'Remarks' section of the MSDN documentation referenced above, at most 100 candidates are
24 # returned for a lookup.
25 candidates_limit = 100
2326
2427 def __init__(self, *args, **kwargs):
2528 super().__init__(*args, **kwargs)
5457 )
5558 )
5659
60 def _get_element_container(self, message, name=None):
61 container_or_exc = super()._get_element_container(message=message, name=name)
62 if isinstance(container_or_exc, Exception):
63 return container_or_exc
64 is_last_page = container_or_exc.get("IncludesLastItemInRange").lower() in ("true", "0")
65 log.debug("Includes last item in range: %s", is_last_page)
66 if not is_last_page:
67 warnings.warn(
68 f"The {self.__class__.__name__} service returns at most {self.candidates_limit} candidates and does "
69 f"not support paging. You have reached this limit and have not received the exhaustive list of "
70 f"candidates."
71 )
72 return container_or_exc
73
5774 def _elem_to_obj(self, elem):
5875 if self.return_full_contact_data:
5976 mailbox_elem = elem.find(Mailbox.response_tag())
2121 from pygments import highlight
2222 from pygments.formatters.terminal import TerminalFormatter
2323 from pygments.lexers.html import XmlLexer
24 from requests_oauthlib import OAuth2Session
2425
2526 from .errors import (
2627 InvalidTypeError,
572573 class PrettyXmlHandler(logging.StreamHandler):
573574 """A steaming log handler that prettifies log statements containing XML when output is a terminal."""
574575
575 @staticmethod
576 def parse_bytes(xml_bytes):
576 def parse_bytes(self, xml_bytes):
577577 return to_xml(xml_bytes)
578578
579 @classmethod
580 def prettify_xml(cls, xml_bytes):
579 def prettify_xml(self, xml_bytes):
581580 """Re-format an XML document to a consistent style."""
582581 return (
583 lxml.etree.tostring(cls.parse_bytes(xml_bytes), xml_declaration=True, encoding="utf-8", pretty_print=True)
582 lxml.etree.tostring(self.parse_bytes(xml_bytes), xml_declaration=True, encoding="utf-8", pretty_print=True)
584583 .replace(b"\t", b" ")
585584 .replace(b" xmlns:", b"\n xmlns:")
586585 )
838837 d_start = time.monotonic()
839838 # Always create a dummy response for logging purposes, in case we fail in the following
840839 r = DummyResponse(url=url, request_headers=headers)
840 kwargs = dict(url=url, headers=headers, data=data, allow_redirects=False, timeout=timeout, stream=stream)
841 if isinstance(session, OAuth2Session):
842 # Fix token refreshing bug. Reported as https://github.com/requests/requests-oauthlib/issues/498
843 kwargs.update(session.auto_refresh_kwargs)
841844 try:
842 r = session.post(
843 url=url, headers=headers, data=data, allow_redirects=False, timeout=timeout, stream=stream
844 )
845 r = session.post(**kwargs)
845846 except TLS_ERRORS as e:
846847 # Don't retry on TLS errors. They will most likely be persistent.
847848 raise TransportError(str(e))
33 [tool.isort]
44 line_length = 120
55 profile = "black"
6
3636 done
3737
3838 """
39 from datetime import timedelta, datetime
40 from netrc import netrc
4139 import sys
4240 import warnings
41 from datetime import datetime, timedelta
42 from netrc import netrc
4343
44 from exchangelib import DELEGATE, Credentials, Account, EWSTimeZone
4544 import sh
4645
47 if '--insecure' in sys.argv:
46 from exchangelib import DELEGATE, Account, Credentials, EWSTimeZone
47
48 if "--insecure" in sys.argv:
4849 # Disable TLS when Office365 can't get their certificate act together
4950 from exchangelib.protocol import BaseProtocol, NoVerifyHTTPAdapter
51
5052 BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapter
5153 # Disable insecure TLS warnings
5254 warnings.filterwarnings("ignore")
5355
5456 # Use notify-send for email notifications and zenity for calendar notifications
55 notify = sh.Command('/usr/bin/notify-send')
56 zenity = sh.Command('/usr/bin/zenity')
57 notify = sh.Command("/usr/bin/notify-send")
58 zenity = sh.Command("/usr/bin/zenity")
5759
5860 # Get the local timezone
5961 tz = EWSTimeZone.localzone()
6264 now = datetime.now(tz=tz)
6365 emails_since = now - timedelta(seconds=sleep)
6466 cal_items_before = now + timedelta(seconds=sleep * 4) # Longer notice of upcoming appointments than new emails
65 username, _, password = netrc().authenticators('office365')
67 username, _, password = netrc().authenticators("office365")
6668 c = Credentials(username, password)
6769 a = Account(primary_smtp_address=c.username, credentials=c, access_type=DELEGATE, autodiscover=True)
6870
69 for msg in a.calendar.view(start=now, end=cal_items_before)\
70 .only('start', 'end', 'subject', 'location')\
71 .order_by('start', 'end'):
71 for msg in (
72 a.calendar.view(start=now, end=cal_items_before)
73 .only("start", "end", "subject", "location")
74 .order_by("start", "end")
75 ):
7276 if msg.start < now:
7377 continue
7478 minutes_to_appointment = int((msg.start - now).total_seconds() / 60)
75 subj = f'You have a meeting in {minutes_to_appointment} minutes'
76 body = f"{msg.start.astimezone(tz).strftime('%H:%M')}-{msg.end.astimezone(tz).strftime('%H:%M')}: " \
77 f"{msg.subject[:150]}\n{msg.location}"
78 zenity(**{'info': None, 'no-markup': None, 'title': subj, 'text': body})
79 subj = f"You have a meeting in {minutes_to_appointment} minutes"
80 body = (
81 f"{msg.start.astimezone(tz).strftime('%H:%M')}-{msg.end.astimezone(tz).strftime('%H:%M')}: "
82 f"{msg.subject[:150]}\n{msg.location}"
83 )
84 zenity(**{"info": None, "no-markup": None, "title": subj, "text": body})
7985
80 for msg in a.inbox.filter(datetime_received__gt=emails_since, is_read=False)\
81 .only('datetime_received', 'subject', 'text_body')\
82 .order_by('datetime_received')[:10]:
83 subj = f'New mail: {msg.subject}'
84 clean_body = '\n'.join(line for line in msg.text_body.split('\n') if line)
86 for msg in (
87 a.inbox.filter(datetime_received__gt=emails_since, is_read=False)
88 .only("datetime_received", "subject", "text_body")
89 .order_by("datetime_received")[:10]
90 ):
91 subj = f"New mail: {msg.subject}"
92 clean_body = "\n".join(line for line in msg.text_body.split("\n") if line)
8593 notify(subj, clean_body[:200])
55 import logging
66 import os
77 import time
8
89 try:
910 import zoneinfo
1011 except ImportError:
1213
1314 from yaml import safe_load
1415
15 from exchangelib import DELEGATE, Configuration, Account, CalendarItem, Credentials, FaultTolerance
16 from exchangelib import DELEGATE, Account, CalendarItem, Configuration, Credentials, FaultTolerance
1617
1718 logging.basicConfig(level=logging.WARNING)
1819
1920 try:
20 with open(os.path.join(os.path.dirname(__file__), '../settings.yml')) as f:
21 with open(os.path.join(os.path.dirname(__file__), "../settings.yml")) as f:
2122 settings = safe_load(f)
2223 except FileNotFoundError:
23 print('Copy settings.yml.sample to settings.yml and enter values for your test server')
24 print("Copy settings.yml.sample to settings.yml and enter values for your test server")
2425 raise
2526
26 categories = ['perftest']
27 tz = zoneinfo.ZoneInfo('America/New_York')
27 categories = ["perftest"]
28 tz = zoneinfo.ZoneInfo("America/New_York")
2829
29 verify_ssl = settings.get('verify_ssl', True)
30 verify_ssl = settings.get("verify_ssl", True)
3031 if not verify_ssl:
3132 from exchangelib.protocol import BaseProtocol, NoVerifyHTTPAdapter
33
3234 BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapter
3335
3436 config = Configuration(
35 server=settings['server'],
36 credentials=Credentials(settings['username'], settings['password']),
37 server=settings["server"],
38 credentials=Credentials(settings["username"], settings["password"]),
3739 retry_policy=FaultTolerance(),
3840 )
39 print(f'Exchange server: {config.service_endpoint}')
41 print(f"Exchange server: {config.service_endpoint}")
4042
41 account = Account(config=config, primary_smtp_address=settings['account'], access_type=DELEGATE)
43 account = Account(config=config, primary_smtp_address=settings["account"], access_type=DELEGATE)
4244
4345 # Remove leftovers from earlier tests
4446 account.calendar.filter(categories__contains=categories).delete()
5153 tpl_item = CalendarItem(
5254 start=start,
5355 end=end,
54 body=f'This is a performance optimization test of server {account.protocol.server} intended to find the '
55 f'optimal batch size and concurrent connection pool size of this server.',
56 body=f"This is a performance optimization test of server {account.protocol.server} intended to find the "
57 f"optimal batch size and concurrent connection pool size of this server.",
5658 location="It's safe to delete this",
5759 categories=categories,
5860 )
5961 for j in range(count):
6062 item = copy.copy(tpl_item)
61 item.subject = f'Performance optimization test {j} by exchangelib',
63 item.subject = (f"Performance optimization test {j} by exchangelib",)
6264 yield item
6365
6466
7476 rate1 = len(ids) / delta1
7577 delta2 = t3 - t2
7678 rate2 = len(ids) / delta2
77 print(f'Time to process {len(ids)} items (batchsize {chunk_size}, poolsize {account.protocol.poolsize}): '
78 f'{delta1} / {delta2} ({rate1} / {rate2} per sec)')
79 print(
80 f"Time to process {len(ids)} items (batchsize {chunk_size}, poolsize {account.protocol.poolsize}): "
81 f"{delta1} / {delta2} ({rate1} / {rate2} per sec)"
82 )
7983
8084
8185 # Generate items
8286 calitems = list(generate_items(500))
8387
84 print('\nTesting batch size')
88 print("\nTesting batch size")
8589 for i in range(1, 11):
8690 chunk_size = 25 * i
8791 account.protocol.poolsize = 5
8892 test(calitems, chunk_size)
8993 time.sleep(60) # Sleep 1 minute. Performance will deteriorate over time if we give the server tie to recover
9094
91 print('\nTesting pool size')
95 print("\nTesting pool size")
9296 for i in range(1, 11):
9397 chunk_size = 10
9498 account.protocol.poolsize = i
0 from exchangelib.protocol import BaseProtocol
01 from tests.common import EWSTest
12
3 BaseProtocol.TIMEOUT = 300 # Seconds
24 t = EWSTest()
35 t.setUpClass()
46 t.wipe_test_account()
settings.yml.enc less more
Binary diff not shown
Binary diff not shown
00 server: 'example.com'
11 autodiscover_server: 'example.com'
2
23 username: 'MYWINDOMAIN\myusername'
34 password: 'topsecret'
5
6 # Or, for OAuth:
7 tenant_id:
8 client_id:
9 client_secret:
10
411 account: 'john.doe@example.com' # Don't use an account containing valuable data! We're polite, but things may go wrong.
5 verify_ssl: True
12 alias: 'john.doe@example.com' # For autodiscover lookups with an alias. Can be the same as 'account'.
13 verify_ssl: True # Must be True for OAuth
22
33 [metadata]
44 license_file = LICENSE
5
6 [flake8]
7 ignore = E203, W503
8 max-line-length = 120
1212 import io
1313 import os
1414
15 from setuptools import setup, find_packages
15 from setuptools import find_packages, setup
1616
1717
1818 def version():
19 with io.open(os.path.join(os.path.dirname(__file__), 'exchangelib/__init__.py'), encoding='utf-8') as f:
19 with io.open(os.path.join(os.path.dirname(__file__), "exchangelib/__init__.py"), encoding="utf-8") as f:
2020 for line in f:
21 if not line.startswith('__version__'):
21 if not line.startswith("__version__"):
2222 continue
23 return line.split('=')[1].strip(' "\'\n')
23 return line.split("=")[1].strip(" \"'\n")
2424
2525
2626 def read(file_name):
27 with io.open(os.path.join(os.path.dirname(__file__), file_name), encoding='utf-8') as f:
27 with io.open(os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8") as f:
2828 return f.read()
2929
3030
3131 setup(
32 name='exchangelib',
32 name="exchangelib",
3333 version=version(),
34 author='Erik Cederstrand',
35 author_email='erik@cederstrand.dk',
36 description='Client for Microsoft Exchange Web Services (EWS)',
37 long_description=read('README.md'),
38 long_description_content_type='text/markdown',
39 license='BSD-2-Clause',
40 keywords='ews exchange autodiscover microsoft outlook exchange-web-services o365 office365',
34 author="Erik Cederstrand",
35 author_email="erik@cederstrand.dk",
36 description="Client for Microsoft Exchange Web Services (EWS)",
37 long_description=read("README.md"),
38 long_description_content_type="text/markdown",
39 license="BSD-2-Clause",
40 keywords="ews exchange autodiscover microsoft outlook exchange-web-services o365 office365",
4141 install_requires=[
4242 'backports.zoneinfo;python_version<"3.9"',
43 'cached_property',
44 'defusedxml>=0.6.0',
45 'dnspython>=2.0.0',
46 'isodate',
47 'lxml>3.0',
48 'oauthlib',
49 'pygments',
50 'requests>=2.7',
51 'requests_ntlm>=0.2.0',
52 'requests_oauthlib',
53 'tzdata',
54 'tzlocal',
43 "cached_property",
44 "defusedxml>=0.6.0",
45 "dnspython>=2.0.0",
46 "isodate",
47 "lxml>3.0",
48 "oauthlib",
49 "pygments",
50 "requests>=2.7",
51 "requests_ntlm>=0.2.0",
52 "requests_oauthlib",
53 "tzdata",
54 "tzlocal",
5555 ],
5656 extras_require={
57 'kerberos': ['requests_gssapi'],
58 'sspi': ['requests_negotiate_sspi'], # Only for Win32 environments
59 'complete': ['requests_gssapi', 'requests_negotiate_sspi'], # Only for Win32 environments
57 "kerberos": ["requests_gssapi"],
58 "sspi": ["requests_negotiate_sspi"], # Only for Win32 environments
59 "complete": ["requests_gssapi", "requests_negotiate_sspi"], # Only for Win32 environments
6060 },
61 packages=find_packages(exclude=('tests', 'tests.*')),
62 tests_require=['psutil', 'python-dateutil', 'pytz', 'PyYAML', 'requests_mock'],
61 packages=find_packages(exclude=("tests", "tests.*")),
6362 python_requires=">=3.7",
64 test_suite='tests',
63 test_suite="tests",
6564 zip_safe=False,
66 url='https://github.com/ecederstrand/exchangelib',
65 url="https://github.com/ecederstrand/exchangelib",
6766 project_urls={
6867 "Bug Tracker": "https://github.com/ecederstrand/exchangelib/issues",
6968 "Documentation": "https://ecederstrand.github.io/exchangelib/",
7069 "Source Code": "https://github.com/ecederstrand/exchangelib",
7170 },
7271 classifiers=[
73 'Development Status :: 5 - Production/Stable',
74 'Topic :: Communications',
75 'License :: OSI Approved :: BSD License',
76 'Programming Language :: Python :: 3',
72 "Development Status :: 5 - Production/Stable",
73 "Topic :: Communications",
74 "License :: OSI Approved :: BSD License",
75 "Programming Language :: Python :: 3",
7776 ],
7877 )
00 black
11 coverage
22 coveralls
3 flake8
34 isort
45 psutil
56 python-dateutil
2525
2626 if os.environ.get("DEBUG", "").lower() in ("1", "yes", "true"):
2727 logging.basicConfig(level=logging.DEBUG, handlers=[PrettyXmlHandler()])
28 logging.getLogger("requests").setLevel(level=logging.INFO)
29 logging.getLogger("requests_oauthlib").setLevel(level=logging.INFO)
2830 else:
2931 logging.basicConfig(level=logging.CRITICAL)
1515 except ImportError:
1616 from backports import zoneinfo
1717
18 from exchangelib.account import Account
18 from exchangelib.account import Account, Identity
1919 from exchangelib.attachments import FileAttachment
2020 from exchangelib.configuration import Configuration
21 from exchangelib.credentials import DELEGATE, Credentials
21 from exchangelib.credentials import DELEGATE, IMPERSONATION, Credentials, OAuth2Credentials
2222 from exchangelib.errors import UnknownTimeZone
2323 from exchangelib.ewsdatetime import EWSTimeZone
2424 from exchangelib.fields import (
123123 cls.retry_policy = FaultTolerance(max_wait=600)
124124 cls.config = Configuration(
125125 server=settings["server"],
126 credentials=Credentials(settings["username"], settings["password"]),
126 credentials=cls.credentials(),
127127 retry_policy=cls.retry_policy,
128128 )
129129 cls.account = cls.get_account()
130
131 @classmethod
132 def credentials(cls):
133 if cls.settings.get("client_id"):
134 return OAuth2Credentials(
135 client_id=cls.settings["client_id"],
136 client_secret=cls.settings["client_secret"],
137 tenant_id=cls.settings["tenant_id"],
138 identity=Identity(primary_smtp_address=cls.settings["account"]),
139 )
140 return Credentials(username=cls.settings["username"], password=cls.settings["password"])
130141
131142 @classmethod
132143 def get_account(cls):
133144 return Account(
134145 primary_smtp_address=cls.settings["account"],
135 access_type=DELEGATE,
146 access_type=IMPERSONATION if isinstance(cls.config.credentials, OAuth2Credentials) else DELEGATE,
136147 config=cls.config,
137148 locale="da_DK",
138149 default_timezone=cls.tz,
208219 if isinstance(field, MailboxListField):
209220 # email_address must be a real account on the server(?)
210221 # TODO: Mailbox has multiple optional args but vals must match server account, so we can't easily test
211 if get_random_bool():
212 return [Mailbox(email_address=self.account.primary_smtp_address)]
213 return [self.account.primary_smtp_address]
222 return [Mailbox(email_address=self.account.primary_smtp_address)]
214223 if isinstance(field, MailboxField):
215224 # email_address must be a real account on the server(?)
216225 # TODO: Mailbox has multiple optional args but vals must match server account, so we can't easily test
217 if get_random_bool():
218 return Mailbox(email_address=self.account.primary_smtp_address)
219 return self.account.primary_smtp_address
226 return Mailbox(email_address=self.account.primary_smtp_address)
220227 if isinstance(field, AttendeesField):
221228 # Attendee must refer to a real mailbox on the server(?). We're only sure to have one
222 if get_random_bool():
223 mbx = Mailbox(email_address=self.account.primary_smtp_address)
224 else:
225 mbx = self.account.primary_smtp_address
229 mbx = Mailbox(email_address=self.account.primary_smtp_address)
226230 with_last_response_time = get_random_bool()
227231 if with_last_response_time:
228232 return [
232236 last_response_time=get_random_datetime(tz=self.account.default_timezone),
233237 )
234238 ]
235 if get_random_bool():
236 return [Attendee(mailbox=mbx, response_type="Accept")]
237 return [self.account.primary_smtp_address]
239 return [Attendee(mailbox=mbx, response_type="Accept")]
238240 if isinstance(field, EmailAddressesField):
239241 addrs = []
240242 for label in EmailAddress.get_field_by_fieldname("label").supported_choices(version=self.account.version):
320322
321323 def get_random_decimal(min_val=0, max_val=100):
322324 precision = 2
323 val = get_random_int(min_val, max_val * 10 ** precision) / 10.0 ** precision
325 val = get_random_int(min_val, max_val * 10**precision) / 10.0**precision
324326 return Decimal(f"{val:.2f}")
325327
326328
44 from exchangelib.account import Account
55 from exchangelib.attachments import FileAttachment
66 from exchangelib.configuration import Configuration
7 from exchangelib.credentials import DELEGATE, Credentials
7 from exchangelib.credentials import DELEGATE, Credentials, OAuth2Credentials
88 from exchangelib.errors import (
99 ErrorAccessDenied,
1010 ErrorDelegateNoUser,
7777 access_type=DELEGATE,
7878 config=Configuration(
7979 service_endpoint=self.account.protocol.service_endpoint,
80 credentials=Credentials(self.account.protocol.credentials.username, "WRONG_PASSWORD"),
80 credentials=Credentials("john@example.com", "WRONG_PASSWORD"),
8181 version=self.account.version,
82 auth_type=self.account.protocol.auth_type,
8382 retry_policy=self.retry_policy,
8483 ),
8584 autodiscover=False,
9392 access_type=DELEGATE,
9493 config=Configuration(
9594 service_endpoint=self.account.protocol.service_endpoint,
96 credentials=Credentials(self.account.protocol.credentials.username, "WRONG_PASSWORD"),
95 credentials=Credentials("john@example.com", "WRONG_PASSWORD"),
9796 version=self.account.version,
98 auth_type=self.account.protocol.auth_type,
9997 retry_policy=self.retry_policy,
10098 ),
10199 autodiscover=False,
163161
164162 def test_mail_tips(self):
165163 # Test that mail tips work
166 self.assertEqual(self.account.mail_tips.recipient_address, self.account.primary_smtp_address)
164 self.assertEqual(self.account.mail_tips.recipient_address.email_address, self.account.primary_smtp_address)
167165 # recipients must not be empty
168166 list(
169167 GetMailTips(protocol=self.account.protocol).call(
291289 access_type=DELEGATE,
292290 config=Configuration(
293291 service_endpoint=self.account.protocol.service_endpoint,
294 credentials=Credentials(self.account.protocol.credentials.username, "WRONG_PASSWORD"),
292 credentials=Credentials("john@example.com", "WRONG_PASSWORD"),
295293 version=self.account.version,
296 auth_type=self.account.protocol.auth_type,
297294 retry_policy=self.retry_policy,
298295 ),
299296 autodiscover=False,
323320 with self.assertRaises(AttributeError):
324321 account.protocol.config.credentials = self.account.protocol.credentials
325322 # Should succeed after credentials update
323 account.protocol.config.auth_type = self.account.protocol.config.auth_type
326324 account.protocol.credentials = self.account.protocol.credentials
327325 account.root.refresh()
328326
329327 def test_protocol_default_values(self):
330328 # Test that retry_policy and auth_type always get a value regardless of how we create an Account
331 c = Credentials(self.settings["username"], self.settings["password"])
332329 a = Account(
333330 self.account.primary_smtp_address,
334331 autodiscover=False,
335332 config=Configuration(
336333 server=self.settings["server"],
337 credentials=c,
334 credentials=self.account.protocol.credentials,
338335 ),
339336 )
340337 self.assertIsNotNone(a.protocol.auth_type)
341338 self.assertIsNotNone(a.protocol.retry_policy)
342339
340 if isinstance(self.account.protocol.credentials, OAuth2Credentials):
341 self.skipTest("OAuth authentication does not work with POX autodiscover")
342
343 pox_credentials = Credentials(username=self.settings["username"], password=self.settings["password"])
344
343345 a = Account(
344 self.account.primary_smtp_address,
346 self.settings["alias"],
345347 autodiscover=True,
346348 config=Configuration(
347349 server=self.settings["server"],
348 credentials=c,
350 credentials=pox_credentials,
349351 ),
350352 )
351353 self.assertIsNotNone(a.protocol.auth_type)
352354 self.assertIsNotNone(a.protocol.retry_policy)
353355
354 a = Account(self.account.primary_smtp_address, autodiscover=True, credentials=c)
356 a = Account(self.settings["alias"], autodiscover=True, credentials=pox_credentials)
355357 self.assertIsNotNone(a.protocol.auth_type)
356358 self.assertIsNotNone(a.protocol.retry_policy)
00 from exchangelib.attachments import AttachmentId, FileAttachment, ItemAttachment
1 from exchangelib.errors import ErrorInvalidIdMalformed, ErrorItemNotFound
1 from exchangelib.errors import ErrorInvalidAttachmentId, ErrorInvalidIdMalformed
22 from exchangelib.fields import FieldPath
33 from exchangelib.folders import Inbox
44 from exchangelib.items import Item, Message
168168 additional_fields=[FieldPath(field=self.ITEM_CLASS.get_field_by_fieldname("body"))],
169169 )
170170 self.assertEqual(
171 attachment.item.body,
172 '<html>\r\n<head>\r\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r\n'
173 "</head>\r\n<body>\r\nHello HTML\r\n</body>\r\n</html>\r\n",
171 attachment.item.body.replace("\r\n", ""),
172 '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
173 "</head><body>Hello HTML </body></html>",
174174 )
175175
176176 def test_file_attachments(self):
214214
215215 def test_streaming_file_attachments(self):
216216 item = self.get_test_item(folder=self.test_folder)
217 large_binary_file_content = get_random_string(2 ** 10).encode("utf-8")
217 large_binary_file_content = get_random_string(2**10).encode("utf-8")
218218 large_att = FileAttachment(name="my_large_file.txt", content=large_binary_file_content)
219219 item.attach(large_att)
220220 item.save()
237237 def test_streaming_file_attachment_error(self):
238238 # Test that we can parse XML error responses in streaming mode.
239239
240 # Try to stram an attachment with malformed ID
240 # Try to stream an attachment with malformed ID
241 item = self.get_test_item(folder=self.test_folder).save()
241242 att = FileAttachment(
242 parent_item=self.get_test_item(folder=self.test_folder),
243 parent_item=item,
243244 attachment_id=AttachmentId(id="AAMk="),
244245 name="dummy.txt",
245246 content=b"",
249250 fp.read()
250251
251252 # Try to stream a non-existent attachment
252 att.attachment_id.id = (
253 "AAMkADQyYzZmYmUxLTJiYjItNDg2Ny1iMzNjLTIzYWE1NDgxNmZhNABGAAAAAADUebQDarW2Q7G2Ji8hKofPBwAl9iKCsfCfS"
254 "a9cmjh+JCrCAAPJcuhjAABioKiOUTCQRI6Q5sRzi0pJAAHnDV3CAAABEgAQAN0zlxDrzlxAteU+kt84qOM="
255 )
256 with self.assertRaises(ErrorItemNotFound):
253 att.attachment_id = None
254 att.attach()
255 att_id = att.attachment_id
256 att.detach()
257 att.parent_item = item
258 att.attachment_id = att_id
259 with self.assertRaises(ErrorInvalidAttachmentId):
257260 with att.fp as fp:
258261 fp.read()
259262
2222 from exchangelib.autodiscover.properties import Account as ADAccount
2323 from exchangelib.autodiscover.properties import Autodiscover, Error, ErrorResponse, Response
2424 from exchangelib.configuration import Configuration
25 from exchangelib.credentials import DELEGATE, Credentials
25 from exchangelib.credentials import DELEGATE, Credentials, OAuth2Credentials
2626 from exchangelib.errors import AutoDiscoverCircularRedirect, AutoDiscoverFailed, ErrorNonExistentMailbox
2727 from exchangelib.protocol import FailFast, FaultTolerance
2828 from exchangelib.transport import NOAUTH, NTLM
3434
3535 class AutodiscoverTest(EWSTest):
3636 def setUp(self):
37 if isinstance(self.account.protocol.credentials, OAuth2Credentials):
38 self.skipTest("OAuth authentication does not work with POX autodiscover")
39
3740 super().setUp()
3841
3942 # Enable retries, to make tests more robust
4851 self.dummy_ad_endpoint = f"https://{self.domain}/Autodiscover/Autodiscover.xml"
4952 self.dummy_ews_endpoint = "https://expr.example.com/EWS/Exchange.asmx"
5053 self.dummy_ad_response = self.settings_xml(self.account.primary_smtp_address, self.dummy_ews_endpoint)
54
55 self.pox_credentials = Credentials(username=self.settings["username"], password=self.settings["password"])
5156
5257 @staticmethod
5358 def settings_xml(address, ews_url):
131136 # A live test of the entire process with an empty cache
132137 ad_response, protocol = discover(
133138 email=self.account.primary_smtp_address,
134 credentials=self.account.protocol.credentials,
139 credentials=self.pox_credentials,
135140 retry_policy=self.retry_policy,
136141 )
137142 self.assertEqual(ad_response.autodiscover_smtp_address, self.account.primary_smtp_address)
142147 self.assertEqual(protocol.version.build, self.account.protocol.version.build)
143148
144149 def test_autodiscover_failure(self):
145 # A live test that errors can be raised. Here, we try to aútodiscover a non-existing email address
150 # A live test that errors can be raised. Here, we try to autodiscover a non-existing email address
146151 if not self.settings.get("autodiscover_server"):
147152 self.skipTest(f"Skipping {self.__class__.__name__} - no 'autodiscover_server' entry in settings.yml")
148153 # Autodiscovery may take a long time. Prime the cache with the autodiscover server from the config file
149154 ad_endpoint = f"https://{self.settings['autodiscover_server']}/Autodiscover/Autodiscover.xml"
150 cache_key = (self.domain, self.account.protocol.credentials)
155 cache_key = (self.domain, self.pox_credentials)
151156 autodiscover_cache[cache_key] = self.get_test_protocol(
152157 service_endpoint=ad_endpoint,
153 credentials=self.account.protocol.credentials,
158 credentials=self.pox_credentials,
154159 retry_policy=self.retry_policy,
155160 )
156161 with self.assertRaises(ErrorNonExistentMailbox):
157162 discover(
158163 email="XXX." + self.account.primary_smtp_address,
159 credentials=self.account.protocol.credentials,
164 credentials=self.pox_credentials,
160165 retry_policy=self.retry_policy,
161166 )
162167
165170 Account(
166171 primary_smtp_address=self.account.primary_smtp_address,
167172 access_type=DELEGATE,
168 credentials=Credentials(self.account.protocol.credentials.username, "WRONG_PASSWORD"),
173 credentials=Credentials("john@example.com", "WRONG_PASSWORD"),
169174 autodiscover=True,
170175 locale="da_DK",
171176 )
192197 m.post(self.dummy_ad_endpoint, status_code=200, content=self.dummy_ad_response)
193198 discovery = Autodiscovery(
194199 email=self.account.primary_smtp_address,
195 credentials=self.account.protocol.credentials,
200 credentials=self.pox_credentials,
196201 )
197202 # Not cached
198203 self.assertNotIn(discovery._cache_key, autodiscover_cache)
203208 self.assertIn(
204209 (
205210 self.account.primary_smtp_address.split("@")[1],
206 Credentials(self.account.protocol.credentials.username, self.account.protocol.credentials.password),
211 self.pox_credentials,
207212 True,
208213 ),
209214 autodiscover_cache,
265270 account = Account(
266271 primary_smtp_address=self.account.primary_smtp_address,
267272 config=Configuration(
268 credentials=self.account.protocol.credentials,
273 credentials=self.pox_credentials,
269274 retry_policy=self.retry_policy,
270275 version=Version(build=EXCHANGE_2013),
271276 ),
276281 self.assertEqual(account.protocol.service_endpoint.lower(), self.dummy_ews_endpoint.lower())
277282 # Make sure cache is full
278283 self.assertEqual(len(autodiscover_cache), 1)
279 self.assertTrue((account.domain, self.account.protocol.credentials, True) in autodiscover_cache)
284 self.assertTrue((account.domain, self.pox_credentials, True) in autodiscover_cache)
280285 # Test that autodiscover works with a full cache
281286 account = Account(
282287 primary_smtp_address=self.account.primary_smtp_address,
283288 config=Configuration(
284 credentials=self.account.protocol.credentials,
289 credentials=self.pox_credentials,
285290 retry_policy=self.retry_policy,
286291 ),
287292 autodiscover=True,
289294 )
290295 self.assertEqual(account.primary_smtp_address, self.account.primary_smtp_address)
291296 # Test cache manipulation
292 key = (account.domain, self.account.protocol.credentials, True)
297 key = (account.domain, self.pox_credentials, True)
293298 self.assertTrue(key in autodiscover_cache)
294299 del autodiscover_cache[key]
295300 self.assertFalse(key in autodiscover_cache)
302307 m.post(self.dummy_ad_endpoint, status_code=200, content=self.dummy_ad_response)
303308 discovery = Autodiscovery(
304309 email=self.account.primary_smtp_address,
305 credentials=self.account.protocol.credentials,
310 credentials=self.pox_credentials,
306311 )
307312 discovery.discover()
308313
379384 def test_autodiscover_path_1_2_5(self, m):
380385 # Test steps 1 -> 2 -> 5
381386 clear_cache()
382 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
387 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
383388 ews_url = f"https://xxx.{self.domain}/EWS/Exchange.asmx"
384389 email = f"xxxd@{self.domain}"
385390 m.post(self.dummy_ad_endpoint, status_code=501)
396401 def test_autodiscover_path_1_2_3_invalid301_4(self, m):
397402 # Test steps 1 -> 2 -> 3 -> invalid 301 URL -> 4
398403 clear_cache()
399 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
404 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
400405 m.post(self.dummy_ad_endpoint, status_code=501)
401406 m.post(f"https://autodiscover.{self.domain}/Autodiscover/Autodiscover.xml", status_code=501)
402407 m.get(
412417 @requests_mock.mock(real_http=False)
413418 def test_autodiscover_path_1_2_3_no301_4(self, m):
414419 # Test steps 1 -> 2 -> 3 -> no 301 response -> 4
415 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
420 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
416421 m.post(self.dummy_ad_endpoint, status_code=501)
417422 m.post(f"https://autodiscover.{self.domain}/Autodiscover/Autodiscover.xml", status_code=501)
418423 m.get(f"http://autodiscover.{self.domain}/Autodiscover/Autodiscover.xml", status_code=200)
424429 @requests_mock.mock(real_http=False)
425430 def test_autodiscover_path_1_2_3_4_valid_srv_invalid_response(self, m):
426431 # Test steps 1 -> 2 -> 3 -> 4 -> invalid response from SRV URL
427 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
432 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
428433 redirect_srv = "httpbin.org"
429434 m.post(self.dummy_ad_endpoint, status_code=501)
430435 m.post(f"https://autodiscover.{self.domain}/Autodiscover/Autodiscover.xml", status_code=501)
444449 @requests_mock.mock(real_http=False)
445450 def test_autodiscover_path_1_2_3_4_valid_srv_valid_response(self, m):
446451 # Test steps 1 -> 2 -> 3 -> 4 -> 5
447 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
452 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
448453 redirect_srv = "httpbin.org"
449454 ews_url = f"https://{redirect_srv}/EWS/Exchange.asmx"
450455 redirect_email = f"john@redirected.{redirect_srv}"
470475 @requests_mock.mock(real_http=False)
471476 def test_autodiscover_path_1_2_3_4_invalid_srv(self, m):
472477 # Test steps 1 -> 2 -> 3 -> 4 -> invalid SRV URL
473 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
478 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
474479 m.post(self.dummy_ad_endpoint, status_code=501)
475480 m.post(f"https://autodiscover.{self.domain}/Autodiscover/Autodiscover.xml", status_code=501)
476481 m.get(f"http://autodiscover.{self.domain}/Autodiscover/Autodiscover.xml", status_code=200)
488493 def test_autodiscover_path_1_5_invalid_redirect_url(self, m):
489494 # Test steps 1 -> -> 5 -> Invalid redirect URL
490495 clear_cache()
491 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
496 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
492497 m.post(
493498 self.dummy_ad_endpoint,
494499 status_code=200,
503508 def test_autodiscover_path_1_5_valid_redirect_url_invalid_response(self, m):
504509 # Test steps 1 -> -> 5 -> Invalid response from redirect URL
505510 clear_cache()
506 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
511 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
507512 redirect_url = "https://httpbin.org/Autodiscover/Autodiscover.xml"
508513 m.post(self.dummy_ad_endpoint, status_code=200, content=self.redirect_url_xml(redirect_url))
509514 m.head(redirect_url, status_code=501)
517522 def test_autodiscover_path_1_5_valid_redirect_url_valid_response(self, m):
518523 # Test steps 1 -> -> 5 -> Valid response from redirect URL -> 5
519524 clear_cache()
520 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.account.protocol.credentials)
525 d = Autodiscovery(email=self.account.primary_smtp_address, credentials=self.pox_credentials)
521526 redirect_hostname = "httpbin.org"
522527 redirect_url = f"https://{redirect_hostname}/Autodiscover/Autodiscover.xml"
523528 ews_url = f"https://{redirect_hostname}/EWS/Exchange.asmx"
541546
542547 class _Mock1:
543548 @staticmethod
544 def resolve(hostname, cat):
549 def resolve(*args, **kwargs):
545550 class A:
546551 @staticmethod
547552 def to_text():
559564
560565 class _Mock2:
561566 @staticmethod
562 def resolve(hostname, cat):
567 def resolve(*args, **kwargs):
563568 class A:
564569 @staticmethod
565570 def to_text():
2727 for o in (
2828 Identity("XXX", "YYY", "ZZZ", "WWW"),
2929 Credentials("XXX", "YYY"),
30 OAuth2Credentials("XXX", "YYY", "ZZZZ"),
31 OAuth2Credentials("XXX", "YYY", "ZZZZ", identity=Identity("AAA")),
32 OAuth2AuthorizationCodeCredentials(client_id="WWW", client_secret="XXX"),
30 OAuth2Credentials(client_id="XXX", client_secret="YYY", tenant_id="ZZZZ"),
31 OAuth2Credentials(client_id="XXX", client_secret="YYY", tenant_id="ZZZZ", identity=Identity("AAA")),
32 OAuth2AuthorizationCodeCredentials(client_id="WWW", client_secret="XXX", authorization_code="YYY"),
33 OAuth2AuthorizationCodeCredentials(
34 client_id="WWW", client_secret="XXX", access_token={"access_token": "ZZZ"}
35 ),
36 OAuth2AuthorizationCodeCredentials(access_token={"access_token": "ZZZ"}),
3337 OAuth2AuthorizationCodeCredentials(
3438 client_id="WWW",
3539 client_secret="XXX",
341341 item = self.get_test_item(folder=self.test_folder).save()
342342 self.assertEqual(self.test_folder.filter(**{attr_name: getattr(item, attr_name)}).count(), 1)
343343 self.assertEqual(
344 self.test_folder.filter(**{f"{array_attr_name}__contains": getattr(item, array_attr_name)}).count(), 1
344 # Does not work in O365
345 # self.test_folder.filter(**{f"{array_attr_name}__contains": getattr(item, array_attr_name)}).count(), 1
346 self.test_folder.filter(**{f"{array_attr_name}__in": getattr(item, array_attr_name)}).count(),
347 1,
345348 )
346349 finally:
347350 self.ITEM_CLASS.deregister(attr_name=attr_name)
77 ErrorFolderNotFound,
88 ErrorItemNotFound,
99 ErrorItemSave,
10 ErrorNoPublicFolderReplicaAvailable,
1011 ErrorObjectTypeChanged,
1112 MultipleObjectsReturned,
1213 )
1617 SHALLOW,
1718 AllContacts,
1819 AllItems,
20 ApplicationData,
21 Birthdays,
1922 Calendar,
2023 Companies,
2124 Contacts,
2225 ConversationSettings,
26 CrawlerData,
2327 DefaultFoldersChangeHistory,
2428 DeletedItems,
2529 DistinguishedFolderId,
30 DlpPolicyEvaluation,
2631 Drafts,
2732 Favorites,
2833 Files,
2934 Folder,
3035 FolderCollection,
3136 FolderQuerySet,
37 FreeBusyCache,
3238 Friends,
3339 GALContacts,
3440 GraphAnalytics,
4854 PublicFoldersRoot,
4955 QuickContacts,
5056 RecipientCache,
57 RecoveryPoints,
5158 Reminders,
5259 RootOfHierarchy,
5360 RSSFeeds,
5562 Sharing,
5663 Signal,
5764 SingleFolderQuerySet,
65 SkypeTeamsMessages,
5866 SmsAndChatsSync,
67 SwssItems,
5968 SyncIssues,
60 System,
6169 Tasks,
6270 ToDoSearch,
6371 VoiceMail,
123131 with self.assertRaises(ValueError):
124132 self.account.root.get_default_folder(Folder)
125133
126 with self.assertRaises(ValueError) as e:
127 Folder(root=self.account.public_folders_root, parent=self.account.inbox)
128 self.assertEqual(e.exception.args[0], "'parent.root' must match 'root'")
134 try:
135 with self.assertRaises(ValueError) as e:
136 Folder(root=self.account.public_folders_root, parent=self.account.inbox)
137 self.assertEqual(e.exception.args[0], "'parent.root' must match 'root'")
138 except ErrorFolderNotFound:
139 pass
129140 with self.assertRaises(ValueError) as e:
130141 Folder(parent=self.account.inbox, parent_folder_id="XXX")
131142 self.assertEqual(e.exception.args[0], "'parent_folder_id' must match 'parent' ID")
146157
147158 def test_public_folders_root(self):
148159 # Test account does not have a public folders root. Make a dummy query just to hit .get_children()
149 self.assertGreaterEqual(
150 len(list(PublicFoldersRoot(account=self.account, is_distinguished=True).get_children(self.account.inbox))),
151 0,
152 )
160 try:
161 self.assertGreaterEqual(
162 len(
163 list(
164 PublicFoldersRoot(account=self.account, is_distinguished=True).get_children(self.account.inbox)
165 )
166 ),
167 0,
168 )
169 except ErrorNoPublicFolderReplicaAvailable:
170 pass
153171
154172 def test_invalid_deletefolder_args(self):
155173 with self.assertRaises(ValueError) as e:
201219 self.assertGreater(len(folders), 40, sorted(f.name for f in folders))
202220
203221 def test_find_folders_multiple_roots(self):
204 coll = FolderCollection(account=self.account, folders=[self.account.root, self.account.public_folders_root])
222 try:
223 coll = FolderCollection(account=self.account, folders=[self.account.root, self.account.public_folders_root])
224 except ErrorFolderNotFound as e:
225 self.skipTest(str(e))
205226 with self.assertRaises(ValueError) as e:
206227 list(coll.find_folders(depth="Shallow"))
207228 self.assertIn("All folders in 'roots' must have the same root hierarchy", e.exception.args[0])
216237
217238 def test_find_folders_with_restriction(self):
218239 # Exact match
240 tois_folder_name = self.account.root.tois.name
219241 folders = list(
220 FolderCollection(account=self.account, folders=[self.account.root]).find_folders(
221 q=Q(name="Top of Information Store")
222 )
242 FolderCollection(account=self.account, folders=[self.account.root]).find_folders(q=Q(name=tois_folder_name))
223243 )
224244 self.assertEqual(len(folders), 1, sorted(f.name for f in folders))
225245 # Startswith
226246 folders = list(
227247 FolderCollection(account=self.account, folders=[self.account.root]).find_folders(
228 q=Q(name__startswith="Top of ")
248 q=Q(name__startswith=tois_folder_name[:6])
229249 )
230250 )
231251 self.assertEqual(len(folders), 1, sorted(f.name for f in folders))
232252 # Wrong case
233253 folders = list(
234254 FolderCollection(account=self.account, folders=[self.account.root]).find_folders(
235 q=Q(name__startswith="top of ")
255 q=Q(name__startswith=tois_folder_name[:6].lower())
236256 )
237257 )
238258 self.assertEqual(len(folders), 0, sorted(f.name for f in folders))
239259 # Case insensitive
240260 folders = list(
241261 FolderCollection(account=self.account, folders=[self.account.root]).find_folders(
242 q=Q(name__istartswith="top of ")
262 q=Q(name__istartswith=tois_folder_name[:6].lower())
243263 )
244264 )
245265 self.assertEqual(len(folders), 1, sorted(f.name for f in folders))
299319 ),
300320 ):
301321 self.assertEqual(f.folder_class, "IPF.Note")
322 elif isinstance(f, ApplicationData):
323 self.assertEqual(f.folder_class, "IPM.ApplicationData")
324 elif isinstance(f, CrawlerData):
325 self.assertEqual(f.folder_class, "IPF.StoreItem.CrawlerData")
326 elif isinstance(f, DlpPolicyEvaluation):
327 self.assertEqual(f.folder_class, "IPF.StoreItem.DlpPolicyEvaluation")
328 elif isinstance(f, FreeBusyCache):
329 self.assertEqual(f.folder_class, "IPF.StoreItem.FreeBusyCache")
330 elif isinstance(f, RecoveryPoints):
331 self.assertEqual(f.folder_class, "IPF.StoreItem.RecoveryPoints")
332 elif isinstance(f, SwssItems):
333 self.assertEqual(f.folder_class, "IPF.StoreItem.SwssItems")
334 elif isinstance(f, PassThroughSearchResults):
335 self.assertEqual(f.folder_class, "IPF.StoreItem.PassThroughSearchResults")
336 elif isinstance(f, GraphAnalytics):
337 self.assertEqual(f.folder_class, "IPF.StoreItem.GraphAnalytics")
338 elif isinstance(f, Signal):
339 self.assertEqual(f.folder_class, "IPF.StoreItem.Signal")
340 elif isinstance(f, PdpProfileV2Secured):
341 self.assertEqual(f.folder_class, "IPF.StoreItem.PdpProfileSecured")
302342 elif isinstance(f, Companies):
303343 self.assertEqual(f.folder_class, "IPF.Contact.Company")
304344 elif isinstance(f, OrganizationalContacts):
309349 self.assertEqual(f.folder_class, "IPF.Contact.GalContacts")
310350 elif isinstance(f, RecipientCache):
311351 self.assertEqual(f.folder_class, "IPF.Contact.RecipientCache")
352 elif isinstance(f, IMContactList):
353 self.assertEqual(f.folder_class, "IPF.Contact.MOC.ImContactList")
354 elif isinstance(f, QuickContacts):
355 self.assertEqual(f.folder_class, "IPF.Contact.MOC.QuickContacts")
312356 elif isinstance(f, Contacts):
313357 self.assertEqual(f.folder_class, "IPF.Contact")
358 elif isinstance(f, Birthdays):
359 self.assertEqual(f.folder_class, "IPF.Appointment.Birthday")
314360 elif isinstance(f, Calendar):
315361 self.assertEqual(f.folder_class, "IPF.Appointment")
316362 elif isinstance(f, (Tasks, ToDoSearch)):
323369 self.assertEqual(f.folder_class, "IPF.Configuration")
324370 elif isinstance(f, Files):
325371 self.assertEqual(f.folder_class, "IPF.Files")
372 elif isinstance(f, VoiceMail):
373 self.assertEqual(f.folder_class, "IPF.Note.Microsoft.Voicemail")
374 elif isinstance(f, RSSFeeds):
375 self.assertEqual(f.folder_class, "IPF.Note.OutlookHomepage")
326376 elif isinstance(f, Friends):
327377 self.assertEqual(f.folder_class, "IPF.Note")
328 elif isinstance(f, RSSFeeds):
329 self.assertEqual(f.folder_class, "IPF.Note.OutlookHomepage")
330 elif isinstance(f, IMContactList):
331 self.assertEqual(f.folder_class, "IPF.Contact.MOC.ImContactList")
332 elif isinstance(f, QuickContacts):
333 self.assertEqual(f.folder_class, "IPF.Contact.MOC.QuickContacts")
334378 elif isinstance(f, Journal):
335379 self.assertEqual(f.folder_class, "IPF.Journal")
336380 elif isinstance(f, Notes):
337381 self.assertEqual(f.folder_class, "IPF.StickyNote")
338382 elif isinstance(f, DefaultFoldersChangeHistory):
339383 self.assertEqual(f.folder_class, "IPM.DefaultFolderHistoryItem")
340 elif isinstance(f, PassThroughSearchResults):
341 self.assertEqual(f.folder_class, "IPF.StoreItem.PassThroughSearchResults")
384 elif isinstance(f, SkypeTeamsMessages):
385 self.assertEqual(f.folder_class, "IPF.SkypeTeams.Message")
342386 elif isinstance(f, SmsAndChatsSync):
343387 self.assertEqual(f.folder_class, "IPF.SmsAndChatsSync")
344 elif isinstance(f, GraphAnalytics):
345 self.assertEqual(f.folder_class, "IPF.StoreItem.GraphAnalytics")
346 elif isinstance(f, Signal):
347 self.assertEqual(f.folder_class, "IPF.StoreItem.Signal")
348 elif isinstance(f, PdpProfileV2Secured):
349 self.assertEqual(f.folder_class, "IPF.StoreItem.PdpProfileSecured")
350 elif isinstance(f, VoiceMail):
351 self.assertEqual(f.folder_class, "IPF.Note.Microsoft.Voicemail")
352388 else:
353389 self.assertIn(f.folder_class, (None, "IPF"), (f.name, f.__class__.__name__, f.folder_class))
354390 self.assertIsInstance(f, Folder)
442478 folder.refresh() # Must have an id
443479
444480 def test_parent(self):
445 self.assertEqual(self.account.calendar.parent.name, "Top of Information Store")
481 self.assertEqual(self.account.calendar.parent.name, self.account.root.tois.name)
446482 self.assertEqual(self.account.calendar.parent.parent.name, "root")
447483 # Setters
448484 parent = self.account.calendar.parent
458494 self.assertIsNone(Folder(id=self.account.inbox.id, parent=self.account.inbox).parent)
459495
460496 def test_children(self):
461 self.assertIn("Top of Information Store", [c.name for c in self.account.root.children])
497 self.assertIn(self.account.root.tois.name, [c.name for c in self.account.root.children])
462498
463499 def test_parts(self):
464500 self.assertEqual(
465501 [p.name for p in self.account.calendar.parts],
466 ["root", "Top of Information Store", self.account.calendar.name],
502 ["root", self.account.root.tois.name, self.account.calendar.name],
467503 )
468504
469505 def test_absolute(self):
470 self.assertEqual(self.account.calendar.absolute, "/root/Top of Information Store/" + self.account.calendar.name)
506 self.assertEqual(
507 self.account.calendar.absolute, f"/root/{self.account.root.tois.name}/{self.account.calendar.name}"
508 )
471509
472510 def test_walk(self):
473511 self.assertGreaterEqual(len(list(self.account.root.walk())), 20)
483521 self.assertGreaterEqual(len(list(self.account.contacts.glob("/"))), 5)
484522 self.assertGreaterEqual(len(list(self.account.contacts.glob("../*"))), 5)
485523 self.assertEqual(len(list(self.account.root.glob(f"**/{self.account.contacts.name}"))), 1)
486 self.assertEqual(len(list(self.account.root.glob(f"Top of*/{self.account.contacts.name}"))), 1)
524 self.assertEqual(
525 len(list(self.account.root.glob(f"{self.account.root.tois.name[:6]}*/{self.account.contacts.name}"))), 1
526 )
487527 with self.assertRaises(ValueError) as e:
488528 list(self.account.root.glob("../*"))
489529 self.assertEqual(e.exception.args[0], "Already at top")
502542
503543 def test_div_navigation(self):
504544 self.assertEqual(
505 (self.account.root / "Top of Information Store" / self.account.calendar.name).id, self.account.calendar.id
506 )
507 self.assertEqual((self.account.root / "Top of Information Store" / "..").id, self.account.root.id)
545 (self.account.root / self.account.root.tois.name / self.account.calendar.name).id, self.account.calendar.id
546 )
547 self.assertEqual((self.account.root / self.account.root.tois.name / "..").id, self.account.root.id)
508548 self.assertEqual((self.account.root / ".").id, self.account.root.id)
509549 with self.assertRaises(ValueError) as e:
510550 _ = self.account.root / ".."
519559
520560 # Test normal navigation
521561 self.assertEqual(
522 (self.account.root // "Top of Information Store" // self.account.calendar.name).id, self.account.calendar.id
562 (self.account.root // self.account.root.tois.name // self.account.calendar.name).id,
563 self.account.calendar.id,
523564 )
524565 self.assertIsNone(self.account.root._subfolders)
525566
526567 # Test parent ('..') syntax. Should not work
527568 with self.assertRaises(ValueError) as e:
528 _ = self.account.root // "Top of Information Store" // ".."
569 _ = self.account.root // self.account.root.tois.name // ".."
529570 self.assertEqual(e.exception.args[0], "Cannot get parent without a folder cache")
530571 self.assertIsNone(self.account.root._subfolders)
531572
332332 matches = qs.filter(**kw).count()
333333 if matches == expected:
334334 break
335 self.skipTest(f"Filter expression {kw} on complex field still failing after multiple retries")
335336 self.assertEqual(matches, expected, (f.name, val, kw, retries))
336337
337338 def test_filter_on_simple_fields(self):
378379 for f in fields:
379380 val = getattr(item, f.name)
380381 # Filter multi-value fields with =, __in and __contains
381 filter_kwargs = [{f"{f.name}__in": val}, {f"{f.name}__contains": val}]
382 # Does not work in O365
383 # filter_kwargs = [{f"{f.name}__in": val}, {f"{f.name}__contains": val}]
384 filter_kwargs = [{f"{f.name}__in": val}]
382385 self._run_filter_tests(common_qs, f, filter_kwargs, val)
383386
384387 def test_filter_on_single_field_index_fields(self):
443446
444447 def test_text_field_settings(self):
445448 # Test that the max_length and is_complex field settings are correctly set for text fields
446 item = self.get_test_item().save()
447449 for f in self.ITEM_CLASS.FIELDS:
448450 with self.subTest(f=f):
449451 if not f.supports_version(self.account.version):
462464 if f.name == "categories":
463465 # We're filtering on this one, so leave it alone
464466 continue
467 item = self.get_test_item().save()
465468 old_max_length = getattr(f, "max_length", None)
466469 old_is_complex = f.is_complex
467470 try:
496499
497500 # is_complex=False forces the query to use FindItems which will only get the short value
498501 f.is_complex = False
499 new_short_item = self.test_folder.all().only(f.name).get(categories__contains=self.categories)
502 new_short_item = {
503 i.id: i
504 for i in self.test_folder.all().only(f.name).filter(categories__contains=self.categories)
505 }[item.id]
500506 new_short = getattr(new_short_item, f.name)
501507
502508 if not old_is_complex:
625631 if f.name == "mime_content":
626632 # This will change depending on other contents fields
627633 continue
628 old, new = getattr(item, f.name), insert_kwargs[f.name]
634 old, new = insert_kwargs[f.name], getattr(item, f.name)
629635 if f.is_list:
630636 old, new = set(old or ()), set(new or ())
631637 self.assertEqual(old, new, (f.name, old, new))
00 import datetime
11
2 from exchangelib.errors import ErrorInvalidOperation, ErrorItemNotFound, ErrorMissingInformationReferenceItemId
2 from exchangelib.errors import (
3 ErrorInvalidOperation,
4 ErrorInvalidRecipients,
5 ErrorItemNotFound,
6 ErrorMissingInformationReferenceItemId,
7 )
38 from exchangelib.ewsdatetime import UTC
49 from exchangelib.fields import MONDAY, NOVEMBER, THIRD, WEDNESDAY, WEEK_DAY, WEEKEND_DAY
510 from exchangelib.folders import Calendar
3641
3742 def test_cancel(self):
3843 item = self.get_test_item().save()
39 res = item.cancel() # Returns (id, changekey) of cancelled item
40 self.assertIsInstance(res, BulkCreateResult)
41 with self.assertRaises(ErrorItemNotFound):
42 # Item is already cancelled
43 item.cancel()
44 try:
45 res = item.cancel() # Returns (id, changekey) of cancelled item
46 except ErrorInvalidRecipients:
47 # Does not always work in a single-account setup
48 pass
49 else:
50 self.assertIsInstance(res, BulkCreateResult)
51 with self.assertRaises(ErrorItemNotFound):
52 # Item is already cancelled
53 item.cancel()
4454
4555 def test_updating_timestamps(self):
4656 # Test that we can update an item without changing anything, and maintain the hidden timezone fields as local
531531 self.assertEqual(common_qs.filter(categories__contains=["TESTA"]).count(), 1) # Test case insensitivity
532532 self.assertEqual(common_qs.filter(categories__contains=["testa"]).count(), 1) # Test case insensitivity
533533 self.assertEqual(common_qs.filter(categories__contains=["TestA"]).count(), 1) # Partial
534 self.assertEqual(common_qs.filter(categories__contains=item.categories).count(), 1) # Exact match
534 # Does not work in O365
535 # self.assertEqual(common_qs.filter(categories__contains=item.categories).count(), 1) # Exact match
535536 with self.assertRaises(TypeError):
536537 common_qs.filter(categories__in="ci6xahH1").count() # Plain string is not supported
537538 self.assertEqual(common_qs.filter(categories__in=["ci6xahH1"]).count(), 0) # Same, but as list
186186 item.mark_as_junk(is_junk=True, move_item=False)
187187 self.assertEqual(item.folder, self.test_folder)
188188 self.assertEqual(self.test_folder.get(categories__contains=self.categories).id, item.id)
189 item.mark_as_junk(is_junk=True, move_item=True)
190 self.assertEqual(item.folder, self.account.junk)
191 self.assertEqual(self.account.junk.get(categories__contains=self.categories).id, item.id)
189 # Does not work in O365
190 # item.mark_as_junk(is_junk=True, move_item=True)
191 # self.assertEqual(item.folder, self.account.junk)
192 # self.assertEqual(self.account.junk.get(categories__contains=self.categories).id, item.id)
192193 item.mark_as_junk(is_junk=False, move_item=True)
193194 self.assertEqual(item.folder, self.account.inbox)
194195 self.assertEqual(self.account.inbox.get(categories__contains=self.categories).id, item.id)
317317 qs.mark_as_junk(is_junk=True, move_item=False)
318318 self.assertEqual(self.test_folder.filter(categories__contains=self.categories).count(), 1)
319319 qs.mark_as_junk(is_junk=True, move_item=True)
320 self.assertEqual(self.account.junk.filter(categories__contains=self.categories).count(), 1)
321 self.account.junk.filter(categories__contains=self.categories).mark_as_junk(is_junk=False, move_item=True)
320 # Does not work in O365
321 # self.assertEqual(self.account.junk.filter(categories__contains=self.categories).count(), 1)
322 # self.account.junk.filter(categories__contains=self.categories).mark_as_junk(is_junk=False, move_item=True)
322323 self.assertEqual(self.account.inbox.filter(categories__contains=self.categories).count(), 1)
323324
324325 def test_archive_via_queryset(self):
22 from exchangelib.errors import ErrorInvalidSubscription, ErrorSubscriptionNotFound, MalformedResponseError
33 from exchangelib.folders import FolderCollection, Inbox
44 from exchangelib.items import Message
5 from exchangelib.properties import CreatedEvent, DeletedEvent, ItemId, ModifiedEvent, Notification, StatusEvent
5 from exchangelib.properties import (
6 CreatedEvent,
7 DeletedEvent,
8 ItemId,
9 ModifiedEvent,
10 MovedEvent,
11 Notification,
12 StatusEvent,
13 )
614 from exchangelib.services import GetStreamingEvents, SendNotification, SubscribeToPull
715 from exchangelib.util import PrettyXmlHandler
816
200208 if item_id is None:
201209 events.append(e)
202210 continue
203 if e.event_type == event_cls.ITEM and e.item_id.id == item_id:
204 events.append(e)
211 if e.event_type == event_cls.ITEM:
212 if isinstance(e, MovedEvent) and e.old_item_id.id == item_id:
213 events.append(e)
214 elif e.item_id.id == item_id:
215 events.append(e)
205216 self.assertEqual(len(events), 1)
206217 event = events[0]
207218 self.assertIsInstance(event, event_cls)
234245 i1.delete()
235246 time.sleep(5) # For some reason, events do not trigger instantly
236247 notifications = list(test_folder.get_events(subscription_id, watermark))
237 deleted_event, watermark = self._filter_events(notifications, DeletedEvent, i1_id)
238 self.assertEqual(deleted_event.item_id.id, i1_id)
248 try:
249 # On some servers, items are moved to the Recoverable Items on delete
250 moved_event, watermark = self._filter_events(notifications, MovedEvent, i1_id)
251 self.assertEqual(moved_event.old_item_id.id, i1_id)
252 except AssertionError:
253 deleted_event, watermark = self._filter_events(notifications, DeletedEvent, i1_id)
254 self.assertEqual(deleted_event.item_id.id, i1_id)
239255
240256 def test_streaming_notifications(self):
241257 # Test that we can create a streaming subscription, make changes and see the events by calling
271287 notifications = list(
272288 test_folder.get_streaming_events(subscription_id, connection_timeout=1, max_notifications_returned=1)
273289 )
274 deleted_event, _ = self._filter_events(notifications, DeletedEvent, i1_id)
275 self.assertEqual(deleted_event.item_id.id, i1_id)
290 try:
291 # On some servers, items are moved to the Recoverable Items on delete
292 moved_event, _ = self._filter_events(notifications, MovedEvent, i1_id)
293 self.assertEqual(moved_event.old_item_id.id, i1_id)
294 except AssertionError:
295 deleted_event, _ = self._filter_events(notifications, DeletedEvent, i1_id)
296 self.assertEqual(deleted_event.item_id.id, i1_id)
276297
277298 def test_streaming_with_other_calls(self):
278299 # Test that we can call other EWS operations while we have a streaming subscription open
404425 # Invalid status
405426 ws.get_payload(status="XXX")
406427 self.assertEqual(
407 PrettyXmlHandler.prettify_xml(ws.ok_payload()),
428 PrettyXmlHandler().prettify_xml(ws.ok_payload()),
408429 b"""\
409430 <?xml version='1.0' encoding='utf-8'?>
410431 <s:Envelope
420441 """,
421442 )
422443 self.assertEqual(
423 PrettyXmlHandler.prettify_xml(ws.unsubscribe_payload()),
444 PrettyXmlHandler().prettify_xml(ws.unsubscribe_payload()),
424445 b"""\
425446 <?xml version='1.0' encoding='utf-8'?>
426447 <s:Envelope
11 from itertools import chain
22
33 from exchangelib.extended_properties import ExternId, Flag
4 from exchangelib.fields import InvalidField, InvalidFieldForVersion, TextField
4 from exchangelib.fields import GenericEventListField, InvalidField, InvalidFieldForVersion, TextField, TypeValueField
55 from exchangelib.folders import Folder, RootOfHierarchy
66 from exchangelib.indexed_properties import PhysicalAddress
77 from exchangelib.items import BulkCreateResult, Item
5959 self.assertIn(
6060 f.name, all_slots, f"Field name {f.name!r} is not in __slots__ on model {cls.__name__}"
6161 )
62 value_cls = f.value_cls # Make sure lazy imports work
63 if not isinstance(f, (TypeValueField, GenericEventListField)):
64 # All other fields must define a value type
65 self.assertIsNotNone(value_cls)
6266 field_names.add(f.name)
6367 # Finally, test that all models have a link to MSDN documentation
6468 if issubclass(cls, Folder):
1919 from exchangelib.credentials import Credentials, OAuth2AuthorizationCodeCredentials, OAuth2Credentials
2020 from exchangelib.errors import (
2121 ErrorAccessDenied,
22 ErrorMailRecipientNotFound,
2223 ErrorNameResolutionNoResults,
2324 RateLimitError,
2425 SessionPoolMaxSizeReached,
2526 SessionPoolMinSizeReached,
26 TimezoneDefinitionInvalidForYear,
2727 TransportError,
2828 )
2929 from exchangelib.items import SEARCH_SCOPE_CHOICES, CalendarItem
3131 EWS_ID,
3232 ID_FORMATS,
3333 AlternateId,
34 DaylightTime,
3435 DLMailbox,
3536 FailedMailbox,
3637 FreeBusyView,
3839 ItemId,
3940 Mailbox,
4041 MailboxData,
42 Period,
4143 RoomList,
4244 SearchableMailbox,
45 StandardTime,
4346 TimeZone,
4447 )
4548 from exchangelib.protocol import BaseProtocol, FailFast, FaultTolerance, NoVerifyHTTPAdapter, Protocol
4851 GetRoomLists,
4952 GetRooms,
5053 GetSearchableMailboxes,
54 GetServerTimeZones,
5155 ResolveNames,
5256 SetUserOofSettings,
5357 )
261265 for_year=2018,
262266 )
263267 self.assertEqual(tz.bias, tz_definition.get_std_and_dst(for_year=2018)[2].bias_in_minutes)
264 except TimezoneDefinitionInvalidForYear:
268 except ValueError:
265269 pass
270
271 def test_get_timezones_parsing(self):
272 # Test static XML since it's non-standard
273 xml = b"""\
274 <?xml version='1.0' encoding='utf-8'?>
275 <soap:Envelope
276 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
277 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
278 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
279 <Header xmlns="http://schemas.xmlsoap.org/soap/envelope/">
280 <ServerVersionInfo
281 xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
282 MajorVersion="14"
283 MinorVersion="2"
284 MajorBuildNumber="390"
285 MinorBuildNumber="3"
286 Version="Exchange2010_SP2"/>
287 </Header>
288 <soap:Body>
289 <m:GetServerTimeZonesResponse
290 xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
291 xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
292 <m:ResponseMessages>
293 <m:GetServerTimeZonesResponseMessage ResponseClass="Success">
294 <m:ResponseCode>NoError</m:ResponseCode>
295 <m:TimeZoneDefinitions>
296 <t:TimeZoneDefinition
297 Id="W. Europe Standard Time"
298 Name="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna">
299 <t:Periods>
300 <t:Period Bias="-PT60M" Name="Standard" Id="std"/>
301 <t:Period Bias="-PT120M" Name="Daylight" Id="dlt"/>
302 </t:Periods>
303 <t:TransitionsGroups>
304 <t:TransitionsGroup Id="0">
305 <t:RecurringDayTransition>
306 <t:To Kind="Period">std</t:To>
307 <t:TimeOffset>PT180M</t:TimeOffset>
308 <t:Month>10</t:Month>
309 <t:DayOfWeek>Sunday</t:DayOfWeek>
310 <t:Occurrence>-1</t:Occurrence>
311 </t:RecurringDayTransition>
312 <t:RecurringDayTransition>
313 <t:To Kind="Period">dlt</t:To>
314 <t:TimeOffset>PT120M</t:TimeOffset>
315 <t:Month>3</t:Month>
316 <t:DayOfWeek>Sunday</t:DayOfWeek>
317 <t:Occurrence>-1</t:Occurrence>
318 </t:RecurringDayTransition>
319 </t:TransitionsGroup>
320 </t:TransitionsGroups>
321 <t:Transitions>
322 <t:Transition>
323 <t:To Kind="Group">0</t:To>
324 </t:Transition>
325 </t:Transitions>
326 </t:TimeZoneDefinition>
327 </m:TimeZoneDefinitions>
328 </m:GetServerTimeZonesResponseMessage>
329 </m:ResponseMessages>
330 </m:GetServerTimeZonesResponse>
331 </soap:Body>
332 </soap:Envelope>"""
333 ws = GetServerTimeZones(self.account.protocol)
334 timezones = list(ws.parse(xml))
335 self.assertEqual(1, len(timezones))
336 (standard_transition, daylight_transition, standard_period) = timezones[0].get_std_and_dst(2022)
337 self.assertEqual(
338 standard_transition,
339 StandardTime(bias=0, time=datetime.time(hour=3), occurrence=5, iso_month=10, weekday=7),
340 )
341 self.assertEqual(
342 daylight_transition,
343 DaylightTime(bias=-60, time=datetime.time(hour=2), occurrence=5, iso_month=3, weekday=7),
344 )
345 self.assertEqual(
346 standard_period,
347 Period(id="std", name="Standard", bias=datetime.timedelta(minutes=-60)),
348 )
266349
267350 def test_get_free_busy_info(self):
268351 tz = self.account.default_timezone
272355 accounts = [(self.account, "Organizer", False)]
273356
274357 with self.assertRaises(TypeError) as e:
275 self.account.protocol.get_free_busy_info(accounts=[(123, "XXX", "XXX")], start=start, end=end)
358 list(self.account.protocol.get_free_busy_info(accounts=[(123, "XXX", "XXX")], start=start, end=end))
276359 self.assertEqual(
277360 e.exception.args[0], "Field 'email' value 123 must be of type <class 'exchangelib.properties.Email'>"
278361 )
279362 with self.assertRaises(ValueError) as e:
280 self.account.protocol.get_free_busy_info(accounts=[(self.account, "XXX", "XXX")], start=start, end=end)
363 list(
364 self.account.protocol.get_free_busy_info(accounts=[(self.account, "XXX", "XXX")], start=start, end=end)
365 )
281366 self.assertEqual(
282367 e.exception.args[0],
283368 f"Invalid choice 'XXX' for field 'attendee_type'. Valid choices are {sorted(MailboxData.ATTENDEE_TYPES)}",
284369 )
285370 with self.assertRaises(TypeError) as e:
286 self.account.protocol.get_free_busy_info(accounts=[(self.account, "Organizer", "X")], start=start, end=end)
371 list(
372 self.account.protocol.get_free_busy_info(
373 accounts=[(self.account, "Organizer", "X")], start=start, end=end
374 )
375 )
287376 self.assertEqual(e.exception.args[0], "Field 'exclude_conflicts' value 'X' must be of type <class 'bool'>")
288377 with self.assertRaises(ValueError) as e:
289 self.account.protocol.get_free_busy_info(accounts=accounts, start=end, end=start)
378 list(self.account.protocol.get_free_busy_info(accounts=accounts, start=end, end=start))
290379 self.assertIn("'start' must be less than 'end'", e.exception.args[0])
291380 with self.assertRaises(TypeError) as e:
292 self.account.protocol.get_free_busy_info(
293 accounts=accounts, start=start, end=end, merged_free_busy_interval="XXX"
381 list(
382 self.account.protocol.get_free_busy_info(
383 accounts=accounts, start=start, end=end, merged_free_busy_interval="XXX"
384 )
294385 )
295386 self.assertEqual(
296387 e.exception.args[0], "Field 'merged_free_busy_interval' value 'XXX' must be of type <class 'int'>"
297388 )
298389 with self.assertRaises(ValueError) as e:
299 self.account.protocol.get_free_busy_info(accounts=accounts, start=start, end=end, requested_view="XXX")
390 list(
391 self.account.protocol.get_free_busy_info(accounts=accounts, start=start, end=end, requested_view="XXX")
392 )
300393 self.assertEqual(
301394 e.exception.args[0],
302395 f"Invalid choice 'XXX' for field 'requested_view'. Valid choices are "
314407 accounts=[(self.account.primary_smtp_address, "Organizer", False)], start=start, end=end
315408 ):
316409 self.assertIsInstance(view_info, FreeBusyView)
410
411 # Test non-existing address
412 for view_info in self.account.protocol.get_free_busy_info(
413 accounts=[(f"unlikely-to-exist-{self.account.primary_smtp_address}", "Organizer", False)],
414 start=start,
415 end=end,
416 ):
417 self.assertIsInstance(view_info, ErrorMailRecipientNotFound)
418
419 # Test +100 addresses
420 for view_info in self.account.protocol.get_free_busy_info(
421 accounts=[(f"unknown-{i}-{self.account.primary_smtp_address}", "Organizer", False) for i in range(101)],
422 start=start,
423 end=end,
424 ):
425 self.assertIsInstance(view_info, ErrorMailRecipientNotFound)
426
427 # Test non-existing and existing address
428 view_infos = list(
429 self.account.protocol.get_free_busy_info(
430 accounts=[
431 (f"unlikely-to-exist-{self.account.primary_smtp_address}", "Organizer", False),
432 (self.account.primary_smtp_address, "Organizer", False),
433 ],
434 start=start,
435 end=end,
436 )
437 )
438 self.assertIsInstance(view_infos[0], ErrorMailRecipientNotFound)
439 self.assertIsInstance(view_infos[1], FreeBusyView)
317440
318441 def test_get_roomlists(self):
319442 # The test server is not guaranteed to have any room lists which makes this test less useful
492615 ws.return_full_contact_data = False
493616 self.assertSetEqual({m.email_address for m in ws.parse(xml)}, {"anne@example.com", "john@example.com"})
494617
618 def test_resolvenames_warning(self):
619 # Test warning that the returned candidate list is non-exchaustive
620 xml = b"""\
621 <?xml version="1.0" encoding="utf-8"?>
622 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
623 <s:Body>
624 <m:ResolveNamesResponse
625 xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
626 xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
627 <m:ResponseMessages>
628 <m:ResolveNamesResponseMessage ResponseClass="Warning">
629 <m:MessageText>Multiple results were found.</m:MessageText>
630 <m:ResponseCode>ErrorNameResolutionMultipleResults</m:ResponseCode>
631 <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
632 <m:ResolutionSet TotalItemsInView="2" IncludesLastItemInRange="false">
633 <t:Resolution>
634 <t:Mailbox>
635 <t:Name>John Doe</t:Name>
636 <t:EmailAddress>anne@example.com</t:EmailAddress>
637 <t:RoutingType>SMTP</t:RoutingType>
638 <t:MailboxType>Mailbox</t:MailboxType>
639 </t:Mailbox>
640 </t:Resolution>
641 <t:Resolution>
642 <t:Mailbox>
643 <t:Name>John Deer</t:Name>
644 <t:EmailAddress>john@example.com</t:EmailAddress>
645 <t:RoutingType>SMTP</t:RoutingType>
646 <t:MailboxType>Mailbox</t:MailboxType>
647 </t:Mailbox>
648 </t:Resolution>
649 </m:ResolutionSet>
650 </m:ResolveNamesResponseMessage>
651 </m:ResponseMessages>
652 </m:ResolveNamesResponse>
653 </s:Body>
654 </s:Envelope>"""
655 ws = ResolveNames(self.account.protocol)
656 with warnings.catch_warnings(record=True) as w:
657 warnings.simplefilter("always")
658 list(ws.parse(xml))
659 self.assertEqual(
660 str(w[0].message),
661 "The ResolveNames service returns at most 100 candidates and does not support paging. You have reached "
662 "this limit and have not received the exhaustive list of candidates.",
663 )
664
495665 def test_get_searchable_mailboxes(self):
496666 # Insufficient privileges for the test account, so let's just test the exception
497667 with self.assertRaises(ErrorAccessDenied):
498668 self.account.protocol.get_searchable_mailboxes(search_filter="non_existent_distro@example.com")
499669 with self.assertRaises(ErrorAccessDenied):
500670 self.account.protocol.get_searchable_mailboxes(expand_group_membership=True)
501
502 xml = b"""\
671 guid = "33a408fe-2574-4e3b-49f5-5e1e000a3035"
672 email = "LOLgroup@example.com"
673 display_name = "LOLgroup"
674 reference_id = "/o=First/ou=Exchange(FYLT)/cn=Recipients/cn=81213b958a0b5295b13b3f02b812bf1bc-LOLgroup"
675 xml = f"""\
503676 <?xml version="1.0" encoding="utf-8"?>
504677 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
505678 <s:Body xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
508681 <m:ResponseCode>NoError</m:ResponseCode>
509682 <m:SearchableMailboxes>
510683 <t:SearchableMailbox>
511 <t:Guid>33a408fe-2574-4e3b-49f5-5e1e000a3035</t:Guid>
512 <t:PrimarySmtpAddress>LOLgroup@example.com</t:PrimarySmtpAddress>
684 <t:Guid>{guid}</t:Guid>
685 <t:PrimarySmtpAddress>{email}</t:PrimarySmtpAddress>
513686 <t:IsExternalMailbox>false</t:IsExternalMailbox>
514687 <t:ExternalEmailAddress/>
515 <t:DisplayName>LOLgroup</t:DisplayName>
688 <t:DisplayName>{display_name}</t:DisplayName>
516689 <t:IsMembershipGroup>true</t:IsMembershipGroup>
517 <t:ReferenceId>/o=First/ou=Exchange(FYLT)/cn=Recipients/cn=81213b958a0b5295b13b3f02b812bf1bc-LOLgroup</t:ReferenceId>
690 <t:ReferenceId>{reference_id}</t:ReferenceId>
518691 </t:SearchableMailbox>
519692 <t:FailedMailbox>
520693 <t:Mailbox>FAILgroup@example.com</t:Mailbox>
525698 </m:SearchableMailboxes>
526699 </m:GetSearchableMailboxesResponse>
527700 </s:Body>
528 </s:Envelope>"""
701 </s:Envelope>""".encode()
529702 ws = GetSearchableMailboxes(protocol=self.account.protocol)
530703 self.assertListEqual(
531704 list(ws.parse(xml)),
532705 [
533706 SearchableMailbox(
534 guid="33a408fe-2574-4e3b-49f5-5e1e000a3035",
535 primary_smtp_address="LOLgroup@example.com",
707 guid=guid,
708 primary_smtp_address=email,
536709 is_external=False,
537710 external_email=None,
538 display_name="LOLgroup",
711 display_name=display_name,
539712 is_membership_group=True,
540 reference_id="/o=First/ou=Exchange(FYLT)/cn=Recipients/cn=81213b958a0b5295b13b3f02b812bf1bc-LOLgroup",
713 reference_id=reference_id,
541714 ),
542715 FailedMailbox(
543716 mailbox="FAILgroup@example.com",
680853 ).clean(version=None)
681854
682855 def test_convert_id(self):
683 i = (
684 "AAMkADQyYzZmYmUxLTJiYjItNDg2Ny1iMzNjLTIzYWE1NDgxNmZhNABGAAAAAADUebQDarW2Q7G2Ji8hKofPBwAl9iKCsfCfSa9cmjh"
685 "+JCrCAAPJcuhjAAB0l+JSKvzBRYP+FXGewReXAABj6DrMAAA="
686 )
856 i = self.account.root.id
687857 for fmt in ID_FORMATS:
688858 res = list(
689859 self.account.protocol.convert_ids(
727897 self.assertEqual(ids.count(), len(items))
728898
729899 def test_disable_ssl_verification(self):
900 if isinstance(self.account.protocol.credentials, OAuth2Credentials):
901 self.skipTest("OAuth authentication ony works with SSL verification enabled")
902
730903 # Test that we can make requests when SSL verification is turned off. I don't know how to mock TLS responses
731904 if not self.verify_ssl:
732905 # We can only run this test if we haven't already disabled TLS
0 from exchangelib.credentials import OAuth2Credentials
01 from exchangelib.errors import (
12 ErrorAccessDenied,
23 ErrorFolderNotFound,
1213 class CommonTest(EWSTest):
1314 def test_magic(self):
1415 self.assertIn(self.account.protocol.version.api_version, str(self.account.protocol))
15 self.assertIn(self.account.protocol.credentials.username, str(self.account.protocol.credentials))
16 if isinstance(self.account.protocol.credentials, OAuth2Credentials):
17 self.assertIn(self.account.protocol.credentials.client_id, str(self.account.protocol.credentials))
18 else:
19 self.assertIn(self.account.protocol.credentials.username, str(self.account.protocol.credentials))
1620 self.assertIn(self.account.primary_smtp_address, str(self.account))
1721 self.assertIn(str(self.account.version.build.major_version), repr(self.account.version))
1822 for item in (
9494 account = MockAccount(access_type=DELEGATE, identity=None, default_timezone=MockTZ("XXX"))
9595 wrapped = wrap(content=content, api_version=api_version, timezone=account.default_timezone)
9696 self.assertEqual(
97 PrettyXmlHandler.prettify_xml(wrapped),
97 PrettyXmlHandler().prettify_xml(wrapped),
9898 b"""<?xml version='1.0' encoding='utf-8'?>
9999 <s:Envelope
100100 xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
129129 timezone=account.default_timezone,
130130 )
131131 self.assertEqual(
132 PrettyXmlHandler.prettify_xml(wrapped),
132 PrettyXmlHandler().prettify_xml(wrapped),
133133 f"""<?xml version='1.0' encoding='utf-8'?>
134134 <s:Envelope
135135 xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"