/usr/lib/python2.7/dist-packages/gdata/apps/emailsettings/data.py is in python-gdata 2.0.18+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 | #!/usr/bin/python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Data model classes for the Email Settings API."""
__author__ = 'Claudio Cherubino <ccherubino@google.com>'
import atom.data
import gdata.apps
import gdata.apps_property
import gdata.data
# This is required to work around a naming conflict between the Google
# Spreadsheets API and Python's built-in property function
pyproperty = property
# The apps:property label of the label property
LABEL_NAME = 'label'
# The apps:property from of the filter property
FILTER_FROM_NAME = 'from'
# The apps:property to of the filter property
FILTER_TO_NAME = 'to'
# The apps:property subject of the filter property
FILTER_SUBJECT_NAME = 'subject'
# The apps:property hasTheWord of the filter property
FILTER_HAS_THE_WORD_NAME = 'hasTheWord'
# The apps:property doesNotHaveTheWord of the filter property
FILTER_DOES_NOT_HAVE_THE_WORD_NAME = 'doesNotHaveTheWord'
# The apps:property hasAttachment of the filter property
FILTER_HAS_ATTACHMENTS_NAME = 'hasAttachment'
# The apps:property label of the filter action property
FILTER_LABEL = 'label'
# The apps:property shouldMarkAsRead of the filter action property
FILTER_MARK_AS_READ = 'shouldMarkAsRead'
# The apps:property shouldArchive of the filter action property
FILTER_ARCHIVE = 'shouldArchive'
# The apps:property name of the send-as alias property
SENDAS_ALIAS_NAME = 'name'
# The apps:property address of the send-as alias property
SENDAS_ALIAS_ADDRESS = 'address'
# The apps:property replyTo of the send-as alias property
SENDAS_ALIAS_REPLY_TO = 'replyTo'
# The apps:property makeDefault of the send-as alias property
SENDAS_ALIAS_MAKE_DEFAULT = 'makeDefault'
# The apps:property enable of the webclip property
WEBCLIP_ENABLE = 'enable'
# The apps:property enable of the forwarding property
FORWARDING_ENABLE = 'enable'
# The apps:property forwardTo of the forwarding property
FORWARDING_TO = 'forwardTo'
# The apps:property action of the forwarding property
FORWARDING_ACTION = 'action'
# The apps:property enable of the POP property
POP_ENABLE = 'enable'
# The apps:property enableFor of the POP property
POP_ENABLE_FOR = 'enableFor'
# The apps:property action of the POP property
POP_ACTION = 'action'
# The apps:property enable of the IMAP property
IMAP_ENABLE = 'enable'
# The apps:property enable of the vacation responder property
VACATION_RESPONDER_ENABLE = 'enable'
# The apps:property subject of the vacation responder property
VACATION_RESPONDER_SUBJECT = 'subject'
# The apps:property message of the vacation responder property
VACATION_RESPONDER_MESSAGE = 'message'
# The apps:property startDate of the vacation responder property
VACATION_RESPONDER_STARTDATE = 'startDate'
# The apps:property endDate of the vacation responder property
VACATION_RESPONDER_ENDDATE = 'endDate'
# The apps:property contactsOnly of the vacation responder property
VACATION_RESPONDER_CONTACTS_ONLY = 'contactsOnly'
# The apps:property domainOnly of the vacation responder property
VACATION_RESPONDER_DOMAIN_ONLY = 'domainOnly'
# The apps:property signature of the signature property
SIGNATURE_VALUE = 'signature'
# The apps:property language of the language property
LANGUAGE_TAG = 'language'
# The apps:property pageSize of the general settings property
GENERAL_PAGE_SIZE = 'pageSize'
# The apps:property shortcuts of the general settings property
GENERAL_SHORTCUTS = 'shortcuts'
# The apps:property arrows of the general settings property
GENERAL_ARROWS = 'arrows'
# The apps:prgdata.appsoperty snippets of the general settings property
GENERAL_SNIPPETS = 'snippets'
# The apps:property uniAppsProcode of the general settings property
GENERAL_UNICODE = 'unicode'
# The apps:property delegationId of the email delegation property
DELEGATION_ID = 'delegationId'
# The apps:property address of the email delegation property
DELEGATION_ADDRESS = 'address'
# The apps:property delegate of the email delegation property
DELEGATION_DELEGATE = 'delegate'
# The apps:property status of the email delegation property
DELEGATION_STATUS = 'status'
class EmailSettingsEntry(gdata.data.GDEntry):
"""Represents an Email Settings entry in object form."""
property = [gdata.apps_property.AppsProperty]
def _GetProperty(self, name):
"""Get the apps:property value with the given name.
Args:
name: string Name of the apps:property value to get.
Returns:
The apps:property value with the given name, or None if the name was
invalid.
"""
value = None
for p in self.property:
if p.name == name:
value = p.value
break
return value
def _SetProperty(self, name, value):
"""Set the apps:property value with the given name to the given value.
Args:
name: string Name of the apps:property value to set.
value: string Value to give the apps:property value with the given name.
"""
found = False
for i in range(len(self.property)):
if self.property[i].name == name:
self.property[i].value = value
found = True
break
if not found:
self.property.append(
gdata.apps_property.AppsProperty(name=name, value=value))
def find_edit_link(self):
return self.uri
class EmailSettingsLabel(EmailSettingsEntry):
"""Represents a Label in object form."""
def GetName(self):
"""Get the name of the Label object.
Returns:
The name of this Label object as a string or None.
"""
return self._GetProperty(LABEL_NAME)
def SetName(self, value):
"""Set the name of this Label object.
Args:
value: string The new label name to give this object.
"""
self._SetProperty(LABEL_NAME, value)
name = pyproperty(GetName, SetName)
def __init__(self, uri=None, name=None, *args, **kwargs):
"""Constructs a new EmailSettingsLabel object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
name: string (optional) The name to give this new object.
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsLabel, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if name:
self.name = name
class EmailSettingsFilter(EmailSettingsEntry):
"""Represents an Email Settings Filter in object form."""
def GetFrom(self):
"""Get the From value of the Filter object.
Returns:
The From value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_FROM_NAME)
def SetFrom(self, value):
"""Set the From value of this Filter object.
Args:
value: string The new From value to give this object.
"""
self._SetProperty(FILTER_FROM_NAME, value)
from_address = pyproperty(GetFrom, SetFrom)
def GetTo(self):
"""Get the To value of the Filter object.
Returns:
The To value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_TO_NAME)
def SetTo(self, value):
"""Set the To value of this Filter object.
Args:
value: string The new To value to give this object.
"""
self._SetProperty(FILTER_TO_NAME, value)
to_address = pyproperty(GetTo, SetTo)
def GetSubject(self):
"""Get the Subject value of the Filter object.
Returns:
The Subject value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_SUBJECT_NAME)
def SetSubject(self, value):
"""Set the Subject value of this Filter object.
Args:
value: string The new Subject value to give this object.
"""
self._SetProperty(FILTER_SUBJECT_NAME, value)
subject = pyproperty(GetSubject, SetSubject)
def GetHasTheWord(self):
"""Get the HasTheWord value of the Filter object.
Returns:
The HasTheWord value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_HAS_THE_WORD_NAME)
def SetHasTheWord(self, value):
"""Set the HasTheWord value of this Filter object.
Args:
value: string The new HasTheWord value to give this object.
"""
self._SetProperty(FILTER_HAS_THE_WORD_NAME, value)
has_the_word = pyproperty(GetHasTheWord, SetHasTheWord)
def GetDoesNotHaveTheWord(self):
"""Get the DoesNotHaveTheWord value of the Filter object.
Returns:
The DoesNotHaveTheWord value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_DOES_NOT_HAVE_THE_WORD_NAME)
def SetDoesNotHaveTheWord(self, value):
"""Set the DoesNotHaveTheWord value of this Filter object.
Args:
value: string The new DoesNotHaveTheWord value to give this object.
"""
self._SetProperty(FILTER_DOES_NOT_HAVE_THE_WORD_NAME, value)
does_not_have_the_word = pyproperty(GetDoesNotHaveTheWord,
SetDoesNotHaveTheWord)
def GetHasAttachments(self):
"""Get the HasAttachments value of the Filter object.
Returns:
The HasAttachments value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_HAS_ATTACHMENTS_NAME)
def SetHasAttachments(self, value):
"""Set the HasAttachments value of this Filter object.
Args:
value: string The new HasAttachments value to give this object.
"""
self._SetProperty(FILTER_HAS_ATTACHMENTS_NAME, value)
has_attachments = pyproperty(GetHasAttachments,
SetHasAttachments)
def GetLabel(self):
"""Get the Label value of the Filter object.
Returns:
The Label value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_LABEL)
def SetLabel(self, value):
"""Set the Label value of this Filter object.
Args:
value: string The new Label value to give this object.
"""
self._SetProperty(FILTER_LABEL, value)
label = pyproperty(GetLabel, SetLabel)
def GetMarkAsRead(self):
"""Get the MarkAsRead value of the Filter object.
Returns:
The MarkAsRead value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_MARK_AS_READ)
def SetMarkAsRead(self, value):
"""Set the MarkAsRead value of this Filter object.
Args:
value: string The new MarkAsRead value to give this object.
"""
self._SetProperty(FILTER_MARK_AS_READ, value)
mark_as_read = pyproperty(GetMarkAsRead, SetMarkAsRead)
def GetArchive(self):
"""Get the Archive value of the Filter object.
Returns:
The Archive value of this Filter object as a string or None.
"""
return self._GetProperty(FILTER_ARCHIVE)
def SetArchive(self, value):
"""Set the Archive value of this Filter object.
Args:
value: string The new Archive value to give this object.
"""
self._SetProperty(FILTER_ARCHIVE, value)
archive = pyproperty(GetArchive, SetArchive)
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):
"""Constructs a new EmailSettingsFilter object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
from_address: string (optional) The source email address for the filter.
to_address: string (optional) The destination email address for
the filter.
subject: string (optional) The value the email must have in its
subject to be filtered.
has_the_word: string (optional) The value the email must have in its
subject or body to be filtered.
does_not_have_the_word: string (optional) The value the email cannot
have in its subject or body to be filtered.
has_attachments: Boolean (optional) Whether or not the email must
have an attachment to be filtered.
label: string (optional) The name of the label to apply to
messages matching the filter criteria.
mark_as_read: Boolean (optional) Whether or not to mark messages
matching the filter criteria as read.
archive: Boolean (optional) Whether or not to move messages
matching to Archived state.
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsFilter, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if from_address:
self.from_address = from_address
if to_address:
self.to_address = to_address
if subject:
self.subject = subject
if has_the_word:
self.has_the_word = has_the_word
if does_not_have_the_word:
self.does_not_have_the_word = does_not_have_the_word
if has_attachments is not None:
self.has_attachments = str(has_attachments)
if label:
self.label = label
if mark_as_read is not None:
self.mark_as_read = str(mark_as_read)
if archive is not None:
self.archive = str(archive)
class EmailSettingsSendAsAlias(EmailSettingsEntry):
"""Represents an Email Settings send-as Alias in object form."""
def GetName(self):
"""Get the Name of the send-as Alias object.
Returns:
The Name of this send-as Alias object as a string or None.
"""
return self._GetProperty(SENDAS_ALIAS_NAME)
def SetName(self, value):
"""Set the Name of this send-as Alias object.
Args:
value: string The new Name to give this object.
"""
self._SetProperty(SENDAS_ALIAS_NAME, value)
name = pyproperty(GetName, SetName)
def GetAddress(self):
"""Get the Address of the send-as Alias object.
Returns:
The Address of this send-as Alias object as a string or None.
"""
return self._GetProperty(SENDAS_ALIAS_ADDRESS)
def SetAddress(self, value):
"""Set the Address of this send-as Alias object.
Args:
value: string The new Address to give this object.
"""
self._SetProperty(SENDAS_ALIAS_ADDRESS, value)
address = pyproperty(GetAddress, SetAddress)
def GetReplyTo(self):
"""Get the ReplyTo address of the send-as Alias object.
Returns:
The ReplyTo address of this send-as Alias object as a string or None.
"""
return self._GetProperty(SENDAS_ALIAS_REPLY_TO)
def SetReplyTo(self, value):
"""Set the ReplyTo address of this send-as Alias object.
Args:
value: string The new ReplyTo address to give this object.
"""
self._SetProperty(SENDAS_ALIAS_REPLY_TO, value)
reply_to = pyproperty(GetReplyTo, SetReplyTo)
def GetMakeDefault(self):
"""Get the MakeDefault value of the send-as Alias object.
Returns:
The MakeDefault value of this send-as Alias object as a string or None.
"""
return self._GetProperty(SENDAS_ALIAS_MAKE_DEFAULT)
def SetMakeDefault(self, value):
"""Set the MakeDefault value of this send-as Alias object.
Args:
value: string The new MakeDefault value to give this object.
"""
self._SetProperty(SENDAS_ALIAS_MAKE_DEFAULT, value)
make_default = pyproperty(GetMakeDefault, SetMakeDefault)
def __init__(self, uri=None, name=None, address=None, reply_to=None,
make_default=None, *args, **kwargs):
"""Constructs a new EmailSettingsSendAsAlias object with the given
arguments.
Args:
uri: string (optional) The uri f this object for HTTP requests.
name: string (optional) The name that will appear in the "From" field
for this user.
address: string (optional) The email address that appears as the
origination address for emails sent by this user.
reply_to: string (optional) The address to be used as the reply-to
address in email sent using the alias.
make_default: Boolean (optional) Whether or not this alias should
become the default alias for this user.
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsSendAsAlias, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if name:
self.name = name
if address:
self.address = address
if reply_to:
self.reply_to = reply_to
if make_default is not None:
self.make_default = str(make_default)
class EmailSettingsWebClip(EmailSettingsEntry):
"""Represents a WebClip in object form."""
def GetEnable(self):
"""Get the Enable value of the WebClip object.
Returns:
The Enable value of this WebClip object as a string or None.
"""
return self._GetProperty(WEBCLIP_ENABLE)
def SetEnable(self, value):
"""Set the Enable value of this WebClip object.
Args:
value: string The new Enable value to give this object.
"""
self._SetProperty(WEBCLIP_ENABLE, value)
enable = pyproperty(GetEnable, SetEnable)
def __init__(self, uri=None, enable=None, *args, **kwargs):
"""Constructs a new EmailSettingsWebClip object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
enable: Boolean (optional) Whether to enable showing Web clips.
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsWebClip, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if enable is not None:
self.enable = str(enable)
class EmailSettingsForwarding(EmailSettingsEntry):
"""Represents Forwarding settings in object form."""
def GetEnable(self):
"""Get the Enable value of the Forwarding object.
Returns:
The Enable value of this Forwarding object as a string or None.
"""
return self._GetProperty(FORWARDING_ENABLE)
def SetEnable(self, value):
"""Set the Enable value of this Forwarding object.
Args:
value: string The new Enable value to give this object.
"""
self._SetProperty(FORWARDING_ENABLE, value)
enable = pyproperty(GetEnable, SetEnable)
def GetForwardTo(self):
"""Get the ForwardTo value of the Forwarding object.
Returns:
The ForwardTo value of this Forwarding object as a string or None.
"""
return self._GetProperty(FORWARDING_TO)
def SetForwardTo(self, value):
"""Set the ForwardTo value of this Forwarding object.
Args:
value: string The new ForwardTo value to give this object.
"""
self._SetProperty(FORWARDING_TO, value)
forward_to = pyproperty(GetForwardTo, SetForwardTo)
def GetAction(self):
"""Get the Action value of the Forwarding object.
Returns:
The Action value of this Forwarding object as a string or None.
"""
return self._GetProperty(FORWARDING_ACTION)
def SetAction(self, value):
"""Set the Action value of this Forwarding object.
Args:
value: string The new Action value to give this object.
"""
self._SetProperty(FORWARDING_ACTION, value)
action = pyproperty(GetAction, SetAction)
def __init__(self, uri=None, enable=None, forward_to=None, action=None,
*args, **kwargs):
"""Constructs a new EmailSettingsForwarding object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
enable: Boolean (optional) Whether to enable incoming email forwarding.
forward_to: string (optional) The address email will be forwarded to.
action: string (optional) The action to perform after forwarding an
email ("KEEP", "ARCHIVE", "DELETE").
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsForwarding, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if enable is not None:
self.enable = str(enable)
if forward_to:
self.forward_to = forward_to
if action:
self.action = action
class EmailSettingsPop(EmailSettingsEntry):
"""Represents POP settings in object form."""
def GetEnable(self):
"""Get the Enable value of the POP object.
Returns:
The Enable value of this POP object as a string or None.
"""
return self._GetProperty(POP_ENABLE)
def SetEnable(self, value):
"""Set the Enable value of this POP object.
Args:
value: string The new Enable value to give this object.
"""
self._SetProperty(POP_ENABLE, value)
enable = pyproperty(GetEnable, SetEnable)
def GetEnableFor(self):
"""Get the EnableFor value of the POP object.
Returns:
The EnableFor value of this POP object as a string or None.
"""
return self._GetProperty(POP_ENABLE_FOR)
def SetEnableFor(self, value):
"""Set the EnableFor value of this POP object.
Args:
value: string The new EnableFor value to give this object.
"""
self._SetProperty(POP_ENABLE_FOR, value)
enable_for = pyproperty(GetEnableFor, SetEnableFor)
def GetPopAction(self):
"""Get the Action value of the POP object.
Returns:
The Action value of this POP object as a string or None.
"""
return self._GetProperty(POP_ACTION)
def SetPopAction(self, value):
"""Set the Action value of this POP object.
Args:
value: string The new Action value to give this object.
"""
self._SetProperty(POP_ACTION, value)
action = pyproperty(GetPopAction, SetPopAction)
def __init__(self, uri=None, enable=None, enable_for=None,
action=None, *args, **kwargs):
"""Constructs a new EmailSettingsPOP object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
enable: Boolean (optional) Whether to enable incoming POP3 access.
enable_for: string (optional) Whether to enable POP3 for all mail
("ALL_MAIL"), or mail from now on ("MAIL_FROM_NOW_ON").
action: string (optional) What Google Mail should do with its copy
of the email after it is retrieved using POP
("KEEP", "ARCHIVE", or "DELETE").
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsPop, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if enable is not None:
self.enable = str(enable)
if enable_for:
self.enable_for = enable_for
if action:
self.action = action
class EmailSettingsImap(EmailSettingsEntry):
"""Represents IMAP settings in object form."""
def GetEnable(self):
"""Get the Enable value of the IMAP object.
Returns:
The Enable value of this IMAP object as a string or None.
"""
return self._GetProperty(IMAP_ENABLE)
def SetEnable(self, value):
"""Set the Enable value of this IMAP object.
Args:
value: string The new Enable value to give this object.
"""
self._SetProperty(IMAP_ENABLE, value)
enable = pyproperty(GetEnable, SetEnable)
def __init__(self, uri=None, enable=None, *args, **kwargs):
"""Constructs a new EmailSettingsImap object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
enable: Boolean (optional) Whether to enable IMAP access.
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsImap, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if enable is not None:
self.enable = str(enable)
class EmailSettingsVacationResponder(EmailSettingsEntry):
"""Represents Vacation Responder settings in object form."""
def GetEnable(self):
"""Get the Enable value of the Vacation Responder object.
Returns:
The Enable value of this Vacation Responder object as a string or None.
"""
return self._GetProperty(VACATION_RESPONDER_ENABLE)
def SetEnable(self, value):
"""Set the Enable value of this Vacation Responder object.
Args:
value: string The new Enable value to give this object.
"""
self._SetProperty(VACATION_RESPONDER_ENABLE, value)
enable = pyproperty(GetEnable, SetEnable)
def GetSubject(self):
"""Get the Subject value of the Vacation Responder object.
Returns:
The Subject value of this Vacation Responder object as a string or None.
"""
return self._GetProperty(VACATION_RESPONDER_SUBJECT)
def SetSubject(self, value):
"""Set the Subject value of this Vacation Responder object.
Args:
value: string The new Subject value to give this object.
"""
self._SetProperty(VACATION_RESPONDER_SUBJECT, value)
subject = pyproperty(GetSubject, SetSubject)
def GetMessage(self):
"""Get the Message value of the Vacation Responder object.
Returns:
The Message value of this Vacation Responder object as a string or None.
"""
return self._GetProperty(VACATION_RESPONDER_MESSAGE)
def SetMessage(self, value):
"""Set the Message value of this Vacation Responder object.
Args:
value: string The new Message value to give this object.
"""
self._SetProperty(VACATION_RESPONDER_MESSAGE, value)
message = pyproperty(GetMessage, SetMessage)
def GetStartDate(self):
"""Get the StartDate value of the Vacation Responder object.
Returns:
The StartDate value of this Vacation Responder object as a
string(YYYY-MM-DD) or None.
"""
return self._GetProperty(VACATION_RESPONDER_STARTDATE)
def SetStartDate(self, value):
"""Set the StartDate value of this Vacation Responder object.
Args:
value: string The new StartDate value to give this object.
"""
self._SetProperty(VACATION_RESPONDER_STARTDATE, value)
start_date = pyproperty(GetStartDate, SetStartDate)
def GetEndDate(self):
"""Get the EndDate value of the Vacation Responder object.
Returns:
The EndDate value of this Vacation Responder object as a
string(YYYY-MM-DD) or None.
"""
return self._GetProperty(VACATION_RESPONDER_ENDDATE)
def SetEndDate(self, value):
"""Set the EndDate value of this Vacation Responder object.
Args:
value: string The new EndDate value to give this object.
"""
self._SetProperty(VACATION_RESPONDER_ENDDATE, value)
end_date = pyproperty(GetEndDate, SetEndDate)
def GetContactsOnly(self):
"""Get the ContactsOnly value of the Vacation Responder object.
Returns:
The ContactsOnly value of this Vacation Responder object as a
string or None.
"""
return self._GetProperty(VACATION_RESPONDER_CONTACTS_ONLY)
def SetContactsOnly(self, value):
"""Set the ContactsOnly value of this Vacation Responder object.
Args:
value: string The new ContactsOnly value to give this object.
"""
self._SetProperty(VACATION_RESPONDER_CONTACTS_ONLY, value)
contacts_only = pyproperty(GetContactsOnly, SetContactsOnly)
def GetDomainOnly(self):
"""Get the DomainOnly value of the Vacation Responder object.
Returns:
The DomainOnly value of this Vacation Responder object as a
string or None.
"""
return self._GetProperty(VACATION_RESPONDER_DOMAIN_ONLY)
def SetDomainOnly(self, value):
"""Set the DomainOnly value of this Vacation Responder object.
Args:
value: string The new DomainOnly value to give this object.
"""
self._SetProperty(VACATION_RESPONDER_DOMAIN_ONLY, value)
domain_only = pyproperty(GetDomainOnly, SetDomainOnly)
def __init__(self, uri=None, enable=None, subject=None,
message=None, start_date=None, end_date=None, contacts_only=None,
domain_only=None, *args, **kwargs):
"""Constructs a new EmailSettingsVacationResponder object with the
given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
enable: Boolean (optional) Whether to enable the vacation responder.
subject: string (optional) The subject line of the vacation responder
autoresponse.
message: string (optional) The message body of the vacation responder
autoresponse.
start_date: string (optional) The start date of the vacation responder
autoresponse
end_date: string (optional) The end date of the vacation responder
autoresponse
contacts_only: Boolean (optional) Whether to only send autoresponses
to known contacts.
domain_only: Boolean (optional) Whether to only send autoresponses
to users in the same primary domain .
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsVacationResponder, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if enable is not None:
self.enable = str(enable)
if subject:
self.subject = subject
if message:
self.message = message
if start_date:
self.start_date = start_date
if end_date:
self.end_date = end_date
if contacts_only is not None:
self.contacts_only = str(contacts_only)
if domain_only is not None:
self.domain_only = str(domain_only)
class EmailSettingsSignature(EmailSettingsEntry):
"""Represents a Signature in object form."""
def GetValue(self):
"""Get the value of the Signature object.
Returns:
The value of this Signature object as a string or None.
"""
value = self._GetProperty(SIGNATURE_VALUE)
if value == ' ': # hack to support empty signature
return ''
else:
return value
def SetValue(self, value):
"""Set the name of this Signature object.
Args:
value: string The new signature value to give this object.
"""
if value == '': # hack to support empty signature
value = ' '
self._SetProperty(SIGNATURE_VALUE, value)
signature_value = pyproperty(GetValue, SetValue)
def __init__(self, uri=None, signature=None, *args, **kwargs):
"""Constructs a new EmailSettingsSignature object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
signature: string (optional) The signature to be appended to outgoing
messages.
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsSignature, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if signature is not None:
self.signature_value = signature
class EmailSettingsLanguage(EmailSettingsEntry):
"""Represents Language Settings in object form."""
def GetLanguage(self):
"""Get the tag of the Language object.
Returns:
The tag of this Language object as a string or None.
"""
return self._GetProperty(LANGUAGE_TAG)
def SetLanguage(self, value):
"""Set the tag of this Language object.
Args:
value: string The new tag value to give this object.
"""
self._SetProperty(LANGUAGE_TAG, value)
language_tag = pyproperty(GetLanguage, SetLanguage)
def __init__(self, uri=None, language=None, *args, **kwargs):
"""Constructs a new EmailSettingsLanguage object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
language: string (optional) The language tag for Google Mail's display
language.
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsLanguage, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if language:
self.language_tag = language
class EmailSettingsGeneral(EmailSettingsEntry):
"""Represents General Settings in object form."""
def GetPageSize(self):
"""Get the Page Size value of the General Settings object.
Returns:
The Page Size value of this General Settings object as a string or None.
"""
return self._GetProperty(GENERAL_PAGE_SIZE)
def SetPageSize(self, value):
"""Set the Page Size value of this General Settings object.
Args:
value: string The new Page Size value to give this object.
"""
self._SetProperty(GENERAL_PAGE_SIZE, value)
page_size = pyproperty(GetPageSize, SetPageSize)
def GetShortcuts(self):
"""Get the Shortcuts value of the General Settings object.
Returns:
The Shortcuts value of this General Settings object as a string or None.
"""
return self._GetProperty(GENERAL_SHORTCUTS)
def SetShortcuts(self, value):
"""Set the Shortcuts value of this General Settings object.
Args:
value: string The new Shortcuts value to give this object.
"""
self._SetProperty(GENERAL_SHORTCUTS, value)
shortcuts = pyproperty(GetShortcuts, SetShortcuts)
def GetArrows(self):
"""Get the Arrows value of the General Settings object.
Returns:
The Arrows value of this General Settings object as a string or None.
"""
return self._GetProperty(GENERAL_ARROWS)
def SetArrows(self, value):
"""Set the Arrows value of this General Settings object.
Args:
value: string The new Arrows value to give this object.
"""
self._SetProperty(GENERAL_ARROWS, value)
arrows = pyproperty(GetArrows, SetArrows)
def GetSnippets(self):
"""Get the Snippets value of the General Settings object.
Returns:
The Snippets value of this General Settings object as a string or None.
"""
return self._GetProperty(GENERAL_SNIPPETS)
def SetSnippets(self, value):
"""Set the Snippets value of this General Settings object.
Args:
value: string The new Snippets value to give this object.
"""
self._SetProperty(GENERAL_SNIPPETS, value)
snippets = pyproperty(GetSnippets, SetSnippets)
def GetUnicode(self):
"""Get the Unicode value of the General Settings object.
Returns:
The Unicode value of this General Settings object as a string or None.
"""
return self._GetProperty(GENERAL_UNICODE)
def SetUnicode(self, value):
"""Set the Unicode value of this General Settings object.
Args:
value: string The new Unicode value to give this object.
"""
self._SetProperty(GENERAL_UNICODE, value)
use_unicode = pyproperty(GetUnicode, SetUnicode)
def __init__(self, uri=None, page_size=None, shortcuts=None,
arrows=None, snippets=None, use_unicode=None, *args, **kwargs):
"""Constructs a new EmailSettingsGeneral object with the given arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
page_size: int (optional) The number of conversations to be shown per page.
shortcuts: Boolean (optional) Whether to enable keyboard shortcuts.
arrows: Boolean (optional) Whether to display arrow-shaped personal
indicators next to email sent specifically to the user.
snippets: Boolean (optional) Whether to display snippets of the messages
in the inbox and when searching.
use_unicode: Boolean (optional) Whether to use UTF-8 (unicode) encoding
for all outgoing messages.
args: The other parameters to pass to gdata.entry.GDEntry constructor.
kwargs: The other parameters to pass to gdata.entry.GDEntry constructor.
"""
super(EmailSettingsGeneral, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if page_size is not None:
self.page_size = str(page_size)
if shortcuts is not None:
self.shortcuts = str(shortcuts)
if arrows is not None:
self.arrows = str(arrows)
if snippets is not None:
self.snippets = str(snippets)
if use_unicode is not None:
self.use_unicode = str(use_unicode)
class EmailSettingsDelegation(EmailSettingsEntry):
"""Represents an Email Settings delegation entry in object form."""
def GetAddress(self):
"""Get the email address of the delegated user.
Returns:
The email address of the delegated user as a string or None.
"""
return self._GetProperty(DELEGATION_ADDRESS)
def SetAddress(self, value):
"""Set the email address of the delegated user.
Args:
value: string The email address of another user on the same domain
"""
self._SetProperty(DELEGATION_ADDRESS, value)
address = pyproperty(GetAddress, SetAddress)
def __init__(self, uri=None, address=None, *args, **kwargs):
"""Constructs a new EmailSettingsDelegation object with the given
arguments.
Args:
uri: string (optional) The uri of this object for HTTP requests.
address: string The email address of the delegated user.
"""
super(EmailSettingsDelegation, self).__init__(*args, **kwargs)
if uri:
self.uri = uri
if address:
self.address = address
class EmailSettingsLabelFeed(gdata.data.GDFeed):
"""Main feed containing a list of labels."""
entry = [EmailSettingsLabel]
class EmailSettingsSendAsAliasFeed(gdata.data.GDFeed):
"""Main feed containing a list of send-as aliases."""
entry = [EmailSettingsSendAsAlias]
class EmailSettingsDelegationFeed(gdata.data.GDFeed):
"""Main feed containing a list of email delegation entries."""
entry = [EmailSettingsDelegation]
|