@@ -71,6 +71,58 @@ def validate(self, resource_id: str, resource_data: ResourceData | None = None)
7171 )
7272
7373
74+ class BlockableMixin [Model ]:
75+ """Blockable mixin for blocking and unblocking resources."""
76+
77+ def block (self , resource_id : str , resource_data : ResourceData | None = None ) -> Model :
78+ """Block a resource.
79+
80+ Args:
81+ resource_id: Resource ID
82+ resource_data: Resource data will be updated
83+ """
84+ return self ._resource_action ( # type: ignore[attr-defined, no-any-return]
85+ resource_id , "POST" , "block" , json = resource_data
86+ )
87+
88+ def unblock (self , resource_id : str , resource_data : ResourceData | None = None ) -> Model :
89+ """Unblock a resource.
90+
91+ Args:
92+ resource_id: Resource ID
93+ resource_data: Resource data will be updated
94+ """
95+ return self ._resource_action ( # type: ignore[attr-defined, no-any-return]
96+ resource_id , "POST" , "unblock" , json = resource_data
97+ )
98+
99+
100+ class SSOMixin [Model ]:
101+ """SSO mixin for generating SSO URLs for resources."""
102+
103+ def sso (self , resource_id : str , resource_data : ResourceData | None = None ) -> Model :
104+ """SSO a resource.
105+
106+ Args:
107+ resource_id: Resource ID
108+ resource_data: Resource data will be updated
109+ """
110+ return self ._resource_action ( # type: ignore[attr-defined, no-any-return]
111+ resource_id , "POST" , "sso" , json = resource_data
112+ )
113+
114+ def sso_check (self , resource_id : str , resource_data : ResourceData | None = None ) -> Model :
115+ """Check SSO for a resource.
116+
117+ Args:
118+ resource_id: Resource ID
119+ resource_data: Resource data will be updated
120+ """
121+ return self ._resource_action ( # type: ignore[attr-defined, no-any-return]
122+ resource_id , "POST" , "sso-check" , json = resource_data
123+ )
124+
125+
74126class AsyncActivatableMixin [Model ]:
75127 """Async activatable mixin for activating, enabling, disabling and deactivating resources."""
76128
@@ -138,3 +190,55 @@ async def validate(self, resource_id: str, resource_data: ResourceData | None =
138190 return await self ._resource_action ( # type: ignore[attr-defined, no-any-return]
139191 resource_id , "POST" , "validate" , json = resource_data
140192 )
193+
194+
195+ class AsyncBlockableMixin [Model ]:
196+ """Asynchronous Blockable mixin for blocking and unblocking resources."""
197+
198+ async def block (self , resource_id : str , resource_data : ResourceData | None = None ) -> Model :
199+ """Block a resource.
200+
201+ Args:
202+ resource_id: Resource ID
203+ resource_data: Resource data will be updated
204+ """
205+ return await self ._resource_action ( # type: ignore[attr-defined, no-any-return]
206+ resource_id , "POST" , "block" , json = resource_data
207+ )
208+
209+ async def unblock (self , resource_id : str , resource_data : ResourceData | None = None ) -> Model :
210+ """Unblock a resource.
211+
212+ Args:
213+ resource_id: Resource ID
214+ resource_data: Resource data will be updated
215+ """
216+ return await self ._resource_action ( # type: ignore[attr-defined, no-any-return]
217+ resource_id , "POST" , "unblock" , json = resource_data
218+ )
219+
220+
221+ class AsyncSSOMixin [Model ]:
222+ """SSO mixin for generating SSO URLs for resources."""
223+
224+ async def sso (self , resource_id : str , resource_data : ResourceData | None = None ) -> Model :
225+ """SSO a resource.
226+
227+ Args:
228+ resource_id: Resource ID
229+ resource_data: Resource data will be updated
230+ """
231+ return await self ._resource_action ( # type: ignore[attr-defined, no-any-return]
232+ resource_id , "POST" , "sso" , json = resource_data
233+ )
234+
235+ async def sso_check (self , resource_id : str , resource_data : ResourceData | None = None ) -> Model :
236+ """Check SSO for a resource.
237+
238+ Args:
239+ resource_id: Resource ID
240+ resource_data: Resource data will be updated
241+ """
242+ return await self ._resource_action ( # type: ignore[attr-defined, no-any-return]
243+ resource_id , "POST" , "sso-check" , json = resource_data
244+ )
0 commit comments