Skip to content

Commit af6f685

Browse files
committed
GetCategoryItem new endpoint ready to use
1 parent d835a31 commit af6f685

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5922
-28
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Install-Package CSharpAmazonSpAPI
4040
- [x] [shipmentInvoicingV0](https://developer-docs.amazon.com/sp-api/docs/shipment-invoicing-api-v0-reference)
4141
- [x] [Shippings](https://developer-docs.amazon.com/sp-api/docs/shipping-api-v1-reference)
4242
- [x] [CatalogItemsV0](https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v0-reference)
43-
- [ ] [CatalogItemsV20201201](https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2020-12-01-reference)
43+
- [x] [CatalogItemsV20220401](https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2022-04-01-reference)
4444
- [x] [FBAInventory](https://developer-docs.amazon.com/sp-api/docs/fbainventory-api-v1-reference)
4545
- [x] [FBASmallAndLight](https://developer-docs.amazon.com/sp-api/docs/fbasmallandlight-api-v1-reference)
4646
- [x] [FBAInboundEligibility](https://developer-docs.amazon.com/sp-api/docs/fbainboundeligibility-api-v1-reference)
@@ -262,6 +262,42 @@ while (string.IsNullOrEmpty(ReportDocumentId))
262262
//filePath for report
263263
```
264264

265+
### Product GetCatalogItem Version 2022-04-01
266+
```CSharp
267+
var data = await amazonConnection.CatalogItem.GetCatalogItem202204Async(
268+
new Parameter.CatalogItems.ParameterGetCatalogItem
269+
{
270+
ASIN = "B00JK2YANC",
271+
includedData = new[] { IncludedData.attributes,
272+
IncludedData.salesRanks,
273+
IncludedData.summaries,
274+
IncludedData.productTypes,
275+
IncludedData.relationships,
276+
IncludedData.dimensions,
277+
IncludedData.identifiers,
278+
IncludedData.images }
279+
});
280+
```
281+
282+
### Product SearchCatalogItems Version 2022-04-01
283+
```CSharp
284+
var data = await amazonConnection.CatalogItem.SearchCatalogItems202204Async(
285+
new Parameter.CatalogItems.ParameterSearchCatalogItems202204
286+
{
287+
keywords = new[] { "vitamin c" },
288+
includedData = new[] { IncludedData.attributes,
289+
IncludedData.salesRanks,
290+
IncludedData.summaries,
291+
IncludedData.productTypes,
292+
IncludedData.relationships,
293+
IncludedData.dimensions,
294+
IncludedData.identifiers,
295+
IncludedData.images }
296+
});
297+
```
298+
299+
300+
265301
### Product Pricing, For more Pricing sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/ProductPricing.cs).
266302
```CSharp
267303

Source/FikaAmazonAPI.SampleCode/Program.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ static async Task Main(string[] args)
3434
MarketPlace = MarketPlace.GetMarketPlaceByID(config.GetSection("FikaAmazonAPI:MarketPlaceID").Value),
3535
});
3636

37+
var GetCatalogItem202204 = await amazonConnection.CatalogItem.GetCatalogItem202204Async(new Parameter.CatalogItems.ParameterGetCatalogItem
38+
{
39+
ASIN = "B00JK2YANC",
40+
includedData = new[] { IncludedData.attributes, IncludedData.salesRanks, IncludedData.summaries, IncludedData.productTypes, IncludedData.relationships, IncludedData.dimensions, IncludedData.identifiers, IncludedData.images }
41+
});
42+
43+
var lissting = await amazonConnection.CatalogItem.SearchCatalogItems202204Async(new Parameter.CatalogItems.ParameterSearchCatalogItems202204
44+
{
45+
keywords = new[] { "vitamin c" },
46+
includedData = new[] { IncludedData.attributes, IncludedData.salesRanks, IncludedData.summaries, IncludedData.productTypes, IncludedData.relationships, IncludedData.dimensions, IncludedData.identifiers, IncludedData.images }
47+
});
48+
49+
//IncludedData.images, IncludedData.identifiers, IncludedData.productTypes, IncludedData.salesRanks, IncludedData.summaries, IncludedData.variations, IncludedData.vendorDetails
50+
51+
3752
var test = amazonConnection.ProductPricing.GetItemOffers(new Parameter.ProductPricing.ParameterGetItemOffers()
3853
{
3954
Asin = "B000RTDUOW"
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/*
2+
* Selling Partner API for Catalog Items
3+
*
4+
* The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, refer to the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2022-04-01-use-case-guide).
5+
*
6+
* OpenAPI spec version: 2022-04-01
7+
*
8+
* Generated by: https://github.com/swagger-api/swagger-codegen.git
9+
*/
10+
11+
using Newtonsoft.Json;
12+
using System;
13+
using System.Collections.Generic;
14+
using System.ComponentModel.DataAnnotations;
15+
using System.IO;
16+
using System.Runtime.Serialization;
17+
using System.Text;
18+
19+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.CatalogItems.V20220401
20+
{
21+
/// <summary>
22+
/// Description of a brand that can be used to get more fine-grained search results.
23+
/// </summary>
24+
[DataContract]
25+
public partial class BrandRefinement : IEquatable<BrandRefinement>, IValidatableObject
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="BrandRefinement" /> class.
29+
/// </summary>
30+
[JsonConstructorAttribute]
31+
public BrandRefinement() { }
32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="BrandRefinement" /> class.
34+
/// </summary>
35+
/// <param name="numberOfResults">The estimated number of results that would still be returned if refinement key applied. (required).</param>
36+
/// <param name="brandName">Brand name. For display and can be used as a search refinement. (required).</param>
37+
public BrandRefinement(int? numberOfResults = default(int?), string brandName = default(string))
38+
{
39+
// to ensure "numberOfResults" is required (not null)
40+
if (numberOfResults == null)
41+
{
42+
throw new InvalidDataException("numberOfResults is a required property for BrandRefinement and cannot be null");
43+
}
44+
else
45+
{
46+
this.NumberOfResults = numberOfResults;
47+
}
48+
// to ensure "brandName" is required (not null)
49+
if (brandName == null)
50+
{
51+
throw new InvalidDataException("brandName is a required property for BrandRefinement and cannot be null");
52+
}
53+
else
54+
{
55+
this.BrandName = brandName;
56+
}
57+
}
58+
59+
/// <summary>
60+
/// The estimated number of results that would still be returned if refinement key applied.
61+
/// </summary>
62+
/// <value>The estimated number of results that would still be returned if refinement key applied.</value>
63+
[DataMember(Name = "numberOfResults", EmitDefaultValue = false)]
64+
public int? NumberOfResults { get; set; }
65+
66+
/// <summary>
67+
/// Brand name. For display and can be used as a search refinement.
68+
/// </summary>
69+
/// <value>Brand name. For display and can be used as a search refinement.</value>
70+
[DataMember(Name = "brandName", EmitDefaultValue = false)]
71+
public string BrandName { get; set; }
72+
73+
/// <summary>
74+
/// Returns the string presentation of the object
75+
/// </summary>
76+
/// <returns>String presentation of the object</returns>
77+
public override string ToString()
78+
{
79+
var sb = new StringBuilder();
80+
sb.Append("class BrandRefinement {\n");
81+
sb.Append(" NumberOfResults: ").Append(NumberOfResults).Append("\n");
82+
sb.Append(" BrandName: ").Append(BrandName).Append("\n");
83+
sb.Append("}\n");
84+
return sb.ToString();
85+
}
86+
87+
/// <summary>
88+
/// Returns the JSON string presentation of the object
89+
/// </summary>
90+
/// <returns>JSON string presentation of the object</returns>
91+
public virtual string ToJson()
92+
{
93+
return JsonConvert.SerializeObject(this, Formatting.Indented);
94+
}
95+
96+
/// <summary>
97+
/// Returns true if objects are equal
98+
/// </summary>
99+
/// <param name="input">Object to be compared</param>
100+
/// <returns>Boolean</returns>
101+
public override bool Equals(object input)
102+
{
103+
return this.Equals(input as BrandRefinement);
104+
}
105+
106+
/// <summary>
107+
/// Returns true if BrandRefinement instances are equal
108+
/// </summary>
109+
/// <param name="input">Instance of BrandRefinement to be compared</param>
110+
/// <returns>Boolean</returns>
111+
public bool Equals(BrandRefinement input)
112+
{
113+
if (input == null)
114+
return false;
115+
116+
return
117+
(
118+
this.NumberOfResults == input.NumberOfResults ||
119+
(this.NumberOfResults != null &&
120+
this.NumberOfResults.Equals(input.NumberOfResults))
121+
) &&
122+
(
123+
this.BrandName == input.BrandName ||
124+
(this.BrandName != null &&
125+
this.BrandName.Equals(input.BrandName))
126+
);
127+
}
128+
129+
/// <summary>
130+
/// Gets the hash code
131+
/// </summary>
132+
/// <returns>Hash code</returns>
133+
public override int GetHashCode()
134+
{
135+
unchecked // Overflow is fine, just wrap
136+
{
137+
int hashCode = 41;
138+
if (this.NumberOfResults != null)
139+
hashCode = hashCode * 59 + this.NumberOfResults.GetHashCode();
140+
if (this.BrandName != null)
141+
hashCode = hashCode * 59 + this.BrandName.GetHashCode();
142+
return hashCode;
143+
}
144+
}
145+
146+
/// <summary>
147+
/// To validate all properties of the instance
148+
/// </summary>
149+
/// <param name="validationContext">Validation context</param>
150+
/// <returns>Validation Result</returns>
151+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
152+
{
153+
yield break;
154+
}
155+
}
156+
157+
}

0 commit comments

Comments
 (0)