2525 FunctionInputsValidationError ,
2626 UnsupportedFunctionClassError ,
2727)
28- from pydantic import PositiveInt
28+ from models_library . users import UserID
2929from servicelib .fastapi .dependencies import get_reverse_url_mapper
3030from simcore_service_api_server ._service_jobs import JobService
3131
7272)
7373async def register_function (
7474 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
75- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
75+ user_id : Annotated [UserID , Depends (get_current_user_id )],
7676 function : Function ,
7777) -> RegisteredFunction :
7878 return await wb_api_rpc .register_function (user_id = user_id , function = function )
@@ -92,7 +92,7 @@ async def register_function(
9292async def get_function (
9393 function_id : FunctionID ,
9494 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
95- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
95+ user_id : Annotated [UserID , Depends (get_current_user_id )],
9696) -> RegisteredFunction :
9797 return await wb_api_rpc .get_function (function_id = function_id , user_id = user_id )
9898
@@ -110,7 +110,7 @@ async def get_function(
110110async def list_functions (
111111 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
112112 page_params : Annotated [PaginationParams , Depends ()],
113- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
113+ user_id : Annotated [UserID , Depends (get_current_user_id )],
114114):
115115 functions_list , meta = await wb_api_rpc .list_functions (
116116 pagination_offset = page_params .offset ,
@@ -139,7 +139,7 @@ async def list_function_jobs_for_functionid(
139139 function_id : FunctionID ,
140140 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
141141 page_params : Annotated [PaginationParams , Depends ()],
142- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
142+ user_id : Annotated [UserID , Depends (get_current_user_id )],
143143):
144144 function_jobs_list , meta = await wb_api_rpc .list_function_jobs (
145145 pagination_offset = page_params .offset ,
@@ -170,7 +170,7 @@ async def update_function_title(
170170 function_id : FunctionID ,
171171 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
172172 title : str ,
173- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
173+ user_id : Annotated [UserID , Depends (get_current_user_id )],
174174) -> RegisteredFunction :
175175 returned_function = await wb_api_rpc .update_function_title (
176176 function_id = function_id , title = title , user_id = user_id
@@ -196,7 +196,7 @@ async def update_function_description(
196196 function_id : FunctionID ,
197197 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
198198 description : str ,
199- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
199+ user_id : Annotated [UserID , Depends (get_current_user_id )],
200200) -> RegisteredFunction :
201201 returned_function = await wb_api_rpc .update_function_description (
202202 function_id = function_id , description = description , user_id = user_id
@@ -235,7 +235,7 @@ def _join_inputs(
235235async def get_function_inputschema (
236236 function_id : FunctionID ,
237237 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
238- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
238+ user_id : Annotated [UserID , Depends (get_current_user_id )],
239239) -> FunctionInputSchema :
240240 function = await wb_api_rpc .get_function (function_id = function_id , user_id = user_id )
241241 return function .input_schema
@@ -255,7 +255,7 @@ async def get_function_inputschema(
255255async def get_function_outputschema (
256256 function_id : FunctionID ,
257257 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
258- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
258+ user_id : Annotated [UserID , Depends (get_current_user_id )],
259259) -> FunctionOutputSchema :
260260 function = await wb_api_rpc .get_function (function_id = function_id , user_id = user_id )
261261 return function .output_schema
@@ -279,7 +279,7 @@ async def validate_function_inputs(
279279 function_id : FunctionID ,
280280 inputs : FunctionInputs ,
281281 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
282- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
282+ user_id : Annotated [UserID , Depends (get_current_user_id )],
283283) -> tuple [bool , str ]:
284284 function = await wb_api_rpc .get_function (function_id = function_id , user_id = user_id )
285285
@@ -320,7 +320,7 @@ async def run_function( # noqa: PLR0913
320320 director2_api : Annotated [DirectorV2Api , Depends (get_api_client (DirectorV2Api ))],
321321 function_id : FunctionID ,
322322 function_inputs : FunctionInputs ,
323- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
323+ user_id : Annotated [UserID , Depends (get_current_user_id )],
324324 product_name : Annotated [str , Depends (get_product_name )],
325325 solver_service : Annotated [SolverService , Depends (get_solver_service )],
326326 job_service : Annotated [JobService , Depends (get_job_service )],
@@ -437,7 +437,7 @@ async def run_function( # noqa: PLR0913
437437async def delete_function (
438438 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
439439 function_id : FunctionID ,
440- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
440+ user_id : Annotated [UserID , Depends (get_current_user_id )],
441441) -> None :
442442 return await wb_api_rpc .delete_function (function_id = function_id , user_id = user_id )
443443
@@ -469,7 +469,7 @@ async def map_function( # noqa: PLR0913
469469 webserver_api : Annotated [AuthSession , Depends (get_webserver_session )],
470470 url_for : Annotated [Callable , Depends (get_reverse_url_mapper )],
471471 director2_api : Annotated [DirectorV2Api , Depends (get_api_client (DirectorV2Api ))],
472- user_id : Annotated [PositiveInt , Depends (get_current_user_id )],
472+ user_id : Annotated [UserID , Depends (get_current_user_id )],
473473 product_name : Annotated [str , Depends (get_product_name )],
474474 solver_service : Annotated [SolverService , Depends (get_solver_service )],
475475 job_service : Annotated [JobService , Depends (get_job_service )],
0 commit comments