def to_array(self):
        """
        Serializes this Animation to a dictionary.

        :return: dictionary representation of this object.
        :rtype: dict
        """
        array = super(Animation, self).to_array()
        array['file_id'] = u(self.file_id)  # py2: type unicode, py3: type str

        array['width'] = int(self.width)  # type int
        array['height'] = int(self.height)  # type int
        array['duration'] = int(self.duration)  # type int
        if self.thumb is not None:
            array['thumb'] = self.thumb.to_array()  # type PhotoSize

        if self.file_name is not None:
            array['file_name'] = u(self.file_name)  # py2: type unicode, py3: type str

        if self.mime_type is not None:
            array['mime_type'] = u(self.mime_type)  # py2: type unicode, py3: type str

        if self.file_size is not None:
            array['file_size'] = int(self.file_size)  # type int
        return array