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