Skip to content

Commit

Permalink
chore: generated code for commit c91ca54. [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
Co-authored-by: shortcuts <vannicattec@gmail.com>
  • Loading branch information
3 people committed Jun 19, 2024
1 parent c91ca54 commit 0bcaea0
Show file tree
Hide file tree
Showing 44 changed files with 4,361 additions and 185 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,56 @@ public interface IIngestionClient
/// <returns>TaskUpdateResponse</returns>
TaskUpdateResponse UpdateTask(string taskID, TaskUpdate taskUpdate, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.
/// </summary>
/// <param name="sourceCreate"> (optional)</param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <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 SourceValidateResponse</returns>
Task<SourceValidateResponse> ValidateSourceAsync(SourceCreate sourceCreate = default, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Validates a source payload to ensure it can be created and that the data source can be reached by Algolia. (Synchronous version)
/// </summary>
/// <param name="sourceCreate"> (optional)</param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <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>SourceValidateResponse</returns>
SourceValidateResponse ValidateSource(SourceCreate sourceCreate = default, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.
/// </summary>
/// <param name="sourceID">Unique identifier of a source.</param>
/// <param name="sourceUpdate"></param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <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 SourceValidateResponse</returns>
Task<SourceValidateResponse> ValidateSourceBeforeUpdateAsync(string sourceID, SourceUpdate sourceUpdate, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia. (Synchronous version)
/// </summary>
/// <param name="sourceID">Unique identifier of a source.</param>
/// <param name="sourceUpdate"></param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <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>SourceValidateResponse</returns>
SourceValidateResponse ValidateSourceBeforeUpdate(string sourceID, SourceUpdate sourceUpdate, RequestOptions options = null, CancellationToken cancellationToken = default);

}


Expand Down Expand Up @@ -2923,5 +2973,104 @@ public async Task<TaskUpdateResponse> UpdateTaskAsync(string taskID, TaskUpdate
public TaskUpdateResponse UpdateTask(string taskID, TaskUpdate taskUpdate, RequestOptions options = null, CancellationToken cancellationToken = default) =>
AsyncHelper.RunSync(() => UpdateTaskAsync(taskID, taskUpdate, options, cancellationToken));


/// <summary>
/// Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.
/// </summary>
///
/// Required API Key ACLs:
/// - addObject
/// - deleteIndex
/// - editSettings
/// <param name="sourceCreate"> (optional)</param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <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 SourceValidateResponse</returns>
public async Task<SourceValidateResponse> ValidateSourceAsync(SourceCreate sourceCreate = default, RequestOptions options = null, CancellationToken cancellationToken = default)
{
var requestOptions = new InternalRequestOptions(options);


requestOptions.Data = sourceCreate;
return await _transport.ExecuteRequestAsync<SourceValidateResponse>(new HttpMethod("POST"), "/1/sources/validate", requestOptions, cancellationToken).ConfigureAwait(false);
}


/// <summary>
/// Validates a source payload to ensure it can be created and that the data source can be reached by Algolia. (Synchronous version)
/// </summary>
///
/// Required API Key ACLs:
/// - addObject
/// - deleteIndex
/// - editSettings
/// <param name="sourceCreate"> (optional)</param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <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>SourceValidateResponse</returns>
public SourceValidateResponse ValidateSource(SourceCreate sourceCreate = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
AsyncHelper.RunSync(() => ValidateSourceAsync(sourceCreate, options, cancellationToken));


/// <summary>
/// Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.
/// </summary>
///
/// Required API Key ACLs:
/// - addObject
/// - deleteIndex
/// - editSettings
/// <param name="sourceID">Unique identifier of a source.</param>
/// <param name="sourceUpdate"></param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <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 SourceValidateResponse</returns>
public async Task<SourceValidateResponse> ValidateSourceBeforeUpdateAsync(string sourceID, SourceUpdate sourceUpdate, RequestOptions options = null, CancellationToken cancellationToken = default)
{

if (sourceID == null)
throw new ArgumentException("Parameter `sourceID` is required when calling `ValidateSourceBeforeUpdate`.");


if (sourceUpdate == null)
throw new ArgumentException("Parameter `sourceUpdate` is required when calling `ValidateSourceBeforeUpdate`.");

var requestOptions = new InternalRequestOptions(options);

requestOptions.PathParameters.Add("sourceID", QueryStringHelper.ParameterToString(sourceID));

requestOptions.Data = sourceUpdate;
return await _transport.ExecuteRequestAsync<SourceValidateResponse>(new HttpMethod("POST"), "/1/sources/{sourceID}/validate", requestOptions, cancellationToken).ConfigureAwait(false);
}


/// <summary>
/// Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia. (Synchronous version)
/// </summary>
///
/// Required API Key ACLs:
/// - addObject
/// - deleteIndex
/// - editSettings
/// <param name="sourceID">Unique identifier of a source.</param>
/// <param name="sourceUpdate"></param>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <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>SourceValidateResponse</returns>
public SourceValidateResponse ValidateSourceBeforeUpdate(string sourceID, SourceUpdate sourceUpdate, RequestOptions options = null, CancellationToken cancellationToken = default) =>
AsyncHelper.RunSync(() => ValidateSourceBeforeUpdateAsync(sourceID, sourceUpdate, options, cancellationToken));

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
//
// 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>
/// SourceValidateResponse
/// </summary>
public partial class SourceValidateResponse
{
/// <summary>
/// Initializes a new instance of the SourceValidateResponse class.
/// </summary>
[JsonConstructor]
public SourceValidateResponse() { }
/// <summary>
/// Initializes a new instance of the SourceValidateResponse class.
/// </summary>
/// <param name="message">a message describing the outcome of a validate run. (required).</param>
public SourceValidateResponse(string message)
{
Message = message ?? throw new ArgumentNullException(nameof(message));
}

/// <summary>
/// Universally unique identifier (UUID) of a task run.
/// </summary>
/// <value>Universally unique identifier (UUID) of a task run.</value>
[JsonPropertyName("runID")]
public string RunID { get; set; }

/// <summary>
/// depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery).
/// </summary>
/// <value>depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery).</value>
[JsonPropertyName("data")]
public List<object> Data { get; set; }

/// <summary>
/// in case of error, observability events will be added to the response, if any.
/// </summary>
/// <value>in case of error, observability events will be added to the response, if any.</value>
[JsonPropertyName("events")]
public List<Event> Events { get; set; }

/// <summary>
/// a message describing the outcome of a validate run.
/// </summary>
/// <value>a message describing the outcome of a validate run.</value>
[JsonPropertyName("message")]
public string Message { 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 SourceValidateResponse {\n");
sb.Append(" RunID: ").Append(RunID).Append("\n");
sb.Append(" Data: ").Append(Data).Append("\n");
sb.Append(" Events: ").Append(Events).Append("\n");
sb.Append(" Message: ").Append(Message).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 SourceValidateResponse input)
{
return false;
}

return
(RunID == input.RunID || (RunID != null && RunID.Equals(input.RunID))) &&
(Data == input.Data || Data != null && input.Data != null && Data.SequenceEqual(input.Data)) &&
(Events == input.Events || Events != null && input.Events != null && Events.SequenceEqual(input.Events)) &&
(Message == input.Message || (Message != null && Message.Equals(input.Message)));
}

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

}

Loading

0 comments on commit 0bcaea0

Please sign in to comment.