def add_self_service_category(new_cat, display_in: true, feature_in: false)
      new_cat = JSS::Category.map_all_ids_to(:name, api: @api)[new_cat] if new_cat.is_a? Integer
      feature_in = false if display_in == false
      raise JSS::NoSuchItemError, "No category '#{new_cat}' in the JSS" unless JSS::Category.all_names(:refresh, api: @api).include? new_cat

      raise JSS::InvalidDataError, 'display_in must be true or false' unless display_in.jss_boolean?

      raise JSS::InvalidDataError, 'feature_in must be true or false' unless feature_in.jss_boolean?

      new_data = { name: new_cat }
      new_data[:display_in] = display_in if @self_service_data_config[:can_display_in_categories]
      new_data[:feature_in] = feature_in if @self_service_data_config[:can_feature_in_categories]

      # see if this category is already among our categories.
      idx = @self_service_categories.index { |c| c[:name] == new_cat }

      if idx
        @self_service_categories[idx] = new_data
      else
        @self_service_categories << new_data
      end

      @need_to_update = true
    end
def add_self_service_category(new_cat, display_in: true, feature_in: false)
      new_cat = JSS::Category.map_all_ids_to(:name, api: @api)[new_cat] if new_cat.is_a? Integer
      feature_in = false if display_in == false
      raise JSS::NoSuchItemError, "No category '#{new_cat}' in the JSS" unless JSS::Category.all_names(:refresh, api: @api).include? new_cat

      raise JSS::InvalidDataError, 'display_in must be true or false' unless display_in.jss_boolean?

      raise JSS::InvalidDataError, 'feature_in must be true or false' unless feature_in.jss_boolean?

      new_data = { name: new_cat }
      new_data[:display_in] = display_in if @self_service_data_config[:can_display_in_categories]
      new_data[:feature_in] = feature_in if @self_service_data_config[:can_feature_in_categories]

      # see if this category is already among our categories.
      idx = @self_service_categories.index { |c| c[:name] == new_cat }

      if idx
        @self_service_categories[idx] = new_data
      else
        @self_service_categories << new_data
      end

      @need_to_update = true
    end
Add or change one of the categories for this item in self service

 @param new_cat[String, Integer] the name or id of a category where this
   object should appear in SelfSvc

 @param display_in[Boolean] should this item appear in the SelfSvc page for
  the category? Only meaningful in applicable classes

 @param feature_in[Boolean] should this item be featured in the SelfSvc page
   for the category? Only meaningful in applicable classes.
   NOTE: this will always be false if display_in is false.

 @return [void]