photo-python/trovebox/objects/tag.py
sneakypete81 86ba0914c8 Refactor the smarts into the api classes.
The object classes are now simple wrappers.
Improve parameter testing, by passing foo="bar" where possible.
2013-09-10 17:45:53 +01:00

32 lines
804 B
Python

"""
Representation of a Tag object
"""
from .trovebox_object import TroveboxObject
class Tag(TroveboxObject):
""" Representation of a Tag object """
_type = "tag"
def delete(self, **kwds):
"""
Endpoint: /tag/<id>/delete.json
Deletes this tag.
Returns True if successful.
Raises a TroveboxError if not.
"""
result = self._client.tag.delete(self, **kwds)
self._delete_fields()
return result
def update(self, **kwds):
"""
Endpoint: /tag/<id>/update.json
Updates this tag with the specified parameters.
Returns the updated tag object.
"""
result = self._client.tag.update(self, **kwds)
self._replace_fields(result.get_fields())
# def view(self, **kwds):