def __item_descriptor(self, config):
    """Builds an item descriptor for a service configuration.

    Args:
      config: A dictionary containing the service configuration to describe.

    Returns:
      A dictionary that describes the service configuration.
    """
    descriptor = {
        'kind': 'discovery#directoryItem',
        'icons': {
            'x16': 'https://www.gstatic.com/images/branding/product/1x/'
                   'googleg_16dp.png',
            'x32': 'https://www.gstatic.com/images/branding/product/1x/'
                   'googleg_32dp.png',
        },
        'preferred': True,
    }

    description = config.get('description')
    root_url = config.get('root')
    name = config.get('name')
    version = config.get('api_version')
    relative_path = '/apis/{0}/{1}/rest'.format(name, version)

    if description:
      descriptor['description'] = description

    descriptor['name'] = name
    descriptor['version'] = version
    descriptor['discoveryLink'] = '.{0}'.format(relative_path)

    root_url_port = urlparse.urlparse(root_url).port

    original_path = self.__request.reconstruct_full_url(
        port_override=root_url_port)
    descriptor['discoveryRestUrl'] = '{0}/{1}/{2}/rest'.format(
        original_path, name, version)

    if name and version:
      descriptor['id'] = '{0}:{1}'.format(name, version)

    return descriptor
Builds an item descriptor for a service configuration.

    Args:
      config: A dictionary containing the service configuration to describe.

    Returns:
      A dictionary that describes the service configuration.