# Path: apitools/gen/extended_descriptor.py
# class ExtendedEnumValueDescriptor(messages.Message):
# class ExtendedEnumDescriptor(messages.Message):
#   class JsonEnumMapping(messages.Message):
# class ExtendedFieldDescriptor(messages.Message):
# class ExtendedMessageDescriptor(messages.Message):
#   class JsonFieldMapping(messages.Message):
# class ExtendedFileDescriptor(messages.Message):
# class ProtoPrinter(six.with_metaclass(abc.ABCMeta, object)):
# class _Proto2Printer(ProtoPrinter):
# class _ProtoRpcPrinter(ProtoPrinter):
# def _WriteFile(file_descriptor, package, version, proto_printer):
# def WriteMessagesFile(file_descriptor, package, version, printer):
# def WritePythonFile(file_descriptor, package, version, printer):
# def PrintIndentedDescriptions(printer, ls, name, prefix=''):
# def _FetchCustomMappings(descriptor_ls):
# def _FormatCustomJsonMapping(mapping_type, mapping, descriptor):
# def _EmptyMessage(message_type):
#   def PrintPreamble(self, package, version, file_descriptor):
#   def PrintEnum(self, enum_type):
#   def PrintMessage(self, message_type):
#   def __init__(self, printer):
#   def __PrintEnumCommentLines(self, enum_type):
#   def __PrintEnumValueCommentLines(self, enum_value):
#   def PrintEnum(self, enum_type):
#   def PrintPreamble(self, package, version, file_descriptor):
#   def __PrintMessageCommentLines(self, message_type):
#   def __PrintFieldDescription(self, description):
#   def __PrintFields(self, fields):
#   def PrintMessage(self, message_type):
#   def PrintCustomJsonMapping(self, mapping_lines):
#   def __init__(self, printer):
#   def __PrintClassSeparator(self):
#   def __PrintEnumDocstringLines(self, enum_type):
#   def PrintEnum(self, enum_type):
#   def __PrintAdditionalImports(self, imports):
#   def PrintPreamble(self, package, version, file_descriptor):
#   def __PrintMessageDocstringLines(self, message_type):
#   def PrintMessage(self, message_type):
#   def PrintCustomJsonMapping(self, mapping):
# def _PrintEnums(proto_printer, enum_types):
# def _PrintMessages(proto_printer, message_list):
# def _PrintFields(fields, printer):
# _MESSAGE_FIELD_MAP = {
#     message_types.DateTimeMessage.definition_name(): message_types.DateTimeField,
# }
# 
# Path: apitools/gen/util.py
# class Error(Exception):
# class CommunicationError(Error):
# class Names(object):
# class ClientInfo(collections.namedtuple('ClientInfo', (
#     'package', 'scopes', 'version', 'client_id', 'client_secret',
#     'user_agent', 'client_class_name', 'url_version', 'api_key'))):
# class SimplePrettyPrinter(object):
# def _SortLengthFirst(a, b):
#   def __init__(self, strip_prefixes,
#                name_convention=None,
#                capitalize_enums=False):
#   def __FromCamel(name, separator='_'):
#   def __ToCamel(name, separator='_'):
#   def __ToLowerCamel(name, separator='_'):
#   def __StripName(self, name):
#   def CleanName(name):
#   def NormalizeRelativePath(path):
#   def NormalizeEnumName(self, enum_name):
#   def ClassName(self, name, separator='_'):
#   def MethodName(self, name, separator='_'):
#   def FieldName(self, name):
# def Chdir(dirname, create=True):
# def NormalizeVersion(version):
#   def Create(cls, discovery_doc,
#              scope_ls, client_id, client_secret, user_agent, names, api_key):
#   def default_directory(self):
#   def cli_rule_name(self):
#   def cli_file_name(self):
#   def client_rule_name(self):
#   def client_file_name(self):
#   def messages_rule_name(self):
#   def services_rule_name(self):
#   def messages_file_name(self):
#   def messages_proto_file_name(self):
#   def services_proto_file_name(self):
# def GetPackage(path):
# def CleanDescription(description):
#   def __init__(self, out):
#   def indent(self):
#   def CalculateWidth(self, max_width=78):
#   def Indent(self, indent='  '):
#   def CommentContext(self):
#   def __call__(self, *args):
# def NormalizeDiscoveryUrl(discovery_url):
# def FetchDiscoveryDoc(discovery_url, retries=5):
#   DEFAULT_NAME_CONVENTION = 'LOWER_CAMEL'
#   NAME_CONVENTIONS = ['LOWER_CAMEL', 'LOWER_WITH_UNDER', 'NONE']


