"""File auto-generated by tglib TL generator. Do not edit manually."""
from ..tlobject import TLObject
from ..tlobject import TLRequest
from typing import Optional, List, Union
import os
import struct
from datetime import datetime


class GetCollectibleInfoRequest(TLRequest):
    """TL type: fragment.getCollectibleInfo"""
    CONSTRUCTOR_ID = 0xbe1e85ba
    SUBCLASS_OF_ID = 0xd4ea5790

    def __init__(self, collectible: 'TypeInputCollectible'):
        self.collectible = collectible

    def to_dict(self):
        return {
            '_': 'GetCollectibleInfoRequest',
            'collectible': self.collectible,
        }

    def _bytes(self) -> bytes:
        import io
        buf = io.BytesIO()
        buf.write(struct.pack('<I', self.CONSTRUCTOR_ID))
        buf.write(bytes(self.collectible))
        return buf.getvalue()

    @classmethod
    def from_reader(cls, reader):
        _args = {}
        _val_collectible = reader.tgread_object()
        _args['collectible'] = _val_collectible
        return cls(**_args)

