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


class AnswerWebhookJSONQueryRequest(TLObject):
    constructor_id = 0xe6213f4d
    subclass_of_id = 0xf5b399ac

    def __init__(self, query_id, data):
        """
        :param query_id: Telegram type: "long".
        :param data: Telegram type: "DataJSON".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.query_id = query_id
        self.data = data

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

    def on_send(self, writer):
        writer.write_int(AnswerWebhookJSONQueryRequest.constructor_id, signed=False)
        writer.write_long(self.query_id)
        self.data.on_send(writer)

    @staticmethod
    def empty():
        return AnswerWebhookJSONQueryRequest(None, None)

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

    def __repr__(self):
        return 'bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool'

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

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



class SendCustomRequestRequest(TLObject):
    constructor_id = 0xaa2769ed
    subclass_of_id = 0xad0352e8

    def __init__(self, custom_method, params):
        """
        :param custom_method: Telegram type: "string".
        :param params: Telegram type: "DataJSON".

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

        self.custom_method = custom_method
        self.params = params

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

    def on_send(self, writer):
        writer.write_int(SendCustomRequestRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.custom_method)
        self.params.on_send(writer)

    @staticmethod
    def empty():
        return SendCustomRequestRequest(None, None)

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

    def __repr__(self):
        return 'bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON'

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

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

