@@ -242,8 +242,8 @@ static async Task CallEndpointAsync(GoAffProClient client)
242242 "GET /user/stats/aggregate" => await client . Api . User . Stats . Aggregate . GetAsync ( config =>
243243 {
244244 config . QueryParameters . SiteIds = siteIds ;
245- config . QueryParameters . StartTime = AskOptional ( "start_time (ISO8601, optional)" ) ?? startTime ;
246- config . QueryParameters . EndTime = AskOptional ( "end_time (ISO8601, optional)" ) ?? endTime ;
245+ config . QueryParameters . StartTime = DateTimeOffset . Parse ( AskOptional ( "start_time (ISO8601, optional)" ) ?? startTime , CultureInfo . InvariantCulture ) ;
246+ config . QueryParameters . EndTime = DateTimeOffset . Parse ( AskOptional ( "end_time (ISO8601, optional)" ) ?? endTime , CultureInfo . InvariantCulture ) ;
247247 config . QueryParameters . FieldsAsGetFieldsQueryParameterType =
248248 [
249249 AggregateField . Total_sales ,
@@ -258,24 +258,24 @@ static async Task CallEndpointAsync(GoAffProClient client)
258258 config . QueryParameters . Limit = limit ;
259259 config . QueryParameters . Offset = offset ;
260260 config . QueryParameters . SiteIds = siteIds ;
261- config . QueryParameters . CreatedAtMin = AskOptional ( "created_at_min (ISO8601, optional)" ) ?? startTime ;
262- config . QueryParameters . CreatedAtMax = AskOptional ( "created_at_max (ISO8601, optional)" ) ?? endTime ;
261+ config . QueryParameters . CreatedAtMin = DateTimeOffset . Parse ( AskOptional ( "created_at_min (ISO8601, optional)" ) ?? startTime , CultureInfo . InvariantCulture ) ;
262+ config . QueryParameters . CreatedAtMax = DateTimeOffset . Parse ( AskOptional ( "created_at_max (ISO8601, optional)" ) ?? endTime , CultureInfo . InvariantCulture ) ;
263263 } ) . ConfigureAwait ( false ) ,
264264 "GET /user/feed/traffic" => await client . Api . User . Feed . Traffic . GetAsync ( config =>
265265 {
266266 config . QueryParameters . Limit = limit ;
267267 config . QueryParameters . Offset = offset ;
268268 config . QueryParameters . SiteIds = siteIds ;
269- config . QueryParameters . StartTime = AskOptional ( "start_time (ISO8601, optional)" ) ?? startTime ;
270- config . QueryParameters . EndTime = AskOptional ( "end_time (ISO8601, optional)" ) ?? endTime ;
269+ config . QueryParameters . StartTime = DateTimeOffset . Parse ( AskOptional ( "start_time (ISO8601, optional)" ) ?? startTime , CultureInfo . InvariantCulture ) ;
270+ config . QueryParameters . EndTime = DateTimeOffset . Parse ( AskOptional ( "end_time (ISO8601, optional)" ) ?? endTime , CultureInfo . InvariantCulture ) ;
271271 } ) . ConfigureAwait ( false ) ,
272272 "GET /user/feed/payouts" => await client . Api . User . Feed . Payouts . GetAsync ( config =>
273273 {
274274 config . QueryParameters . Limit = limit ;
275275 config . QueryParameters . Offset = offset ;
276276 config . QueryParameters . SiteIds = siteIds ;
277- config . QueryParameters . StartTime = AskOptional ( "start_time (ISO8601, optional)" ) ?? startTime ;
278- config . QueryParameters . EndTime = AskOptional ( "end_time (ISO8601, optional)" ) ?? endTime ;
277+ config . QueryParameters . StartTime = DateTimeOffset . Parse ( AskOptional ( "start_time (ISO8601, optional)" ) ?? startTime , CultureInfo . InvariantCulture ) ;
278+ config . QueryParameters . EndTime = DateTimeOffset . Parse ( AskOptional ( "end_time (ISO8601, optional)" ) ?? endTime , CultureInfo . InvariantCulture ) ;
279279 } ) . ConfigureAwait ( false ) ,
280280 "GET /user/feed/products" => await client . Api . User . Feed . Products . GetAsync ( config =>
281281 {
@@ -287,8 +287,8 @@ static async Task CallEndpointAsync(GoAffProClient client)
287287 config . QueryParameters . Limit = limit ;
288288 config . QueryParameters . Offset = offset ;
289289 config . QueryParameters . SiteIds = siteIds ;
290- config . QueryParameters . StartTime = AskOptional ( "start_time (ISO8601, optional)" ) ?? startTime ;
291- config . QueryParameters . EndTime = AskOptional ( "end_time (ISO8601, optional)" ) ?? endTime ;
290+ config . QueryParameters . StartTime = DateTimeOffset . Parse ( AskOptional ( "start_time (ISO8601, optional)" ) ?? startTime , CultureInfo . InvariantCulture ) ;
291+ config . QueryParameters . EndTime = DateTimeOffset . Parse ( AskOptional ( "end_time (ISO8601, optional)" ) ?? endTime , CultureInfo . InvariantCulture ) ;
292292 } ) . ConfigureAwait ( false ) ,
293293 "GET /user/feed/transactions" => await client . Api . User . Feed . Transactions . GetAsync ( config =>
294294 {
@@ -474,8 +474,8 @@ public Task StartAsync()
474474
475475 client . OrderDetected += ( _ , args ) =>
476476 WriteLiveEvent ( "order" , args . Order . Id ? . String ?? args . Order . OrderId ? . String ?? "<unknown>" ) ;
477- client . AffiliateDetected += ( _ , args ) =>
478- WriteLiveEvent ( "affiliate " , args . Affiliate . AffiliateId ? . String ?? args . Affiliate . Id ? . String ?? args . Affiliate . CustomerId ? . String ?? "<unknown>" ) ;
477+ client . TrafficDetected += ( _ , args ) =>
478+ WriteLiveEvent ( "traffic " , args . Traffic . AffiliateId ? . String ?? args . Traffic . Id ? . String ?? args . Traffic . CustomerId ? . String ?? "<unknown>" ) ;
479479 client . PayoutDetected += ( _ , args ) =>
480480 WriteLiveEvent ( "payout" , args . Payout . Id ? . String ?? args . Payout . PayoutId ? . String ?? "<unknown>" ) ;
481481
@@ -572,8 +572,8 @@ public static async Task<ApiSweepReport> RunAllAsync(
572572 TimeSpan productTimeout ,
573573 CancellationToken cancellationToken )
574574 {
575- string startTime = DateTimeOffset . UtcNow . AddDays ( - 1 ) . ToString ( "o" , CultureInfo . InvariantCulture ) ;
576- string endTime = DateTimeOffset . UtcNow . ToString ( "o" , CultureInfo . InvariantCulture ) ;
575+ DateTimeOffset startTime = DateTimeOffset . UtcNow . AddDays ( - 1 ) ;
576+ DateTimeOffset endTime = DateTimeOffset . UtcNow ;
577577 var results = new List < ApiEndpointResult > ( ) ;
578578
579579 await RunEndpointAsync ( results , "GET /user" , ( ) => client . Api . User . GetAsync ( cancellationToken : cancellationToken ) ) . ConfigureAwait ( false ) ;
0 commit comments