Skip to content

Commit 8ec04ca

Browse files
committed
fix bug #188
1 parent 6876fd0 commit 8ec04ca

File tree

1 file changed

+43
-26
lines changed
  • Source/FikaAmazonAPI/AmazonSpApiSDK/Models/ProductPricing

1 file changed

+43
-26
lines changed

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/ProductPricing/Summary.cs

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,40 @@ public partial class Summary : IEquatable<Summary>, IValidatableObject
2828
/// Initializes a new instance of the <see cref="Summary" /> class.
2929
/// </summary>
3030
[JsonConstructorAttribute]
31-
public Summary() { }
31+
protected Summary() { }
3232
/// <summary>
3333
/// Initializes a new instance of the <see cref="Summary" /> class.
3434
/// </summary>
35-
/// <param name="TotalOfferCount">The number of unique offers contained in NumberOfOffers. (required).</param>
36-
/// <param name="NumberOfOffers">A list that contains the total number of offers for the item for the given conditions and fulfillment channels..</param>
37-
/// <param name="LowestPrices">A list of the lowest prices for the item..</param>
38-
/// <param name="BuyBoxPrices">A list of item prices..</param>
39-
/// <param name="ListPrice">The list price of the item as suggested by the manufacturer..</param>
40-
/// <param name="CompetitivePriceThreshold">This price is based on competitive prices from other retailers (excluding other Amazon sellers). The offer may be ineligible for the Buy Box if the seller&#39;s price + shipping (minus Amazon Points) is greater than this competitive price..</param>
41-
/// <param name="SuggestedLowerPricePlusShipping">The suggested lower price of the item, including shipping and Amazon Points. The suggested lower price is based on a range of factors, including historical selling prices, recent Buy Box-eligible prices, and input from customers for your products..</param>
42-
/// <param name="BuyBoxEligibleOffers">A list that contains the total number of offers that are eligible for the Buy Box for the given conditions and fulfillment channels..</param>
43-
/// <param name="OffersAvailableTime">When the status is ActiveButTooSoonForProcessing, this is the time when the offers will be available for processing..</param>
44-
public Summary(int? TotalOfferCount = default(int?), NumberOfOffers NumberOfOffers = default(NumberOfOffers), LowestPrices LowestPrices = default(LowestPrices), BuyBoxPrices BuyBoxPrices = default(BuyBoxPrices), MoneyType ListPrice = default(MoneyType), MoneyType CompetitivePriceThreshold = null, MoneyType SuggestedLowerPricePlusShipping = default(MoneyType), BuyBoxEligibleOffers BuyBoxEligibleOffers = default(BuyBoxEligibleOffers), DateTime? OffersAvailableTime = default(DateTime?))
35+
/// <param name="totalOfferCount">The number of unique offers contained in NumberOfOffers. (required).</param>
36+
/// <param name="numberOfOffers">A list that contains the total number of offers for the item for the given conditions and fulfillment channels..</param>
37+
/// <param name="lowestPrices">A list of the lowest prices for the item..</param>
38+
/// <param name="buyBoxPrices">A list of item prices..</param>
39+
/// <param name="listPrice">The list price of the item as suggested by the manufacturer..</param>
40+
/// <param name="competitivePriceThreshold">This price is based on competitive prices from other retailers (excluding other Amazon sellers). The offer may be ineligible for the Buy Box if the seller&#39;s price + shipping (minus Amazon Points) is greater than this competitive price..</param>
41+
/// <param name="suggestedLowerPricePlusShipping">The suggested lower price of the item, including shipping and Amazon Points. The suggested lower price is based on a range of factors, including historical selling prices, recent Buy Box-eligible prices, and input from customers for your products..</param>
42+
/// <param name="salesRankings">A list that contains the sales rank of the item in the given product categories..</param>
43+
/// <param name="buyBoxEligibleOffers">A list that contains the total number of offers that are eligible for the Buy Box for the given conditions and fulfillment channels..</param>
44+
/// <param name="offersAvailableTime">When the status is ActiveButTooSoonForProcessing, this is the time when the offers will be available for processing..</param>
45+
public Summary(int? totalOfferCount = default(int?), NumberOfOffers numberOfOffers = default(NumberOfOffers), LowestPrices lowestPrices = default(LowestPrices), BuyBoxPrices buyBoxPrices = default(BuyBoxPrices), MoneyType listPrice = default(MoneyType), MoneyType competitivePriceThreshold = default(MoneyType), MoneyType suggestedLowerPricePlusShipping = default(MoneyType), SalesRankList salesRankings = default(SalesRankList), BuyBoxEligibleOffers buyBoxEligibleOffers = default(BuyBoxEligibleOffers), DateTime? offersAvailableTime = default(DateTime?))
4546
{
46-
// to ensure "TotalOfferCount" is required (not null)
47-
if (TotalOfferCount == null)
47+
// to ensure "totalOfferCount" is required (not null)
48+
if (totalOfferCount == null)
4849
{
49-
throw new InvalidDataException("TotalOfferCount is a required property for Summary and cannot be null");
50+
throw new InvalidDataException("totalOfferCount is a required property for Summary and cannot be null");
5051
}
5152
else
5253
{
53-
this.TotalOfferCount = TotalOfferCount;
54+
this.TotalOfferCount = totalOfferCount;
5455
}
55-
this.NumberOfOffers = NumberOfOffers;
56-
this.LowestPrices = LowestPrices;
57-
this.BuyBoxPrices = BuyBoxPrices;
58-
this.ListPrice = ListPrice;
59-
this.CompetitivePriceThreshold = CompetitivePriceThreshold;
60-
this.SuggestedLowerPricePlusShipping = SuggestedLowerPricePlusShipping;
61-
this.BuyBoxEligibleOffers = BuyBoxEligibleOffers;
62-
this.OffersAvailableTime = OffersAvailableTime;
56+
this.NumberOfOffers = numberOfOffers;
57+
this.LowestPrices = lowestPrices;
58+
this.BuyBoxPrices = buyBoxPrices;
59+
this.ListPrice = listPrice;
60+
this.CompetitivePriceThreshold = competitivePriceThreshold;
61+
this.SuggestedLowerPricePlusShipping = suggestedLowerPricePlusShipping;
62+
this.SalesRankings = salesRankings;
63+
this.BuyBoxEligibleOffers = buyBoxEligibleOffers;
64+
this.OffersAvailableTime = offersAvailableTime;
6365
}
6466

