@@ -32,7 +32,7 @@ class Spaces(MetablockComponent):
3232
3333 async def get (self , space_id_or_name : str ) -> Space :
3434 data = await self .cli .get (f"{ self .url } /{ space_id_or_name } " )
35- return Space (root = self . cli , root_path = data ["id" ], ** data )
35+ return Space (root = self , root_path = data ["id" ], ** data )
3636
3737
3838class Route (BaseModel ):
@@ -82,9 +82,6 @@ class Block(MetablockEntity):
8282 def deployments (self ) -> Deployments :
8383 return Deployments (root = self , root_path = "deployments" )
8484
85- async def config (self , * , callback : Any = None ) -> dict :
86- return await self .cli .get (f"{ self .url } /config" , callback = callback )
87-
8885 async def certificate (self ) -> Certificate :
8986 data = await self .cli .get (f"{ self .url } /certificate" )
9087 return Certificate (** data )
@@ -124,7 +121,7 @@ async def get(self, block_id: str) -> Block:
124121 """Get a block by id"""
125122 data = await self .cli .get (f"{ self .url } /{ block_id } " )
126123 return Block (
127- root = self . cli ,
124+ root = self ,
128125 root_path = data ["id" ],
129126 is_root = data .pop ("root" , False ),
130127 ** data ,
@@ -134,7 +131,7 @@ async def patch(self, block_id: str, **kwargs: Any) -> Block:
134131 """Update a block by id"""
135132 data = await self .cli .patch (f"{ self .url } /{ block_id } " , json = kwargs )
136133 return Block (
137- root = self . cli ,
134+ root = self ,
138135 root_path = data ["id" ],
139136 is_root = data .pop ("root" , False ),
140137 ** data ,
@@ -146,15 +143,20 @@ async def get_list(self) -> list[Block]:
146143 """Get a list of blocks in the space"""
147144 data = await self .cli .get (self .url )
148145 return [
149- Block (root = self .cli , root_path = s ["id" ], is_root = s .pop ("root" , False ), ** s )
146+ Block (
147+ root = self .cli .blocks ,
148+ root_path = s ["id" ],
149+ is_root = s .pop ("root" , False ),
150+ ** s ,
151+ )
150152 for s in data
151153 ]
152154
153155 async def create (self , name : str , ** kwargs : Any ) -> Block :
154156 """Create a new block in the space"""
155157 data = await self .cli .post (self .url , json = dict (name = name , ** kwargs ))
156158 return Block (
157- root = self .cli ,
159+ root = self .cli . cli ,
158160 root_path = data ["id" ],
159161 is_root = data .pop ("root" , False ),
160162 ** data ,
0 commit comments