diff --git a/src/gdata/apps/emailsettings/client.py b/src/gdata/apps/emailsettings/client.py index 4bab6095..839d199c 100644 --- a/src/gdata/apps/emailsettings/client.py +++ b/src/gdata/apps/emailsettings/client.py @@ -189,7 +189,8 @@ def delete_label(self, username, label, **kwargs): def create_filter(self, username, from_address=None, to_address=None, subject=None, has_the_word=None, does_not_have_the_word=None, has_attachments=None, - label=None, mark_as_read=None, archive=None, **kwargs): + label=None, mark_as_read=None, archive=None, + forward_to=None, **kwargs): """Creates a filter with the given properties. Args: @@ -211,6 +212,7 @@ def create_filter(self, username, from_address=None, messages matching the filter criteria as read. archive: Boolean (optional) Whether or not to move messages matching to Archived state. + forwardTo: (optional) The email address to forward matching messages to. kwargs: The other parameters to pass to gdata.client.GDClient.post(). Returns: @@ -224,7 +226,8 @@ def create_filter(self, username, from_address=None, has_the_word=has_the_word, does_not_have_the_word=does_not_have_the_word, has_attachments=has_attachments, label=label, - mark_as_read=mark_as_read, archive=archive) + mark_as_read=mark_as_read, archive=archive, + forward_to=forward_to) return self.post(new_filter, uri, **kwargs) CreateFilter = create_filter diff --git a/src/gdata/apps/emailsettings/data.py b/src/gdata/apps/emailsettings/data.py index fea98860..7a1d9163 100644 --- a/src/gdata/apps/emailsettings/data.py +++ b/src/gdata/apps/emailsettings/data.py @@ -392,10 +392,18 @@ def SetArchive(self, value): archive = pyproperty(GetArchive, SetArchive) + def GetForwardTo(self): + return self._GetProperty(FORWARDING_TO) + + def SetForwardTo(self, value): + self._SetProperty(FORWARDING_TO, value) + + forward_to = pyproperty(GetForwardTo, SetForwardTo) + def __init__(self, uri=None, from_address=None, to_address=None, subject=None, has_the_word=None, does_not_have_the_word=None, has_attachments=None, label=None, mark_as_read=None, - archive=None, *args, **kwargs): + archive=None, forward_to=None, *args, **kwargs): """Constructs a new EmailSettingsFilter object with the given arguments. Args: @@ -441,6 +449,8 @@ def __init__(self, uri=None, from_address=None, to_address=None, self.mark_as_read = str(mark_as_read) if archive is not None: self.archive = str(archive) + if forward_to is not None: + self.forward_to = forward_to class EmailSettingsSendAsAlias(EmailSettingsEntry): @@ -1270,4 +1280,4 @@ class EmailSettingsSendAsAliasFeed(gdata.data.GDFeed): class EmailSettingsDelegationFeed(gdata.data.GDFeed): """Main feed containing a list of email delegation entries.""" - entry = [EmailSettingsDelegation] \ No newline at end of file + entry = [EmailSettingsDelegation]