code: func BasicNetworkFromGRPC(n swarmapi.Network) basictypes.NetworkResource {
  	spec := n.Spec
  	var ipam networktypes.IPAM
  	if n.IPAM != nil {
  		if n.IPAM.Driver != nil {
  			ipam.Driver = n.IPAM.Driver.Name
  			ipam.Options = n.IPAM.Driver.Options
  		}
  		ipam.Config = make([]networktypes.IPAMConfig, 0, len(n.IPAM.Configs))
  		for _, ic := range n.IPAM.Configs {
  			ipamConfig := networktypes.IPAMConfig{
  				Subnet:     ic.Subnet,
  				IPRange:    ic.Range,
  				Gateway:    ic.Gateway,
  				AuxAddress: ic.Reserved,
  			}
  			ipam.Config = append(ipam.Config, ipamConfig)
  		}
  	}
  
  	nr := basictypes.NetworkResource{
  		ID:         n.ID,
  		Name:       n.Spec.Annotations.Name,
  		Scope:      netconst.SwarmScope,
  		EnableIPv6: spec.Ipv6Enabled,
  		IPAM:       ipam,
  		Internal:   spec.Internal,
  		Attachable: spec.Attachable,
  		Ingress:    IsIngressNetwork(&n),
  		Labels:     n.Spec.Annotations.Labels,
  	}
  	nr.Created, _ = gogotypes.TimestampFromProto(n.Meta.CreatedAt)
  
  	if n.Spec.GetNetwork() != "" {
  		nr.ConfigFrom = networktypes.ConfigReference{
  			Network: n.Spec.GetNetwork(),
  		}
  	}
  
  	if n.DriverState != nil {
  		nr.Driver = n.DriverState.Name
  		nr.Options = n.DriverState.Options
  	}
  
  	return nr
  }
docs: // BasicNetworkFromGRPC converts a grpc Network to a NetworkResource.