Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions anytype_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,27 @@ def delete_space(self, space_id: str) -> bool:
return True

# Object methods
def list_objects(self, space_id: str,) -> Object:
"""Get an object by ID.

Args:
space_id: ID of the space containing the object.

Returns:
Object with the specified ID.
"""
response = self.request("GET", f"spaces/{space_id}/objects")
# Handle the actual API response format with 'data' key
if isinstance(response, dict) and "data" in response and isinstance(response["data"], list):
objects = []
for objects_data in response["data"]:
try:
objects.append(Object.model_validate(objects_data))
except Exception:
logger.error(f"Failed to parse objects data: {space_data}")
raise
return objects

def get_object(self, space_id: str, object_id: str) -> Object:
"""Get an object by ID.

Expand Down