""" Representation of a Tag object """ try: from urllib.parse import quote # Python3 except ImportError: from urllib import quote # Python2 from trovebox.errors import TroveboxError from .trovebox_object import TroveboxObject class Tag(TroveboxObject): """ Representation of a Tag object """ _type = "tag" def delete(self, **kwds): """ Endpoint: /tag//delete.json Deletes this tag. Returns True if successful. Raises a TroveboxError if not. """ result = self._client.post("/tag/%s/delete.json" % quote(self.id), **kwds)["result"] if not result: raise TroveboxError("Delete response returned False") self._delete_fields() return result def update(self, **kwds): """ Endpoint: /tag//update.json Updates this tag with the specified parameters. Returns the updated tag object. """ result = self._client.post("/tag/%s/update.json" % quote(self.id), **kwds)["result"] self._replace_fields(result) # def view(self, **kwds):