|
| 1 | +/* |
| 2 | + * Selling Partner API for Catalog Items |
| 3 | + * |
| 4 | + * The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, refer to the [Catalog Items API Use Case Guide](doc:catalog-items-api-v2022-04-01-use-case-guide). |
| 5 | + * |
| 6 | + * OpenAPI spec version: 2022-04-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.Runtime.Serialization; |
| 17 | +using System.Text; |
| 18 | + |
| 19 | +namespace FikaAmazonAPI.AmazonSpApiSDK.Models.CatalogItems.V20220401 |
| 20 | +{ |
| 21 | + /// <summary> |
| 22 | + /// Description of a brand that can be used to get more fine-grained search results. |
| 23 | + /// </summary> |
| 24 | + [DataContract] |
| 25 | + public partial class BrandRefinement : IEquatable<BrandRefinement>, IValidatableObject |
| 26 | + { |
| 27 | + /// <summary> |
| 28 | + /// Initializes a new instance of the <see cref="BrandRefinement" /> class. |
| 29 | + /// </summary> |
| 30 | + [JsonConstructorAttribute] |
| 31 | + public BrandRefinement() { } |
| 32 | + /// <summary> |
| 33 | + /// Initializes a new instance of the <see cref="BrandRefinement" /> class. |
| 34 | + /// </summary> |
| 35 | + /// <param name="numberOfResults">The estimated number of results that would still be returned if refinement key applied. (required).</param> |
| 36 | + /// <param name="brandName">Brand name. For display and can be used as a search refinement. (required).</param> |
| 37 | + public BrandRefinement(int? numberOfResults = default(int?), string brandName = default(string)) |
| 38 | + { |
| 39 | + // to ensure "numberOfResults" is required (not null) |
| 40 | + if (numberOfResults == null) |
| 41 | + { |
| 42 | + throw new InvalidDataException("numberOfResults is a required property for BrandRefinement and cannot be null"); |
| 43 | + } |
| 44 | + else |
| 45 | + { |
| 46 | + this.NumberOfResults = numberOfResults; |
| 47 | + } |
| 48 | + // to ensure "brandName" is required (not null) |
| 49 | + if (brandName == null) |
| 50 | + { |
| 51 | + throw new InvalidDataException("brandName is a required property for BrandRefinement and cannot be null"); |
| 52 | + } |
| 53 | + else |
| 54 | + { |
| 55 | + this.BrandName = brandName; |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + /// <summary> |
| 60 | + /// The estimated number of results that would still be returned if refinement key applied. |
| 61 | + /// </summary> |
| 62 | + /// <value>The estimated number of results that would still be returned if refinement key applied.</value> |
| 63 | + [DataMember(Name = "numberOfResults", EmitDefaultValue = false)] |
| 64 | + public int? NumberOfResults { get; set; } |
| 65 | + |
| 66 | + /// <summary> |
| 67 | + /// Brand name. For display and can be used as a search refinement. |
| 68 | + /// </summary> |
| 69 | + /// <value>Brand name. For display and can be used as a search refinement.</value> |
| 70 | + [DataMember(Name = "brandName", EmitDefaultValue = false)] |
| 71 | + public string BrandName { get; set; } |
| 72 | + |
| 73 | + /// <summary> |
| 74 | + /// Returns the string presentation of the object |
| 75 | + /// </summary> |
| 76 | + /// <returns>String presentation of the object</returns> |
| 77 | + public override string ToString() |
| 78 | + { |
| 79 | + var sb = new StringBuilder(); |
| 80 | + sb.Append("class BrandRefinement {\n"); |
| 81 | + sb.Append(" NumberOfResults: ").Append(NumberOfResults).Append("\n"); |
| 82 | + sb.Append(" BrandName: ").Append(BrandName).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 BrandRefinement); |
| 104 | + } |
| 105 | + |
| 106 | + /// <summary> |
| 107 | + /// Returns true if BrandRefinement instances are equal |
| 108 | + /// </summary> |
| 109 | + /// <param name="input">Instance of BrandRefinement to be compared</param> |
| 110 | + /// <returns>Boolean</returns> |
| 111 | + public bool Equals(BrandRefinement input) |
| 112 | + { |
| 113 | + if (input == null) |
| 114 | + return false; |
| 115 | + |
| 116 | + return |
| 117 | + ( |
| 118 | + this.NumberOfResults == input.NumberOfResults || |
| 119 | + (this.NumberOfResults != null && |
| 120 | + this.NumberOfResults.Equals(input.NumberOfResults)) |
| 121 | + ) && |
| 122 | + ( |
| 123 | + this.BrandName == input.BrandName || |
| 124 | + (this.BrandName != null && |
| 125 | + this.BrandName.Equals(input.BrandName)) |
| 126 | + ); |
| 127 | + } |
| 128 | + |
| 129 | + /// <summary> |
| 130 | + /// Gets the hash code |
| 131 | + /// </summary> |
| 132 | + /// <returns>Hash code</returns> |
| 133 | + public override int GetHashCode() |
| 134 | + { |
| 135 | + unchecked // Overflow is fine, just wrap |
| 136 | + { |
| 137 | + int hashCode = 41; |
| 138 | + if (this.NumberOfResults != null) |
| 139 | + hashCode = hashCode * 59 + this.NumberOfResults.GetHashCode(); |
| 140 | + if (this.BrandName != null) |
| 141 | + hashCode = hashCode * 59 + this.BrandName.GetHashCode(); |
| 142 | + return hashCode; |
| 143 | + } |
| 144 | + } |
| 145 | + |
| 146 | + /// <summary> |
| 147 | + /// To validate all properties of the instance |
| 148 | + /// </summary> |
| 149 | + /// <param name="validationContext">Validation context</param> |
| 150 | + /// <returns>Validation Result</returns> |
| 151 | + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) |
| 152 | + { |
| 153 | + yield break; |
| 154 | + } |
| 155 | + } |
| 156 | + |
| 157 | +} |
0 commit comments