import collections
import contextlib
import json
import six
from protorpc import descriptor
from protorpc import messages
from apitools.gen import extended_descriptor
from apitools.gen import util
      'any': TypeInfo(type_name='extra_types.JsonValue',
                      variant=messages.Variant.MESSAGE),
  }

  PRIMITIVE_FORMAT_MAP = {
      'int32': TypeInfo(type_name='integer',
                        variant=messages.Variant.INT32),
      'uint32': TypeInfo(type_name='integer',
                         variant=messages.Variant.UINT32),
      'int64': TypeInfo(type_name='string',
                        variant=messages.Variant.INT64),
      'uint64': TypeInfo(type_name='string',
                         variant=messages.Variant.UINT64),
      'double': TypeInfo(type_name='number',
                         variant=messages.Variant.DOUBLE),
      'float': TypeInfo(type_name='number',
                        variant=messages.Variant.FLOAT),
      'byte': TypeInfo(type_name='byte',
                       variant=messages.BytesField.DEFAULT_VARIANT),
      'date': TypeInfo(type_name='extra_types.DateField',
                       variant=messages.Variant.STRING),
      'date-time': TypeInfo(type_name='protorpc.message_types.DateTimeMessage',
                            variant=messages.Variant.MESSAGE),
  }

  def __init__(self, client_info, names, description,
               root_package_dir, base_files_package):
    self.__names = names
    self.__client_info = client_info
    self.__package = client_info.package

