6969 ProjectForbiddenRpcError ,
7070 ProjectNotFoundRpcError ,
7171)
72- from servicelib .rabbitmq .rpc_interfaces .webserver .functions import (
73- functions_rpc_interface ,
74- )
75- from servicelib .rabbitmq .rpc_interfaces .webserver .licenses .licensed_items import (
76- checkout_licensed_item_for_wallet as _checkout_licensed_item_for_wallet ,
77- )
78- from servicelib .rabbitmq .rpc_interfaces .webserver .licenses .licensed_items import (
79- get_available_licensed_items_for_wallet as _get_available_licensed_items_for_wallet ,
80- )
81- from servicelib .rabbitmq .rpc_interfaces .webserver .licenses .licensed_items import (
82- get_licensed_items as _get_licensed_items ,
83- )
84- from servicelib .rabbitmq .rpc_interfaces .webserver .licenses .licensed_items import (
85- release_licensed_item_for_wallet as _release_licensed_item_for_wallet ,
86- )
72+ from servicelib .rabbitmq .rpc_interfaces .webserver .licenses import licensed_items
8773from servicelib .rabbitmq .rpc_interfaces .webserver .v1 import WebServerRpcClient
8874from simcore_service_api_server .models .basic_types import NameValueTuple
8975
@@ -146,7 +132,7 @@ class WbApiRpcClient(SingletonInAppStateMixin):
146132 async def get_licensed_items (
147133 self , * , product_name : ProductName , page_params : PaginationParams
148134 ) -> Page [LicensedItemGet ]:
149- licensed_items_page = await _get_licensed_items (
135+ licensed_items_page = await licensed_items . get_licensed_items (
150136 rabbitmq_rpc_client = self ._client ,
151137 product_name = product_name ,
152138 offset = page_params .offset ,
@@ -165,13 +151,15 @@ async def get_available_licensed_items_for_wallet(
165151 user_id : UserID ,
166152 page_params : PaginationParams ,
167153 ) -> Page [LicensedItemGet ]:
168- licensed_items_page = await _get_available_licensed_items_for_wallet (
169- rabbitmq_rpc_client = self ._client ,
170- product_name = product_name ,
171- wallet_id = wallet_id ,
172- user_id = user_id ,
173- offset = page_params .offset ,
174- limit = page_params .limit ,
154+ licensed_items_page = (
155+ await licensed_items .get_available_licensed_items_for_wallet (
156+ rabbitmq_rpc_client = self ._client ,
157+ product_name = product_name ,
158+ wallet_id = wallet_id ,
159+ user_id = user_id ,
160+ offset = page_params .offset ,
161+ limit = page_params .limit ,
162+ )
175163 )
176164 return _create_licensed_items_get_page (
177165 licensed_items_page = licensed_items_page , page_params = page_params
@@ -195,14 +183,16 @@ async def checkout_licensed_item_for_wallet(
195183 num_of_seats : int ,
196184 service_run_id : ServiceRunID ,
197185 ) -> LicensedItemCheckoutGet :
198- licensed_item_checkout_get = await _checkout_licensed_item_for_wallet (
199- self ._client ,
200- product_name = product_name ,
201- user_id = user_id ,
202- wallet_id = wallet_id ,
203- licensed_item_id = licensed_item_id ,
204- num_of_seats = num_of_seats ,
205- service_run_id = service_run_id ,
186+ licensed_item_checkout_get = (
187+ await licensed_items .checkout_licensed_item_for_wallet (
188+ self ._client ,
189+ product_name = product_name ,
190+ user_id = user_id ,
191+ wallet_id = wallet_id ,
192+ licensed_item_id = licensed_item_id ,
193+ num_of_seats = num_of_seats ,
194+ service_run_id = service_run_id ,
195+ )
206196 )
207197 return LicensedItemCheckoutGet (
208198 licensed_item_checkout_id = licensed_item_checkout_get .licensed_item_checkout_id ,
@@ -229,11 +219,13 @@ async def release_licensed_item_for_wallet(
229219 user_id : UserID ,
230220 licensed_item_checkout_id : LicensedItemCheckoutID ,
231221 ) -> LicensedItemCheckoutGet :
232- licensed_item_checkout_get = await _release_licensed_item_for_wallet (
233- self ._client ,
234- product_name = product_name ,
235- user_id = user_id ,
236- licensed_item_checkout_id = licensed_item_checkout_id ,
222+ licensed_item_checkout_get = (
223+ await licensed_items .release_licensed_item_for_wallet (
224+ self ._client ,
225+ product_name = product_name ,
226+ user_id = user_id ,
227+ licensed_item_checkout_id = licensed_item_checkout_id ,
228+ )
237229 )
238230 return LicensedItemCheckoutGet (
239231 licensed_item_checkout_id = licensed_item_checkout_get .licensed_item_checkout_id ,
@@ -321,8 +313,7 @@ async def list_projects_marked_as_jobs(
321313 async def register_function (
322314 self , * , user_id : UserID , product_name : ProductName , function : Function
323315 ) -> RegisteredFunction :
324- return await functions_rpc_interface .register_function (
325- self ._client ,
316+ return await self ._rpc_client .functions .register_function (
326317 function = function ,
327318 user_id = user_id ,
328319 product_name = product_name ,
@@ -331,8 +322,7 @@ async def register_function(
331322 async def get_function (
332323 self , * , user_id : UserID , product_name : ProductName , function_id : FunctionID
333324 ) -> RegisteredFunction :
334- return await functions_rpc_interface .get_function (
335- self ._client ,
325+ return await self ._rpc_client .functions .get_function (
336326 user_id = user_id ,
337327 product_name = product_name ,
338328 function_id = function_id ,
@@ -341,8 +331,7 @@ async def get_function(
341331 async def delete_function (
342332 self , * , user_id : UserID , product_name : ProductName , function_id : FunctionID
343333 ) -> None :
344- return await functions_rpc_interface .delete_function (
345- self ._client ,
334+ return await self ._rpc_client .functions .delete_function (
346335 user_id = user_id ,
347336 product_name = product_name ,
348337 function_id = function_id ,
@@ -357,8 +346,7 @@ async def list_functions(
357346 pagination_limit : PageLimitInt = DEFAULT_NUMBER_OF_ITEMS_PER_PAGE ,
358347 ) -> tuple [list [RegisteredFunction ], PageMetaInfoLimitOffset ]:
359348
360- return await functions_rpc_interface .list_functions (
361- self ._client ,
349+ return await self ._rpc_client .functions .list_functions (
362350 user_id = user_id ,
363351 product_name = product_name ,
364352 pagination_offset = pagination_offset ,
@@ -376,8 +364,7 @@ async def list_function_jobs(
376364 filter_by_function_job_ids : list [FunctionJobID ] | None = None ,
377365 filter_by_function_job_collection_id : FunctionJobCollectionID | None = None ,
378366 ) -> tuple [list [RegisteredFunctionJob ], PageMetaInfoLimitOffset ]:
379- return await functions_rpc_interface .list_function_jobs (
380- self ._client ,
367+ return await self ._rpc_client .functions .list_function_jobs (
381368 user_id = user_id ,
382369 product_name = product_name ,
383370 pagination_offset = pagination_offset ,
@@ -401,8 +388,7 @@ async def list_function_jobs_with_status(
401388 list [RegisteredFunctionJobWithStatus ],
402389 PageMetaInfoLimitOffset ,
403390 ]:
404- return await functions_rpc_interface .list_function_jobs_with_status (
405- self ._client ,
391+ return await self ._rpc_client .functions .list_function_jobs_with_status (
406392 user_id = user_id ,
407393 product_name = product_name ,
408394 pagination_offset = pagination_offset ,
@@ -421,8 +407,7 @@ async def list_function_job_collections(
421407 pagination_limit : PageLimitInt = DEFAULT_NUMBER_OF_ITEMS_PER_PAGE ,
422408 filters : FunctionJobCollectionsListFilters | None = None ,
423409 ) -> tuple [list [RegisteredFunctionJobCollection ], PageMetaInfoLimitOffset ]:
424- return await functions_rpc_interface .list_function_job_collections (
425- self ._client ,
410+ return await self ._rpc_client .functions .list_function_job_collections (
426411 user_id = user_id ,
427412 product_name = product_name ,
428413 pagination_offset = pagination_offset ,
@@ -438,8 +423,7 @@ async def run_function(
438423 function_id : FunctionID ,
439424 inputs : FunctionInputs ,
440425 ) -> RegisteredFunctionJob :
441- return await functions_rpc_interface .run_function (
442- self ._client ,
426+ return await self ._rpc_client .functions .run_function (
443427 user_id = user_id ,
444428 product_name = product_name ,
445429 function_id = function_id ,
@@ -453,8 +437,7 @@ async def get_function_job(
453437 product_name : ProductName ,
454438 function_job_id : FunctionJobID ,
455439 ) -> RegisteredFunctionJob :
456- return await functions_rpc_interface .get_function_job (
457- self ._client ,
440+ return await self ._rpc_client .functions .get_function_job (
458441 user_id = user_id ,
459442 product_name = product_name ,
460443 function_job_id = function_job_id ,
@@ -468,8 +451,7 @@ async def update_function_title(
468451 function_id : FunctionID ,
469452 title : str ,
470453 ) -> RegisteredFunction :
471- return await functions_rpc_interface .update_function_title (
472- self ._client ,
454+ return await self ._rpc_client .functions .update_function_title (
473455 user_id = user_id ,
474456 product_name = product_name ,
475457 function_id = function_id ,
@@ -484,8 +466,7 @@ async def update_function_description(
484466 function_id : FunctionID ,
485467 description : str ,
486468 ) -> RegisteredFunction :
487- return await functions_rpc_interface .update_function_description (
488- self ._client ,
469+ return await self ._rpc_client .functions .update_function_description (
489470 user_id = user_id ,
490471 product_name = product_name ,
491472 function_id = function_id ,
@@ -499,8 +480,7 @@ async def delete_function_job(
499480 product_name : ProductName ,
500481 function_job_id : FunctionJobID ,
501482 ) -> None :
502- return await functions_rpc_interface .delete_function_job (
503- self ._client ,
483+ return await self ._rpc_client .functions .delete_function_job (
504484 user_id = user_id ,
505485 product_name = product_name ,
506486 function_job_id = function_job_id ,
@@ -509,8 +489,7 @@ async def delete_function_job(
509489 async def register_function_job (
510490 self , * , user_id : UserID , function_job : FunctionJob , product_name : ProductName
511491 ) -> RegisteredFunctionJob :
512- return await functions_rpc_interface .register_function_job (
513- self ._client ,
492+ return await self ._rpc_client .functions .register_function_job (
514493 user_id = user_id ,
515494 product_name = product_name ,
516495 function_job = function_job ,
@@ -524,8 +503,7 @@ async def patch_registered_function_job(
524503 function_job_id : FunctionJobID ,
525504 registered_function_job_patch : RegisteredFunctionJobPatch ,
526505 ) -> RegisteredFunctionJob :
527- return await functions_rpc_interface .patch_registered_function_job (
528- self ._client ,
506+ return await self ._rpc_client .functions .patch_registered_function_job (
529507 user_id = user_id ,
530508 product_name = product_name ,
531509 function_job_uuid = function_job_id ,
@@ -535,8 +513,7 @@ async def patch_registered_function_job(
535513 async def get_function_input_schema (
536514 self , * , user_id : UserID , product_name : ProductName , function_id : FunctionID
537515 ) -> FunctionInputSchema :
538- return await functions_rpc_interface .get_function_input_schema (
539- self ._client ,
516+ return await self ._rpc_client .functions .get_function_input_schema (
540517 user_id = user_id ,
541518 product_name = product_name ,
542519 function_id = function_id ,
@@ -545,8 +522,7 @@ async def get_function_input_schema(
545522 async def get_function_output_schema (
546523 self , * , user_id : UserID , product_name : ProductName , function_id : FunctionID
547524 ) -> FunctionOutputSchema :
548- return await functions_rpc_interface .get_function_output_schema (
549- self ._client ,
525+ return await self ._rpc_client .functions .get_function_output_schema (
550526 user_id = user_id ,
551527 product_name = product_name ,
552528 function_id = function_id ,
@@ -559,8 +535,7 @@ async def get_function_job_status(
559535 product_name : ProductName ,
560536 function_job_id : FunctionJobID ,
561537 ) -> FunctionJobStatus :
562- return await functions_rpc_interface .get_function_job_status (
563- self ._client ,
538+ return await self ._rpc_client .functions .get_function_job_status (
564539 user_id = user_id ,
565540 product_name = product_name ,
566541 function_job_id = function_job_id ,
@@ -573,8 +548,7 @@ async def get_function_job_outputs(
573548 product_name : ProductName ,
574549 function_job_id : FunctionJobID ,
575550 ) -> FunctionOutputs :
576- return await functions_rpc_interface .get_function_job_outputs (
577- self ._client ,
551+ return await self ._rpc_client .functions .get_function_job_outputs (
578552 user_id = user_id ,
579553 product_name = product_name ,
580554 function_job_id = function_job_id ,
@@ -589,8 +563,7 @@ async def update_function_job_status(
589563 job_status : FunctionJobStatus ,
590564 check_write_permissions : bool = True ,
591565 ) -> FunctionJobStatus :
592- return await functions_rpc_interface .update_function_job_status (
593- self ._client ,
566+ return await self ._rpc_client .functions .update_function_job_status (
594567 function_job_id = function_job_id ,
595568 user_id = user_id ,
596569 product_name = product_name ,
@@ -607,8 +580,7 @@ async def update_function_job_outputs(
607580 outputs : FunctionOutputs ,
608581 check_write_permissions : bool = True ,
609582 ) -> FunctionOutputs :
610- return await functions_rpc_interface .update_function_job_outputs (
611- self ._client ,
583+ return await self ._rpc_client .functions .update_function_job_outputs (
612584 function_job_id = function_job_id ,
613585 user_id = user_id ,
614586 product_name = product_name ,
@@ -624,8 +596,7 @@ async def find_cached_function_jobs(
624596 function_id : FunctionID ,
625597 inputs : FunctionInputs ,
626598 ) -> list [RegisteredFunctionJob ] | None :
627- return await functions_rpc_interface .find_cached_function_jobs (
628- self ._client ,
599+ return await self ._rpc_client .functions .find_cached_function_jobs (
629600 user_id = user_id ,
630601 product_name = product_name ,
631602 function_id = function_id ,
@@ -639,8 +610,7 @@ async def get_function_job_collection(
639610 product_name : ProductName ,
640611 function_job_collection_id : FunctionJobCollectionID ,
641612 ) -> RegisteredFunctionJobCollection :
642- return await functions_rpc_interface .get_function_job_collection (
643- self ._client ,
613+ return await self ._rpc_client .functions .get_function_job_collection (
644614 user_id = user_id ,
645615 product_name = product_name ,
646616 function_job_collection_id = function_job_collection_id ,
@@ -653,8 +623,7 @@ async def register_function_job_collection(
653623 function_job_collection : FunctionJobCollection ,
654624 product_name : ProductName ,
655625 ) -> RegisteredFunctionJobCollection :
656- return await functions_rpc_interface .register_function_job_collection (
657- self ._client ,
626+ return await self ._rpc_client .functions .register_function_job_collection (
658627 user_id = user_id ,
659628 function_job_collection = function_job_collection ,
660629 product_name = product_name ,
@@ -667,8 +636,7 @@ async def delete_function_job_collection(
667636 product_name : ProductName ,
668637 function_job_collection_id : FunctionJobCollectionID ,
669638 ) -> None :
670- return await functions_rpc_interface .delete_function_job_collection (
671- self ._client ,
639+ return await self ._rpc_client .functions .delete_function_job_collection (
672640 user_id = user_id ,
673641 product_name = product_name ,
674642 function_job_collection_id = function_job_collection_id ,
@@ -681,8 +649,7 @@ async def get_function_user_permissions(
681649 product_name : ProductName ,
682650 function_id : FunctionID ,
683651 ) -> FunctionUserAccessRights :
684- return await functions_rpc_interface .get_function_user_permissions (
685- self ._client ,
652+ return await self ._rpc_client .functions .get_function_user_permissions (
686653 user_id = user_id ,
687654 product_name = product_name ,
688655 function_id = function_id ,
@@ -694,8 +661,7 @@ async def get_functions_user_api_access_rights(
694661 user_id : UserID ,
695662 product_name : ProductName ,
696663 ) -> FunctionUserApiAccessRights :
697- return await functions_rpc_interface .get_functions_user_api_access_rights (
698- self ._client ,
664+ return await self ._rpc_client .functions .get_functions_user_api_access_rights (
699665 user_id = user_id ,
700666 product_name = product_name ,
701667 )
0 commit comments