# Path: telethon_generator/utils.py
# def snake_to_camel_case(name, suffix=None):
#     # Courtesy of http://stackoverflow.com/a/31531797/4759433
#     result = re.sub(r'_([a-z])', lambda m: m.group(1).upper(), name)
#     result = result[:1].upper() + result[1:].replace('_', '')
#     return result + suffix if suffix else result


import re
import struct
import zlib
from ...utils import snake_to_camel_case
        :param result: The result type of the TL object
        :param is_function: Is the object a function or a type?
        :param usability: The usability for this method.
        :param friendly: A tuple (namespace, friendly method name) if known.
        :param layer: The layer this TLObject belongs to.
        """
        # The name can or not have a namespace
        self.fullname = fullname
        if '.' in fullname:
            self.namespace, self.name = fullname.split('.', maxsplit=1)
        else:
            self.namespace, self.name = None, fullname

        self.args = args
        self.result = result
        self.is_function = is_function
        self.usability = usability
        self.friendly = friendly
        self.id = None
        if object_id is None:
            self.id = self.infer_id()
        else:
            self.id = int(object_id, base=16)
            whitelist = WHITELISTED_MISMATCHING_IDS[0] |\
                WHITELISTED_MISMATCHING_IDS.get(layer, set())

            if self.fullname not in whitelist:
                assert self.id == self.infer_id(),\
                    'Invalid inferred ID for ' + repr(self)


# Path: telethon_generator/utils.py
# def snake_to_camel_case(name, suffix=None):
#     # Courtesy of http://stackoverflow.com/a/31531797/4759433
#     result = re.sub(r'_([a-z])', lambda m: m.group(1).upper(), name)
#     result = result[:1].upper() + result[1:].replace('_', '')
#     return result + suffix if suffix else result


# Path: telethon_generator/parsers/tlobject/tlobject.py
import re
import struct
import zlib
from ...utils import snake_to_camel_case

        :param result: The result type of the TL object
        :param is_function: Is the object a function or a type?
        :param usability: The usability for this method.
        :param friendly: A tuple (namespace, friendly method name) if known.
        :param layer: The layer this TLObject belongs to.
        """
        # The name can or not have a namespace
        self.fullname = fullname
        if '.' in fullname:
            self.namespace, self.name = fullname.split('.', maxsplit=1)
        else:
            self.namespace, self.name = None, fullname

        self.args = args
        self.result = result
        self.is_function = is_function
        self.usability = usability
        self.friendly = friendly
        self.id = None
        if object_id is None:
            self.id = self.infer_id()
        else:
            self.id = int(object_id, base=16)
            whitelist = WHITELISTED_MISMATCHING_IDS[0] |\
                WHITELISTED_MISMATCHING_IDS.get(layer, set())

            if self.fullname not in whitelist:
                assert self.id == self.infer_id(),\
                    'Invalid inferred ID for ' + repr(self)


        self.class_name = snake_to_camel_case(self.name)