Skip to content

Commit

Permalink
Merge branch 'main' into fix/ingestion-transformation-copilot
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluf22 authored Aug 5, 2024
2 parents 16ee594 + 1034d8e commit 14a2b7f
Show file tree
Hide file tree
Showing 46 changed files with 95 additions and 1,116 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ namespace Algolia.Search.Models.Ingestion;
[JsonConverter(typeof(DestinationInputJsonConverter))]
public partial class DestinationInput : AbstractSchema
{
/// <summary>
/// Initializes a new instance of the DestinationInput class
/// with a DestinationIndexPrefix
/// </summary>
/// <param name="actualInstance">An instance of DestinationIndexPrefix.</param>
public DestinationInput(DestinationIndexPrefix actualInstance)
{
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
}

/// <summary>
/// Initializes a new instance of the DestinationInput class
/// with a DestinationIndexName
Expand All @@ -46,16 +36,6 @@ public DestinationInput(DestinationIndexName actualInstance)
/// </summary>
public sealed override object ActualInstance { get; set; }

/// <summary>
/// Get the actual instance of `DestinationIndexPrefix`. If the actual instance is not `DestinationIndexPrefix`,
/// the InvalidClassException will be thrown
/// </summary>
/// <returns>An instance of DestinationIndexPrefix</returns>
public DestinationIndexPrefix AsDestinationIndexPrefix()
{
return (DestinationIndexPrefix)ActualInstance;
}

/// <summary>
/// Get the actual instance of `DestinationIndexName`. If the actual instance is not `DestinationIndexName`,
/// the InvalidClassException will be thrown
Expand All @@ -67,15 +47,6 @@ public DestinationIndexName AsDestinationIndexName()
}


/// <summary>
/// Check if the actual instance is of `DestinationIndexPrefix` type.
/// </summary>
/// <returns>Whether or not the instance is the type</returns>
public bool IsDestinationIndexPrefix()
{
return ActualInstance.GetType() == typeof(DestinationIndexPrefix);
}

/// <summary>
/// Check if the actual instance is of `DestinationIndexName` type.
/// </summary>
Expand Down Expand Up @@ -170,18 +141,6 @@ public override DestinationInput Read(ref Utf8JsonReader reader, Type typeToConv
var jsonDocument = JsonDocument.ParseValue(ref reader);
var root = jsonDocument.RootElement;
if (root.ValueKind == JsonValueKind.Object)
{
try
{
return new DestinationInput(jsonDocument.Deserialize<DestinationIndexPrefix>(JsonConfig.Options));
}
catch (Exception exception)
{
// deserialization failed, try the next one
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into DestinationIndexPrefix: {exception}");
}
}
if (root.ValueKind == JsonValueKind.Object)
{
try
{
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ class Deserializer extends JsonDeserializer<DestinationInput> {
@Override
public DestinationInput deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
JsonNode tree = jp.readValueAsTree();
// deserialize DestinationIndexPrefix
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
return parser.readValueAs(DestinationIndexPrefix.class);
} catch (Exception e) {
// deserialization failed, continue
LOGGER.finest(
"Failed to deserialize oneOf DestinationIndexPrefix (error: " + e.getMessage() + ") (type: DestinationIndexPrefix)"
);
}
}
// deserialize DestinationIndexName
if (tree.isObject()) {
try (JsonParser parser = tree.traverse(jp.getCodec())) {
Expand Down

This file was deleted.

Loading

0 comments on commit 14a2b7f

Please sign in to comment.