# Path: apitools/gen/extended_descriptor.py
# class ExtendedEnumValueDescriptor(messages.Message):
# class ExtendedEnumDescriptor(messages.Message):
#   class JsonEnumMapping(messages.Message):
# class ExtendedFieldDescriptor(messages.Message):
# class ExtendedMessageDescriptor(messages.Message):
#   class JsonFieldMapping(messages.Message):
# class ExtendedFileDescriptor(messages.Message):
# class ProtoPrinter(six.with_metaclass(abc.ABCMeta, object)):
# class _Proto2Printer(ProtoPrinter):
# class _ProtoRpcPrinter(ProtoPrinter):
# def _WriteFile(file_descriptor, package, version, proto_printer):
# def WriteMessagesFile(file_descriptor, package, version, printer):
# def WritePythonFile(file_descriptor, package, version, printer):
# def PrintIndentedDescriptions(printer, ls, name, prefix=''):
# def _FetchCustomMappings(descriptor_ls):
# def _FormatCustomJsonMapping(mapping_type, mapping, descriptor):
# def _EmptyMessage(message_type):
#   def PrintPreamble(self, package, version, file_descriptor):
#   def PrintEnum(self, enum_type):
#   def PrintMessage(self, message_type):
#   def __init__(self, printer):
#   def __PrintEnumCommentLines(self, enum_type):
#   def __PrintEnumValueCommentLines(self, enum_value):
#   def PrintEnum(self, enum_type):
#   def PrintPreamble(self, package, version, file_descriptor):
#   def __PrintMessageCommentLines(self, message_type):
#   def __PrintFieldDescription(self, description):
#   def __PrintFields(self, fields):
#   def PrintMessage(self, message_type):
#   def PrintCustomJsonMapping(self, mapping_lines):
#   def __init__(self, printer):
#   def __PrintClassSeparator(self):
#   def __PrintEnumDocstringLines(self, enum_type):
#   def PrintEnum(self, enum_type):
#   def __PrintAdditionalImports(self, imports):
#   def PrintPreamble(self, package, version, file_descriptor):
#   def __PrintMessageDocstringLines(self, message_type):
#   def PrintMessage(self, message_type):
#   def PrintCustomJsonMapping(self, mapping):
# def _PrintEnums(proto_printer, enum_types):
# def _PrintMessages(proto_printer, message_list):
# def _PrintFields(fields, printer):
# _MESSAGE_FIELD_MAP = {
#     message_types.DateTimeMessage.definition_name(): message_types.DateTimeField,
# }
# 
# Path: apitools/gen/util.py
# class Error(Exception):
# class CommunicationError(Error):
# class Names(object):
# class ClientInfo(collections.namedtuple('ClientInfo', (
#     'package', 'scopes', 'version', 'client_id', 'client_secret',
#     'user_agent', 'client_class_name', 'url_version', 'api_key'))):
# class SimplePrettyPrinter(object):
# def _SortLengthFirst(a, b):
#   def __init__(self, strip_prefixes,
#                name_convention=None,
#                capitalize_enums=False):
#   def __FromCamel(name, separator='_'):
#   def __ToCamel(name, separator='_'):
#   def __ToLowerCamel(name, separator='_'):
#   def __StripName(self, name):
#   def CleanName(name):
#   def NormalizeRelativePath(path):
#   def NormalizeEnumName(self, enum_name):
#   def ClassName(self, name, separator='_'):
#   def MethodName(self, name, separator='_'):
#   def FieldName(self, name):
# def Chdir(dirname, create=True):
# def NormalizeVersion(version):
#   def Create(cls, discovery_doc,
#              scope_ls, client_id, client_secret, user_agent, names, api_key):
#   def default_directory(self):
#   def cli_rule_name(self):
#   def cli_file_name(self):
#   def client_rule_name(self):
#   def client_file_name(self):
#   def messages_rule_name(self):
#   def services_rule_name(self):
#   def messages_file_name(self):
#   def messages_proto_file_name(self):
#   def services_proto_file_name(self):
# def GetPackage(path):
# def CleanDescription(description):
#   def __init__(self, out):
#   def indent(self):
#   def CalculateWidth(self, max_width=78):
#   def Indent(self, indent='  '):
#   def CommentContext(self):
#   def __call__(self, *args):
# def NormalizeDiscoveryUrl(discovery_url):
# def FetchDiscoveryDoc(discovery_url, retries=5):
#   DEFAULT_NAME_CONVENTION = 'LOWER_CAMEL'
#   NAME_CONVENTIONS = ['LOWER_CAMEL', 'LOWER_WITH_UNDER', 'NONE']


# Path: apitools/gen/message_registry.py
import collections
import contextlib
import json
import six
from protorpc import descriptor
from protorpc import messages
from apitools.gen import extended_descriptor
from apitools.gen import util

      'any': TypeInfo(type_name='extra_types.JsonValue',
                      variant=messages.Variant.MESSAGE),
  }

  PRIMITIVE_FORMAT_MAP = {
      'int32': TypeInfo(type_name='integer',
                        variant=messages.Variant.INT32),
      'uint32': TypeInfo(type_name='integer',
                         variant=messages.Variant.UINT32),
      'int64': TypeInfo(type_name='string',
                        variant=messages.Variant.INT64),
      'uint64': TypeInfo(type_name='string',
                         variant=messages.Variant.UINT64),
      'double': TypeInfo(type_name='number',
                         variant=messages.Variant.DOUBLE),
      'float': TypeInfo(type_name='number',
                        variant=messages.Variant.FLOAT),
      'byte': TypeInfo(type_name='byte',
                       variant=messages.BytesField.DEFAULT_VARIANT),
      'date': TypeInfo(type_name='extra_types.DateField',
                       variant=messages.Variant.STRING),
      'date-time': TypeInfo(type_name='protorpc.message_types.DateTimeMessage',
                            variant=messages.Variant.MESSAGE),
  }

  def __init__(self, client_info, names, description,
               root_package_dir, base_files_package):
    self.__names = names
    self.__client_info = client_info
    self.__package = client_info.package

    self.__description = util.CleanDescription(description)