File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,6 @@ public class ParameterListFinancialEvents : ParameterBased
9
9
public DateTime ? PostedAfter { get ; set ; }
10
10
public DateTime ? PostedBefore { get ; set ; }
11
11
public string NextToken { get ; set ; }
12
+ public int ? MaxNumberOfPages { get ; set ; }
12
13
}
13
14
}
Original file line number Diff line number Diff line change @@ -121,12 +121,15 @@ public async Task<IList<FinancialEvents>> ListFinancialEventsAsync(ParameterList
121
121
122
122
list . Add ( response . Payload . FinancialEvents ) ;
123
123
var nextToken = response . Payload . NextToken ;
124
-
125
- while ( ! string . IsNullOrEmpty ( nextToken ) )
124
+ int countPages = 1 ;
125
+ while ( ! string . IsNullOrEmpty ( nextToken ) &&
126
+ ( ( ! parameterListFinancials . MaxNumberOfPages . HasValue )
127
+ || ( parameterListFinancials . MaxNumberOfPages . HasValue && parameterListFinancials . MaxNumberOfPages <= countPages ) ) )
126
128
{
127
129
var data = GetFinancialEventsByNextToken ( nextToken ) ;
128
130
list . Add ( data . FinancialEvents ) ;
129
131
nextToken = data . NextToken ;
132
+ countPages ++ ;
130
133
}
131
134
132
135
return list ;
You can’t perform that action at this time.
0 commit comments