from telethon.tl.mtproto_request import MTProtoRequest


class MaskCoords(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    maskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords"""

    # Telegram's constructor ID (and unique identifier) for this class
    constructor_id = 0xaed6dbb2

    def __init__(self, n, x, y, zoom):
        """
        :param n: Telegram type: «int».
        :param x: Telegram type: «double».
        :param y: Telegram type: «double».
        :param zoom: Telegram type: «double».
        """
        super().__init__()

        self.n = n
        self.x = x
        self.y = y
        self.zoom = zoom

    def on_send(self, writer):
        writer.write_int(MaskCoords.constructor_id, signed=False)
        writer.write_int(self.n)
        writer.write_double(self.x)
        writer.write_double(self.y)
        writer.write_double(self.zoom)

    @staticmethod
    def empty():
        """Returns an "empty" instance (all attributes are None)"""
        return MaskCoords(None, None, None, None)

    def on_response(self, reader):
        self.n = reader.read_int()
        self.x = reader.read_double()
        self.y = reader.read_double()
        self.zoom = reader.read_double()

    def __repr__(self):
        return 'maskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords'

    def __str__(self):
        return '(maskCoords (ID: 0xaed6dbb2) = (n={}, x={}, y={}, zoom={}))'.format(str(self.n), str(self.x), str(self.y), str(self.zoom))
