From e60b3be7b08efb05fb6f882f223bb1c244781abd Mon Sep 17 00:00:00 2001 From: Betsy Alegria Date: Tue, 19 Nov 2019 14:25:23 -0800 Subject: [PATCH] Add a new FreeBusyAccount class object --- exchangelib/account.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/exchangelib/account.py b/exchangelib/account.py index 670d5f15..7b346260 100644 --- a/exchangelib/account.py +++ b/exchangelib/account.py @@ -619,3 +619,17 @@ def __str__(self): if self.fullname: txt += ' (%s)' % self.fullname return txt + +class FreeBusyAccount(Account): + ''' + The `FreeBusyAccount` class is necessary in order to fetch free-busy data via exchangelib. + + `Protocol.get_free_busy_info` has an `accounts` parameter that needs to be type `Account`. + Those accounts don't have to be syncing with Nylas, and we don't need to run any authentication + on them. That's why `FreeBusyAccount` exists - this class extends from `Account` but should + never run any authentication logic. + ''' + def __init__(self, primary_smtp_address): + # We are intentionally *not* calling the __init__ of it's super class, + # as to not run any authentication logic. + self.primary_smtp_address = primary_smtp_address