Skip to content

Commit ffdc22e

Browse files
committed
2 parents db794a9 + 8f7dc1f commit ffdc22e

File tree

8 files changed

+41
-17
lines changed

8 files changed

+41
-17
lines changed

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/CatalogItems/V20220401/ItemSummaryByMarketplace.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,14 @@ protected ItemSummaryByMarketplace() { }
8282
/// <param name="modelNumber">Model number associated with an Amazon catalog item..</param>
8383
/// <param name="packageQuantity">Quantity of an Amazon catalog item in one package..</param>
8484
/// <param name="partNumber">Part number associated with an Amazon catalog item..</param>
85+
/// <param name="releaseDate">First date on which an Amazon catalog item is shippable to customers..</param>
8586
/// <param name="size">Name of the size associated with an Amazon catalog item..</param>
8687
/// <param name="style">Name of the style associated with an Amazon catalog item..</param>
8788
/// <param name="websiteDisplayGroup">Name of the website display group associated with an Amazon catalog item..</param>
88-
public ItemSummaryByMarketplace(string marketplaceId = default(string), string brand = default(string), ItemBrowseClassification browseClassification = default(ItemBrowseClassification), string color = default(string), ItemClassificationEnum? itemClassification = default(ItemClassificationEnum?), string itemName = default(string), string manufacturer = default(string), string modelNumber = default(string), int? packageQuantity = default(int?), string partNumber = default(string), string size = default(string), string style = default(string), string websiteDisplayGroup = default(string), string websiteDisplayGroupName = default(string))
89+
public ItemSummaryByMarketplace(string marketplaceId = default, string brand = default, ItemBrowseClassification browseClassification = default,
90+
string color = default, ItemClassificationEnum? itemClassification = default, string itemName = default, string manufacturer = default,
91+
string modelNumber = default, int? packageQuantity = default, string partNumber = default, DateTime? releaseDate = default,
92+
string size = default, string style = default, string websiteDisplayGroup = default, string websiteDisplayGroupName = default)
8993
{
9094
// to ensure "marketplaceId" is required (not null)
9195
if (marketplaceId == null)
@@ -105,6 +109,7 @@ protected ItemSummaryByMarketplace() { }
105109
this.ModelNumber = modelNumber;
106110
this.PackageQuantity = packageQuantity;
107111
this.PartNumber = partNumber;
112+
this.ReleaseDate = releaseDate;
108113
this.Size = size;
109114
this.Style = style;
110115
this.WebsiteDisplayGroup = websiteDisplayGroup;
@@ -175,6 +180,13 @@ protected ItemSummaryByMarketplace() { }
175180
[DataMember(Name = "partNumber", EmitDefaultValue = false)]
176181
public string PartNumber { get; set; }
177182

183+
/// <summary>
184+
/// First date on which an Amazon catalog item is shippable to customers.
185+
/// </summary>
186+
/// <value>First date on which an Amazon catalog item is shippable to customers.</value>
187+
[DataMember(Name = "releaseDate", EmitDefaultValue = false)]
188+
public DateTime? ReleaseDate { get; set; }
189+
178190
/// <summary>
179191
/// Name of the size associated with an Amazon catalog item.
180192
/// </summary>

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/Exceptions/AmazonException.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ public AmazonUnauthorizedException(string msg, RestResponse response = null) : b
3838

3939
public class AmazonInvalidInputException : AmazonException
4040
{
41-
public AmazonInvalidInputException(string msg, RestResponse response = null) : base(msg, response)
42-
{
41+
public string Details { get; set; }
4342

43+
public AmazonInvalidInputException(string msg, string details = null, RestResponse response = null) : base(msg, response)
44+
{
45+
this.Details = details;
46+
//this.Data["Details"] = details;
4447
}
4548
}
49+
4650
public class AmazonQuotaExceededException : AmazonException
4751
{
4852
public AmazonQuotaExceededException(string msg, RestResponse response = null) : base(msg, response)

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/Notifications/EventFilter.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ public class EventFilter : AggregationFilter
2626
[JsonProperty(PropertyName = "eventFilterType")]
2727
public string EventFilterType { get; set; }
2828

29+
/// <summary>
30+
/// Gets or Sets OrderChangeTypes
31+
/// </summary>
32+
[DataMember(Name = "orderChangeTypes", EmitDefaultValue = false)]
33+
[JsonProperty(PropertyName = "orderChangeTypes")]
34+
public IList<string> OrderChangeTypes { get; set; }
35+
2936

3037
/// <summary>
3138
/// Get the string presentation of the object
@@ -37,6 +44,7 @@ public override string ToString()
3744
sb.Append("class EventFilter {\n");
3845
sb.Append(" MarketplaceIds: ").Append(MarketplaceIds).Append("\n");
3946
sb.Append(" EventFilterType: ").Append(EventFilterType).Append("\n");
47+
sb.Append(" OrderChangeTypes: ").Append(OrderChangeTypes).Append("\n");
4048
sb.Append("}\n");
4149
return sb.ToString();
4250
}

Source/FikaAmazonAPI/ReportGeneration/ProductsReport.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace FikaAmazonAPI.ReportGeneration
77
public class ProductsReport
88
{
99
public List<ProductsRow> Data { get; set; } = new List<ProductsRow>();
10-
public ProductsReport(string path, string refNumber, Encoding encoding = default)
10+
public ProductsReport(string path, Encoding encoding = default)
1111
{
1212
if (string.IsNullOrEmpty(path))
1313
return;
@@ -17,7 +17,7 @@ public ProductsReport(string path, string refNumber, Encoding encoding = default
1717
List<ProductsRow> values = new List<ProductsRow>();
1818
foreach (var row in table.Rows)
1919
{
20-
values.Add(ProductsRow.FromRow(row, refNumber));
20+
values.Add(ProductsRow.FromRow(row));
2121
}
2222
Data = values;
2323
}
@@ -144,7 +144,7 @@ public class ProductsRow
144144
public string refNumber { get; set; }
145145
public string MerchantShippingGroup { get; set; }
146146

147-
public static ProductsRow FromRow(TableRow rowData, string refNumber)
147+
public static ProductsRow FromRow(TableRow rowData)
148148
{
149149
var row = new ProductsRow();
150150
row.ItemName = rowData.GetString("item-name");

Source/FikaAmazonAPI/ReportGeneration/ReportManager.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,20 @@ private async Task<string> GetInventoryAgingAsync(AmazonConnection amazonConnect
186186
#endregion
187187

188188
#region Products
189-
public List<ProductsRow> GetProducts() =>
190-
Task.Run(() => GetProductsAsync()).ConfigureAwait(false).GetAwaiter().GetResult();
191-
public async Task<List<ProductsRow>> GetProductsAsync()
189+
public List<ProductsRow> GetProducts(List<MarketPlace> marketplaces = null) =>
190+
Task.Run(() => GetProductsAsync(marketplaces)).ConfigureAwait(false).GetAwaiter().GetResult();
191+
public async Task<List<ProductsRow>> GetProductsAsync(List<MarketPlace> marketplaces = null, CancellationToken cancellationToken = default)
192192
{
193-
var path = await GetProductsAsync(_amazonConnection);
194-
ProductsReport report = new ProductsReport(path, _amazonConnection.RefNumber);
193+
var path = await GetProductsAsync(_amazonConnection, marketplaces, cancellationToken);
194+
ProductsReport report = new ProductsReport(path);
195195
return report.Data;
196196
}
197-
private async Task<string> GetProductsAsync(AmazonConnection amazonConnection)
197+
private async Task<string> GetProductsAsync(AmazonConnection amazonConnection, List<MarketPlace> marketplaces = null, CancellationToken cancellationToken = default)
198198
{
199-
return await amazonConnection.Reports.CreateReportAndDownloadFileAsync(ReportTypes.GET_MERCHANT_LISTINGS_ALL_DATA);
199+
return await amazonConnection.Reports.CreateReportAndDownloadFileAsync(ReportTypes.GET_MERCHANT_LISTINGS_ALL_DATA, marketplaces: marketplaces, cancellationToken: cancellationToken);
200200
}
201201
#endregion
202-
202+
203203
#region Categories
204204

205205
public List<CategoriesRow> GetCategories()

Source/FikaAmazonAPI/Services/ReportService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public async Task<string> CreateReportAndDownloadFileAsync(ReportTypes reportTyp
285285

286286
parameters.marketplaceIds = new MarketplaceIds();
287287

288-
if (marketplaces == null)
288+
if (marketplaces == null || marketplaces.Count() == 0)
289289
{
290290
parameters.marketplaceIds.Add(AmazonCredential.MarketPlace.ID);
291291
}

Source/FikaAmazonAPI/Services/RequestService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ protected void ParseResponse(RestResponse response)
285285
case "InvalidSignature":
286286
throw new AmazonInvalidSignatureException(error.Message, response);
287287
case "InvalidInput":
288-
throw new AmazonInvalidInputException(error.Message, response);
288+
throw new AmazonInvalidInputException(error.Message, error.Details, response);
289289
case "QuotaExceeded":
290290
throw new AmazonQuotaExceededException(error.Message, response);
291291
case "InternalFailure":

Source/FikaAmazonAPI/Utils/RateLimitsDefinitions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ internal static Dictionary<RateLimitType, RateLimits> RateLimitsTime()
172172
{ RateLimitType.ProductPricing_GetListingOffers, new RateLimits(1M, 2) },
173173
{ RateLimitType.ProductPricing_GetItemOffers, new RateLimits(0.5M, 1) },
174174

175-
{ RateLimitType.ProductPricing_GetItemOffersBatch, new RateLimits(0.5M, 1) },
175+
{ RateLimitType.ProductPricing_GetItemOffersBatch, new RateLimits(0.1M, 1) },
176176
{ RateLimitType.ProductPricing_GetListingOffersBatch, new RateLimits(0.5M, 1) },
177177

178178
{ RateLimitType.Sales_GetOrderMetrics, new RateLimits(0.5M, 15) },

0 commit comments

Comments
 (0)