from ....tl.mtproto_request import MTProtoRequest


class PaymentVerficationNeeded(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    payments.paymentVerficationNeeded#6b56b921 url:string = payments.PaymentResult"""

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

    def __init__(self, url):
        """
        :param url: Telegram type: «string».

        Constructor for payments.PaymentResult: Instance of either PaymentResult, PaymentVerficationNeeded.
        """
        super().__init__()

        self.url = url

    def on_send(self, writer):
        writer.write_int(PaymentVerficationNeeded.constructor_id, signed=False)
        writer.tgwrite_string(self.url)

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

    def on_response(self, reader):
        self.url = reader.tgread_string()

    def __repr__(self):
        return 'payments.paymentVerficationNeeded#6b56b921 url:string = payments.PaymentResult'

    def __str__(self):
        return '(payments.paymentVerficationNeeded (ID: 0x6b56b921) = (url={}))'.format(str(self.url))
