@@ -18,7 +18,7 @@ public CatalogItemService(AmazonCredential amazonCredential) : base(amazonCreden
1818 public IList < Item > ListCatalogItems ( ParameterListCatalogItems parameterListCatalogItems )
1919 {
2020 if ( string . IsNullOrEmpty ( parameterListCatalogItems . MarketplaceId ) )
21- throw new InvalidDataException ( " MarketplaceId is a required property and cannot be null or empty" ) ;
21+ parameterListCatalogItems . MarketplaceId = MarketPlace . ID ;
2222
2323 if (
2424 string . IsNullOrEmpty ( parameterListCatalogItems . Query ) &&
@@ -43,12 +43,12 @@ public IList<Item> ListCatalogItems(ParameterListCatalogItems parameterListCatal
4343 return list ;
4444 }
4545
46+ //[Obsolete("This method is will be deprecated in June 2022. Please use GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem) instead.")]
4647 public Item GetCatalogItem ( string asin )
4748 {
48-
49- if ( string . IsNullOrEmpty ( asin ) )
50- throw new InvalidDataException ( "asin is a required property and cannot be null" ) ;
5149
50+ if ( string . IsNullOrEmpty ( asin ) )
51+ throw new InvalidDataException ( "asin is a required property and cannot be null" ) ;
5252
5353 var param = new List < KeyValuePair < string , string > > ( ) ;
5454 param . Add ( new KeyValuePair < string , string > ( "MarketplaceId" , MarketPlace . ID ) ) ;
@@ -62,15 +62,33 @@ public Item GetCatalogItem(string asin)
6262 return null ;
6363 }
6464
65+ //public Item GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem)
66+ //{
67+
68+ // if (string.IsNullOrEmpty(parameterListCatalogItem.ASIN))
69+ // throw new InvalidDataException("asin is a required property and cannot be null");
70+
71+ // if (parameterListCatalogItem == null || parameterListCatalogItem.MarketplaceIds == null || parameterListCatalogItem.MarketplaceIds.Count == 0)
72+ // {
73+ // parameterListCatalogItem.MarketplaceIds.Add(MarketPlace.ID);
74+ // }
6575
66- public IList < Categories > ListCatalogCategories ( string ASIN , string SellerSKU = null )
76+ // var param = parameterListCatalogItem.getParameters();
77+
78+ // CreateAuthorizedRequest(CategoryApiUrls.GetCatalogItem202012(parameterListCatalogItem.ASIN), RestSharp.Method.GET, param);
79+ // var response = ExecuteRequest<Item>();
80+
81+ // return response;
82+ //}
83+
84+ public IList < Categories > ListCatalogCategories ( string ASIN , string SellerSKU = null , string MarketPlaceID = null )
6785 {
6886 if ( string . IsNullOrEmpty ( ASIN ) )
6987 throw new InvalidDataException ( "ASIN is a required property and cannot be null or empty" ) ;
7088
7189
7290 var param = new List < KeyValuePair < string , string > > ( ) ;
73- param . Add ( new KeyValuePair < string , string > ( "MarketplaceId" , MarketPlace . ID ) ) ;
91+ param . Add ( new KeyValuePair < string , string > ( "MarketplaceId" , MarketPlaceID ?? MarketPlace . ID ) ) ;
7492 param . Add ( new KeyValuePair < string , string > ( "ASIN" , ASIN ) ) ;
7593 if ( ! string . IsNullOrEmpty ( SellerSKU ) )
7694 param . Add ( new KeyValuePair < string , string > ( "SellerSKU" , SellerSKU ) ) ;
0 commit comments