code: def update(self, title, rulegroups):
          
          body = {
              "Title": title,
              "RuleGroups": rulegroups}
          response = self._put("/segments/%s.json" %
                               self.segment_id, json.dumps(body))
docs: Updates this segment.