@@ -312,9 +312,8 @@ Get the first page on initial load and store the state (e.g., in memory or a fil
312
312
" next_page_cursor" : pagination.next_page_cursor,
313
313
" has_next_page" : pagination.has_next_page,
314
314
}
315
- # with open("pagination_state.json", "w") as f:
316
- # with open("/tmp/seam_connected_accounts_list.json", "w") as f:
317
- # json.dump(pagination_state, f)
315
+ with open (" /tmp/seam_connected_accounts_list.json" , " w" ) as f:
316
+ json.dump(pagination_state, f)
318
317
319
318
Get the next page at a later time using the stored state:
320
319
@@ -326,15 +325,8 @@ Get the next page at a later time using the stored state:
326
325
seam = Seam()
327
326
328
327
# Example: Load state from where it was stored
329
- # with open("/tmp/seam_connected_accounts_list.json", "r") as f:
330
- # pagination_state = json.load(f)
331
- # Placeholder for loaded state:
332
- pagination_state = {
333
- " params" : {" limit" : 20 },
334
- " next_page_cursor" : " some_cursor_value" ,
335
- " has_next_page" : True ,
336
- }
337
-
328
+ with open (" /tmp/seam_connected_accounts_list.json" , " r" ) as f:
329
+ pagination_state = json.load(f)
338
330
339
331
if pagination_state.get(" has_next_page" ):
340
332
paginator = seam.create_paginator(
0 commit comments