|
| 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 | +/// An object that contains the extra key-value pairs provided in the injectedItem definition. |
| 16 | +/// </summary> |
| 17 | +public partial class HitMetadata |
| 18 | +{ |
| 19 | + /// <summary> |
| 20 | + /// Initializes a new instance of the HitMetadata class. |
| 21 | + /// </summary> |
| 22 | + public HitMetadata() |
| 23 | + { |
| 24 | + AdditionalProperties = new Dictionary<string, object>(); |
| 25 | + } |
| 26 | + |
| 27 | + /// <summary> |
| 28 | + /// The key of the injectedItem that inserted this metadata. |
| 29 | + /// </summary> |
| 30 | + /// <value>The key of the injectedItem that inserted this metadata.</value> |
| 31 | + [JsonPropertyName("_injectedItemKey")] |
| 32 | + public string InjectedItemKey { get; set; } |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// Gets or Sets additional properties |
| 36 | + /// </summary> |
| 37 | + [JsonExtensionData] |
| 38 | + public IDictionary<string, object> AdditionalProperties { get; set; } |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// Returns the string presentation of the object |
| 42 | + /// </summary> |
| 43 | + /// <returns>String presentation of the object</returns> |
| 44 | + public override string ToString() |
| 45 | + { |
| 46 | + StringBuilder sb = new StringBuilder(); |
| 47 | + sb.Append("class HitMetadata {\n"); |
| 48 | + sb.Append(" InjectedItemKey: ").Append(InjectedItemKey).Append("\n"); |
| 49 | + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); |
| 50 | + sb.Append("}\n"); |
| 51 | + return sb.ToString(); |
| 52 | + } |
| 53 | + |
| 54 | + /// <summary> |
| 55 | + /// Returns the JSON string presentation of the object |
| 56 | + /// </summary> |
| 57 | + /// <returns>JSON string presentation of the object</returns> |
| 58 | + public virtual string ToJson() |
| 59 | + { |
| 60 | + return JsonSerializer.Serialize(this, JsonConfig.Options); |
| 61 | + } |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// Returns true if objects are equal |
| 65 | + /// </summary> |
| 66 | + /// <param name="obj">Object to be compared</param> |
| 67 | + /// <returns>Boolean</returns> |
| 68 | + public override bool Equals(object obj) |
| 69 | + { |
| 70 | + if (obj is not HitMetadata input) |
| 71 | + { |
| 72 | + return false; |
| 73 | + } |
| 74 | + |
| 75 | + return ( |
| 76 | + InjectedItemKey == input.InjectedItemKey |
| 77 | + || (InjectedItemKey != null && InjectedItemKey.Equals(input.InjectedItemKey)) |
| 78 | + ) |
| 79 | + && ( |
| 80 | + AdditionalProperties.Count == input.AdditionalProperties.Count |
| 81 | + && !AdditionalProperties.Except(input.AdditionalProperties).Any() |
| 82 | + ); |
| 83 | + } |
| 84 | + |
| 85 | + /// <summary> |
| 86 | + /// Gets the hash code |
| 87 | + /// </summary> |
| 88 | + /// <returns>Hash code</returns> |
| 89 | + public override int GetHashCode() |
| 90 | + { |
| 91 | + unchecked // Overflow is fine, just wrap |
| 92 | + { |
| 93 | + int hashCode = 41; |
| 94 | + if (InjectedItemKey != null) |
| 95 | + { |
| 96 | + hashCode = (hashCode * 59) + InjectedItemKey.GetHashCode(); |
| 97 | + } |
| 98 | + if (AdditionalProperties != null) |
| 99 | + { |
| 100 | + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); |
| 101 | + } |
| 102 | + return hashCode; |
| 103 | + } |
| 104 | + } |
| 105 | +} |
0 commit comments