2222 ClientCheckRequest ,
2323 construct_check_request ,
2424)
25+ from openfga_sdk .client .models .client_batch_check_response import ClientBatchCheckClientResponse
2526from openfga_sdk .client .models .expand_request import ClientExpandRequest
2627from openfga_sdk .client .models .list_objects_request import ClientListObjectsRequest
2728from openfga_sdk .client .models .list_relations_request import ClientListRelationsRequest
@@ -115,7 +116,7 @@ def options_to_transaction_info(options: dict[str, int | str] = None):
115116 return WriteTransactionOpts ()
116117
117118
118- def _check_allowed (response : BatchCheckResponse ):
119+ def _check_allowed (response : ClientBatchCheckClientResponse ):
119120 """
120121 Helper function to return whether the response is check is allowed
121122 """
@@ -571,7 +572,7 @@ async def check(self, body: ClientCheckRequest, options: dict[str, str] = None):
571572 api_response = await self ._api .check (body = req_body , ** kwargs )
572573 return api_response
573574
574- async def _single_batch_check (
575+ async def _single_client_batch_check (
575576 self ,
576577 body : ClientCheckRequest ,
577578 semaphore : asyncio .Semaphore ,
@@ -585,7 +586,7 @@ async def _single_batch_check(
585586 await semaphore .acquire ()
586587 try :
587588 api_response = await self .check (body , options )
588- return BatchCheckResponse (
589+ return ClientBatchCheckClientResponse (
589590 allowed = api_response .allowed ,
590591 request = body ,
591592 response = api_response ,
@@ -594,13 +595,13 @@ async def _single_batch_check(
594595 except (AuthenticationError , UnauthorizedException ) as err :
595596 raise err
596597 except Exception as err :
597- return BatchCheckResponse (
598+ return ClientBatchCheckClientResponse (
598599 allowed = False , request = body , response = None , error = err
599600 )
600601 finally :
601602 semaphore .release ()
602603
603- async def batch_check (
604+ async def client_batch_check (
604605 self , body : list [ClientCheckRequest ], options : dict [str , str | int ] = None
605606 ):
606607 """
@@ -630,7 +631,7 @@ async def batch_check(
630631
631632 sem = asyncio .Semaphore (max_parallel_requests )
632633 batch_check_coros = [
633- self ._single_batch_check (request , sem , options ) for request in body
634+ self ._single_client_batch_check (request , sem , options ) for request in body
634635 ]
635636 batch_check_response = await asyncio .gather (* batch_check_coros )
636637
@@ -718,7 +719,7 @@ async def list_relations(
718719 )
719720 for i in body .relations
720721 ]
721- result = await self .batch_check (request_body , options )
722+ result = await self .client_batch_check (request_body , options )
722723 # need to filter with the allowed response
723724 result_iterator = filter (_check_allowed , result )
724725 result_list = list (result_iterator )
0 commit comments