File size: 3,102 Bytes
550665c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from .person import Person


class ResponseStatus:
    """Possible values for attendee's response status



    * NEEDS_ACTION - The attendee has not responded to the invitation.

    * DECLINED - The attendee has declined the invitation.

    * TENTATIVE - The attendee has tentatively accepted the invitation.

    * ACCEPTED - The attendee has accepted the invitation.

    """
    NEEDS_ACTION = "needsAction"
    DECLINED = "declined"
    TENTATIVE = "tentative"
    ACCEPTED = "accepted"


class Attendee(Person):
    def __init__(

            self,

            email: str,

            display_name: str = None,

            comment: str = None,

            optional: bool = None,

            is_resource: bool = None,

            additional_guests: int = None,

            _id: str = None,

            _is_self: bool = None,

            _response_status: str = None

    ):
        """Represents attendee of the event.



        :param email:

                The attendee's email address, if available.

        :param display_name:

                The attendee's name, if available

        :param comment:

                The attendee's response comment

        :param optional:

                Whether this is an optional attendee. The default is False.

        :param is_resource:

                Whether the attendee is a resource.

                Can only be set when the attendee is added to the event

                for the first time. Subsequent modifications are ignored.

                The default is False.

        :param additional_guests:

                Number of additional guests. The default is 0.

        :param _id:

                The attendee's Profile ID, if available.

                It corresponds to the id field in the People collection of the Google+ API

        :param _is_self:

                Whether this entry represents the calendar on which this copy of the event appears.

                The default is False (set by Google's API).

        :param _response_status:

                The attendee's response status. See :py:class:`~gcsa.attendee.ResponseStatus`

        """
        super().__init__(email=email, display_name=display_name, _id=_id, _is_self=_is_self)
        self.comment = comment
        self.optional = optional
        self.is_resource = is_resource
        self.additional_guests = additional_guests
        self.response_status = _response_status

    def __eq__(self, other):
        return (
                isinstance(other, Attendee)
                and super().__eq__(other)
                and self.comment == other.comment
                and self.optional == other.optional
                and self.is_resource == other.is_resource
                and self.additional_guests == other.additional_guests
                and self.response_status == other.response_status
        )

    def __str__(self):
        return "'{}' - response: '{}'".format(self.email, self.response_status)

    def __repr__(self):
        return '<Attendee {}>'.format(self.__str__())