Skip to content

Commit eb0f3ca

Browse files
committed
fix #306
1 parent 9a2d56d commit eb0f3ca

File tree

4 files changed

+16
-31
lines changed

4 files changed

+16
-31
lines changed

Source/FikaAmazonAPI/Services/CatalogItemService.cs

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using FikaAmazonAPI.AmazonSpApiSDK.Models.CatalogItems.V20220401;
33
using FikaAmazonAPI.Parameter.CatalogItems;
44
using FikaAmazonAPI.Utils;
5+
using System;
56
using System.Collections.Generic;
67
using System.IO;
78
using System.Threading.Tasks;
@@ -16,10 +17,11 @@ public CatalogItemService(AmazonCredential amazonCredential) : base(amazonCreden
1617

1718
}
1819

19-
20+
[Obsolete("This method deprecated in June 2022. Please use SearchCatalogItems202204 instead.", true)]
2021
public IList<Item> ListCatalogItems(ParameterListCatalogItems parameterListCatalogItems) =>
2122
Task.Run(() => ListCatalogItemsAsync(parameterListCatalogItems)).ConfigureAwait(false).GetAwaiter().GetResult();
2223

24+
[Obsolete("This method deprecated in June 2022. Please use SearchCatalogItems202204Async instead.", true)]
2325
public async Task<IList<Item>> ListCatalogItemsAsync(ParameterListCatalogItems parameterListCatalogItems)
2426
{
2527
if (string.IsNullOrEmpty(parameterListCatalogItems.MarketplaceId))
@@ -48,10 +50,10 @@ public async Task<IList<Item>> ListCatalogItemsAsync(ParameterListCatalogItems p
4850
return list;
4951
}
5052

51-
//[Obsolete("This method is will be deprecated in June 2022. Please use GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem) instead.")]
53+
[Obsolete("This method deprecated in June 2022. Please use GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem) instead.", true)]
5254
public Item GetCatalogItem(string asin) =>
5355
Task.Run(() => GetCatalogItemAsync(asin)).ConfigureAwait(false).GetAwaiter().GetResult();
54-
56+
[Obsolete("This method deprecated in June 2022. Please use GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem) instead.", true)]
5557
public async Task<Item> GetCatalogItemAsync(string asin)
5658
{
5759

@@ -70,24 +72,6 @@ public async Task<Item> GetCatalogItemAsync(string asin)
7072
return null;
7173
}
7274

73-
//public Item GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem)
74-
//{
75-
76-
// if (string.IsNullOrEmpty(parameterListCatalogItem.ASIN))
77-
// throw new InvalidDataException("asin is a required property and cannot be null");
78-
79-
// if (parameterListCatalogItem == null || parameterListCatalogItem.MarketplaceIds == null || parameterListCatalogItem.MarketplaceIds.Count == 0)
80-
// {
81-
// parameterListCatalogItem.MarketplaceIds.Add(MarketPlace.ID);
82-
// }
83-
84-
// var param = parameterListCatalogItem.getParameters();
85-
86-
// await CreateAuthorizedRequestAsync(CategoryApiUrls.GetCatalogItem202012(parameterListCatalogItem.ASIN), RestSharp.Method.GET, param);
87-
// var response = await ExecuteRequestAsync<Item>();
88-
89-
// return response;
90-
//}
9175

9276
public IList<Categories> ListCatalogCategories(string ASIN, string SellerSKU = null, string MarketPlaceID = null) =>
9377
Task.Run(() => ListCatalogCategoriesAsync(ASIN, SellerSKU, MarketPlaceID)).ConfigureAwait(false).GetAwaiter().GetResult();

Source/FikaAmazonAPI/Services/ProductFeeService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using FikaAmazonAPI.AmazonSpApiSDK.Models.ProductFees;
22
using FikaAmazonAPI.Parameter.ProductFee;
33
using FikaAmazonAPI.Utils;
4-
using System.Collections.Generic;
54
using System.Threading.Tasks;
65

76
namespace FikaAmazonAPI.Services
@@ -47,7 +46,7 @@ public GetMyFeesEstimatesResponse GetMyFeesEstimate(FeesEstimateByIdRequest[] fe
4746
public async Task<GetMyFeesEstimatesResponse> GetMyFeesEstimateAsync(FeesEstimateByIdRequest[] feesEstimateRequest)
4847
{
4948
await CreateAuthorizedRequestAsync(ProductFeeApiUrls.GetMyFeesEstimate, RestSharp.Method.POST, postJsonObj: feesEstimateRequest);
50-
var response = await ExecuteRequestAsync<GetMyFeesEstimatesResponse>(RateLimitType.ProductFees_GetMyFeesEstimateForASIN);
49+
var response = await ExecuteRequestAsync<GetMyFeesEstimatesResponse>(RateLimitType.ProductFees_GetMyFeesEstimate);
5150
return response;
5251
}
5352
}

Source/FikaAmazonAPI/Utils/RateLimitType.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public enum RateLimitType
143143

144144
ProductFees_GetMyFeesEstimateForSKU,
145145
ProductFees_GetMyFeesEstimateForASIN,
146+
ProductFees_GetMyFeesEstimate,
146147

147148
ProductPricing_GetPricing,
148149
ProductPricing_GetCompetitivePricing,

Source/FikaAmazonAPI/Utils/RateLimitsDefinitions.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ internal static Dictionary<RateLimitType, RateLimits> RateLimitsTime()
7171
{ RateLimitType.CatalogItems_ListCatalogItems, new RateLimits(6.0M, 40) },
7272
{ RateLimitType.CatalogItems_GetCatalogItem, new RateLimits(2.0M, 20) },
7373
{ RateLimitType.CatalogItems_ListCatalogCategories, new RateLimits(1.0M, 40) },
74-
{ RateLimitType.CatalogItems20220401_GetCatalogItem, new RateLimits(5.0M, 5) },
75-
{ RateLimitType.CatalogItems20220401_SearchCatalogItems, new RateLimits(5.0M, 5) },
74+
{ RateLimitType.CatalogItems20220401_GetCatalogItem, new RateLimits(2.0M, 2) },
75+
{ RateLimitType.CatalogItems20220401_SearchCatalogItems, new RateLimits(2.0M, 2) },
7676

7777
{ RateLimitType.FbaInventory_GetInventorySummaries, new RateLimits(2.0M, 2) },
7878

@@ -159,13 +159,14 @@ internal static Dictionary<RateLimitType, RateLimits> RateLimitsTime()
159159
{ RateLimitType.Notifications_GetDestination, new RateLimits(1.0M, 5) },
160160
{ RateLimitType.Notifications_DeleteDestination, new RateLimits(1.0M, 5) },
161161

162-
{ RateLimitType.ProductFees_GetMyFeesEstimateForSKU, new RateLimits(10.0M, 20) },
163-
{ RateLimitType.ProductFees_GetMyFeesEstimateForASIN, new RateLimits(10.0M, 20) },
162+
{ RateLimitType.ProductFees_GetMyFeesEstimateForSKU, new RateLimits(1M, 2) },
163+
{ RateLimitType.ProductFees_GetMyFeesEstimateForASIN, new RateLimits(1M, 2) },
164+
{ RateLimitType.ProductFees_GetMyFeesEstimate, new RateLimits(0.5M, 1) },
164165

165-
{ RateLimitType.ProductPricing_GetPricing, new RateLimits(10.0M, 20) },
166-
{ RateLimitType.ProductPricing_GetCompetitivePricing, new RateLimits(10.0M, 20) },
167-
{ RateLimitType.ProductPricing_GetListingOffers, new RateLimits(5.0M, 10) },
168-
{ RateLimitType.ProductPricing_GetItemOffers, new RateLimits(5.0M, 10) },
166+
{ RateLimitType.ProductPricing_GetPricing, new RateLimits(0.5M, 1) },
167+
{ RateLimitType.ProductPricing_GetCompetitivePricing, new RateLimits(0.5M, 1) },
168+
{ RateLimitType.ProductPricing_GetListingOffers, new RateLimits(1M, 2) },
169+
{ RateLimitType.ProductPricing_GetItemOffers, new RateLimits(0.5M, 1) },
169170

170171
{ RateLimitType.ProductPricing_GetItemOffersBatch, new RateLimits(0.5M, 1) },
171172
{ RateLimitType.ProductPricing_GetListingOffersBatch, new RateLimits(0.5M, 1) },

0 commit comments

Comments
 (0)