'Return a Network object from the JSON-response dictionary.
:param  network: The dictionary describing the network.
:type   network: ``dict``
:return: Network object
:rtype: :class:`GCENetwork`'

def _to_network(self, network):

    extra = {}
    extra['selfLink'] = network.get('selfLink')
    extra['description'] = network.get('description')
    extra['creationTimestamp'] = network.get('creationTimestamp')
    extra['gatewayIPv4'] = network.get('gatewayIPv4')
    extra['IPv4Range'] = network.get('IPv4Range')
    extra['autoCreateSubnetworks'] = network.get('autoCreateSubnetworks')
    extra['subnetworks'] = network.get('subnetworks')
    if ('autoCreateSubnetworks' in network):
        if network['autoCreateSubnetworks']:
            extra['mode'] = 'auto'
        else:
            extra['mode'] = 'custom'
    else:
        extra['mode'] = 'legacy'
    return GCENetwork(id=network['id'], name=network['name'], cidr=network.get('IPv4Range'), driver=self, extra=extra)
