-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReportingLegacySample.cs
More file actions
30 lines (25 loc) · 1.04 KB
/
ReportingLegacySample.cs
File metadata and controls
30 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using CSharpAmazonBusinessAPI;
using CSharpAmazonBusinessAPI.Model.ReportingLegacy;
namespace CSharpAmazonBusinessAPI.SampleCode;
// Legacy Reporting API v2021-01-08. Prefer the v2025-06-09 surface (connection.Reporting)
// for new code; this is here for callers still on the old version.
public class ReportingLegacySample
{
private readonly AmazonBusinessConnection _connection;
public ReportingLegacySample(AmazonBusinessConnection connection)
{
_connection = connection;
}
public Task<OrdersOutput> GetOrdersLast7DaysAsync() =>
_connection.ReportingLegacy.GetOrdersByOrderDateAsync(
startDate: DateTimeOffset.UtcNow.AddDays(-7),
endDate: DateTimeOffset.UtcNow,
includeLineItems: true,
includeShipments: true,
includeCharges: true);
public Task<OrdersOutput> GetOrderByIdAsync(string orderId) =>
_connection.ReportingLegacy.GetOrdersByOrderIdAsync(
orderId: orderId,
includeLineItems: true,
includeShipments: true);
}