Skip to content

Commit

Permalink
feat(specs): add notification settings to tasks [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4297

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
  • Loading branch information
algolia-bot and millotp committed Jan 6, 2025
1 parent f44f198 commit ae1f32e
Show file tree
Hide file tree
Showing 8 changed files with 373 additions and 7 deletions.
13 changes: 8 additions & 5 deletions algoliasearch/Clients/IngestionClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ public interface IIngestionClient
/// <param name="sourceType">Filters the tasks with the specified source type. (optional)</param>
/// <param name="destinationID">Destination IDs for filtering the list of tasks. (optional)</param>
/// <param name="triggerType">Type of task trigger for filtering the list of tasks. (optional)</param>
/// <param name="withEmailNotifications">If specified, the response only includes tasks with notifications.email.enabled set to this value. (optional)</param>
/// <param name="sort">Property by which to sort the list of tasks. (optional)</param>
/// <param name="order">Sort order of the response, ascending or descending. (optional)</param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
Expand All @@ -1147,7 +1148,7 @@ public interface IIngestionClient
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>Task of ListTasksResponse</returns>
Task<ListTasksResponse> ListTasksAsync(int? itemsPerPage = default, int? page = default, List<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<SourceType> sourceType = default, List<string> destinationID = default, List<TriggerType> triggerType = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default);
Task<ListTasksResponse> ListTasksAsync(int? itemsPerPage = default, int? page = default, List<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<SourceType> sourceType = default, List<string> destinationID = default, List<TriggerType> triggerType = default, bool? withEmailNotifications = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieves a list of tasks. (Synchronous version)
Expand All @@ -1165,6 +1166,7 @@ public interface IIngestionClient
/// <param name="sourceType">Filters the tasks with the specified source type. (optional)</param>
/// <param name="destinationID">Destination IDs for filtering the list of tasks. (optional)</param>
/// <param name="triggerType">Type of task trigger for filtering the list of tasks. (optional)</param>
/// <param name="withEmailNotifications">If specified, the response only includes tasks with notifications.email.enabled set to this value. (optional)</param>
/// <param name="sort">Property by which to sort the list of tasks. (optional)</param>
/// <param name="order">Sort order of the response, ascending or descending. (optional)</param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
Expand All @@ -1173,7 +1175,7 @@ public interface IIngestionClient
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>ListTasksResponse</returns>
ListTasksResponse ListTasks(int? itemsPerPage = default, int? page = default, List<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<SourceType> sourceType = default, List<string> destinationID = default, List<TriggerType> triggerType = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default);
ListTasksResponse ListTasks(int? itemsPerPage = default, int? page = default, List<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<SourceType> sourceType = default, List<string> destinationID = default, List<TriggerType> triggerType = default, bool? withEmailNotifications = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieves a list of tasks using the v1 endpoint, please use `getTasks` instead.
Expand Down Expand Up @@ -2736,7 +2738,7 @@ public ListSourcesResponse ListSources(int? itemsPerPage = default, int? page =


/// <inheritdoc />
public async Task<ListTasksResponse> ListTasksAsync(int? itemsPerPage = default, int? page = default, List<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<SourceType> sourceType = default, List<string> destinationID = default, List<TriggerType> triggerType = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default)
public async Task<ListTasksResponse> ListTasksAsync(int? itemsPerPage = default, int? page = default, List<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<SourceType> sourceType = default, List<string> destinationID = default, List<TriggerType> triggerType = default, bool? withEmailNotifications = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default)
{
var requestOptions = new InternalRequestOptions(options);

Expand All @@ -2749,15 +2751,16 @@ public async Task<ListTasksResponse> 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<ListTasksResponse>(new HttpMethod("GET"), "/2/tasks", requestOptions, cancellationToken).ConfigureAwait(false);
}


/// <inheritdoc />
public ListTasksResponse ListTasks(int? itemsPerPage = default, int? page = default, List<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<SourceType> sourceType = default, List<string> destinationID = default, List<TriggerType> 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<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<SourceType> sourceType = default, List<string> destinationID = default, List<TriggerType> 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));


/// <inheritdoc />
Expand Down
86 changes: 86 additions & 0 deletions algoliasearch/Models/Ingestion/EmailNotifications.cs
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
/// EmailNotifications
/// </summary>
public partial class EmailNotifications
{
/// <summary>
/// Initializes a new instance of the EmailNotifications class.
/// </summary>
public EmailNotifications()
{
}

/// <summary>
/// Whether to send email notifications, note that this doesn't prevent the task from being blocked.
/// </summary>
/// <value>Whether to send email notifications, note that this doesn't prevent the task from being blocked.</value>
[JsonPropertyName("enabled")]
public bool? Enabled { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
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();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not EmailNotifications input)
{
return false;
}

return
(Enabled == input.Enabled || Enabled.Equals(input.Enabled));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
hashCode = (hashCode * 59) + Enabled.GetHashCode();
return hashCode;
}
}

}

24 changes: 24 additions & 0 deletions algoliasearch/Models/Ingestion/IngestionTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ public IngestionTask(string taskID, string sourceID, string destinationID, bool
[JsonPropertyName("cursor")]
public string Cursor { get; set; }

/// <summary>
/// Gets or Sets Notifications
/// </summary>
[JsonPropertyName("notifications")]
public Notifications Notifications { get; set; }

/// <summary>
/// Gets or Sets Policies
/// </summary>
[JsonPropertyName("policies")]
public Policies Policies { get; set; }

/// <summary>
/// Date of creation in RFC 3339 format.
/// </summary>
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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)));
}
Expand Down Expand Up @@ -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();
Expand Down
95 changes: 95 additions & 0 deletions algoliasearch/Models/Ingestion/Notifications.cs
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
/// Notifications settings for a task.
/// </summary>
public partial class Notifications
{
/// <summary>
/// Initializes a new instance of the Notifications class.
/// </summary>
[JsonConstructor]
public Notifications() { }
/// <summary>
/// Initializes a new instance of the Notifications class.
/// </summary>
/// <param name="email">email (required).</param>
public Notifications(EmailNotifications email)
{
Email = email ?? throw new ArgumentNullException(nameof(email));
}

/// <summary>
/// Gets or Sets Email
/// </summary>
[JsonPropertyName("email")]
public EmailNotifications Email { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
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();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not Notifications input)
{
return false;
}

return
(Email == input.Email || (Email != null && Email.Equals(input.Email)));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Email != null)
{
hashCode = (hashCode * 59) + Email.GetHashCode();
}
return hashCode;
}
}

}

86 changes: 86 additions & 0 deletions algoliasearch/Models/Ingestion/Policies.cs
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
/// Set of rules for a task.
/// </summary>
public partial class Policies
{
/// <summary>
/// Initializes a new instance of the Policies class.
/// </summary>
public Policies()
{
}

/// <summary>
/// The number of critical failures in a row before blocking the task and sending a notification.
/// </summary>
/// <value>The number of critical failures in a row before blocking the task and sending a notification.</value>
[JsonPropertyName("criticalThreshold")]
public int? CriticalThreshold { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
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();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not Policies input)
{
return false;
}

return
(CriticalThreshold == input.CriticalThreshold || CriticalThreshold.Equals(input.CriticalThreshold));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
hashCode = (hashCode * 59) + CriticalThreshold.GetHashCode();
return hashCode;
}
}

}

Loading

0 comments on commit ae1f32e

Please sign in to comment.