@@ -53,13 +53,38 @@ public async Task<ListFinancialEventGroupsPayload> GetFinancialEventGroupListByN
53
53
}
54
54
55
55
56
- public FinancialEvents ListFinancialEventsByGroupId ( string eventGroupId ) =>
56
+ public List < FinancialEvents > ListFinancialEventsByGroupId ( string eventGroupId ) =>
57
57
Task . Run ( ( ) => ListFinancialEventsByGroupIdAsync ( eventGroupId ) ) . ConfigureAwait ( false ) . GetAwaiter ( ) . GetResult ( ) ;
58
- public async Task < FinancialEvents > ListFinancialEventsByGroupIdAsync ( string eventGroupId )
58
+ public async Task < List < FinancialEvents > > ListFinancialEventsByGroupIdAsync ( string eventGroupId )
59
59
{
60
60
await CreateAuthorizedRequestAsync ( FinanceApiUrls . ListFinancialEventsByGroupId ( eventGroupId ) , RestSharp . Method . GET ) ;
61
61
var response = await ExecuteRequestAsync < ListFinancialEventsResponse > ( RateLimitType . Financial_ListFinancialEventsByGroupId ) ;
62
- return response . Payload . FinancialEvents ;
62
+
63
+ var nextToken = response . Payload . NextToken ;
64
+
65
+ var list = new List < FinancialEvents > ( ) ;
66
+ list . Add ( response . Payload . FinancialEvents ) ;
67
+
68
+ while ( ! string . IsNullOrEmpty ( nextToken ) )
69
+ {
70
+ var data = await ListFinancialEventsByGroupIdByNextTokenAsync ( eventGroupId , nextToken ) ;
71
+ if ( data . Payload != null && data . Payload . FinancialEvents != null )
72
+ {
73
+ list . Add ( data . Payload . FinancialEvents ) ;
74
+ }
75
+ nextToken = data . Payload . NextToken ;
76
+ }
77
+
78
+ return list ;
79
+ }
80
+ private async Task < ListFinancialEventsResponse > ListFinancialEventsByGroupIdByNextTokenAsync ( string eventGroupId , string nextToken )
81
+ {
82
+ List < KeyValuePair < string , string > > queryParameters = new List < KeyValuePair < string , string > > ( ) ;
83
+ queryParameters . Add ( new KeyValuePair < string , string > ( "NextToken" , nextToken ) ) ;
84
+
85
+
86
+ await CreateAuthorizedRequestAsync ( FinanceApiUrls . ListFinancialEventsByGroupId ( eventGroupId ) , RestSharp . Method . GET , queryParameters ) ;
87
+ return await ExecuteRequestAsync < ListFinancialEventsResponse > ( RateLimitType . Financial_ListFinancialEventsByGroupId ) ;
63
88
}
64
89
65
90
public FinancialEvents ListFinancialEventsByOrderId ( string orderId ) =>
0 commit comments