6567
/// <summary>
@@ -111,6 +113,13 @@ public Summary() { }
111113
[DataMember(Name = "SuggestedLowerPricePlusShipping", EmitDefaultValue = false)]
112114
public MoneyType SuggestedLowerPricePlusShipping { get; set; }
113115

116+
/// <summary>
117+
/// A list that contains the sales rank of the item in the given product categories.
118+
/// </summary>
119+
/// <value>A list that contains the sales rank of the item in the given product categories.</value>
120+
[DataMember(Name = "SalesRankings", EmitDefaultValue = false)]
121+
public SalesRankList SalesRankings { get; set; }
122+
114123
/// <summary>
115124
/// A list that contains the total number of offers that are eligible for the Buy Box for the given conditions and fulfillment channels.
116125
/// </summary>
@@ -140,6 +149,7 @@ public override string ToString()
140149
sb.Append(" ListPrice: ").Append(ListPrice).Append("\n");
141150
sb.Append(" CompetitivePriceThreshold: ").Append(CompetitivePriceThreshold).Append("\n");
142151
sb.Append(" SuggestedLowerPricePlusShipping: ").Append(SuggestedLowerPricePlusShipping).Append("\n");
152+
sb.Append(" SalesRankings: ").Append(SalesRankings).Append("\n");
143153
sb.Append(" BuyBoxEligibleOffers: ").Append(BuyBoxEligibleOffers).Append("\n");
144154
sb.Append(" OffersAvailableTime: ").Append(OffersAvailableTime).Append("\n");
145155
sb.Append("}\n");
@@ -150,7 +160,7 @@ public override string ToString()
150160
/// Returns the JSON string presentation of the object
151161
/// </summary>
152162
/// <returns>JSON string presentation of the object</returns>
153-
public string ToJson()
163+
public virtual string ToJson()
154164
{
155165
return JsonConvert.SerializeObject(this, Formatting.Indented);
156166
}
@@ -203,14 +213,19 @@ public bool Equals(Summary input)
203213
) &&
204214
(
205215
this.CompetitivePriceThreshold == input.CompetitivePriceThreshold ||
206-
this.CompetitivePriceThreshold != null &&
207-
this.CompetitivePriceThreshold.Equals(input.CompetitivePriceThreshold)
216+
(this.CompetitivePriceThreshold != null &&
217+
this.CompetitivePriceThreshold.Equals(input.CompetitivePriceThreshold))
208218
) &&
209219
(
210220
this.SuggestedLowerPricePlusShipping == input.SuggestedLowerPricePlusShipping ||
211221
(this.SuggestedLowerPricePlusShipping != null &&
212222
this.SuggestedLowerPricePlusShipping.Equals(input.SuggestedLowerPricePlusShipping))
213223
) &&
224+
(
225+
this.SalesRankings == input.SalesRankings ||
226+
(this.SalesRankings != null &&
227+
this.SalesRankings.Equals(input.SalesRankings))
228+
) &&
214229
(
215230
this.BuyBoxEligibleOffers == input.BuyBoxEligibleOffers ||
216231
(this.BuyBoxEligibleOffers != null &&
@@ -246,6 +261,8 @@ public override int GetHashCode()
246261
hashCode = hashCode * 59 + this.CompetitivePriceThreshold.GetHashCode();
247262
if (this.SuggestedLowerPricePlusShipping != null)
248263
hashCode = hashCode * 59 + this.SuggestedLowerPricePlusShipping.GetHashCode();
264+
if (this.SalesRankings != null)
265+
hashCode = hashCode * 59 + this.SalesRankings.GetHashCode();
249266
if (this.BuyBoxEligibleOffers != null)
250267
hashCode = hashCode * 59 + this.BuyBoxEligibleOffers.GetHashCode();
251268
if (this.OffersAvailableTime != null)

0 commit comments

Comments
 (0)