/*
* Amazon Shipping API
*
* The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
*
* OpenAPI spec version: v2
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
namespace Amazon.SellingPartnerApiSDK.AmazonSpApiSDK.Models.ShippingV2
{
///
/// A list of error responses returned when a request is unsuccessful.
///
[DataContract]
public partial class ErrorList : IEquatable, IValidatableObject
{
///
/// Initializes a new instance of the class.
///
[JsonConstructor]
protected ErrorList() { }
///
/// Initializes a new instance of the class.
///
/// errors (required).
public ErrorList(List errors = default(List))
{
// to ensure "errors" is required (not null)
if (errors == null)
{
throw new InvalidDataException("errors is a required property for ErrorList and cannot be null");
}
else
{
this.Errors = errors;
}
}
///
/// Gets or Sets Errors
///
[DataMember(Name="errors", EmitDefaultValue=false)]
public List Errors { get; set; }
///
/// Returns the string presentation of the object
///
/// String presentation of the object
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class ErrorList {\n");
sb.Append(" Errors: ").Append(Errors).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
///
/// Returns the JSON string presentation of the object
///
/// JSON string presentation of the object
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
///
/// Returns true if objects are equal
///
/// Object to be compared
/// Boolean
public override bool Equals(object input)
{
return this.Equals(input as ErrorList);
}
///
/// Returns true if ErrorList instances are equal
///
/// Instance of ErrorList to be compared
/// Boolean
public bool Equals(ErrorList input)
{
if (input == null)
return false;
return
(
this.Errors == input.Errors ||
this.Errors != null &&
this.Errors.SequenceEqual(input.Errors)
);
}
///
/// Gets the hash code
///
/// Hash code
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Errors != null)
hashCode = hashCode * 59 + this.Errors.GetHashCode();
return hashCode;
}
}
///
/// To validate all properties of the instance
///
/// Validation context
/// Validation Result
IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}