Skip to content

Commit 5b2bb27

Browse files
authored
Merge pull request #889 from Baros6647/main
Updated Listing Items models.
2 parents 223cebf + c091159 commit 5b2bb27

12 files changed

+400
-7
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*
2+
* Selling Partner API for Pricing
3+
*
4+
* The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products.
5+
*
6+
* OpenAPI spec version: v0
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.ListingsItems
20+
{
21+
/// <summary>
22+
/// AsinIdentifier
23+
/// </summary>
24+
[DataContract]
25+
public partial class AsinIdentifier : IEquatable<AsinIdentifier>, IValidatableObject
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="AsinIdentifier" /> class.
29+
/// </summary>
30+
[JsonConstructorAttribute]
31+
public AsinIdentifier() { }
32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="AsinIdentifier" /> class.
34+
/// </summary>
35+
/// <param name="marketplaceId">A marketplace identifier. Identifies the Amazon marketplace for the listings item.</param>
36+
/// <param name="asin">Amazon Standard Identification Number (ASIN) of the listings item.</param>
37+
public AsinIdentifier(string marketplaceId = default(string), string asin = default(string))
38+
{
39+
40+
}
41+
42+
/// <summary>
43+
/// A marketplace identifier. Identifies the Amazon marketplace for the listings item.
44+
/// </summary>
45+
/// <value>A marketplace identifier. Identifies the Amazon marketplace for the listings item.</value>
46+
[DataMember(Name = "marketplaceId", EmitDefaultValue = false)]
47+
public string MarketplaceId { get; set; }
48+
49+
/// <summary>
50+
/// Amazon Standard Identification Number (ASIN) of the listings item.
51+
/// </summary>
52+
/// <value>Amazon Standard Identification Number (ASIN) of the listings item.</value>
53+
[DataMember(Name = "asin", EmitDefaultValue = false)]
54+
public string Asin { get; set; }
55+
56+
/// <summary>
57+
/// Returns the string presentation of the object
58+
/// </summary>
59+
/// <returns>String presentation of the object</returns>
60+
public override string ToString()
61+
{
62+
var sb = new StringBuilder();
63+
sb.Append("class AsinIdentifier {\n");
64+
sb.Append(" MarketplaceId: ").Append(MarketplaceId).Append("\n");
65+
sb.Append(" Asin: ").Append(Asin).Append("\n");
66+
sb.Append("}\n");
67+
return sb.ToString();
68+
}
69+
70+
/// <summary>
71+
/// Returns the JSON string presentation of the object
72+
/// </summary>
73+
/// <returns>JSON string presentation of the object</returns>
74+
public string ToJson()
75+
{
76+
return JsonConvert.SerializeObject(this, Formatting.Indented);
77+
}
78+
79+
/// <summary>
80+
/// Returns true if objects are equal
81+
/// </summary>
82+
/// <param name="input">Object to be compared</param>
83+
/// <returns>Boolean</returns>
84+
public override bool Equals(object input)
85+
{
86+
return this.Equals(input as AsinIdentifier);
87+
}
88+
89+
/// <summary>
90+
/// Returns true if AsinIdentifier instances are equal
91+
/// </summary>
92+
/// <param name="input">Instance of AsinIdentifier to be compared</param>
93+
/// <returns>Boolean</returns>
94+
public bool Equals(AsinIdentifier input)
95+
{
96+
if (input == null)
97+
return false;
98+
99+
return
100+
(
101+
this.MarketplaceId == input.MarketplaceId ||
102+
(this.MarketplaceId != null &&
103+
this.MarketplaceId.Equals(input.MarketplaceId))
104+
) &&
105+
(
106+
this.Asin == input.Asin ||
107+
(this.Asin != null &&
108+
this.Asin.Equals(input.Asin))
109+
);
110+
}
111+
112+
/// <summary>
113+
/// Gets the hash code
114+
/// </summary>
115+
/// <returns>Hash code</returns>
116+
public override int GetHashCode()
117+
{
118+
unchecked // Overflow is fine, just wrap
119+
{
120+
int hashCode = 41;
121+
if (this.MarketplaceId != null)
122+
hashCode = hashCode * 59 + this.MarketplaceId.GetHashCode();
123+
if (this.Asin != null)
124+
hashCode = hashCode * 59 + this.Asin.GetHashCode();
125+
return hashCode;
126+
}
127+
}
128+
129+
/// <summary>
130+
/// To validate all properties of the instance
131+
/// </summary>
132+
/// <param name="validationContext">Validation context</param>
133+
/// <returns>Validation Result</returns>
134+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
135+
{
136+
yield break;
137+
}
138+
}
139+
140+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*
2+
* Selling Partner API for Listings Items
3+
*
4+
* The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](doc:listings-items-api-v2021-08-01-use-case-guide).
5+
*
6+
* OpenAPI spec version: 2021-08-01
7+
*
8+
* Generated by: https://github.com/swagger-api/swagger-codegen.git
9+
*/
10+
11+
using System;
12+
using System.IO;
13+
using System.Text;
14+
using System.Collections.Generic;
15+
using System.Runtime.Serialization;
16+
using Newtonsoft.Json;
17+
using System.ComponentModel.DataAnnotations;
18+
19+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems
20+
{
21+
/// <summary>
22+
/// Buyer segment or program this offer is applicable to.
23+
/// </summary>
24+
[DataContract]
25+
public partial class Audience : IEquatable<Audience>, IValidatableObject
26+
{
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="Audience" /> class.
29+
/// </summary>
30+
[JsonConstructorAttribute]
31+
protected Audience() { }
32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="Audience" /> class.
34+
/// </summary>
35+
/// <param name="value">Name of the audience an offer is applicable to.</param>
36+
/// <param name="displayName">Localized display name for the audience.</param>
37+
public Audience(OfferAudienceEnum? value = default(OfferAudienceEnum?), string displayName = default(string))
38+
{
39+
40+
}
41+
42+
/// <summary>
43+
/// Name of the audience an offer is applicable to.
44+
/// </summary>
45+
/// <value>Name of the audience an offer is applicable to.</value>
46+
[DataMember(Name= "value", EmitDefaultValue=false)]
47+
public OfferAudienceEnum? Value { get; set; }
48+
49+
/// <summary>
50+
/// Localized display name for the audience.
51+
/// </summary>
52+
/// <value>Localized display name for the audience.</value>
53+
[DataMember(Name= "displayName", EmitDefaultValue=false)]
54+
public string DisplayName { get; set; }
55+
56+
/// <summary>
57+
/// Returns the string presentation of the object
58+
/// </summary>
59+
/// <returns>String presentation of the object</returns>
60+
public override string ToString()
61+
{
62+
var sb = new StringBuilder();
63+
sb.Append("class Audience {\n");
64+
sb.Append(" Value: ").Append(Value).Append("\n");
65+
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
66+
sb.Append("}\n");
67+
return sb.ToString();
68+
}
69+
70+
/// <summary>
71+
/// Returns the JSON string presentation of the object
72+
/// </summary>
73+
/// <returns>JSON string presentation of the object</returns>
74+
public virtual string ToJson()
75+
{
76+
return JsonConvert.SerializeObject(this, Formatting.Indented);
77+
}
78+
79+
/// <summary>
80+
/// Returns true if objects are equal
81+
/// </summary>
82+
/// <param name="input">Object to be compared</param>
83+
/// <returns>Boolean</returns>
84+
public override bool Equals(object input)
85+
{
86+
return this.Equals(input as Audience);
87+
}
88+
89+
/// <summary>
90+
/// Returns true if Audience instances are equal
91+
/// </summary>
92+
/// <param name="input">Instance of Audience to be compared</param>
93+
/// <returns>Boolean</returns>
94+
public bool Equals(Audience input)
95+
{
96+
if (input == null)
97+
return false;
98+
99+
return
100+
(
101+
this.Value == input.Value ||
102+
(this.Value != null &&
103+
this.Value.Equals(input.Value))
104+
) &&
105+
(
106+
this.DisplayName == input.DisplayName ||
107+
(this.DisplayName != null &&
108+
this.DisplayName.Equals(input.DisplayName))
109+
);
110+
}
111+
112+
/// <summary>
113+
/// Gets the hash code
114+
/// </summary>
115+
/// <returns>Hash code</returns>
116+
public override int GetHashCode()
117+
{
118+
unchecked // Overflow is fine, just wrap
119+
{
120+
int hashCode = 41;
121+
if (this.Value != null)
122+
hashCode = hashCode * 59 + this.Value.GetHashCode();
123+
if (this.DisplayName != null)
124+
hashCode = hashCode * 59 + this.DisplayName.GetHashCode();
125+
return hashCode;
126+
}
127+
}
128+
129+
/// <summary>
130+
/// To validate all properties of the instance
131+
/// </summary>
132+
/// <param name="validationContext">Validation context</param>
133+
/// <returns>Validation Result</returns>
134+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
135+
{
136+
yield break;
137+
}
138+
}
139+
140+
}

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/ListingsItems/ItemOfferByMarketplace.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected ItemOfferByMarketplace() { }
6464
/// <param name="offerType">Type of offer for the listings item. (required).</param>
6565
/// <param name="price">Purchase price of the listings item (required).</param>
6666
/// <param name="points">points.</param>
67-
public ItemOfferByMarketplace(string marketplaceId = default(string), OfferTypeEnum offerType = default(OfferTypeEnum), Money price = default(Money), Points points = default(Points))
67+
public ItemOfferByMarketplace(string marketplaceId = default(string), OfferTypeEnum offerType = default(OfferTypeEnum), Money price = default(Money), Points points = default(Points), Audience audience = default(Audience))
6868
{
6969
// to ensure "marketplaceId" is required (not null)
7070
if (marketplaceId == null)
@@ -94,6 +94,7 @@ protected ItemOfferByMarketplace() { }
9494
this.Price = price;
9595
}
9696
this.Points = points;
97+
this.Audience = audience;
9798
}
9899

