Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Listings Item model. Added new models #835

Merged
merged 2 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions Source/FikaAmazonAPI/AmazonSpApiSDK/Models/ListingsItems/Issue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,22 @@ public enum SeverityEnum
/// Initializes a new instance of the <see cref="Issue" /> class.
/// </summary>
[JsonConstructorAttribute]
protected Issue() { }
public Issue() { }
/// <summary>
/// Initializes a new instance of the <see cref="Issue" /> class.
/// </summary>
/// <param name="code">An issue code that identifies the type of issue. (required).</param>
/// <param name="message">A message that describes the issue. (required).</param>
/// <param name="severity">The severity of the issue. (required).</param>
/// <param name="attributeNames">Names of the attributes associated with the issue, if applicable..</param>
public Issue(string code = default(string), string message = default(string), SeverityEnum severity = default(SeverityEnum), List<string> attributeNames = default(List<string>))
/// <param name="categories">List of issue categories. (required).</param>
/// <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>
public Issue(string code = default(string),
string message = default(string),
SeverityEnum severity = default(SeverityEnum),
List<string> attributeNames = default(List<string>),
List<IssueCategory> categories = default(List<IssueCategory>),
IssueEnforcements enforcements = default(IssueEnforcements))
{
// to ensure "code" is required (not null)
if (code == null)
Expand Down Expand Up @@ -100,7 +107,17 @@ protected Issue() { }
{
this.Severity = severity;
}
// to ensure "categories" is required (not null)
if (categories == null)
{
throw new InvalidDataException("categories is a required property for Issue and cannot be null");
}
else
{
this.Categories = categories;
}
this.AttributeNames = attributeNames;
this.Enforcements = enforcements;
}

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

/// <summary>
/// List of issue categories.
/// </summary>
/// <value>List of issue categories.</value>
[DataMember(Name="categories", EmitDefaultValue = false)]
public List<IssueCategory> Categories { get; set; }

/// <summary>
/// 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.
/// </summary>
/// <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>
[DataMember(Name="enforcements", EmitDefaultValue = false)]
public IssueEnforcements Enforcements { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
Expand All @@ -137,6 +168,8 @@ public override string ToString()
sb.Append(" Message: ").Append(Message).Append("\n");
sb.Append(" Severity: ").Append(Severity).Append("\n");
sb.Append(" AttributeNames: ").Append(AttributeNames).Append("\n");
sb.Append(" Categories: ").Append(Categories).Append("\n");
sb.Append(" Enforcements: ").Append(Enforcements).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand Down Expand Up @@ -190,6 +223,16 @@ public bool Equals(Issue input)
this.AttributeNames == input.AttributeNames ||
this.AttributeNames != null &&
this.AttributeNames.SequenceEqual(input.AttributeNames)
) &&
(
this.Categories == input.Categories ||
this.Categories != null &&
this.Categories.SequenceEqual(input.Categories)
) &&
(
this.Enforcements == input.Enforcements ||
(this.Enforcements != null &&
this.Enforcements.Equals(input.Enforcements))
);
}

