@@ -23,6 +23,11 @@ public List<Report> GetReports(ParameterReportList parameterReportList) =>
23
23
Task . Run ( ( ) => GetReportsAsync ( parameterReportList ) ) . ConfigureAwait ( false ) . GetAwaiter ( ) . GetResult ( ) ;
24
24
public async Task < List < Report > > GetReportsAsync ( ParameterReportList parameterReportList )
25
25
{
26
+ if ( parameterReportList . marketplaceIds == null || parameterReportList . marketplaceIds . Count == 0 )
27
+ {
28
+ parameterReportList . marketplaceIds = new List < string > ( ) ;
29
+ parameterReportList . marketplaceIds . Add ( AmazonCredential . MarketPlace . ID ) ;
30
+ }
26
31
if ( parameterReportList . createdSince . HasValue )
27
32
{
28
33
var totalDays = ( parameterReportList . createdSince . Value - DateTime . UtcNow ) . TotalDays ;
@@ -101,6 +106,11 @@ public string CreateReport(ParameterCreateReportSpecification createReportSpecif
101
106
Task . Run ( ( ) => CreateReportAsync ( createReportSpecification ) ) . ConfigureAwait ( false ) . GetAwaiter ( ) . GetResult ( ) ;
102
107
public async Task < string > CreateReportAsync ( ParameterCreateReportSpecification createReportSpecification )
103
108
{
109
+ if ( createReportSpecification . marketplaceIds == null || createReportSpecification . marketplaceIds . Count == 0 )
110
+ {
111
+ createReportSpecification . marketplaceIds = new MarketplaceIds ( ) ;
112
+ createReportSpecification . marketplaceIds . Add ( AmazonCredential . MarketPlace . ID ) ;
113
+ }
104
114
await CreateAuthorizedRequestAsync ( ReportApiUrls . CreateReport , RestSharp . Method . Post , null , createReportSpecification ) ;
105
115
var response = await ExecuteRequestAsync < AmazonSpApiSDK . Models . Reports . CreateReportResult > ( RateLimitType . Report_CreateReport ) ;
106
116
@@ -248,7 +258,7 @@ public async Task<bool> CancelReportScheduleAsync(string reportScheduleId)
248
258
249
259
public string CreateReportAndDownloadFile ( ReportTypes reportType , DateTime ? dataStartTime = null , DateTime ? dataEndTime = null , ReportOptions reportOptions = null , bool isRestrictedReport = false , List < MarketPlace > marketplaces = null , int millisecondsDelay = 500 ) =>
250
260
Task . Run ( ( ) => CreateReportAndDownloadFileAsync ( reportType , dataStartTime , dataEndTime , reportOptions , isRestrictedReport , marketplaces , millisecondsDelay ) ) . ConfigureAwait ( false ) . GetAwaiter ( ) . GetResult ( ) ;
251
- public async Task < string > CreateReportAndDownloadFileAsync ( ReportTypes reportType , DateTime ? dataStartTime = null , DateTime ? dataEndTime = null , ReportOptions reportOptions = null , bool isRestrictedReport = false , List < MarketPlace > marketplaces = null , int millisecondsDelay = 500 )
261
+ public async Task < string > CreateReportAndDownloadFileAsync ( ReportTypes reportType , DateTime ? dataStartTime = null , DateTime ? dataEndTime = null , ReportOptions reportOptions = null , bool isRestrictedReport = false , List < MarketPlace > marketplaces = null , int millisecondsDelay = 500 )
252
262
{
253
263
if ( ! isRestrictedReport && Enum . TryParse < RestrictedReportTypes > ( reportType . ToString ( ) , out _ ) )
254
264
{
0 commit comments