|
| 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.Ingestion; |
| 13 | + |
| 14 | +/// <summary> |
| 15 | +/// API request body for updating a task. |
| 16 | +/// </summary> |
| 17 | +public partial class TaskReplace |
| 18 | +{ |
| 19 | + /// <summary> |
| 20 | + /// Gets or Sets Action |
| 21 | + /// </summary> |
| 22 | + [JsonPropertyName("action")] |
| 23 | + public ActionType? Action { get; set; } |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// Gets or Sets SubscriptionAction |
| 27 | + /// </summary> |
| 28 | + [JsonPropertyName("subscriptionAction")] |
| 29 | + public ActionType? SubscriptionAction { get; set; } |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// Initializes a new instance of the TaskReplace class. |
| 33 | + /// </summary> |
| 34 | + [JsonConstructor] |
| 35 | + public TaskReplace() { } |
| 36 | + |
| 37 | + /// <summary> |
| 38 | + /// Initializes a new instance of the TaskReplace class. |
| 39 | + /// </summary> |
| 40 | + /// <param name="destinationID">Universally unique identifier (UUID) of a destination resource. (required).</param> |
| 41 | + /// <param name="action">action (required).</param> |
| 42 | + public TaskReplace(string destinationID, ActionType? action) |
| 43 | + { |
| 44 | + DestinationID = destinationID ?? throw new ArgumentNullException(nameof(destinationID)); |
| 45 | + Action = action; |
| 46 | + } |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// Universally unique identifier (UUID) of a destination resource. |
| 50 | + /// </summary> |
| 51 | + /// <value>Universally unique identifier (UUID) of a destination resource.</value> |
| 52 | + [JsonPropertyName("destinationID")] |
| 53 | + public string DestinationID { get; set; } |
| 54 | + |
| 55 | + /// <summary> |
| 56 | + /// Cron expression for the task's schedule. |
| 57 | + /// </summary> |
| 58 | + /// <value>Cron expression for the task's schedule.</value> |
| 59 | + [JsonPropertyName("cron")] |
| 60 | + public string Cron { get; set; } |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// Whether the task is enabled. |
| 64 | + /// </summary> |
| 65 | + /// <value>Whether the task is enabled.</value> |
| 66 | + [JsonPropertyName("enabled")] |
| 67 | + public bool? Enabled { get; set; } |
| 68 | + |
| 69 | + /// <summary> |
| 70 | + /// Maximum accepted percentage of failures for a task run to finish successfully. |
| 71 | + /// </summary> |
| 72 | + /// <value>Maximum accepted percentage of failures for a task run to finish successfully.</value> |
| 73 | + [JsonPropertyName("failureThreshold")] |
| 74 | + public int? FailureThreshold { get; set; } |
| 75 | + |
| 76 | + /// <summary> |
| 77 | + /// Gets or Sets Input |
| 78 | + /// </summary> |
| 79 | + [JsonPropertyName("input")] |
| 80 | + public TaskInput Input { get; set; } |
| 81 | + |
| 82 | + /// <summary> |
| 83 | + /// Date of the last cursor in RFC 3339 format. |
| 84 | + /// </summary> |
| 85 | + /// <value>Date of the last cursor in RFC 3339 format.</value> |
| 86 | + [JsonPropertyName("cursor")] |
| 87 | + public string Cursor { get; set; } |
| 88 | + |
| 89 | + /// <summary> |
| 90 | + /// Gets or Sets Notifications |
| 91 | + /// </summary> |
| 92 | + [JsonPropertyName("notifications")] |
| 93 | + public Notifications Notifications { get; set; } |
| 94 | + |
| 95 | + /// <summary> |
| 96 | + /// Gets or Sets Policies |
| 97 | + /// </summary> |
| 98 | + [JsonPropertyName("policies")] |
| 99 | + public Policies Policies { get; set; } |
| 100 | + |
| 101 | + /// <summary> |
| 102 | + /// Returns the string presentation of the object |
| 103 | + /// </summary> |
| 104 | + /// <returns>String presentation of the object</returns> |
| 105 | + public override string ToString() |
| 106 | + { |
| 107 | + StringBuilder sb = new StringBuilder(); |
| 108 | + sb.Append("class TaskReplace {\n"); |
| 109 | + sb.Append(" DestinationID: ").Append(DestinationID).Append("\n"); |
| 110 | + sb.Append(" Action: ").Append(Action).Append("\n"); |
| 111 | + sb.Append(" SubscriptionAction: ").Append(SubscriptionAction).Append("\n"); |
| 112 | + sb.Append(" Cron: ").Append(Cron).Append("\n"); |
| 113 | + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); |
| 114 | + sb.Append(" FailureThreshold: ").Append(FailureThreshold).Append("\n"); |
| 115 | + sb.Append(" Input: ").Append(Input).Append("\n"); |
| 116 | + sb.Append(" Cursor: ").Append(Cursor).Append("\n"); |
| 117 | + sb.Append(" Notifications: ").Append(Notifications).Append("\n"); |
| 118 | + sb.Append(" Policies: ").Append(Policies).Append("\n"); |
| 119 | + sb.Append("}\n"); |
| 120 | + return sb.ToString(); |
| 121 | + } |
| 122 | + |
| 123 | + /// <summary> |
| 124 | + /// Returns the JSON string presentation of the object |
| 125 | + /// </summary> |
| 126 | + /// <returns>JSON string presentation of the object</returns> |
| 127 | + public virtual string ToJson() |
| 128 | + { |
| 129 | + return JsonSerializer.Serialize(this, JsonConfig.Options); |
| 130 | + } |
| 131 | + |
| 132 | + /// <summary> |
| 133 | + /// Returns true if objects are equal |
| 134 | + /// </summary> |
| 135 | + /// <param name="obj">Object to be compared</param> |
| 136 | + /// <returns>Boolean</returns> |
| 137 | + public override bool Equals(object obj) |
| 138 | + { |
| 139 | + if (obj is not TaskReplace input) |
| 140 | + { |
| 141 | + return false; |
| 142 | + } |
| 143 | + |
| 144 | + return ( |
| 145 | + DestinationID == input.DestinationID |
| 146 | + || (DestinationID != null && DestinationID.Equals(input.DestinationID)) |
| 147 | + ) |
| 148 | + && (Action == input.Action || Action.Equals(input.Action)) |
| 149 | + && ( |
| 150 | + SubscriptionAction == input.SubscriptionAction |
| 151 | + || SubscriptionAction.Equals(input.SubscriptionAction) |
| 152 | + ) |
| 153 | + && (Cron == input.Cron || (Cron != null && Cron.Equals(input.Cron))) |
| 154 | + && (Enabled == input.Enabled || Enabled.Equals(input.Enabled)) |
| 155 | + && ( |
| 156 | + FailureThreshold == input.FailureThreshold |
| 157 | + || FailureThreshold.Equals(input.FailureThreshold) |
| 158 | + ) |
| 159 | + && (Input == input.Input || (Input != null && Input.Equals(input.Input))) |
| 160 | + && (Cursor == input.Cursor || (Cursor != null && Cursor.Equals(input.Cursor))) |
| 161 | + && ( |
| 162 | + Notifications == input.Notifications |
| 163 | + || (Notifications != null && Notifications.Equals(input.Notifications)) |
| 164 | + ) |
| 165 | + && (Policies == input.Policies || (Policies != null && Policies.Equals(input.Policies))); |
| 166 | + } |
| 167 | + |
| 168 | + /// <summary> |
| 169 | + /// Gets the hash code |
| 170 | + /// </summary> |
| 171 | + /// <returns>Hash code</returns> |
| 172 | + public override int GetHashCode() |
| 173 | + { |
| 174 | + unchecked // Overflow is fine, just wrap |
| 175 | + { |
| 176 | + int hashCode = 41; |
| 177 | + if (DestinationID != null) |
| 178 | + { |
| 179 | + hashCode = (hashCode * 59) + DestinationID.GetHashCode(); |
| 180 | + } |
| 181 | + hashCode = (hashCode * 59) + Action.GetHashCode(); |
| 182 | + hashCode = (hashCode * 59) + SubscriptionAction.GetHashCode(); |
| 183 | + if (Cron != null) |
| 184 | + { |
| 185 | + hashCode = (hashCode * 59) + Cron.GetHashCode(); |
| 186 | + } |
| 187 | + hashCode = (hashCode * 59) + Enabled.GetHashCode(); |
| 188 | + hashCode = (hashCode * 59) + FailureThreshold.GetHashCode(); |
| 189 | + if (Input != null) |
| 190 | + { |
| 191 | + hashCode = (hashCode * 59) + Input.GetHashCode(); |
| 192 | + } |
| 193 | + if (Cursor != null) |
| 194 | + { |
| 195 | + hashCode = (hashCode * 59) + Cursor.GetHashCode(); |
| 196 | + } |
| 197 | + if (Notifications != null) |
| 198 | + { |
| 199 | + hashCode = (hashCode * 59) + Notifications.GetHashCode(); |
| 200 | + } |
| 201 | + if (Policies != null) |
| 202 | + { |
| 203 | + hashCode = (hashCode * 59) + Policies.GetHashCode(); |
| 204 | + } |
| 205 | + return hashCode; |
| 206 | + } |
| 207 | + } |
| 208 | +} |
0 commit comments