8
8
from office365 .runtime .auth .client_credential import ClientCredential
9
9
from office365 .runtime .auth .token_response import TokenResponse
10
10
from office365 .runtime .auth .user_credential import UserCredential
11
+ from office365 .runtime .client_object import ClientObject
11
12
from office365 .runtime .client_result import ClientResult
12
13
from office365 .runtime .client_runtime_context import ClientRuntimeContext
13
14
from office365 .runtime .compat import get_absolute_url , urlparse
@@ -197,11 +198,11 @@ def with_credentials(self, credentials, environment="commercial"):
197
198
return self
198
199
199
200
def execute_batch (self , items_per_batch = 100 , success_callback = None ):
200
- # type: (int, Callable[[int ], None]) -> Self
201
+ # type: (int, Callable[[List[ClientObject|ClientResult] ], None]) -> Self
201
202
"""
202
203
Construct and submit to a server a batch request
203
204
:param int items_per_batch: Maximum to be selected for bulk operation
204
- :param (int )-> None success_callback: A success callback
205
+ :param (List[ClientObject|ClientResult] )-> None success_callback: A success callback
205
206
"""
206
207
batch_request = ODataBatchV3Request (JsonLightFormat ())
207
208
batch_request .beforeExecute += self ._authenticate_request
@@ -210,7 +211,7 @@ def execute_batch(self, items_per_batch=100, success_callback=None):
210
211
qry = self ._get_next_query (items_per_batch )
211
212
batch_request .execute_query (qry )
212
213
if callable (success_callback ):
213
- success_callback (items_per_batch )
214
+ success_callback (qry . return_type )
214
215
return self
215
216
216
217
def pending_request (self ):
0 commit comments