|
| 1 | +// |
| 2 | +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. |
| 3 | +// |
| 4 | +using System; |
| 5 | +using System.Collections.Generic; |
| 6 | +using System.Linq; |
| 7 | +using System.Text; |
| 8 | +using System.Text.Json; |
| 9 | +using System.Text.Json.Serialization; |
| 10 | +using Algolia.Search.Serializer; |
| 11 | + |
| 12 | +namespace Algolia.Search.Models.Composition; |
| 13 | + |
| 14 | +/// <summary> |
| 15 | +/// Multifeed |
| 16 | +/// </summary> |
| 17 | +public partial class Multifeed |
| 18 | +{ |
| 19 | + /// <summary> |
| 20 | + /// Initializes a new instance of the Multifeed class. |
| 21 | + /// </summary> |
| 22 | + [JsonConstructor] |
| 23 | + public Multifeed() { } |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// Initializes a new instance of the Multifeed class. |
| 27 | + /// </summary> |
| 28 | + /// <param name="feeds">A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection. (required).</param> |
| 29 | + public Multifeed(Dictionary<string, Injection> feeds) |
| 30 | + { |
| 31 | + Feeds = feeds ?? throw new ArgumentNullException(nameof(feeds)); |
| 32 | + } |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection. |
| 36 | + /// </summary> |
| 37 | + /// <value>A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection.</value> |
| 38 | + [JsonPropertyName("feeds")] |
| 39 | + public Dictionary<string, Injection> Feeds { get; set; } |
| 40 | + |
| 41 | + /// <summary> |
| 42 | + /// A list of Feed IDs that specifies the order in which to order the results in the response. The IDs should be a subset of those in the Feeds object, and only those specified will be processed. When this field is not set, all Feeds are processed and returned with a default ordering. |
| 43 | + /// </summary> |
| 44 | + /// <value>A list of Feed IDs that specifies the order in which to order the results in the response. The IDs should be a subset of those in the Feeds object, and only those specified will be processed. When this field is not set, all Feeds are processed and returned with a default ordering.</value> |
| 45 | + [JsonPropertyName("feedsOrder")] |
| 46 | + public List<string> FeedsOrder { get; set; } |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// Returns the string presentation of the object |
| 50 | + /// </summary> |
| 51 | + /// <returns>String presentation of the object</returns> |
| 52 | + public override string ToString() |
| 53 | + { |
| 54 | + StringBuilder sb = new StringBuilder(); |
| 55 | + sb.Append("class Multifeed {\n"); |
| 56 | + sb.Append(" Feeds: ").Append(Feeds).Append("\n"); |
| 57 | + sb.Append(" FeedsOrder: ").Append(FeedsOrder).Append("\n"); |
| 58 | + sb.Append("}\n"); |
| 59 | + return sb.ToString(); |
| 60 | + } |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// Returns the JSON string presentation of the object |
| 64 | + /// </summary> |
| 65 | + /// <returns>JSON string presentation of the object</returns> |
| 66 | + public virtual string ToJson() |
| 67 | + { |
| 68 | + return JsonSerializer.Serialize(this, JsonConfig.Options); |
| 69 | + } |
| 70 | + |
| 71 | + /// <summary> |
| 72 | + /// Returns true if objects are equal |
| 73 | + /// </summary> |
| 74 | + /// <param name="obj">Object to be compared</param> |
| 75 | + /// <returns>Boolean</returns> |
| 76 | + public override bool Equals(object obj) |
| 77 | + { |
| 78 | + if (obj is not Multifeed input) |
| 79 | + { |
| 80 | + return false; |
| 81 | + } |
| 82 | + |
| 83 | + return ( |
| 84 | + Feeds == input.Feeds |
| 85 | + || Feeds != null && input.Feeds != null && Feeds.SequenceEqual(input.Feeds) |
| 86 | + ) |
| 87 | + && ( |
| 88 | + FeedsOrder == input.FeedsOrder |
| 89 | + || FeedsOrder != null |
| 90 | + && input.FeedsOrder != null |
| 91 | + && FeedsOrder.SequenceEqual(input.FeedsOrder) |
| 92 | + ); |
| 93 | + } |
| 94 | + |
| 95 | + /// <summary> |
| 96 | + /// Gets the hash code |
| 97 | + /// </summary> |
| 98 | + /// <returns>Hash code</returns> |
| 99 | + public override int GetHashCode() |
| 100 | + { |
| 101 | + unchecked // Overflow is fine, just wrap |
| 102 | + { |
| 103 | + int hashCode = 41; |
| 104 | + if (Feeds != null) |
| 105 | + { |
| 106 | + hashCode = (hashCode * 59) + Feeds.GetHashCode(); |
| 107 | + } |
| 108 | + if (FeedsOrder != null) |
| 109 | + { |
| 110 | + hashCode = (hashCode * 59) + FeedsOrder.GetHashCode(); |
| 111 | + } |
| 112 | + return hashCode; |
| 113 | + } |
| 114 | + } |
| 115 | +} |
0 commit comments