|
| 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.Search; |
| 13 | + |
| 14 | +/// <summary> |
| 15 | +/// An event describe a step of the task execution flow.. |
| 16 | +/// </summary> |
| 17 | +public partial class Event |
| 18 | +{ |
| 19 | + /// <summary> |
| 20 | + /// Gets or Sets Status |
| 21 | + /// </summary> |
| 22 | + [JsonPropertyName("status")] |
| 23 | + public EventStatus? Status { get; set; } |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// Gets or Sets Type |
| 27 | + /// </summary> |
| 28 | + [JsonPropertyName("type")] |
| 29 | + public EventType? Type { get; set; } |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// Initializes a new instance of the Event class. |
| 33 | + /// </summary> |
| 34 | + [JsonConstructor] |
| 35 | + public Event() { } |
| 36 | + |
| 37 | + /// <summary> |
| 38 | + /// Initializes a new instance of the Event class. |
| 39 | + /// </summary> |
| 40 | + /// <param name="eventID">Universally unique identifier (UUID) of an event. (required).</param> |
| 41 | + /// <param name="runID">Universally unique identifier (UUID) of a task run. (required).</param> |
| 42 | + /// <param name="status">status (required).</param> |
| 43 | + /// <param name="type">type (required).</param> |
| 44 | + /// <param name="batchSize">The extracted record batch size. (required).</param> |
| 45 | + /// <param name="publishedAt">Date of publish RFC 3339 format. (required).</param> |
| 46 | + public Event( |
| 47 | + string eventID, |
| 48 | + string runID, |
| 49 | + EventStatus? status, |
| 50 | + EventType? type, |
| 51 | + int batchSize, |
| 52 | + string publishedAt |
| 53 | + ) |
| 54 | + { |
| 55 | + EventID = eventID ?? throw new ArgumentNullException(nameof(eventID)); |
| 56 | + RunID = runID ?? throw new ArgumentNullException(nameof(runID)); |
| 57 | + Status = status; |
| 58 | + Type = type; |
| 59 | + BatchSize = batchSize; |
| 60 | + PublishedAt = publishedAt ?? throw new ArgumentNullException(nameof(publishedAt)); |
| 61 | + } |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// Universally unique identifier (UUID) of an event. |
| 65 | + /// </summary> |
| 66 | + /// <value>Universally unique identifier (UUID) of an event.</value> |
| 67 | + [JsonPropertyName("eventID")] |
| 68 | + public string EventID { get; set; } |
| 69 | + |
| 70 | + /// <summary> |
| 71 | + /// Universally unique identifier (UUID) of a task run. |
| 72 | + /// </summary> |
| 73 | + /// <value>Universally unique identifier (UUID) of a task run.</value> |
| 74 | + [JsonPropertyName("runID")] |
| 75 | + public string RunID { get; set; } |
| 76 | + |
| 77 | + /// <summary> |
| 78 | + /// The extracted record batch size. |
| 79 | + /// </summary> |
| 80 | + /// <value>The extracted record batch size.</value> |
| 81 | + [JsonPropertyName("batchSize")] |
| 82 | + public int BatchSize { get; set; } |
| 83 | + |
| 84 | + /// <summary> |
| 85 | + /// Gets or Sets Data |
| 86 | + /// </summary> |
| 87 | + [JsonPropertyName("data")] |
| 88 | + public Dictionary<string, object> Data { get; set; } |
| 89 | + |
| 90 | + /// <summary> |
| 91 | + /// Date of publish RFC 3339 format. |
| 92 | + /// </summary> |
| 93 | + /// <value>Date of publish RFC 3339 format.</value> |
| 94 | + [JsonPropertyName("publishedAt")] |
| 95 | + public string PublishedAt { get; set; } |
| 96 | + |
| 97 | + /// <summary> |
| 98 | + /// Returns the string presentation of the object |
| 99 | + /// </summary> |
| 100 | + /// <returns>String presentation of the object</returns> |
| 101 | + public override string ToString() |
| 102 | + { |
| 103 | + StringBuilder sb = new StringBuilder(); |
| 104 | + sb.Append("class Event {\n"); |
| 105 | + sb.Append(" EventID: ").Append(EventID).Append("\n"); |
| 106 | + sb.Append(" RunID: ").Append(RunID).Append("\n"); |
| 107 | + sb.Append(" Status: ").Append(Status).Append("\n"); |
| 108 | + sb.Append(" Type: ").Append(Type).Append("\n"); |
| 109 | + sb.Append(" BatchSize: ").Append(BatchSize).Append("\n"); |
| 110 | + sb.Append(" Data: ").Append(Data).Append("\n"); |
| 111 | + sb.Append(" PublishedAt: ").Append(PublishedAt).Append("\n"); |
| 112 | + sb.Append("}\n"); |
| 113 | + return sb.ToString(); |
| 114 | + } |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// Returns the JSON string presentation of the object |
| 118 | + /// </summary> |
| 119 | + /// <returns>JSON string presentation of the object</returns> |
| 120 | + public virtual string ToJson() |
| 121 | + { |
| 122 | + return JsonSerializer.Serialize(this, JsonConfig.Options); |
| 123 | + } |
| 124 | + |
| 125 | + /// <summary> |
| 126 | + /// Returns true if objects are equal |
| 127 | + /// </summary> |
| 128 | + /// <param name="obj">Object to be compared</param> |
| 129 | + /// <returns>Boolean</returns> |
| 130 | + public override bool Equals(object obj) |
| 131 | + { |
| 132 | + if (obj is not Event input) |
| 133 | + { |
| 134 | + return false; |
| 135 | + } |
| 136 | + |
| 137 | + return (EventID == input.EventID || (EventID != null && EventID.Equals(input.EventID))) |
| 138 | + && (RunID == input.RunID || (RunID != null && RunID.Equals(input.RunID))) |
| 139 | + && (Status == input.Status || Status.Equals(input.Status)) |
| 140 | + && (Type == input.Type || Type.Equals(input.Type)) |
| 141 | + && (BatchSize == input.BatchSize || BatchSize.Equals(input.BatchSize)) |
| 142 | + && ( |
| 143 | + Data == input.Data || Data != null && input.Data != null && Data.SequenceEqual(input.Data) |
| 144 | + ) |
| 145 | + && ( |
| 146 | + PublishedAt == input.PublishedAt |
| 147 | + || (PublishedAt != null && PublishedAt.Equals(input.PublishedAt)) |
| 148 | + ); |
| 149 | + } |
| 150 | + |
| 151 | + /// <summary> |
| 152 | + /// Gets the hash code |
| 153 | + /// </summary> |
| 154 | + /// <returns>Hash code</returns> |
| 155 | + public override int GetHashCode() |
| 156 | + { |
| 157 | + unchecked // Overflow is fine, just wrap |
| 158 | + { |
| 159 | + int hashCode = 41; |
| 160 | + if (EventID != null) |
| 161 | + { |
| 162 | + hashCode = (hashCode * 59) + EventID.GetHashCode(); |
| 163 | + } |
| 164 | + if (RunID != null) |
| 165 | + { |
| 166 | + hashCode = (hashCode * 59) + RunID.GetHashCode(); |
| 167 | + } |
| 168 | + hashCode = (hashCode * 59) + Status.GetHashCode(); |
| 169 | + hashCode = (hashCode * 59) + Type.GetHashCode(); |
| 170 | + hashCode = (hashCode * 59) + BatchSize.GetHashCode(); |
| 171 | + if (Data != null) |
| 172 | + { |
| 173 | + hashCode = (hashCode * 59) + Data.GetHashCode(); |
| 174 | + } |
| 175 | + if (PublishedAt != null) |
| 176 | + { |
| 177 | + hashCode = (hashCode * 59) + PublishedAt.GetHashCode(); |
| 178 | + } |
| 179 | + return hashCode; |
| 180 | + } |
| 181 | + } |
| 182 | +} |
0 commit comments