"""File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject
from ...utils import get_input_user


class GetFullUserRequest(TLObject):
    constructor_id = 0xca30a5b1
    subclass_of_id = 0x1f4661b9

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

        :returns UserFull: Instance of UserFull.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.id = get_input_user(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(GetFullUserRequest.constructor_id, signed=False)
        self.id.on_send(writer)

    @staticmethod
    def empty():
        return GetFullUserRequest(None)

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

    def __repr__(self):
        return 'users.getFullUser#ca30a5b1 id:InputUser = UserFull'

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

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

from ...utils import get_input_user


class GetUsersRequest(TLObject):
    constructor_id = 0xd91a548
    subclass_of_id = 0x406da4d

    def __init__(self, id):
        """
        :param id: Telegram type: "InputUser". Must be a list.

        :returns Vector<User>: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.id = [get_input_user(_x) for _x in id]

    def to_dict(self):
        return {
            'id': [] if self.id is None else [None if x is None else x.to_dict() for x in self.id],
        }

    def on_send(self, writer):
        writer.write_int(GetUsersRequest.constructor_id, signed=False)
        writer.write_int(0x1cb5c415, signed=False)  # Vector's constructor ID
        writer.write_int(len(self.id))
        for _x in self.id:
            _x.on_send(writer)

    @staticmethod
    def empty():
        return GetUsersRequest(None)

    def on_response(self, reader):
        self.result = reader.tgread_vector()

    def __repr__(self):
        return 'users.getUsers#0d91a548 id:Vector<InputUser> = Vector<User>'

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

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

