|
| 1 | +using Newtonsoft.Json; |
| 2 | +using Newtonsoft.Json.Converters; |
| 3 | +using System; |
| 4 | +using System.Collections.Generic; |
| 5 | +using System.ComponentModel.DataAnnotations; |
| 6 | +using System.IO; |
| 7 | +using System.Runtime.Serialization; |
| 8 | +using System.Text; |
| 9 | + |
| 10 | +namespace FikaAmazonAPI.AmazonSpApiSDK.Models.Orders |
| 11 | +{ |
| 12 | + /// <summary> |
| 13 | + /// Buyer information |
| 14 | + /// </summary> |
| 15 | + [DataContract] |
| 16 | + public partial class BuyerInfo : IEquatable<BuyerInfo>, IValidatableObject |
| 17 | + { |
| 18 | + /// <summary> |
| 19 | + /// Initializes a new instance of the <see cref="BuyerInfo" /> class. |
| 20 | + /// </summary> |
| 21 | + /// <param name="buyerEmail">The anonymized email address of the buyer..</param> |
| 22 | + /// <param name="buyerName">The name of the buyer..</param> |
| 23 | + /// <param name="buyerCounty">The county of the buyer..</param> |
| 24 | + /// <param name="buyerTaxInfo">Tax information about the buyer..</param> |
| 25 | + /// <param name="purchaseOrderNumber">The purchase order (PO) number entered by the buyer at checkout. Returned only for orders where the buyer entered a PO number at checkout..</param> |
| 26 | + public BuyerInfo(string buyerEmail = default(string), string buyerName = default(string), string buyerCounty = default(string), BuyerTaxInfo buyerTaxInfo = default(BuyerTaxInfo), string purchaseOrderNumber = default(string)) |
| 27 | + { |
| 28 | + this.BuyerEmail = buyerEmail; |
| 29 | + this.BuyerName = buyerName; |
| 30 | + this.BuyerCounty = buyerCounty; |
| 31 | + this.BuyerTaxInfo = buyerTaxInfo; |
| 32 | + this.PurchaseOrderNumber = purchaseOrderNumber; |
| 33 | + } |
| 34 | + |
| 35 | + /// <summary> |
| 36 | + /// The anonymized email address of the buyer. |
| 37 | + /// </summary> |
| 38 | + /// <value>The anonymized email address of the buyer.</value> |
| 39 | + [DataMember(Name = "BuyerEmail", EmitDefaultValue = false)] |
| 40 | + public string BuyerEmail { get; set; } |
| 41 | + |
| 42 | + /// <summary> |
| 43 | + /// The name of the buyer. |
| 44 | + /// </summary> |
| 45 | + /// <value>The name of the buyer.</value> |
| 46 | + [DataMember(Name = "BuyerName", EmitDefaultValue = false)] |
| 47 | + public string BuyerName { get; set; } |
| 48 | + |
| 49 | + /// <summary> |
| 50 | + /// The county of the buyer. |
| 51 | + /// </summary> |
| 52 | + /// <value>The county of the buyer.</value> |
| 53 | + [DataMember(Name = "BuyerCounty", EmitDefaultValue = false)] |
| 54 | + public string BuyerCounty { get; set; } |
| 55 | + |
| 56 | + /// <summary> |
| 57 | + /// Tax information about the buyer. |
| 58 | + /// </summary> |
| 59 | + /// <value>Tax information about the buyer.</value> |
| 60 | + [DataMember(Name = "BuyerTaxInfo", EmitDefaultValue = false)] |
| 61 | + public BuyerTaxInfo BuyerTaxInfo { get; set; } |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// The purchase order (PO) number entered by the buyer at checkout. Returned only for orders where the buyer entered a PO number at checkout. |
| 65 | + /// </summary> |
| 66 | + /// <value>The purchase order (PO) number entered by the buyer at checkout. Returned only for orders where the buyer entered a PO number at checkout.</value> |
| 67 | + [DataMember(Name = "PurchaseOrderNumber", EmitDefaultValue = false)] |
| 68 | + public string PurchaseOrderNumber { get; set; } |
| 69 | + |
| 70 | + /// <summary> |
| 71 | + /// Returns the string presentation of the object |
| 72 | + /// </summary> |
| 73 | + /// <returns>String presentation of the object</returns> |
| 74 | + public override string ToString() |
| 75 | + { |
| 76 | + var sb = new StringBuilder(); |
| 77 | + sb.Append("class BuyerInfo {\n"); |
| 78 | + sb.Append(" BuyerEmail: ").Append(BuyerEmail).Append("\n"); |
| 79 | + sb.Append(" BuyerName: ").Append(BuyerName).Append("\n"); |
| 80 | + sb.Append(" BuyerCounty: ").Append(BuyerCounty).Append("\n"); |
| 81 | + sb.Append(" BuyerTaxInfo: ").Append(BuyerTaxInfo).Append("\n"); |
| 82 | + sb.Append(" PurchaseOrderNumber: ").Append(PurchaseOrderNumber).Append("\n"); |
| 83 | + sb.Append("}\n"); |
| 84 | + return sb.ToString(); |
| 85 | + } |
| 86 | + |
| 87 | + /// <summary> |
| 88 | + /// Returns the JSON string presentation of the object |
| 89 | + /// </summary> |
| 90 | + /// <returns>JSON string presentation of the object</returns> |
| 91 | + public virtual string ToJson() |
| 92 | + { |
| 93 | + return JsonConvert.SerializeObject(this, Formatting.Indented); |
| 94 | + } |
| 95 | + |
| 96 | + /// <summary> |
| 97 | + /// Returns true if objects are equal |
| 98 | + /// </summary> |
| 99 | + /// <param name="input">Object to be compared</param> |
| 100 | + /// <returns>Boolean</returns> |
| 101 | + public override bool Equals(object input) |
| 102 | + { |
| 103 | + return this.Equals(input as BuyerInfo); |
| 104 | + } |
| 105 | + |
| 106 | + /// <summary> |
| 107 | + /// Returns true if BuyerInfo instances are equal |
| 108 | + /// </summary> |
| 109 | + /// <param name="input">Instance of BuyerInfo to be compared</param> |
| 110 | + /// <returns>Boolean</returns> |
| 111 | + public bool Equals(BuyerInfo input) |
| 112 | + { |
| 113 | + if (input == null) |
| 114 | + return false; |
| 115 | + |
| 116 | + return |
| 117 | + ( |
| 118 | + this.BuyerEmail == input.BuyerEmail || |
| 119 | + (this.BuyerEmail != null && |
| 120 | + this.BuyerEmail.Equals(input.BuyerEmail)) |
| 121 | + ) && |
| 122 | + ( |
| 123 | + this.BuyerName == input.BuyerName || |
| 124 | + (this.BuyerName != null && |
| 125 | + this.BuyerName.Equals(input.BuyerName)) |
| 126 | + ) && |
| 127 | + ( |
| 128 | + this.BuyerCounty == input.BuyerCounty || |
| 129 | + (this.BuyerCounty != null && |
| 130 | + this.BuyerCounty.Equals(input.BuyerCounty)) |
| 131 | + ) && |
| 132 | + ( |
| 133 | + this.BuyerTaxInfo == input.BuyerTaxInfo || |
| 134 | + (this.BuyerTaxInfo != null && |
| 135 | + this.BuyerTaxInfo.Equals(input.BuyerTaxInfo)) |
| 136 | + ) && |
| 137 | + ( |
| 138 | + this.PurchaseOrderNumber == input.PurchaseOrderNumber || |
| 139 | + (this.PurchaseOrderNumber != null && |
| 140 | + this.PurchaseOrderNumber.Equals(input.PurchaseOrderNumber)) |
| 141 | + ); |
| 142 | + } |
| 143 | + |
| 144 | + /// <summary> |
| 145 | + /// Gets the hash code |
| 146 | + /// </summary> |
| 147 | + /// <returns>Hash code</returns> |
| 148 | + public override int GetHashCode() |
| 149 | + { |
| 150 | + unchecked // Overflow is fine, just wrap |
| 151 | + { |
| 152 | + int hashCode = 41; |
| 153 | + if (this.BuyerEmail != null) |
| 154 | + hashCode = hashCode * 59 + this.BuyerEmail.GetHashCode(); |
| 155 | + if (this.BuyerName != null) |
| 156 | + hashCode = hashCode * 59 + this.BuyerName.GetHashCode(); |
| 157 | + if (this.BuyerCounty != null) |
| 158 | + hashCode = hashCode * 59 + this.BuyerCounty.GetHashCode(); |
| 159 | + if (this.BuyerTaxInfo != null) |
| 160 | + hashCode = hashCode * 59 + this.BuyerTaxInfo.GetHashCode(); |
| 161 | + if (this.PurchaseOrderNumber != null) |
| 162 | + hashCode = hashCode * 59 + this.PurchaseOrderNumber.GetHashCode(); |
| 163 | + return hashCode; |
| 164 | + } |
| 165 | + } |
| 166 | + |
| 167 | + /// <summary> |
| 168 | + /// To validate all properties of the instance |
| 169 | + /// </summary> |
| 170 | + /// <param name="validationContext">Validation context</param> |
| 171 | + /// <returns>Validation Result</returns> |
| 172 | + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) |
| 173 | + { |
| 174 | + yield break; |
| 175 | + } |
| 176 | + } |
| 177 | +} |
0 commit comments