from ...tl.mtproto_request import MTProtoRequest


class PhotoEmpty(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    photoEmpty#2331b22d id:long = Photo"""

    # Telegram's constructor (U)ID for this class
    constructor_id = 0x2331b22d
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0xd576ab1c

    def __init__(self, id):
        """
        :param id: Telegram type: "long".

        Constructor for Photo: Instance of either PhotoEmpty, Photo.
        """
        super().__init__()

        self.id = id

    def to_dict(self):
        return {
            'id': self.id,
        }

    def on_send(self, writer):
        writer.write_int(PhotoEmpty.constructor_id, signed=False)
        writer.write_long(self.id)

    @staticmethod
    def empty():
        """Returns an "empty" instance (attributes=None)"""
        return PhotoEmpty(None)

    def on_response(self, reader):
        self.id = reader.read_long()

    def __repr__(self):
        return 'photoEmpty#2331b22d id:long = Photo'

    def __str__(self):
        return '(photoEmpty (ID: 0x2331b22d) = (id={}))'.format(str(self.id))