Expand All @@ -210,6 +253,10 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.Severity.GetHashCode();
if (this.AttributeNames != null)
hashCode = hashCode * 59 + this.AttributeNames.GetHashCode();
if (this.Categories != null)
hashCode = hashCode * 59 + this.Categories.GetHashCode();
if (this.Enforcements != null)
hashCode = hashCode * 59 + this.Enforcements.GetHashCode();
return hashCode;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Selling Partner API for Listings Items
*
* 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).
*
* OpenAPI spec version: 2021-08-01
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems
{
/// <summary>
/// Issue category enum
/// </summary>
/// <value>Issue category</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum IssueCategory
{
/// <summary>
/// Enum INVALID_ATTRIBUTE for value: INVALID_ATTRIBUTE
/// </summary>
[EnumMember(Value = "INVALID_ATTRIBUTE")]
INVALID_ATTRIBUTE = 1,

/// <summary>
/// Enum MISSING_ATTRIBUTE for value: MISSING_ATTRIBUTE
/// </summary>
[EnumMember(Value = "MISSING_ATTRIBUTE")]
MISSING_ATTRIBUTE = 2,

/// <summary>
/// Enum INVALID_IMAGE for value: INVALID_IMAGE
/// </summary>
[EnumMember(Value = "INVALID_IMAGE")]
INVALID_IMAGE = 3,

/// <summary>
/// Enum MISSING_IMAGE for value: MISSING_IMAGE
/// </summary>
[EnumMember(Value = "MISSING_IMAGE")]
MISSING_IMAGE = 4,

/// <summary>
/// Enum INVALID_PRICE for value: INVALID_PRICE
/// </summary>
[EnumMember(Value = "INVALID_PRICE")]
INVALID_PRICE = 5,

/// <summary>
/// Enum MISSING_PRICE for value: MISSING_PRICE
/// </summary>
[EnumMember(Value = "MISSING_PRICE")]
MISSING_PRICE = 6,

/// <summary>
/// Enum DUPLICATE for value: DUPLICATE
/// </summary>
[EnumMember(Value = "DUPLICATE")]
DUPLICATE = 7,

/// <summary>
/// Enum QUALIFICATION_REQUIRED for value: QUALIFICATION_REQUIRED
/// </summary>
[EnumMember(Value = "QUALIFICATION_REQUIRED")]
QUALIFICATION_REQUIRED = 8,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
* Selling Partner API for Listings Items
*
* 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).
*
* OpenAPI spec version: 2021-08-01
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems
{
/// <summary>
/// The enforcement action taken by Amazon that affect the publishing or status of a listing
/// </summary>
[DataContract]
public partial class IssueEnforcementAction : IEquatable<IssueEnforcementAction>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="IssueEnforcementAction" /> class.
/// </summary>
/// <param name="action">The enforcement action name. (required).</param>
public IssueEnforcementAction(IssueEnforcementActionEnum action = default(IssueEnforcementActionEnum))
{
// to ensure "action" is required (not null)
if (action == null)
{
throw new InvalidDataException("action is a required property for IssueEnforcementAction and cannot be null");
}
else
{
this.Action = action;
}
}

/// <summary>
/// Initializes a new instance of the <see cref="IssueEnforcementAction" /> class.
/// </summary>
[JsonConstructorAttribute]
public IssueEnforcementAction() { }

/// <summary>
/// The enforcement action name.
/// </summary>
/// <value>The enforcement action name.</value>
[DataMember(Name="action", EmitDefaultValue = false)]
public IssueEnforcementActionEnum Action { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class IssueEnforcementAction {\n");
sb.Append(" Action: ").Append(Action).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as IssueEnforcementAction);
}

/// <summary>
/// Returns true if IssueEnforcementAction instances are equal
/// </summary>
/// <param name="input">Instance of IssueEnforcementAction to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(IssueEnforcementAction input)
{
if (input == null)
return false;

return
(
this.Action == input.Action ||
(this.Action != null &&
this.Action.Equals(input.Action))
);
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Action != null)
hashCode = hashCode * 59 + this.Action.GetHashCode();
return hashCode;
}
}

/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Selling Partner API for Listings Items
*
* 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).
*
* OpenAPI spec version: 2021-08-01
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems
{
/// <summary>
/// The enforcement action name.
/// </summary>
/// <value>The enforcement action name. </value>
[JsonConverter(typeof(StringEnumConverter))]
public enum IssueEnforcementActionEnum
{

/// <summary>
/// Enum LISTING_SUPPRESSED for value: LISTING_SUPPRESSED
/// </summary>
[EnumMember(Value = "LISTING_SUPPRESSED")]
LISTING_SUPPRESSED = 1,

/// <summary>
/// Enum ATTRIBUTE_SUPPRESSED for value: ATTRIBUTE_SUPPRESSED
/// </summary>
[EnumMember(Value = "ATTRIBUTE_SUPPRESSED")]
ATTRIBUTE_SUPPRESSED = 2,

/// <summary>
/// Enum CATALOG_ITEM_REMOVED for value: CATALOG_ITEM_REMOVED
/// </summary>
[EnumMember(Value = "CATALOG_ITEM_REMOVED")]
CATALOG_ITEM_REMOVED = 3,

/// <summary>
/// Enum SEARCH_SUPPRESSED for value: SEARCH_SUPPRESSED
/// </summary>
[EnumMember(Value = "SEARCH_SUPPRESSED")]
SEARCH_SUPPRESSED = 4,
}
}
Loading
Loading