diff --git a/algoliasearch/Clients/IngestionClient.cs b/algoliasearch/Clients/IngestionClient.cs index 85730217..619769b6 100644 --- a/algoliasearch/Clients/IngestionClient.cs +++ b/algoliasearch/Clients/IngestionClient.cs @@ -1139,6 +1139,7 @@ public interface IIngestionClient /// Filters the tasks with the specified source type. (optional) /// Destination IDs for filtering the list of tasks. (optional) /// Type of task trigger for filtering the list of tasks. (optional) + /// If specified, the response only includes tasks with notifications.email.enabled set to this value. (optional) /// Property by which to sort the list of tasks. (optional) /// Sort order of the response, ascending or descending. (optional) /// Add extra http header or query parameters to Algolia. @@ -1147,7 +1148,7 @@ public interface IIngestionClient /// Thrown when the API call was rejected by Algolia /// Thrown when the client failed to call the endpoint /// Task of ListTasksResponse - Task ListTasksAsync(int? itemsPerPage = default, int? page = default, List action = default, bool? enabled = default, List sourceID = default, List sourceType = default, List destinationID = default, List triggerType = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default); + Task ListTasksAsync(int? itemsPerPage = default, int? page = default, List action = default, bool? enabled = default, List sourceID = default, List sourceType = default, List destinationID = default, List triggerType = default, bool? withEmailNotifications = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default); /// /// Retrieves a list of tasks. (Synchronous version) @@ -1165,6 +1166,7 @@ public interface IIngestionClient /// Filters the tasks with the specified source type. (optional) /// Destination IDs for filtering the list of tasks. (optional) /// Type of task trigger for filtering the list of tasks. (optional) + /// If specified, the response only includes tasks with notifications.email.enabled set to this value. (optional) /// Property by which to sort the list of tasks. (optional) /// Sort order of the response, ascending or descending. (optional) /// Add extra http header or query parameters to Algolia. @@ -1173,7 +1175,7 @@ public interface IIngestionClient /// Thrown when the API call was rejected by Algolia /// Thrown when the client failed to call the endpoint /// ListTasksResponse - ListTasksResponse ListTasks(int? itemsPerPage = default, int? page = default, List action = default, bool? enabled = default, List sourceID = default, List sourceType = default, List destinationID = default, List triggerType = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default); + ListTasksResponse ListTasks(int? itemsPerPage = default, int? page = default, List action = default, bool? enabled = default, List sourceID = default, List sourceType = default, List destinationID = default, List triggerType = default, bool? withEmailNotifications = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default); /// /// Retrieves a list of tasks using the v1 endpoint, please use `getTasks` instead. @@ -2736,7 +2738,7 @@ public ListSourcesResponse ListSources(int? itemsPerPage = default, int? page = /// - public async Task ListTasksAsync(int? itemsPerPage = default, int? page = default, List action = default, bool? enabled = default, List sourceID = default, List sourceType = default, List destinationID = default, List triggerType = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default) + public async Task ListTasksAsync(int? itemsPerPage = default, int? page = default, List action = default, bool? enabled = default, List sourceID = default, List sourceType = default, List destinationID = default, List triggerType = default, bool? withEmailNotifications = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default) { var requestOptions = new InternalRequestOptions(options); @@ -2749,6 +2751,7 @@ public async Task ListTasksAsync(int? itemsPerPage = default, requestOptions.AddQueryParameter("sourceType", sourceType); requestOptions.AddQueryParameter("destinationID", destinationID); requestOptions.AddQueryParameter("triggerType", triggerType); + requestOptions.AddQueryParameter("withEmailNotifications", withEmailNotifications); requestOptions.AddQueryParameter("sort", sort); requestOptions.AddQueryParameter("order", order); return await _transport.ExecuteRequestAsync(new HttpMethod("GET"), "/2/tasks", requestOptions, cancellationToken).ConfigureAwait(false); @@ -2756,8 +2759,8 @@ public async Task ListTasksAsync(int? itemsPerPage = default, /// - public ListTasksResponse ListTasks(int? itemsPerPage = default, int? page = default, List action = default, bool? enabled = default, List sourceID = default, List sourceType = default, List destinationID = default, List triggerType = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default) => - AsyncHelper.RunSync(() => ListTasksAsync(itemsPerPage, page, action, enabled, sourceID, sourceType, destinationID, triggerType, sort, order, options, cancellationToken)); + public ListTasksResponse ListTasks(int? itemsPerPage = default, int? page = default, List action = default, bool? enabled = default, List sourceID = default, List sourceType = default, List destinationID = default, List triggerType = default, bool? withEmailNotifications = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default) => + AsyncHelper.RunSync(() => ListTasksAsync(itemsPerPage, page, action, enabled, sourceID, sourceType, destinationID, triggerType, withEmailNotifications, sort, order, options, cancellationToken)); /// diff --git a/algoliasearch/Models/Ingestion/EmailNotifications.cs b/algoliasearch/Models/Ingestion/EmailNotifications.cs new file mode 100644 index 00000000..828db160 --- /dev/null +++ b/algoliasearch/Models/Ingestion/EmailNotifications.cs @@ -0,0 +1,86 @@ +// +// 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. +// +using System; +using System.Text; +using System.Linq; +using System.Text.Json.Serialization; +using System.Collections.Generic; +using Algolia.Search.Serializer; +using System.Text.Json; + +namespace Algolia.Search.Models.Ingestion; + +/// +/// EmailNotifications +/// +public partial class EmailNotifications +{ + /// + /// Initializes a new instance of the EmailNotifications class. + /// + public EmailNotifications() + { + } + + /// + /// Whether to send email notifications, note that this doesn't prevent the task from being blocked. + /// + /// Whether to send email notifications, note that this doesn't prevent the task from being blocked. + [JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class EmailNotifications {\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonSerializer.Serialize(this, JsonConfig.Options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is not EmailNotifications input) + { + return false; + } + + return + (Enabled == input.Enabled || Enabled.Equals(input.Enabled)); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + Enabled.GetHashCode(); + return hashCode; + } + } + +} + diff --git a/algoliasearch/Models/Ingestion/IngestionTask.cs b/algoliasearch/Models/Ingestion/IngestionTask.cs index 2b2f2932..e6c6e670 100644 --- a/algoliasearch/Models/Ingestion/IngestionTask.cs +++ b/algoliasearch/Models/Ingestion/IngestionTask.cs @@ -113,6 +113,18 @@ public IngestionTask(string taskID, string sourceID, string destinationID, bool [JsonPropertyName("cursor")] public string Cursor { get; set; } + /// + /// Gets or Sets Notifications + /// + [JsonPropertyName("notifications")] + public Notifications Notifications { get; set; } + + /// + /// Gets or Sets Policies + /// + [JsonPropertyName("policies")] + public Policies Policies { get; set; } + /// /// Date of creation in RFC 3339 format. /// @@ -146,6 +158,8 @@ public override string ToString() sb.Append(" FailureThreshold: ").Append(FailureThreshold).Append("\n"); sb.Append(" Action: ").Append(Action).Append("\n"); sb.Append(" Cursor: ").Append(Cursor).Append("\n"); + sb.Append(" Notifications: ").Append(Notifications).Append("\n"); + sb.Append(" Policies: ").Append(Policies).Append("\n"); sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); sb.Append("}\n"); @@ -185,6 +199,8 @@ public override bool Equals(object obj) (FailureThreshold == input.FailureThreshold || FailureThreshold.Equals(input.FailureThreshold)) && (Action == input.Action || Action.Equals(input.Action)) && (Cursor == input.Cursor || (Cursor != null && Cursor.Equals(input.Cursor))) && + (Notifications == input.Notifications || (Notifications != null && Notifications.Equals(input.Notifications))) && + (Policies == input.Policies || (Policies != null && Policies.Equals(input.Policies))) && (CreatedAt == input.CreatedAt || (CreatedAt != null && CreatedAt.Equals(input.CreatedAt))) && (UpdatedAt == input.UpdatedAt || (UpdatedAt != null && UpdatedAt.Equals(input.UpdatedAt))); } @@ -233,6 +249,14 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + Cursor.GetHashCode(); } + if (Notifications != null) + { + hashCode = (hashCode * 59) + Notifications.GetHashCode(); + } + if (Policies != null) + { + hashCode = (hashCode * 59) + Policies.GetHashCode(); + } if (CreatedAt != null) { hashCode = (hashCode * 59) + CreatedAt.GetHashCode(); diff --git a/algoliasearch/Models/Ingestion/Notifications.cs b/algoliasearch/Models/Ingestion/Notifications.cs new file mode 100644 index 00000000..777c96ee --- /dev/null +++ b/algoliasearch/Models/Ingestion/Notifications.cs @@ -0,0 +1,95 @@ +// +// 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. +// +using System; +using System.Text; +using System.Linq; +using System.Text.Json.Serialization; +using System.Collections.Generic; +using Algolia.Search.Serializer; +using System.Text.Json; + +namespace Algolia.Search.Models.Ingestion; + +/// +/// Notifications settings for a task. +/// +public partial class Notifications +{ + /// + /// Initializes a new instance of the Notifications class. + /// + [JsonConstructor] + public Notifications() { } + /// + /// Initializes a new instance of the Notifications class. + /// + /// email (required). + public Notifications(EmailNotifications email) + { + Email = email ?? throw new ArgumentNullException(nameof(email)); + } + + /// + /// Gets or Sets Email + /// + [JsonPropertyName("email")] + public EmailNotifications Email { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Notifications {\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonSerializer.Serialize(this, JsonConfig.Options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is not Notifications input) + { + return false; + } + + return + (Email == input.Email || (Email != null && Email.Equals(input.Email))); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (Email != null) + { + hashCode = (hashCode * 59) + Email.GetHashCode(); + } + return hashCode; + } + } + +} + diff --git a/algoliasearch/Models/Ingestion/Policies.cs b/algoliasearch/Models/Ingestion/Policies.cs new file mode 100644 index 00000000..0a0ed395 --- /dev/null +++ b/algoliasearch/Models/Ingestion/Policies.cs @@ -0,0 +1,86 @@ +// +// 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. +// +using System; +using System.Text; +using System.Linq; +using System.Text.Json.Serialization; +using System.Collections.Generic; +using Algolia.Search.Serializer; +using System.Text.Json; + +namespace Algolia.Search.Models.Ingestion; + +/// +/// Set of rules for a task. +/// +public partial class Policies +{ + /// + /// Initializes a new instance of the Policies class. + /// + public Policies() + { + } + + /// + /// The number of critical failures in a row before blocking the task and sending a notification. + /// + /// The number of critical failures in a row before blocking the task and sending a notification. + [JsonPropertyName("criticalThreshold")] + public int? CriticalThreshold { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class Policies {\n"); + sb.Append(" CriticalThreshold: ").Append(CriticalThreshold).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonSerializer.Serialize(this, JsonConfig.Options); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (obj is not Policies input) + { + return false; + } + + return + (CriticalThreshold == input.CriticalThreshold || CriticalThreshold.Equals(input.CriticalThreshold)); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + CriticalThreshold.GetHashCode(); + return hashCode; + } + } + +} + diff --git a/algoliasearch/Models/Ingestion/TaskCreate.cs b/algoliasearch/Models/Ingestion/TaskCreate.cs index 7af5e694..f1cad518 100644 --- a/algoliasearch/Models/Ingestion/TaskCreate.cs +++ b/algoliasearch/Models/Ingestion/TaskCreate.cs @@ -88,6 +88,18 @@ public TaskCreate(string sourceID, string destinationID, ActionType? action) [JsonPropertyName("cursor")] public string Cursor { get; set; } + /// + /// Gets or Sets Notifications + /// + [JsonPropertyName("notifications")] + public Notifications Notifications { get; set; } + + /// + /// Gets or Sets Policies + /// + [JsonPropertyName("policies")] + public Policies Policies { get; set; } + /// /// Returns the string presentation of the object /// @@ -104,6 +116,8 @@ public override string ToString() sb.Append(" FailureThreshold: ").Append(FailureThreshold).Append("\n"); sb.Append(" Input: ").Append(Input).Append("\n"); sb.Append(" Cursor: ").Append(Cursor).Append("\n"); + sb.Append(" Notifications: ").Append(Notifications).Append("\n"); + sb.Append(" Policies: ").Append(Policies).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -137,7 +151,9 @@ public override bool Equals(object obj) (Enabled == input.Enabled || Enabled.Equals(input.Enabled)) && (FailureThreshold == input.FailureThreshold || FailureThreshold.Equals(input.FailureThreshold)) && (Input == input.Input || (Input != null && Input.Equals(input.Input))) && - (Cursor == input.Cursor || (Cursor != null && Cursor.Equals(input.Cursor))); + (Cursor == input.Cursor || (Cursor != null && Cursor.Equals(input.Cursor))) && + (Notifications == input.Notifications || (Notifications != null && Notifications.Equals(input.Notifications))) && + (Policies == input.Policies || (Policies != null && Policies.Equals(input.Policies))); } /// @@ -172,6 +188,14 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + Cursor.GetHashCode(); } + if (Notifications != null) + { + hashCode = (hashCode * 59) + Notifications.GetHashCode(); + } + if (Policies != null) + { + hashCode = (hashCode * 59) + Policies.GetHashCode(); + } return hashCode; } } diff --git a/algoliasearch/Models/Ingestion/TaskUpdate.cs b/algoliasearch/Models/Ingestion/TaskUpdate.cs index 4fc30854..6aeeaa84 100644 --- a/algoliasearch/Models/Ingestion/TaskUpdate.cs +++ b/algoliasearch/Models/Ingestion/TaskUpdate.cs @@ -57,6 +57,18 @@ public TaskUpdate() [JsonPropertyName("failureThreshold")] public int? FailureThreshold { get; set; } + /// + /// Gets or Sets Notifications + /// + [JsonPropertyName("notifications")] + public Notifications Notifications { get; set; } + + /// + /// Gets or Sets Policies + /// + [JsonPropertyName("policies")] + public Policies Policies { get; set; } + /// /// Returns the string presentation of the object /// @@ -70,6 +82,8 @@ public override string ToString() sb.Append(" Input: ").Append(Input).Append("\n"); sb.Append(" Enabled: ").Append(Enabled).Append("\n"); sb.Append(" FailureThreshold: ").Append(FailureThreshold).Append("\n"); + sb.Append(" Notifications: ").Append(Notifications).Append("\n"); + sb.Append(" Policies: ").Append(Policies).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -100,7 +114,9 @@ public override bool Equals(object obj) (Cron == input.Cron || (Cron != null && Cron.Equals(input.Cron))) && (Input == input.Input || (Input != null && Input.Equals(input.Input))) && (Enabled == input.Enabled || Enabled.Equals(input.Enabled)) && - (FailureThreshold == input.FailureThreshold || FailureThreshold.Equals(input.FailureThreshold)); + (FailureThreshold == input.FailureThreshold || FailureThreshold.Equals(input.FailureThreshold)) && + (Notifications == input.Notifications || (Notifications != null && Notifications.Equals(input.Notifications))) && + (Policies == input.Policies || (Policies != null && Policies.Equals(input.Policies))); } /// @@ -126,6 +142,14 @@ public override int GetHashCode() } hashCode = (hashCode * 59) + Enabled.GetHashCode(); hashCode = (hashCode * 59) + FailureThreshold.GetHashCode(); + if (Notifications != null) + { + hashCode = (hashCode * 59) + Notifications.GetHashCode(); + } + if (Policies != null) + { + hashCode = (hashCode * 59) + Policies.GetHashCode(); + } return hashCode; } } diff --git a/algoliasearch/Models/Ingestion/TaskV1.cs b/algoliasearch/Models/Ingestion/TaskV1.cs index 7a6eafc1..433d4f13 100644 --- a/algoliasearch/Models/Ingestion/TaskV1.cs +++ b/algoliasearch/Models/Ingestion/TaskV1.cs @@ -100,6 +100,18 @@ public TaskV1(string taskID, string sourceID, string destinationID, Trigger trig [JsonPropertyName("cursor")] public string Cursor { get; set; } + /// + /// Gets or Sets Notifications + /// + [JsonPropertyName("notifications")] + public Notifications Notifications { get; set; } + + /// + /// Gets or Sets Policies + /// + [JsonPropertyName("policies")] + public Policies Policies { get; set; } + /// /// Date of creation in RFC 3339 format. /// @@ -131,6 +143,8 @@ public override string ToString() sb.Append(" FailureThreshold: ").Append(FailureThreshold).Append("\n"); sb.Append(" Action: ").Append(Action).Append("\n"); sb.Append(" Cursor: ").Append(Cursor).Append("\n"); + sb.Append(" Notifications: ").Append(Notifications).Append("\n"); + sb.Append(" Policies: ").Append(Policies).Append("\n"); sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); sb.Append("}\n"); @@ -168,6 +182,8 @@ public override bool Equals(object obj) (FailureThreshold == input.FailureThreshold || FailureThreshold.Equals(input.FailureThreshold)) && (Action == input.Action || Action.Equals(input.Action)) && (Cursor == input.Cursor || (Cursor != null && Cursor.Equals(input.Cursor))) && + (Notifications == input.Notifications || (Notifications != null && Notifications.Equals(input.Notifications))) && + (Policies == input.Policies || (Policies != null && Policies.Equals(input.Policies))) && (CreatedAt == input.CreatedAt || (CreatedAt != null && CreatedAt.Equals(input.CreatedAt))) && (UpdatedAt == input.UpdatedAt || (UpdatedAt != null && UpdatedAt.Equals(input.UpdatedAt))); } @@ -208,6 +224,14 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + Cursor.GetHashCode(); } + if (Notifications != null) + { + hashCode = (hashCode * 59) + Notifications.GetHashCode(); + } + if (Policies != null) + { + hashCode = (hashCode * 59) + Policies.GetHashCode(); + } if (CreatedAt != null) { hashCode = (hashCode * 59) + CreatedAt.GetHashCode();