code: def save(self):
          
          if self.path.is_collection:
              self.session.post_json(self.href,
                                     {self.type: dict(self.data)},
                                     cls=ResourceEncoder)
          else:
              self.session.put_json(self.href,
                                    {self.type: dict(self.data)},
                                    cls=ResourceEncoder)
          return self.fetch(exclude_children=True, exclude_back_refs=True)
docs: Save the resource to the API server
  
          If the resource doesn't have a uuid the resource will be created.
          If uuid is present the resource is updated.
  
          :rtype: Resource