@@ -17,6 +17,9 @@ class Space(MetablockEntity):
1717 domain : str = Field (description = "The domain of the space" )
1818 org_id : str = Field (description = "The organization id of the space" )
1919 org_name : str = Field (description = "The organization name of the space" )
20+ hosted : bool = Field (
21+ description = "Whether the space is hosted in metablock or self-hosted" ,
22+ )
2023
2124 @property
2225 def blocks (self ) -> SpaceBlocks :
@@ -34,6 +37,10 @@ async def get(self, space_id_or_name: str) -> Space:
3437 data = await self .cli .get (f"{ self .url } /{ space_id_or_name } " )
3538 return Space (root = self , root_path = data ["id" ], ** data )
3639
40+ async def update (self , space_id_or_name : str , ** kwargs : Any ) -> Space :
41+ data = await self .cli .patch (f"{ self .url } /{ space_id_or_name } " , json = kwargs )
42+ return Space (root = self , root_path = data ["id" ], ** data )
43+
3744
3845class Route (BaseModel ):
3946 id : str = Field (description = "The unique identifier of the route" )
@@ -76,6 +83,10 @@ class Block(MetablockEntity):
7683 default_factory = list ,
7784 description = "The routes of the block" ,
7885 )
86+ tags : list [str ] = Field (
87+ default_factory = list ,
88+ description = "An optional set of strings" ,
89+ )
7990 # space: Space = Field(description="The space of the block")
8091
8192 @property
@@ -127,7 +138,7 @@ async def get(self, block_id: str) -> Block:
127138 ** data ,
128139 )
129140
130- async def patch (self , block_id : str , ** kwargs : Any ) -> Block :
141+ async def update (self , block_id : str , ** kwargs : Any ) -> Block :
131142 """Update a block by id"""
132143 data = await self .cli .patch (f"{ self .url } /{ block_id } " , json = kwargs )
133144 return Block (
0 commit comments