code: def save(self):
          
          # Object probably exists if it has an ID (user can't assign
          # one).  The only objects that don't have an ID are those that
          # cannot list.
          if self.can_put and (not self.can_list or self.id):
              # The JSS will reject PUT requests for objects that do not have
              # a category. The JSS assigns a name of "No category assigned",
              # which it will reject. Therefore, if that is the category
              # name, changed it to "", which is accepted.
              categories = [elem for elem in self.findall("category")]
              categories.extend([elem for elem in self.findall("category/name")])
              for cat_tag in categories:
                  if cat_tag.text == "No category assigned":
                      cat_tag.text = ""
  
              try:
                  self.jss.put(self.url, self)
                  updated_data = self.jss.get(self.url)
              except JSSPutError as put_error:
                  # Something when wrong.
                  raise JSSPutError(put_error)
          elif self.can_post:
              url = self.get_post_url()
              try:
                  updated_data = self.jss.post(self.__class__, url, self)
              except JSSPostError as err:
                  raise JSSPostError(err)
          else:
              raise JSSMethodNotAllowedError(self.__class__.__name__)
  
          # Replace current instance's data with new, JSS-validated data.
          self.clear()
          for child in updated_data.getchildren():
              self._children.append(child)
docs: Update or create a new object on the JSS.
  
          If this object is not yet on the JSS, this method will create
          a new object with POST, otherwise, it will try to update the
          existing object with PUT.
  
          Data validation is up to the client; The JSS in most cases will
          at least give you some hints as to what is invalid.