99100
/// <summary>
@@ -117,6 +118,12 @@ protected ItemOfferByMarketplace() { }
117118
[DataMember(Name="points", EmitDefaultValue=false)]
118119
public Points Points { get; set; }
119120

121+
/// <summary>
122+
/// Buyer segment or program this offer is applicable to.
123+
/// </summary>
124+
[DataMember(Name = "audience", EmitDefaultValue = false)]
125+
public Audience Audience { get; set; }
126+
120127
/// <summary>
121128
/// Returns the string presentation of the object
122129
/// </summary>
@@ -129,6 +136,7 @@ public override string ToString()
129136
sb.Append(" OfferType: ").Append(OfferType).Append("\n");
130137
sb.Append(" Price: ").Append(Price).Append("\n");
131138
sb.Append(" Points: ").Append(Points).Append("\n");
139+
sb.Append(" Audience: ").Append(Audience).Append("\n");
132140
sb.Append("}\n");
133141
return sb.ToString();
134142
}
@@ -182,6 +190,11 @@ public bool Equals(ItemOfferByMarketplace input)
182190
this.Points == input.Points ||
183191
(this.Points != null &&
184192
this.Points.Equals(input.Points))
193+
) &&
194+
(
195+
this.Audience == input.Audience ||
196+
(this.Audience != null &&
197+
this.Audience.Equals(input.Audience))
185198
);
186199
}
187200

@@ -202,6 +215,8 @@ public override int GetHashCode()
202215
hashCode = hashCode * 59 + this.Price.GetHashCode();
203216
if (this.Points != null)
204217
hashCode = hashCode * 59 + this.Points.GetHashCode();
218+
if (this.Audience != null)
219+
hashCode = hashCode * 59 + this.Audience.GetHashCode();
205220
return hashCode;
206221
}
207222
}

0 commit comments

Comments
 (0)