Skip to content

Commit

Permalink
Add refresh method.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Feb 6, 2024
1 parent cc4b471 commit 623d025
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tiled/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ def __repr__(self):
def context(self):
return self._context

def refresh(self):
content = handle_error(
self.context.http_client.get(
self.uri,
headers={"Accept": MSGPACK_MIME_TYPE},
params={"include_data_sources": self._include_data_sources},
)
).json()
self._item = content["data"]
return self

@property
def item(self):
"JSON payload describing this item. Mostly for internal use."
Expand Down

0 comments on commit 623d025

Please sign in to comment.