Skip to content

Commit da43d92

Browse files
authored
Merge pull request #835 from Baros6647/main
Updated Listings Item model. Added new models
2 parents fbca4fe + 3f1ebf4 commit da43d92

25 files changed

+2084
-28
lines changed

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

+49-2
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,22 @@ public enum SeverityEnum
6363
/// Initializes a new instance of the <see cref="Issue" /> class.
6464
/// </summary>
6565
[JsonConstructorAttribute]
66-
protected Issue() { }
66+
public Issue() { }
6767
/// <summary>
6868
/// Initializes a new instance of the <see cref="Issue" /> class.
6969
/// </summary>
7070
/// <param name="code">An issue code that identifies the type of issue. (required).</param>
7171
/// <param name="message">A message that describes the issue. (required).</param>
7272
/// <param name="severity">The severity of the issue. (required).</param>
7373
/// <param name="attributeNames">Names of the attributes associated with the issue, if applicable..</param>
74-
public Issue(string code = default(string), string message = default(string), SeverityEnum severity = default(SeverityEnum), List<string> attributeNames = default(List<string>))
74+
/// <param name="categories">List of issue categories. (required).</param>
75+
/// <param name="enforcements">This field provides information about the enforcement actions taken by Amazon that affect the publishing or status of a listing. It also includes details about any associated exemptions.</param>
76+
public Issue(string code = default(string),
77+
string message = default(string),
78+
SeverityEnum severity = default(SeverityEnum),
79+
List<string> attributeNames = default(List<string>),
80+
List<IssueCategory> categories = default(List<IssueCategory>),
81+
IssueEnforcements enforcements = default(IssueEnforcements))
7582
{
7683
// to ensure "code" is required (not null)
7784
if (code == null)
@@ -100,7 +107,17 @@ protected Issue() { }
100107
{
101108
this.Severity = severity;
102109
}
110+
// to ensure "categories" is required (not null)
111+
if (categories == null)
112+
{
113+
throw new InvalidDataException("categories is a required property for Issue and cannot be null");
114+
}
115+
else
116+
{
117+
this.Categories = categories;
118+
}
103119
this.AttributeNames = attributeNames;
120+
this.Enforcements = enforcements;
104121
}
105122

106123
/// <summary>
@@ -125,6 +142,20 @@ protected Issue() { }
125142
[DataMember(Name="attributeNames", EmitDefaultValue=false)]
126143
public List<string> AttributeNames { get; set; }
127144

145+
/// <summary>
146+
/// List of issue categories.
147+
/// </summary>
148+
/// <value>List of issue categories.</value>
149+
[DataMember(Name="categories", EmitDefaultValue = false)]
150+
public List<IssueCategory> Categories { get; set; }
151+
152+
/// <summary>
153+
/// This field provides information about the enforcement actions taken by Amazon that affect the publishing or status of a listing. It also includes details about any associated exemptions.
154+
/// </summary>
155+
/// <value>This field provides information about the enforcement actions taken by Amazon that affect the publishing or status of a listing. It also includes details about any associated exemptions.</value>
156+
[DataMember(Name="enforcements", EmitDefaultValue = false)]
157+
public IssueEnforcements Enforcements { get; set; }
158+
128159
/// <summary>
129160
/// Returns the string presentation of the object
130161
/// </summary>
@@ -137,6 +168,8 @@ public override string ToString()
137168
sb.Append(" Message: ").Append(Message).Append("\n");
138169
sb.Append(" Severity: ").Append(Severity).Append("\n");
139170
sb.Append(" AttributeNames: ").Append(AttributeNames).Append("\n");
171+
sb.Append(" Categories: ").Append(Categories).Append("\n");
172+
sb.Append(" Enforcements: ").Append(Enforcements).Append("\n");
140173
sb.Append("}\n");
141174
return sb.ToString();
142175
}
@@ -190,6 +223,16 @@ public bool Equals(Issue input)
190223
this.AttributeNames == input.AttributeNames ||
191224
this.AttributeNames != null &&
192225
this.AttributeNames.SequenceEqual(input.AttributeNames)
226+
) &&
227+
(
228+
this.Categories == input.Categories ||
229+
this.Categories != null &&
230+
this.Categories.SequenceEqual(input.Categories)
231+
) &&
232+
(
233+
this.Enforcements == input.Enforcements ||
234+
(this.Enforcements != null &&
235+
this.Enforcements.Equals(input.Enforcements))
193236
);
194237
}
195238

