from ...tl.tlobject import TLObject


class InputMediaGame(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    inputMediaGame#d33f43f3 id:InputGame = InputMedia"""

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

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

        Constructor for InputMedia: Instance of either InputMediaEmpty, InputMediaUploadedPhoto, InputMediaPhoto, InputMediaGeoPoint, InputMediaContact, InputMediaUploadedDocument, InputMediaDocument, InputMediaVenue, InputMediaGifExternal, InputMediaPhotoExternal, InputMediaDocumentExternal, InputMediaGame, InputMediaInvoice.
        """
        super().__init__()

        self.id = id

    def to_dict(self):
        return {
            'id': None if self.id is None else self.id.to_dict(),
        }

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

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

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

    def __repr__(self):
        return 'inputMediaGame#d33f43f3 id:InputGame = InputMedia'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)
