Skip to content

Commit 0c375b4

Browse files
committed
Added LastUpdatedBefore to OrderList
added LastUpdatedBefore to OrderList so it can be used to make sure we don't miss any orders
1 parent 1bc9079 commit 0c375b4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/Orders/OrderList.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public OrderList() : base()
3232
}
3333

3434
public string NextToken { get; set; }
35+
public DateTime? LastUpdatedBefore { get; set; }
3536

3637
/// <summary>
3738
/// Returns the string presentation of the object

Source/FikaAmazonAPI/Services/OrderService.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using FikaAmazonAPI.AmazonSpApiSDK.Models.Orders;
1+
using System;
2+
using FikaAmazonAPI.AmazonSpApiSDK.Models.Orders;
23
using FikaAmazonAPI.AmazonSpApiSDK.Models.Token;
34
using FikaAmazonAPI.Parameter.Order;
45
using FikaAmazonAPI.Search;
@@ -51,6 +52,9 @@ public async Task<OrderList> GetOrdersAsync(ParameterOrderList searchOrderList,
5152
var response = await ExecuteRequestAsync<GetOrdersResponse>(Utils.RateLimitType.Order_GetOrders, cancellationToken);
5253
var nextToken = response.Payload.NextToken;
5354
orderList = response.Payload.Orders;
55+
if (!string.IsNullOrWhiteSpace(response.Payload.LastUpdatedBefore))
56+
orderList.LastUpdatedBefore = DateTime.Parse(response.Payload.LastUpdatedBefore);
57+
5458
int PageCount = 1;
5559
if (searchOrderList.MaxNumberOfPages.HasValue && searchOrderList.MaxNumberOfPages.Value == 1)
5660
{

0 commit comments

Comments
 (0)