@@ -210,6 +253,10 @@ public override int GetHashCode()
210253
hashCode = hashCode * 59 + this.Severity.GetHashCode();
211254
if (this.AttributeNames != null)
212255
hashCode = hashCode * 59 + this.AttributeNames.GetHashCode();
256+
if (this.Categories != null)
257+
hashCode = hashCode * 59 + this.Categories.GetHashCode();
258+
if (this.Enforcements != null)
259+
hashCode = hashCode * 59 + this.Enforcements.GetHashCode();
213260
return hashCode;
214261
}
215262
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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 Newtonsoft.Json;
12+
using Newtonsoft.Json.Converters;
13+
using System;
14+
using System.Collections.Generic;
15+
using System.Runtime.Serialization;
16+
using System.Text;
17+
18+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems
19+
{
20+
/// <summary>
21+
/// Issue category enum
22+
/// </summary>
23+
/// <value>Issue category</value>
24+
[JsonConverter(typeof(StringEnumConverter))]
25+
public enum IssueCategory
26+
{
27+
/// <summary>
28+
/// Enum INVALID_ATTRIBUTE for value: INVALID_ATTRIBUTE
29+
/// </summary>
30+
[EnumMember(Value = "INVALID_ATTRIBUTE")]
31+
INVALID_ATTRIBUTE = 1,
32+
33+
/// <summary>
34+
/// Enum MISSING_ATTRIBUTE for value: MISSING_ATTRIBUTE
35+
/// </summary>
36+
[EnumMember(Value = "MISSING_ATTRIBUTE")]
37+
MISSING_ATTRIBUTE = 2,
38+
39+
/// <summary>
40+
/// Enum INVALID_IMAGE for value: INVALID_IMAGE
41+
/// </summary>
42+
[EnumMember(Value = "INVALID_IMAGE")]
43+
INVALID_IMAGE = 3,
44+
45+
/// <summary>
46+
/// Enum MISSING_IMAGE for value: MISSING_IMAGE
47+
/// </summary>
48+
[EnumMember(Value = "MISSING_IMAGE")]
49+
MISSING_IMAGE = 4,
50+
51+
/// <summary>
52+
/// Enum INVALID_PRICE for value: INVALID_PRICE
53+
/// </summary>
54+
[EnumMember(Value = "INVALID_PRICE")]
55+
INVALID_PRICE = 5,
56+
57+
/// <summary>
58+
/// Enum MISSING_PRICE for value: MISSING_PRICE
59+
/// </summary>
60+
[EnumMember(Value = "MISSING_PRICE")]
61+
MISSING_PRICE = 6,
62+
63+
/// <summary>
64+
/// Enum DUPLICATE for value: DUPLICATE
65+
/// </summary>
66+
[EnumMember(Value = "DUPLICATE")]
67+
DUPLICATE = 7,
68+
69+
/// <summary>
70+
/// Enum QUALIFICATION_REQUIRED for value: QUALIFICATION_REQUIRED
71+
/// </summary>
72+
[EnumMember(Value = "QUALIFICATION_REQUIRED")]
73+
QUALIFICATION_REQUIRED = 8,
74+
}
75+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
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 Newtonsoft.Json;
12+
using System;
13+
using System.Collections.Generic;
14+
using System.ComponentModel.DataAnnotations;
15+
using System.IO;
16+
using System.Linq;
17+
using System.Runtime.Serialization;
18+
using System.Text;
19+
20+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems
21+
{
22+
/// <summary>
23+
/// The enforcement action taken by Amazon that affect the publishing or status of a listing
24+
/// </summary>
25+
[DataContract]
26+
public partial class IssueEnforcementAction : IEquatable<IssueEnforcementAction>, IValidatableObject
27+
{
28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="IssueEnforcementAction" /> class.
30+
/// </summary>
31+
/// <param name="action">The enforcement action name. (required).</param>
32+
public IssueEnforcementAction(IssueEnforcementActionEnum action = default(IssueEnforcementActionEnum))
33+
{
34+
// to ensure "action" is required (not null)
35+
if (action == null)
36+
{
37+
throw new InvalidDataException("action is a required property for IssueEnforcementAction and cannot be null");
38+
}
39+
else
40+
{
41+
this.Action = action;
42+
}
43+
}
44+
45+
/// <summary>
46+
/// Initializes a new instance of the <see cref="IssueEnforcementAction" /> class.
47+
/// </summary>
48+
[JsonConstructorAttribute]
49+
public IssueEnforcementAction() { }
50+
51+
/// <summary>
52+
/// The enforcement action name.
53+
/// </summary>
54+
/// <value>The enforcement action name.</value>
55+
[DataMember(Name="action", EmitDefaultValue = false)]
56+
public IssueEnforcementActionEnum Action { get; set; }
57+
58+
/// <summary>
59+
/// Returns the string presentation of the object
60+
/// </summary>
61+
/// <returns>String presentation of the object</returns>
62+
public override string ToString()
63+
{
64+
var sb = new StringBuilder();
65+
sb.Append("class IssueEnforcementAction {\n");
66+
sb.Append(" Action: ").Append(Action).Append("\n");
67+
sb.Append("}\n");
68+
return sb.ToString();
69+
}
70+
71+
/// <summary>
72+
/// Returns the JSON string presentation of the object
73+
/// </summary>
74+
/// <returns>JSON string presentation of the object</returns>
75+
public virtual string ToJson()
76+
{
77+
return JsonConvert.SerializeObject(this, Formatting.Indented);
78+
}
79+
80+
/// <summary>
81+
/// Returns true if objects are equal
82+
/// </summary>
83+
/// <param name="input">Object to be compared</param>
84+
/// <returns>Boolean</returns>
85+
public override bool Equals(object input)
86+
{
87+
return this.Equals(input as IssueEnforcementAction);
88+
}
89+
90+
/// <summary>
91+
/// Returns true if IssueEnforcementAction instances are equal
92+
/// </summary>
93+
/// <param name="input">Instance of IssueEnforcementAction to be compared</param>
94+
/// <returns>Boolean</returns>
95+
public bool Equals(IssueEnforcementAction input)
96+
{
97+
if (input == null)
98+
return false;
99+
100+
return
101+
(
102+
this.Action == input.Action ||
103+
(this.Action != null &&
104+
this.Action.Equals(input.Action))
105+
);
106+
}
107+
108+
/// <summary>
109+
/// Gets the hash code
110+
/// </summary>
111+
/// <returns>Hash code</returns>
112+
public override int GetHashCode()
113+
{
114+
unchecked // Overflow is fine, just wrap
115+
{
116+
int hashCode = 41;
117+
if (this.Action != null)
118+
hashCode = hashCode * 59 + this.Action.GetHashCode();
119+
return hashCode;
120+
}
121+
}
122+
123+
/// <summary>
124+
/// To validate all properties of the instance
125+
/// </summary>
126+
/// <param name="validationContext">Validation context</param>
127+
/// <returns>Validation Result</returns>
128+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
129+
{
130+
yield break;
131+
}
132+
}
133+
134+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 Newtonsoft.Json;
12+
using Newtonsoft.Json.Converters;
13+
using System;
14+
using System.Collections.Generic;
15+
using System.Runtime.Serialization;
16+
using System.Text;
17+
18+
namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems
19+
{
20+
/// <summary>
21+
/// The enforcement action name.
22+
/// </summary>
23+
/// <value>The enforcement action name. </value>
24+
[JsonConverter(typeof(StringEnumConverter))]
25+
public enum IssueEnforcementActionEnum
26+
{
27+
28+
/// <summary>
29+
/// Enum LISTING_SUPPRESSED for value: LISTING_SUPPRESSED
30+
/// </summary>
31+
[EnumMember(Value = "LISTING_SUPPRESSED")]
32+
LISTING_SUPPRESSED = 1,
33+
34+
/// <summary>
35+
/// Enum ATTRIBUTE_SUPPRESSED for value: ATTRIBUTE_SUPPRESSED
36+
/// </summary>
37+
[EnumMember(Value = "ATTRIBUTE_SUPPRESSED")]
38+
ATTRIBUTE_SUPPRESSED = 2,
39+
40+
/// <summary>
41+
/// Enum CATALOG_ITEM_REMOVED for value: CATALOG_ITEM_REMOVED
42+
/// </summary>
43+
[EnumMember(Value = "CATALOG_ITEM_REMOVED")]
44+
CATALOG_ITEM_REMOVED = 3,
45+
46+
/// <summary>
47+
/// Enum SEARCH_SUPPRESSED for value: SEARCH_SUPPRESSED
48+
/// </summary>
49+
[EnumMember(Value = "SEARCH_SUPPRESSED")]
50+
SEARCH_SUPPRESSED = 4,
51+
}
52+
}

0 commit comments

Comments
 (0)