Skip to content

Commit

Permalink
docs: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ecederstrand committed Apr 11, 2024
1 parent 6f6515b commit ff43417
Show file tree
Hide file tree
Showing 13 changed files with 9,553 additions and 6,591 deletions.
31 changes: 8 additions & 23 deletions docs/exchangelib/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1 class="title">Module <code>exchangelib.account</code></h1>
from .autodiscover import Autodiscovery
from .configuration import Configuration
from .credentials import ACCESS_TYPES, DELEGATE, IMPERSONATION
from .errors import ErrorItemNotFound, InvalidEnumValue, InvalidTypeError, ResponseMessageError, UnknownTimeZone
from .errors import InvalidEnumValue, InvalidTypeError, ResponseMessageError, UnknownTimeZone
from .ewsdatetime import UTC, EWSTimeZone
from .fields import FieldPath, TextField
from .folders import (
Expand Down Expand Up @@ -815,16 +815,11 @@ <h1 class="title">Module <code>exchangelib.account</code></h1>
def delete_rule(self, rule: Rule):
&#34;&#34;&#34;Delete an Inbox rule.

:param rule: The rule to delete. Must have ID or &#39;display_name&#39;.
:param rule: The rule to delete. Must have an ID.
:return: None if success, else raises an error.
&#34;&#34;&#34;
if not rule.id:
if not rule.display_name:
raise ValueError(&#34;Rule must have ID or display_name&#34;)
try:
rule = {i.display_name: i for i in GetInboxRules(account=self).call()}[rule.display_name]
except KeyError:
raise ErrorItemNotFound(f&#34;No rule with name {rule.display_name!r}&#34;)
raise ValueError(&#34;Rule must have an ID&#34;)
DeleteInboxRule(account=self).get(rule=rule)
rule.id = None

Expand Down Expand Up @@ -1617,16 +1612,11 @@ <h2 class="section-title" id="header-classes">Classes</h2>
def delete_rule(self, rule: Rule):
&#34;&#34;&#34;Delete an Inbox rule.

:param rule: The rule to delete. Must have ID or &#39;display_name&#39;.
:param rule: The rule to delete. Must have an ID.
:return: None if success, else raises an error.
&#34;&#34;&#34;
if not rule.id:
if not rule.display_name:
raise ValueError(&#34;Rule must have ID or display_name&#34;)
try:
rule = {i.display_name: i for i in GetInboxRules(account=self).call()}[rule.display_name]
except KeyError:
raise ErrorItemNotFound(f&#34;No rule with name {rule.display_name!r}&#34;)
raise ValueError(&#34;Rule must have an ID&#34;)
DeleteInboxRule(account=self).get(rule=rule)
rule.id = None

Expand Down Expand Up @@ -3169,7 +3159,7 @@ <h3>Methods</h3>
</code></dt>
<dd>
<div class="desc"><p>Delete an Inbox rule.</p>
<p>:param rule: The rule to delete. Must have ID or 'display_name'.
<p>:param rule: The rule to delete. Must have an ID.
:return: None if success, else raises an error.</p></div>
<details class="source">
<summary>
Expand All @@ -3178,16 +3168,11 @@ <h3>Methods</h3>
<pre><code class="python">def delete_rule(self, rule: Rule):
&#34;&#34;&#34;Delete an Inbox rule.

:param rule: The rule to delete. Must have ID or &#39;display_name&#39;.
:param rule: The rule to delete. Must have an ID.
:return: None if success, else raises an error.
&#34;&#34;&#34;
if not rule.id:
if not rule.display_name:
raise ValueError(&#34;Rule must have ID or display_name&#34;)
try:
rule = {i.display_name: i for i in GetInboxRules(account=self).call()}[rule.display_name]
except KeyError:
raise ErrorItemNotFound(f&#34;No rule with name {rule.display_name!r}&#34;)
raise ValueError(&#34;Rule must have an ID&#34;)
DeleteInboxRule(account=self).get(rule=rule)
rule.id = None</code></pre>
</details>
Expand Down
169 changes: 168 additions & 1 deletion docs/exchangelib/fields.html
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,19 @@ <h1 class="title">Module <code>exchangelib.fields</code></h1>
return super().clean(value, version=version)


class AddressListField(EWSElementListField):
def __init__(self, *args, **kwargs):
from .properties import Address

kwargs[&#34;value_cls&#34;] = Address
super().__init__(*args, **kwargs)

def clean(self, value, version=None):
if value is not None:
value = [self.value_cls(email_address=s) if isinstance(s, str) else s for s in value]
return super().clean(value, version=version)


class MemberListField(EWSElementListField):
def __init__(self, *args, **kwargs):
from .properties import Member
Expand Down Expand Up @@ -1812,7 +1825,23 @@ <h1 class="title">Module <code>exchangelib.fields</code></h1>

def __init__(self, *args, **kwargs):
kwargs[&#34;choices&#34;] = SENSITIVITY_CHOICES
super().__init__(*args, **kwargs)</code></pre>
super().__init__(*args, **kwargs)


class FolderActionField(EWSElementField):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def clean(self, value, version=None):
from .folders import DistinguishedFolderId, Folder

if isinstance(value, Folder):
folder_id = value.to_id()
if isinstance(folder_id, DistinguishedFolderId):
value = self.value_cls(distinguished_folder_id=folder_id)
else:
value = self.value_cls(folder_id=folder_id)
return super().clean(value, version=version)</code></pre>
</details>
</section>
<section>
Expand Down Expand Up @@ -1928,6 +1957,64 @@ <h2 class="section-title" id="header-functions">Functions</h2>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="exchangelib.fields.AddressListField"><code class="flex name class">
<span>class <span class="ident">AddressListField</span></span>
<span>(</span><span>*args, **kwargs)</span>
</code></dt>
<dd>
<div class="desc"><p>Like EWSElementField, but for lists of EWSElement objects.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class AddressListField(EWSElementListField):
def __init__(self, *args, **kwargs):
from .properties import Address

kwargs[&#34;value_cls&#34;] = Address
super().__init__(*args, **kwargs)

def clean(self, value, version=None):
if value is not None:
value = [self.value_cls(email_address=s) if isinstance(s, str) else s for s in value]
return super().clean(value, version=version)</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
<li><a title="exchangelib.fields.EWSElementListField" href="#exchangelib.fields.EWSElementListField">EWSElementListField</a></li>
<li><a title="exchangelib.fields.EWSElementField" href="#exchangelib.fields.EWSElementField">EWSElementField</a></li>
<li><a title="exchangelib.fields.FieldURIField" href="#exchangelib.fields.FieldURIField">FieldURIField</a></li>
<li><a title="exchangelib.fields.Field" href="#exchangelib.fields.Field">Field</a></li>
<li><a title="exchangelib.version.SupportedVersionInstanceMixIn" href="version.html#exchangelib.version.SupportedVersionInstanceMixIn">SupportedVersionInstanceMixIn</a></li>
</ul>
<h3>Methods</h3>
<dl>
<dt id="exchangelib.fields.AddressListField.clean"><code class="name flex">
<span>def <span class="ident">clean</span></span>(<span>self, value, version=None)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def clean(self, value, version=None):
if value is not None:
value = [self.value_cls(email_address=s) if isinstance(s, str) else s for s in value]
return super().clean(value, version=version)</code></pre>
</details>
</dd>
</dl>
<h3>Inherited members</h3>
<ul class="hlist">
<li><code><b><a title="exchangelib.fields.EWSElementListField" href="#exchangelib.fields.EWSElementListField">EWSElementListField</a></b></code>:
<ul class="hlist">
<li><code><a title="exchangelib.fields.EWSElementListField.from_xml" href="#exchangelib.fields.Field.from_xml">from_xml</a></code></li>
<li><code><a title="exchangelib.fields.EWSElementListField.to_xml" href="#exchangelib.fields.Field.to_xml">to_xml</a></code></li>
</ul>
</li>
</ul>
</dd>
<dt id="exchangelib.fields.AppointmentStateField"><code class="flex name class">
<span>class <span class="ident">AppointmentStateField</span></span>
<span>(</span><span>*args, **kwargs)</span>
Expand Down Expand Up @@ -3308,6 +3395,7 @@ <h3>Subclasses</h3>
<li><a title="exchangelib.fields.BodyContentAttributedValueField" href="#exchangelib.fields.BodyContentAttributedValueField">BodyContentAttributedValueField</a></li>
<li><a title="exchangelib.fields.EWSElementListField" href="#exchangelib.fields.EWSElementListField">EWSElementListField</a></li>
<li><a title="exchangelib.fields.EffectiveRightsField" href="#exchangelib.fields.EffectiveRightsField">EffectiveRightsField</a></li>
<li><a title="exchangelib.fields.FolderActionField" href="#exchangelib.fields.FolderActionField">FolderActionField</a></li>
<li><a title="exchangelib.fields.GenericEventListField" href="#exchangelib.fields.GenericEventListField">GenericEventListField</a></li>
<li><a title="exchangelib.fields.IdElementField" href="#exchangelib.fields.IdElementField">IdElementField</a></li>
<li><a title="exchangelib.fields.IndexedField" href="#exchangelib.fields.IndexedField">IndexedField</a></li>
Expand Down Expand Up @@ -3372,6 +3460,7 @@ <h3>Ancestors</h3>
</ul>
<h3>Subclasses</h3>
<ul class="hlist">
<li><a title="exchangelib.fields.AddressListField" href="#exchangelib.fields.AddressListField">AddressListField</a></li>
<li><a title="exchangelib.fields.AttachmentField" href="#exchangelib.fields.AttachmentField">AttachmentField</a></li>
<li><a title="exchangelib.fields.AttendeesField" href="#exchangelib.fields.AttendeesField">AttendeesField</a></li>
<li><a title="exchangelib.fields.EmailAddressAttributedValueField" href="#exchangelib.fields.EmailAddressAttributedValueField">EmailAddressAttributedValueField</a></li>
Expand Down Expand Up @@ -4751,6 +4840,72 @@ <h3>Inherited members</h3>
</li>
</ul>
</dd>
<dt id="exchangelib.fields.FolderActionField"><code class="flex name class">
<span>class <span class="ident">FolderActionField</span></span>
<span>(</span><span>*args, **kwargs)</span>
</code></dt>
<dd>
<div class="desc"><p>A generic field for any EWSElement object.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class FolderActionField(EWSElementField):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def clean(self, value, version=None):
from .folders import DistinguishedFolderId, Folder

if isinstance(value, Folder):
folder_id = value.to_id()
if isinstance(folder_id, DistinguishedFolderId):
value = self.value_cls(distinguished_folder_id=folder_id)
else:
value = self.value_cls(folder_id=folder_id)
return super().clean(value, version=version)</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
<li><a title="exchangelib.fields.EWSElementField" href="#exchangelib.fields.EWSElementField">EWSElementField</a></li>
<li><a title="exchangelib.fields.FieldURIField" href="#exchangelib.fields.FieldURIField">FieldURIField</a></li>
<li><a title="exchangelib.fields.Field" href="#exchangelib.fields.Field">Field</a></li>
<li><a title="exchangelib.version.SupportedVersionInstanceMixIn" href="version.html#exchangelib.version.SupportedVersionInstanceMixIn">SupportedVersionInstanceMixIn</a></li>
</ul>
<h3>Methods</h3>
<dl>
<dt id="exchangelib.fields.FolderActionField.clean"><code class="name flex">
<span>def <span class="ident">clean</span></span>(<span>self, value, version=None)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def clean(self, value, version=None):
from .folders import DistinguishedFolderId, Folder

if isinstance(value, Folder):
folder_id = value.to_id()
if isinstance(folder_id, DistinguishedFolderId):
value = self.value_cls(distinguished_folder_id=folder_id)
else:
value = self.value_cls(folder_id=folder_id)
return super().clean(value, version=version)</code></pre>
</details>
</dd>
</dl>
<h3>Inherited members</h3>
<ul class="hlist">
<li><code><b><a title="exchangelib.fields.EWSElementField" href="#exchangelib.fields.EWSElementField">EWSElementField</a></b></code>:
<ul class="hlist">
<li><code><a title="exchangelib.fields.EWSElementField.from_xml" href="#exchangelib.fields.Field.from_xml">from_xml</a></code></li>
<li><code><a title="exchangelib.fields.EWSElementField.to_xml" href="#exchangelib.fields.Field.to_xml">to_xml</a></code></li>
</ul>
</li>
</ul>
</dd>
<dt id="exchangelib.fields.FreeBusyStatusField"><code class="flex name class">
<span>class <span class="ident">FreeBusyStatusField</span></span>
<span>(</span><span>*args, **kwargs)</span>
Expand Down Expand Up @@ -7223,6 +7378,12 @@ <h1>Index</h1>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="exchangelib.fields.AddressListField" href="#exchangelib.fields.AddressListField">AddressListField</a></code></h4>
<ul class="">
<li><code><a title="exchangelib.fields.AddressListField.clean" href="#exchangelib.fields.AddressListField.clean">clean</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="exchangelib.fields.AppointmentStateField" href="#exchangelib.fields.AppointmentStateField">AppointmentStateField</a></code></h4>
<ul class="">
<li><code><a title="exchangelib.fields.AppointmentStateField.CANCELLED" href="#exchangelib.fields.AppointmentStateField.CANCELLED">CANCELLED</a></code></li>
Expand Down Expand Up @@ -7449,6 +7610,12 @@ <h4><code><a title="exchangelib.fields.FieldURIField" href="#exchangelib.fields.
<h4><code><a title="exchangelib.fields.FlaggedForActionField" href="#exchangelib.fields.FlaggedForActionField">FlaggedForActionField</a></code></h4>
</li>
<li>
<h4><code><a title="exchangelib.fields.FolderActionField" href="#exchangelib.fields.FolderActionField">FolderActionField</a></code></h4>
<ul class="">
<li><code><a title="exchangelib.fields.FolderActionField.clean" href="#exchangelib.fields.FolderActionField.clean">clean</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="exchangelib.fields.FreeBusyStatusField" href="#exchangelib.fields.FreeBusyStatusField">FreeBusyStatusField</a></code></h4>
</li>
<li>
Expand Down
Loading

0 comments on commit ff43417

Please sign in to comment.