|
| 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.Linq; |
| 13 | +using System.IO; |
| 14 | +using System.Text; |
| 15 | +using System.Text.RegularExpressions; |
| 16 | +using System.Collections; |
| 17 | +using System.Collections.Generic; |
| 18 | +using System.Collections.ObjectModel; |
| 19 | +using System.Runtime.Serialization; |
| 20 | +using Newtonsoft.Json; |
| 21 | +using Newtonsoft.Json.Converters; |
| 22 | +using System.ComponentModel.DataAnnotations; |
| 23 | + |
| 24 | +namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems |
| 25 | +{ |
| 26 | + /// <summary> |
| 27 | + /// Error response returned when the request is unsuccessful. |
| 28 | + /// </summary> |
| 29 | + [DataContract] |
| 30 | + public partial class Error : IEquatable<Error>, IValidatableObject |
| 31 | + { |
| 32 | + /// <summary> |
| 33 | + /// Initializes a new instance of the <see cref="Error" /> class. |
| 34 | + /// </summary> |
| 35 | + [JsonConstructorAttribute] |
| 36 | + protected Error() { } |
| 37 | + /// <summary> |
| 38 | + /// Initializes a new instance of the <see cref="Error" /> class. |
| 39 | + /// </summary> |
| 40 | + /// <param name="code">An error code that identifies the type of error that occurred. (required).</param> |
| 41 | + /// <param name="message">A message that describes the error condition. (required).</param> |
| 42 | + /// <param name="details">Additional details that can help the caller understand or fix the issue..</param> |
| 43 | + public Error(string code = default(string), string message = default(string), string details = default(string)) |
| 44 | + { |
| 45 | + // to ensure "code" is required (not null) |
| 46 | + if (code == null) |
| 47 | + { |
| 48 | + throw new InvalidDataException("code is a required property for Error and cannot be null"); |
| 49 | + } |
| 50 | + else |
| 51 | + { |
| 52 | + this.Code = code; |
| 53 | + } |
| 54 | + // to ensure "message" is required (not null) |
| 55 | + if (message == null) |
| 56 | + { |
| 57 | + throw new InvalidDataException("message is a required property for Error and cannot be null"); |
| 58 | + } |
| 59 | + else |
| 60 | + { |
| 61 | + this.Message = message; |
| 62 | + } |
| 63 | + this.Details = details; |
| 64 | + } |
| 65 | + |
| 66 | + /// <summary> |
| 67 | + /// An error code that identifies the type of error that occurred. |
| 68 | + /// </summary> |
| 69 | + /// <value>An error code that identifies the type of error that occurred.</value> |
| 70 | + [DataMember(Name="code", EmitDefaultValue=false)] |
| 71 | + public string Code { get; set; } |
| 72 | + |
| 73 | + /// <summary> |
| 74 | + /// A message that describes the error condition. |
| 75 | + /// </summary> |
| 76 | + /// <value>A message that describes the error condition.</value> |
| 77 | + [DataMember(Name="message", EmitDefaultValue=false)] |
| 78 | + public string Message { get; set; } |
| 79 | + |
| 80 | + /// <summary> |
| 81 | + /// Additional details that can help the caller understand or fix the issue. |
| 82 | + /// </summary> |
| 83 | + /// <value>Additional details that can help the caller understand or fix the issue.</value> |
| 84 | + [DataMember(Name="details", EmitDefaultValue=false)] |
| 85 | + public string Details { get; set; } |
| 86 | + |
| 87 | + /// <summary> |
| 88 | + /// Returns the string presentation of the object |
| 89 | + /// </summary> |
| 90 | + /// <returns>String presentation of the object</returns> |
| 91 | + public override string ToString() |
| 92 | + { |
| 93 | + var sb = new StringBuilder(); |
| 94 | + sb.Append("class Error {\n"); |
| 95 | + sb.Append(" Code: ").Append(Code).Append("\n"); |
| 96 | + sb.Append(" Message: ").Append(Message).Append("\n"); |
| 97 | + sb.Append(" Details: ").Append(Details).Append("\n"); |
| 98 | + sb.Append("}\n"); |
| 99 | + return sb.ToString(); |
| 100 | + } |
| 101 | + |
| 102 | + /// <summary> |
| 103 | + /// Returns the JSON string presentation of the object |
| 104 | + /// </summary> |
| 105 | + /// <returns>JSON string presentation of the object</returns> |
| 106 | + public virtual string ToJson() |
| 107 | + { |
| 108 | + return JsonConvert.SerializeObject(this, Formatting.Indented); |
| 109 | + } |
| 110 | + |
| 111 | + /// <summary> |
| 112 | + /// Returns true if objects are equal |
| 113 | + /// </summary> |
| 114 | + /// <param name="input">Object to be compared</param> |
| 115 | + /// <returns>Boolean</returns> |
| 116 | + public override bool Equals(object input) |
| 117 | + { |
| 118 | + return this.Equals(input as Error); |
| 119 | + } |
| 120 | + |
| 121 | + /// <summary> |
| 122 | + /// Returns true if Error instances are equal |
| 123 | + /// </summary> |
| 124 | + /// <param name="input">Instance of Error to be compared</param> |
| 125 | + /// <returns>Boolean</returns> |
| 126 | + public bool Equals(Error input) |
| 127 | + { |
| 128 | + if (input == null) |
| 129 | + return false; |
| 130 | + |
| 131 | + return |
| 132 | + ( |
| 133 | + this.Code == input.Code || |
| 134 | + (this.Code != null && |
| 135 | + this.Code.Equals(input.Code)) |
| 136 | + ) && |
| 137 | + ( |
| 138 | + this.Message == input.Message || |
| 139 | + (this.Message != null && |
| 140 | + this.Message.Equals(input.Message)) |
| 141 | + ) && |
| 142 | + ( |
| 143 | + this.Details == input.Details || |
| 144 | + (this.Details != null && |
| 145 | + this.Details.Equals(input.Details)) |
| 146 | + ); |
| 147 | + } |
| 148 | + |
| 149 | + /// <summary> |
| 150 | + /// Gets the hash code |
| 151 | + /// </summary> |
| 152 | + /// <returns>Hash code</returns> |
| 153 | + public override int GetHashCode() |
| 154 | + { |
| 155 | + unchecked // Overflow is fine, just wrap |
| 156 | + { |
| 157 | + int hashCode = 41; |
| 158 | + if (this.Code != null) |
| 159 | + hashCode = hashCode * 59 + this.Code.GetHashCode(); |
| 160 | + if (this.Message != null) |
| 161 | + hashCode = hashCode * 59 + this.Message.GetHashCode(); |
| 162 | + if (this.Details != null) |
| 163 | + hashCode = hashCode * 59 + this.Details.GetHashCode(); |
| 164 | + return hashCode; |
| 165 | + } |
| 166 | + } |
| 167 | + |
| 168 | + /// <summary> |
| 169 | + /// To validate all properties of the instance |
| 170 | + /// </summary> |
| 171 | + /// <param name="validationContext">Validation context</param> |
| 172 | + /// <returns>Validation Result</returns> |
| 173 | + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) |
| 174 | + { |
| 175 | + yield break; |
| 176 | + } |
| 177 | + } |
| 178 | + |
| 179 | +} |
0 commit comments