Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#nullable enable

namespace Dust
{
public partial interface IPrivateEventsClient
{
/// <summary>
/// Stream sandbox function invocation events<br/>
/// Stream real-time events for a sandbox function invocation using Server-Sent Events (SSE). This endpoint is redirected to /api/sse/ for SSE traffic routing.
/// </summary>
/// <param name="wId"></param>
/// <param name="functionId"></param>
/// <param name="invocationId"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Dust.ApiException"></exception>
global::System.Collections.Generic.IAsyncEnumerable<global::Dust.PrivateSandboxFunctionInvocationEvent> GetWByWIdSandboxFunctionsByFunctionIdInvocationsByInvocationIdEventsAsync(
string wId,
string functionId,
string invocationId,
global::Dust.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Dust.JsonConverters
{
/// <inheritdoc />
public sealed class PrivateSandboxFunctionInvocationCreatedEventInvocationStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus>
{
/// <inheritdoc />
public override global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatusExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatusExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Dust.JsonConverters
{
/// <inheritdoc />
public sealed class PrivateSandboxFunctionInvocationCreatedEventInvocationStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus?>
{
/// <inheritdoc />
public override global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatusExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatus? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Dust.PrivateSandboxFunctionInvocationCreatedEventInvocationStatusExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Dust.JsonConverters
{
/// <inheritdoc />
public sealed class PrivateSandboxFunctionInvocationCreatedEventTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Dust.PrivateSandboxFunctionInvocationCreatedEventType>
{
/// <inheritdoc />
public override global::Dust.PrivateSandboxFunctionInvocationCreatedEventType Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Dust.PrivateSandboxFunctionInvocationCreatedEventTypeExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Dust.PrivateSandboxFunctionInvocationCreatedEventType)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Dust.PrivateSandboxFunctionInvocationCreatedEventType);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Dust.PrivateSandboxFunctionInvocationCreatedEventType value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Dust.PrivateSandboxFunctionInvocationCreatedEventTypeExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Dust.JsonConverters
{
/// <inheritdoc />
public sealed class PrivateSandboxFunctionInvocationCreatedEventTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Dust.PrivateSandboxFunctionInvocationCreatedEventType?>
{
/// <inheritdoc />
public override global::Dust.PrivateSandboxFunctionInvocationCreatedEventType? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Dust.PrivateSandboxFunctionInvocationCreatedEventTypeExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Dust.PrivateSandboxFunctionInvocationCreatedEventType)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Dust.PrivateSandboxFunctionInvocationCreatedEventType?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Dust.PrivateSandboxFunctionInvocationCreatedEventType? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Dust.PrivateSandboxFunctionInvocationCreatedEventTypeExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#nullable enable
#pragma warning disable CS0618 // Type or member is obsolete

namespace Dust.JsonConverters
{
/// <inheritdoc />
public class PrivateSandboxFunctionInvocationEventJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Dust.PrivateSandboxFunctionInvocationEvent>
{
/// <inheritdoc />
public override global::Dust.PrivateSandboxFunctionInvocationEvent Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");


var readerCopy = reader;
var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Dust.PrivateSandboxFunctionInvocationEventDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Dust.PrivateSandboxFunctionInvocationEventDiscriminator> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Dust.PrivateSandboxFunctionInvocationEventDiscriminator)}");
var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);

global::Dust.PrivateSandboxFunctionInvocationCreatedEvent? sandboxFunctionInvocationCreated = default;
if (discriminator?.Type == global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorType.SandboxFunctionInvocationCreated)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Dust.PrivateSandboxFunctionInvocationCreatedEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Dust.PrivateSandboxFunctionInvocationCreatedEvent> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Dust.PrivateSandboxFunctionInvocationCreatedEvent)}");
sandboxFunctionInvocationCreated = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::Dust.PrivateSandboxFunctionInvocationResultEvent? sandboxFunctionInvocationResult = default;
if (discriminator?.Type == global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorType.SandboxFunctionInvocationResult)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Dust.PrivateSandboxFunctionInvocationResultEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Dust.PrivateSandboxFunctionInvocationResultEvent> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Dust.PrivateSandboxFunctionInvocationResultEvent)}");
sandboxFunctionInvocationResult = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

var __value = new global::Dust.PrivateSandboxFunctionInvocationEvent(
discriminator?.Type,
sandboxFunctionInvocationCreated,

sandboxFunctionInvocationResult
);

return __value;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Dust.PrivateSandboxFunctionInvocationEvent value,
global::System.Text.Json.JsonSerializerOptions options)
{
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");

if (value.IsSandboxFunctionInvocationCreated)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Dust.PrivateSandboxFunctionInvocationCreatedEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Dust.PrivateSandboxFunctionInvocationCreatedEvent?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Dust.PrivateSandboxFunctionInvocationCreatedEvent).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.SandboxFunctionInvocationCreated!, typeInfo);
}
else if (value.IsSandboxFunctionInvocationResult)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Dust.PrivateSandboxFunctionInvocationResultEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Dust.PrivateSandboxFunctionInvocationResultEvent?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Dust.PrivateSandboxFunctionInvocationResultEvent).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.SandboxFunctionInvocationResult!, typeInfo);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Dust.JsonConverters
{
/// <inheritdoc />
public sealed class PrivateSandboxFunctionInvocationEventDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorType>
{
/// <inheritdoc />
public override global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorType Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorType)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorType);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorType value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Dust.PrivateSandboxFunctionInvocationEventDiscriminatorTypeExtensions.ToValueString(value));
}
}
}
Loading