code: func (s *Server) RemoveNetwork(ctx context.Context, request *api.RemoveNetworkRequest) (*api.RemoveNetworkResponse, error) {
  	if request.NetworkID == "" {
  		return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
  	}
  
  	var (
  		n  *api.Network
  		rm = s.removeNetwork
  	)
  
  	s.store.View(func(tx store.ReadTx) {
  		n = store.GetNetwork(tx, request.NetworkID)
  	})
  	if n == nil {
  		return nil, status.Errorf(codes.NotFound, "network %s not found", request.NetworkID)
  	}
  
  	if allocator.IsIngressNetwork(n) {
  		rm = s.removeIngressNetwork
  	}
  
  	if v, ok := n.Spec.Annotations.Labels[networkallocator.PredefinedLabel]; ok && v == "true" {
  		return nil, status.Errorf(codes.FailedPrecondition, "network %s (%s) is a swarm predefined network and cannot be removed",
  			request.NetworkID, n.Spec.Annotations.Name)
  	}
  
  	if err := rm(n.ID); err != nil {
  		if err == store.ErrNotExist {
  			return nil, status.Errorf(codes.NotFound, "network %s not found", request.NetworkID)
  		}
  		return nil, err
  	}
  	return &api.RemoveNetworkResponse{}, nil
  }
docs: // RemoveNetwork removes a Network referenced by NetworkID.
  // - Returns `InvalidArgument` if NetworkID is not provided.
  // - Returns `NotFound` if the Network is not found.
  // - Returns an error if the deletion fails.