from ....tl.mtproto_request import MTProtoRequest


class GetPaymentFormRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    payments.getPaymentForm#99f09745 msg_id:int = payments.PaymentForm"""

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

    def __init__(self, msg_id):
        """
        :param msg_id: Telegram type: «int».

        :returns payments.PaymentForm: Instance of PaymentForm.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.msg_id = msg_id

    def on_send(self, writer):
        writer.write_int(GetPaymentFormRequest.constructor_id, signed=False)
        writer.write_int(self.msg_id)

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

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

    def __repr__(self):
        return 'payments.getPaymentForm#99f09745 msg_id:int = payments.PaymentForm'

    def __str__(self):
        return '(payments.getPaymentForm (ID: 0x99f09745) = (msg_id={}))'.format(str(self.msg_id))
