diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.Json.g.cs similarity index 88% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequest.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.Json.g.cs index 1201ce3..d467655 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequest.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationAudioRequest + public readonly partial struct AnyOf { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioRequest? FromJson( + public static global::ModerationAPI.AnyOf? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationAudioRequest), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioRequest; + typeof(global::ModerationAPI.AnyOf), + jsonSerializerContext) as global::ModerationAPI.AnyOf?; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioRequest? FromJson( + public static global::ModerationAPI.AnyOf? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationAudioRequest? FromJson( + public static global::ModerationAPI.AnyOf? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationAudioRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioRequest; + typeof(global::ModerationAPI.AnyOf), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.AnyOf?; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.g.cs new file mode 100644 index 0000000..ecb2c07 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.g.cs @@ -0,0 +1,294 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public readonly partial struct AnyOf : global::System.IEquatable> + { + /// + /// + /// +#if NET6_0_OR_GREATER + public T1? Value1 { get; init; } +#else + public T1? Value1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] +#endif + public bool IsValue1 => Value1 != null; + + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => Value1 is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T2? Value2 { get; init; } +#else + public T2? Value2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] +#endif + public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => Value2 is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(AnyOf @this) => @this.Value1; + + /// + /// + /// + public AnyOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T2 value) => new AnyOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(AnyOf @this) => @this.Value2; + + /// + /// + /// + public AnyOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + + /// + /// + /// + public AnyOf( + T1? value1, + T2? value2 + ) + { + Value1 = value1; + Value2 = value2; + } + + /// + /// + /// + public object? Object => + Value2 as object ?? + Value1 as object + ; + + /// + /// + /// + public override string? ToString() => + Value1?.ToString() ?? + Value2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 || IsValue2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Value1 is { } __value0 && value1 != null) + { + return value1(__value0); + } + else if (Value2 is { } __value1 && value2 != null) + { + return value2(__value1); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Value1 is { } __value0) + { + value1?.Invoke(__value0); + } + else if (Value2 is { } __value1) + { + value2?.Invoke(__value1); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Value1 is { } __value0) + { + value1?.Invoke(__value0); + } + else if (Value2 is { } __value1) + { + value2?.Invoke(__value1); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(AnyOf other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) + ; + } + + /// + /// + /// + public static bool operator ==(AnyOf obj1, AnyOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(AnyOf obj1, AnyOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is AnyOf o && Equals(o); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorDelete.g.cs index 561ad5e..8715ddc 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AuthorClient.AuthorDelete.g.cs @@ -43,9 +43,11 @@ partial void ProcessAuthorDeleteResponseContent( /// /// Delete an author
- /// Delete a specific author + /// Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. ///
- /// + /// + /// Either external ID or the ID assigned by moderation API. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -73,9 +75,11 @@ partial void ProcessAuthorDeleteResponseContent( } /// /// Delete an author
- /// Delete a specific author + /// Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. ///
- /// + /// + /// Either external ID or the ID assigned by moderation API. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Channels.JsonSerializerContext.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Channels.JsonSerializerContext.g.cs new file mode 100644 index 0000000..6298116 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Channels.JsonSerializerContext.g.cs @@ -0,0 +1,281 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorBadRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorBadRequestIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorUnauthorized))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorUnauthorizedIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorForbidden))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorForbiddenIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorNotFound))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorNotFoundIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.Channel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelContentType), TypeInfoPropertyName = "ChannelContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelFlaggingMode), TypeInfoPropertyName = "ChannelFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelTranscriptionQuality), TypeInfoPropertyName = "ChannelTranscriptionQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsCreateRequestContentType), TypeInfoPropertyName = "ManagementChannelsCreateRequestContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestContentType), TypeInfoPropertyName = "ManagementChannelsUpdateRequestContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode), TypeInfoPropertyName = "ManagementChannelsUpdateRequestFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality), TypeInfoPropertyName = "ManagementChannelsUpdateRequestTranscriptionQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsDuplicateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsDeleteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelContentType?), TypeInfoPropertyName = "NullableChannelContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelFlaggingMode?), TypeInfoPropertyName = "NullableChannelFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelTranscriptionQuality?), TypeInfoPropertyName = "NullableChannelTranscriptionQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsCreateRequestContentType?), TypeInfoPropertyName = "NullableManagementChannelsCreateRequestContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestContentType?), TypeInfoPropertyName = "NullableManagementChannelsUpdateRequestContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode?), TypeInfoPropertyName = "NullableManagementChannelsUpdateRequestFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality?), TypeInfoPropertyName = "NullableManagementChannelsUpdateRequestTranscriptionQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class ChannelsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ChannelsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ChannelsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ChannelsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::ModerationAPI.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::ModerationAPI.ChannelContentType) + + || typeToConvert == typeof(global::ModerationAPI.ChannelContentType?) + + || typeToConvert == typeof(global::ModerationAPI.ChannelFlaggingMode) + + || typeToConvert == typeof(global::ModerationAPI.ChannelFlaggingMode?) + + || typeToConvert == typeof(global::ModerationAPI.ChannelTranscriptionQuality) + + || typeToConvert == typeof(global::ModerationAPI.ChannelTranscriptionQuality?) + + || typeToConvert == typeof(global::ModerationAPI.ManagementChannelsCreateRequestContentType) + + || typeToConvert == typeof(global::ModerationAPI.ManagementChannelsCreateRequestContentType?) + + || typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestContentType) + + || typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestContentType?) + + || typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode) + + || typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode?) + + || typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality) + + || typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::ModerationAPI.ChannelContentType)) + { + return new global::ModerationAPI.JsonConverters.ChannelContentTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ChannelContentType?)) + { + return new global::ModerationAPI.JsonConverters.ChannelContentTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ChannelFlaggingMode)) + { + return new global::ModerationAPI.JsonConverters.ChannelFlaggingModeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ChannelFlaggingMode?)) + { + return new global::ModerationAPI.JsonConverters.ChannelFlaggingModeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ChannelTranscriptionQuality)) + { + return new global::ModerationAPI.JsonConverters.ChannelTranscriptionQualityJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ChannelTranscriptionQuality?)) + { + return new global::ModerationAPI.JsonConverters.ChannelTranscriptionQualityNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementChannelsCreateRequestContentType)) + { + return new global::ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementChannelsCreateRequestContentType?)) + { + return new global::ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestContentType)) + { + return new global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestContentType?)) + { + return new global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode)) + { + return new global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingModeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode?)) + { + return new global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingModeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality)) + { + return new global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQualityJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality?)) + { + return new global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQualityNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ChannelsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..0dffa1e --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class ChannelsClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::ModerationAPI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.Constructors.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..f8f4010 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class ChannelsClient + { + /// + + public ChannelsClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsCreate.g.cs new file mode 100644 index 0000000..a591883 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsCreate.g.cs @@ -0,0 +1,643 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ChannelsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementChannelsCreateSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementChannelsCreateSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementChannelsCreateSecurityRequirement0, + }; + partial void PrepareManagementChannelsCreateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId, + global::ModerationAPI.ManagementChannelsCreateRequest request); + partial void PrepareManagementChannelsCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId, + global::ModerationAPI.ManagementChannelsCreateRequest request); + partial void ProcessManagementChannelsCreateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementChannelsCreateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a channel
+ /// Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the project to add the channel to. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementChannelsCreateAsync( + string projectId, + + global::ModerationAPI.ManagementChannelsCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementChannelsCreateAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a channel
+ /// Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the project to add the channel to. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementChannelsCreateAsResponseAsync( + string projectId, + + global::ModerationAPI.ManagementChannelsCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareManagementChannelsCreateArguments( + httpClient: HttpClient, + projectId: ref projectId, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementChannelsCreateSecurityRequirements, + operationName: "ManagementChannelsCreateAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/projects/{projectId}/channels", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementChannelsCreateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsCreate", + methodName: "ManagementChannelsCreateAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsCreate", + methodName: "ManagementChannelsCreateAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsCreate", + methodName: "ManagementChannelsCreateAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementChannelsCreateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsCreate", + methodName: "ManagementChannelsCreateAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsCreate", + methodName: "ManagementChannelsCreateAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementChannelsCreateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.Channel.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.Channel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a channel
+ /// Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the project to add the channel to. + /// + /// + /// The channel's name. + /// + /// + /// The key you pass as `channel` when you moderate content. Defaults to the name in lowercase with dashes. Must be unique in the project. + /// + /// + /// The channel's description. + /// + /// + /// The kind of content the channel moderates. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementChannelsCreateAsync( + string projectId, + string name, + string? key = default, + string? description = default, + global::ModerationAPI.ManagementChannelsCreateRequestContentType? contentType = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.ManagementChannelsCreateRequest + { + Name = name, + Key = key, + Description = description, + ContentType = contentType, + }; + + return await ManagementChannelsCreateAsync( + projectId: projectId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDelete.g.cs new file mode 100644 index 0000000..636b4e5 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDelete.g.cs @@ -0,0 +1,578 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ChannelsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementChannelsDeleteSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementChannelsDeleteSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementChannelsDeleteSecurityRequirement0, + }; + partial void PrepareManagementChannelsDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareManagementChannelsDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessManagementChannelsDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementChannelsDeleteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a channel
+ /// Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementChannelsDeleteAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementChannelsDeleteAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a channel
+ /// Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementChannelsDeleteAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareManagementChannelsDeleteArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementChannelsDeleteSecurityRequirements, + operationName: "ManagementChannelsDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/channels/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementChannelsDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDelete", + methodName: "ManagementChannelsDeleteAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDelete", + methodName: "ManagementChannelsDeleteAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDelete", + methodName: "ManagementChannelsDeleteAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementChannelsDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDelete", + methodName: "ManagementChannelsDeleteAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDelete", + methodName: "ManagementChannelsDeleteAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementChannelsDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.ManagementChannelsDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.ManagementChannelsDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDuplicate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDuplicate.g.cs new file mode 100644 index 0000000..7d70d3a --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsDuplicate.g.cs @@ -0,0 +1,633 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ChannelsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementChannelsDuplicateSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementChannelsDuplicateSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementChannelsDuplicateSecurityRequirement0, + }; + partial void PrepareManagementChannelsDuplicateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::ModerationAPI.ManagementChannelsDuplicateRequest request); + partial void PrepareManagementChannelsDuplicateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::ModerationAPI.ManagementChannelsDuplicateRequest request); + partial void ProcessManagementChannelsDuplicateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementChannelsDuplicateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Duplicate a channel
+ /// Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to copy. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementChannelsDuplicateAsync( + string id, + + global::ModerationAPI.ManagementChannelsDuplicateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementChannelsDuplicateAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Duplicate a channel
+ /// Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to copy. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementChannelsDuplicateAsResponseAsync( + string id, + + global::ModerationAPI.ManagementChannelsDuplicateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareManagementChannelsDuplicateArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementChannelsDuplicateSecurityRequirements, + operationName: "ManagementChannelsDuplicateAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/channels/{id}/duplicate", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementChannelsDuplicateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDuplicate", + methodName: "ManagementChannelsDuplicateAsync", + pathTemplate: "$\"/channels/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDuplicate", + methodName: "ManagementChannelsDuplicateAsync", + pathTemplate: "$\"/channels/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDuplicate", + methodName: "ManagementChannelsDuplicateAsync", + pathTemplate: "$\"/channels/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementChannelsDuplicateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDuplicate", + methodName: "ManagementChannelsDuplicateAsync", + pathTemplate: "$\"/channels/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsDuplicate", + methodName: "ManagementChannelsDuplicateAsync", + pathTemplate: "$\"/channels/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementChannelsDuplicateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.Channel.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.Channel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Duplicate a channel
+ /// Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to copy. + /// + /// + /// Name of the copy. Defaults to the original name with "(copy)". + /// + /// + /// Key of the copy. Defaults to the original key with a timestamp. Must be unique in the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementChannelsDuplicateAsync( + string id, + string? name = default, + string? key = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.ManagementChannelsDuplicateRequest + { + Name = name, + Key = key, + }; + + return await ManagementChannelsDuplicateAsync( + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsGet.g.cs new file mode 100644 index 0000000..61bcf4b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsGet.g.cs @@ -0,0 +1,541 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ChannelsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementChannelsGetSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementChannelsGetSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementChannelsGetSecurityRequirement0, + }; + partial void PrepareManagementChannelsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareManagementChannelsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessManagementChannelsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementChannelsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a channel
+ /// Get a channel by ID. Needs the `channels:read` permission. + ///
+ /// + /// The ID of the channel. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementChannelsGetAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementChannelsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a channel
+ /// Get a channel by ID. Needs the `channels:read` permission. + ///
+ /// + /// The ID of the channel. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementChannelsGetAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareManagementChannelsGetArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementChannelsGetSecurityRequirements, + operationName: "ManagementChannelsGetAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/channels/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementChannelsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsGet", + methodName: "ManagementChannelsGetAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsGet", + methodName: "ManagementChannelsGetAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsGet", + methodName: "ManagementChannelsGetAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementChannelsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsGet", + methodName: "ManagementChannelsGetAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsGet", + methodName: "ManagementChannelsGetAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementChannelsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.Channel.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.Channel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsList.g.cs new file mode 100644 index 0000000..c18e585 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsList.g.cs @@ -0,0 +1,541 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ChannelsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementChannelsListSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementChannelsListSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementChannelsListSecurityRequirement0, + }; + partial void PrepareManagementChannelsListArguments( + global::System.Net.Http.HttpClient httpClient, + ref string projectId); + partial void PrepareManagementChannelsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string projectId); + partial void ProcessManagementChannelsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementChannelsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List channels
+ /// List the channels in a project. Needs the `channels:read` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementChannelsListAsync( + string projectId, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementChannelsListAsResponseAsync( + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List channels
+ /// List the channels in a project. Needs the `channels:read` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ManagementChannelsListAsResponseAsync( + string projectId, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareManagementChannelsListArguments( + httpClient: HttpClient, + projectId: ref projectId); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementChannelsListSecurityRequirements, + operationName: "ManagementChannelsListAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/projects/{projectId}/channels", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementChannelsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + projectId: projectId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsList", + methodName: "ManagementChannelsListAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsList", + methodName: "ManagementChannelsListAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsList", + methodName: "ManagementChannelsListAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementChannelsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsList", + methodName: "ManagementChannelsListAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsList", + methodName: "ManagementChannelsListAsync", + pathTemplate: "$\"/projects/{projectId}/channels\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementChannelsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsUpdate.g.cs new file mode 100644 index 0000000..8a58e67 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.ManagementChannelsUpdate.g.cs @@ -0,0 +1,703 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ChannelsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementChannelsUpdateSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementChannelsUpdateSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementChannelsUpdateSecurityRequirement0, + }; + partial void PrepareManagementChannelsUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::ModerationAPI.ManagementChannelsUpdateRequest request); + partial void PrepareManagementChannelsUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::ModerationAPI.ManagementChannelsUpdateRequest request); + partial void ProcessManagementChannelsUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementChannelsUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a channel
+ /// Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementChannelsUpdateAsync( + string id, + + global::ModerationAPI.ManagementChannelsUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementChannelsUpdateAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a channel
+ /// Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementChannelsUpdateAsResponseAsync( + string id, + + global::ModerationAPI.ManagementChannelsUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareManagementChannelsUpdateArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementChannelsUpdateSecurityRequirements, + operationName: "ManagementChannelsUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/channels/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Put, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementChannelsUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsUpdate", + methodName: "ManagementChannelsUpdateAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsUpdate", + methodName: "ManagementChannelsUpdateAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsUpdate", + methodName: "ManagementChannelsUpdateAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementChannelsUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsUpdate", + methodName: "ManagementChannelsUpdateAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementChannelsUpdate", + methodName: "ManagementChannelsUpdateAsync", + pathTemplate: "$\"/channels/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementChannelsUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.Channel.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.Channel.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a channel
+ /// Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to update. + /// + /// + /// The channel's name. + /// + /// + /// The key you pass as `channel` when you moderate content. Changing it breaks integrations that send the old key. + /// + /// + /// The channel's description. + /// + /// + /// The kind of content the channel moderates. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + /// + /// + /// Whether earlier messages in the conversation are read when moderating a message. + /// + /// + /// Whether images are moderated. + /// + /// + /// Whether videos are moderated. + /// + /// + /// Whether audio is moderated. + /// + /// + /// Whether real-time voice streams are moderated. + /// + /// + /// Whether audio and video transcripts are returned in responses. + /// + /// + /// Trade-off between transcription speed and accuracy. + /// + /// + /// Whether look-alike Unicode characters are normalized before moderation. + /// + /// + /// Seconds between frames captured from a video. + /// + /// + /// The most frames moderated per video. + /// + /// + /// Whether frames are spread evenly across the whole video. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementChannelsUpdateAsync( + string id, + string? name = default, + string? key = default, + string? description = default, + global::ModerationAPI.ManagementChannelsUpdateRequestContentType? contentType = default, + global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? flaggingMode = default, + bool? contextEnabled = default, + bool? enableImageModeration = default, + bool? enableVideoModeration = default, + bool? enableAudioModeration = default, + bool? enableVoiceModeration = default, + bool? includeTranscriptInResponse = default, + global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? transcriptionQuality = default, + bool? unicodeSpoofDetectionEnabled = default, + double? frameCaptureInterval = default, + int? maxFramesPerVideo = default, + bool? spreadFrames = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.ManagementChannelsUpdateRequest + { + Name = name, + Key = key, + Description = description, + ContentType = contentType, + FlaggingMode = flaggingMode, + ContextEnabled = contextEnabled, + EnableImageModeration = enableImageModeration, + EnableVideoModeration = enableVideoModeration, + EnableAudioModeration = enableAudioModeration, + EnableVoiceModeration = enableVoiceModeration, + IncludeTranscriptInResponse = includeTranscriptInResponse, + TranscriptionQuality = transcriptionQuality, + UnicodeSpoofDetectionEnabled = unicodeSpoofDetectionEnabled, + FrameCaptureInterval = frameCaptureInterval, + MaxFramesPerVideo = maxFramesPerVideo, + SpreadFrames = spreadFrames, + }; + + return await ManagementChannelsUpdateAsync( + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.g.cs new file mode 100644 index 0000000..94899d5 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ChannelsClient.g.cs @@ -0,0 +1,151 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ChannelsClient : global::ModerationAPI.IChannelsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.moderationapi.com/v1"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + + internal global::ModerationAPI.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::ModerationAPI.AutoSDKServerConfiguration(); + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::ModerationAPI.ChannelsSourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the ChannelsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ChannelsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ChannelsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ChannelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ChannelsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ChannelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::ModerationAPI.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorDelete.g.cs index 747ec02..505ff84 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorDelete.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IAuthorClient.AuthorDelete.g.cs @@ -6,9 +6,11 @@ public partial interface IAuthorClient { /// /// Delete an author
- /// Delete a specific author + /// Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. ///
- /// + /// + /// Either external ID or the ID assigned by moderation API. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -27,9 +29,11 @@ public partial interface IAuthorClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Delete an author
- /// Delete a specific author + /// Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. ///
- /// + /// + /// Either external ID or the ID assigned by moderation API. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..d8e9722 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial interface IChannelsClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsCreate.g.cs new file mode 100644 index 0000000..517c5cd --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsCreate.g.cs @@ -0,0 +1,72 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IChannelsClient + { + /// + /// Create a channel
+ /// Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the project to add the channel to. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementChannelsCreateAsync( + string projectId, + + global::ModerationAPI.ManagementChannelsCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a channel
+ /// Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the project to add the channel to. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementChannelsCreateAsResponseAsync( + string projectId, + + global::ModerationAPI.ManagementChannelsCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a channel
+ /// Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the project to add the channel to. + /// + /// + /// The channel's name. + /// + /// + /// The key you pass as `channel` when you moderate content. Defaults to the name in lowercase with dashes. Must be unique in the project. + /// + /// + /// The channel's description. + /// + /// + /// The kind of content the channel moderates. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementChannelsCreateAsync( + string projectId, + string name, + string? key = default, + string? description = default, + global::ModerationAPI.ManagementChannelsCreateRequestContentType? contentType = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDelete.g.cs new file mode 100644 index 0000000..822689d --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDelete.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IChannelsClient + { + /// + /// Delete a channel
+ /// Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementChannelsDeleteAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a channel
+ /// Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementChannelsDeleteAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDuplicate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDuplicate.g.cs new file mode 100644 index 0000000..f0f624f --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsDuplicate.g.cs @@ -0,0 +1,64 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IChannelsClient + { + /// + /// Duplicate a channel
+ /// Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to copy. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementChannelsDuplicateAsync( + string id, + + global::ModerationAPI.ManagementChannelsDuplicateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Duplicate a channel
+ /// Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to copy. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementChannelsDuplicateAsResponseAsync( + string id, + + global::ModerationAPI.ManagementChannelsDuplicateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Duplicate a channel
+ /// Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to copy. + /// + /// + /// Name of the copy. Defaults to the original name with "(copy)". + /// + /// + /// Key of the copy. Defaults to the original key with a timestamp. Must be unique in the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementChannelsDuplicateAsync( + string id, + string? name = default, + string? key = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsGet.g.cs new file mode 100644 index 0000000..082f1e9 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsGet.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IChannelsClient + { + /// + /// Get a channel
+ /// Get a channel by ID. Needs the `channels:read` permission. + ///
+ /// + /// The ID of the channel. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementChannelsGetAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a channel
+ /// Get a channel by ID. Needs the `channels:read` permission. + ///
+ /// + /// The ID of the channel. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementChannelsGetAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsList.g.cs new file mode 100644 index 0000000..a6d3b63 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsList.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IChannelsClient + { + /// + /// List channels
+ /// List the channels in a project. Needs the `channels:read` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementChannelsListAsync( + string projectId, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List channels
+ /// List the channels in a project. Needs the `channels:read` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ManagementChannelsListAsResponseAsync( + string projectId, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsUpdate.g.cs new file mode 100644 index 0000000..a0a8dbf --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.ManagementChannelsUpdate.g.cs @@ -0,0 +1,120 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IChannelsClient + { + /// + /// Update a channel
+ /// Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementChannelsUpdateAsync( + string id, + + global::ModerationAPI.ManagementChannelsUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a channel
+ /// Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementChannelsUpdateAsResponseAsync( + string id, + + global::ModerationAPI.ManagementChannelsUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a channel
+ /// Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission. + ///
+ /// + /// The ID of the channel to update. + /// + /// + /// The channel's name. + /// + /// + /// The key you pass as `channel` when you moderate content. Changing it breaks integrations that send the old key. + /// + /// + /// The channel's description. + /// + /// + /// The kind of content the channel moderates. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + /// + /// + /// Whether earlier messages in the conversation are read when moderating a message. + /// + /// + /// Whether images are moderated. + /// + /// + /// Whether videos are moderated. + /// + /// + /// Whether audio is moderated. + /// + /// + /// Whether real-time voice streams are moderated. + /// + /// + /// Whether audio and video transcripts are returned in responses. + /// + /// + /// Trade-off between transcription speed and accuracy. + /// + /// + /// Whether look-alike Unicode characters are normalized before moderation. + /// + /// + /// Seconds between frames captured from a video. + /// + /// + /// The most frames moderated per video. + /// + /// + /// Whether frames are spread evenly across the whole video. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementChannelsUpdateAsync( + string id, + string? name = default, + string? key = default, + string? description = default, + global::ModerationAPI.ManagementChannelsUpdateRequestContentType? contentType = default, + global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? flaggingMode = default, + bool? contextEnabled = default, + bool? enableImageModeration = default, + bool? enableVideoModeration = default, + bool? enableAudioModeration = default, + bool? enableVoiceModeration = default, + bool? includeTranscriptInResponse = default, + global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? transcriptionQuality = default, + bool? unicodeSpoofDetectionEnabled = default, + double? frameCaptureInterval = default, + int? maxFramesPerVideo = default, + bool? spreadFrames = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.g.cs new file mode 100644 index 0000000..2b3c5cc --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IChannelsClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IChannelsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs index 90f473f..14afd5f 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs @@ -96,7 +96,7 @@ public partial interface IModerationAPIClient object? metadata = default, global::ModerationAPI.NewModerateModerateRequestClientAction? clientAction = default, bool? doNotStore = default, - global::System.Collections.Generic.IList>? policies = default, + global::System.Collections.Generic.IList>? policies = default, global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.g.cs index 4ac0961..5a843a9 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.g.cs @@ -81,6 +81,16 @@ public partial interface IModerationAPIClient : global::System.IDisposable /// public AuthorClient Author { get; } + /// + /// + /// + public ChannelsClient Channels { get; } + + /// + /// + /// + public ProjectsClient Projects { get; } + /// /// /// @@ -91,6 +101,11 @@ public partial interface IModerationAPIClient : global::System.IDisposable /// public VoiceClient Voice { get; } + /// + /// + /// + public WebhooksClient Webhooks { get; } + /// /// /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..2e6501b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial interface IProjectsClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsCreate.g.cs new file mode 100644 index 0000000..bc9da63 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsCreate.g.cs @@ -0,0 +1,65 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IProjectsClient + { + /// + /// Create a project
+ /// Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementProjectsCreateAsync( + + global::ModerationAPI.ManagementProjectsCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a project
+ /// Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementProjectsCreateAsResponseAsync( + + global::ModerationAPI.ManagementProjectsCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a project
+ /// Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// The project's name. + /// + /// + /// The website or app the project moderates content for. Used to write the context when none is given. + /// + /// + /// What the platform is and who uses it. + /// + /// + /// What you moderate, the problems you see and your guidelines. + /// + /// + /// Whether children use the platform.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementProjectsCreateAsync( + string name, + string? domain = default, + string? context = default, + string? brief = default, + bool? usedByMinors = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDelete.g.cs new file mode 100644 index 0000000..23380f0 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDelete.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IProjectsClient + { + /// + /// Delete a project
+ /// Delete a project with everything in it: channels, queues, API keys and stored content. This can't be undone. The project's API keys stop working at once. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementProjectsDeleteAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a project
+ /// Delete a project with everything in it: channels, queues, API keys and stored content. This can't be undone. The project's API keys stop working at once. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementProjectsDeleteAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDuplicate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDuplicate.g.cs new file mode 100644 index 0000000..fca0e8c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsDuplicate.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IProjectsClient + { + /// + /// Duplicate a project
+ /// Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// The ID of the project to copy. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementProjectsDuplicateAsync( + string id, + + global::ModerationAPI.ManagementProjectsDuplicateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Duplicate a project
+ /// Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// The ID of the project to copy. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementProjectsDuplicateAsResponseAsync( + string id, + + global::ModerationAPI.ManagementProjectsDuplicateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Duplicate a project
+ /// Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// The ID of the project to copy. + /// + /// + /// Name of the copy. Defaults to the original name with "(copy)". + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementProjectsDuplicateAsync( + string id, + string? name = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsGet.g.cs new file mode 100644 index 0000000..79e64e9 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsGet.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IProjectsClient + { + /// + /// Get a project
+ /// Get a project by ID. Needs the `projects:read` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementProjectsGetAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a project
+ /// Get a project by ID. Needs the `projects:read` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementProjectsGetAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsList.g.cs new file mode 100644 index 0000000..60f281b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsList.g.cs @@ -0,0 +1,28 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IProjectsClient + { + /// + /// List projects
+ /// List every project in the organization. Needs the `projects:read` permission. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementProjectsListAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List projects
+ /// List every project in the organization. Needs the `projects:read` permission. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ManagementProjectsListAsResponseAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsUpdate.g.cs new file mode 100644 index 0000000..a421e80 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.ManagementProjectsUpdate.g.cs @@ -0,0 +1,84 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IProjectsClient + { + /// + /// Update a project
+ /// Update a project. Fields you leave out keep their value. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementProjectsUpdateAsync( + string id, + + global::ModerationAPI.ManagementProjectsUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a project
+ /// Update a project. Fields you leave out keep their value. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ManagementProjectsUpdateAsResponseAsync( + string id, + + global::ModerationAPI.ManagementProjectsUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a project
+ /// Update a project. Fields you leave out keep their value. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project to update. + /// + /// + /// The project's name. + /// + /// + /// The project's description. + /// + /// + /// The website or app the project moderates content for. Setting it on a project without context writes one. + /// + /// + /// What the platform is and who uses it. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates without flagging. + /// + /// + /// Whether moderated content is stored and shown in the dashboard. + /// + /// + /// Whether review queue decisions are recorded in the casebook. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ManagementProjectsUpdateAsync( + string id, + string? name = default, + string? description = default, + string? domain = default, + string? context = default, + global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? globalFlaggingMode = default, + bool? enableRequestLogging = default, + bool? casebookEnabled = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.g.cs new file mode 100644 index 0000000..51e0c26 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IProjectsClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IProjectsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..d04b5d5 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial interface IWebhooksClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicCreate.g.cs new file mode 100644 index 0000000..c3bc274 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicCreate.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IWebhooksClient + { + /// + /// Create a webhook
+ /// Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task WebhooksPublicCreateAsync( + + global::ModerationAPI.WebhooksPublicCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a webhook
+ /// Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> WebhooksPublicCreateAsResponseAsync( + + global::ModerationAPI.WebhooksPublicCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a webhook
+ /// Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint). + ///
+ /// + /// The webhook's name, used to identify it in the dashboard + /// + /// + /// The webhook's description + /// + /// + /// The webhook's URL. We'll call this URL when an event occurs. + /// + /// + /// Event types this webhook subscribes to. One webhook URL receives all events you list here. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task WebhooksPublicCreateAsync( + string name, + string url, + global::System.Collections.Generic.IList eventTypes, + string? description = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicDelete.g.cs new file mode 100644 index 0000000..3de9edd --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicDelete.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IWebhooksClient + { + /// + /// Delete a webhook
+ /// Delete a webhook. + ///
+ /// + /// The ID of the webhook to delete. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task WebhooksPublicDeleteAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a webhook
+ /// Delete a webhook. + ///
+ /// + /// The ID of the webhook to delete. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> WebhooksPublicDeleteAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGet.g.cs new file mode 100644 index 0000000..957f7ca --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGet.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IWebhooksClient + { + /// + /// Get a webhook
+ /// Get a webhook by ID. + ///
+ /// + /// The ID of the webhook to get. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task WebhooksPublicGetAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a webhook
+ /// Get a webhook by ID. + ///
+ /// + /// The ID of the webhook to get. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> WebhooksPublicGetAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGetSecret.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGetSecret.g.cs new file mode 100644 index 0000000..733366b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicGetSecret.g.cs @@ -0,0 +1,28 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IWebhooksClient + { + /// + /// Get the webhook signing secret
+ /// Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task WebhooksPublicGetSecretAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get the webhook signing secret
+ /// Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> WebhooksPublicGetSecretAsResponseAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicList.g.cs new file mode 100644 index 0000000..39323e8 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicList.g.cs @@ -0,0 +1,28 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IWebhooksClient + { + /// + /// List webhooks
+ /// List all webhooks for the authenticated project. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> WebhooksPublicListAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List webhooks
+ /// List all webhooks for the authenticated project. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> WebhooksPublicListAsResponseAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicUpdate.g.cs new file mode 100644 index 0000000..8a14908 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.WebhooksPublicUpdate.g.cs @@ -0,0 +1,72 @@ +#nullable enable + +namespace ModerationAPI +{ + public partial interface IWebhooksClient + { + /// + /// Update a webhook
+ /// Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. + ///
+ /// + /// The ID of the webhook to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task WebhooksPublicUpdateAsync( + string id, + + global::ModerationAPI.WebhooksPublicUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a webhook
+ /// Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. + ///
+ /// + /// The ID of the webhook to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> WebhooksPublicUpdateAsResponseAsync( + string id, + + global::ModerationAPI.WebhooksPublicUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a webhook
+ /// Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. + ///
+ /// + /// The ID of the webhook to update. + /// + /// + /// The webhook's name, used to identify it in the dashboard + /// + /// + /// The webhook's description + /// + /// + /// The webhook's URL. We'll call this URL when an event occurs. + /// + /// + /// Event types this webhook subscribes to. One webhook URL receives all events you list here. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task WebhooksPublicUpdateAsync( + string id, + string? name = default, + string? description = default, + string? url = default, + global::System.Collections.Generic.IList? eventTypes = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.g.cs new file mode 100644 index 0000000..4d581eb --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IWebhooksClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IWebhooksClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.AnyOf2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.AnyOf2.g.cs new file mode 100644 index 0000000..2a655c4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.AnyOf2.g.cs @@ -0,0 +1,161 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::ModerationAPI.AnyOf 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."); + + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + } + } + + var __score0 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score0++; + } + } + } + var __score1 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score1++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + T1? value1 = default; + T2? value2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 1) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (value1 == null && value2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::ModerationAPI.AnyOf( + value1, + + value2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.AnyOf 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.IsValue1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue1(), typeInfo); + } + else if (value.IsValue2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue2(), typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelContentType.g.cs similarity index 63% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatus.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelContentType.g.cs index a0cc318..c5984b9 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatus.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelContentType.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationAudioResponseAuthorStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ChannelContentTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationAudioResponseAuthorStatus Read( + public override global::ModerationAPI.ChannelContentType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationAudioResponseAuthorStatusJsonConverter : global::S var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationAudioResponseAuthorStatusExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.ChannelContentTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationAudioResponseAuthorStatusJsonConverter : global::S case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationAudioResponseAuthorStatus)numValue; + return (global::ModerationAPI.ChannelContentType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationAudioResponseAuthorStatus); + return default(global::ModerationAPI.ChannelContentType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationAudioResponseAuthorStatusJsonConverter : global::S /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationAudioResponseAuthorStatus value, + global::ModerationAPI.ChannelContentType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationAudioResponseAuthorStatusExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.ChannelContentTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatusNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelContentTypeNullable.g.cs similarity index 65% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatusNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelContentTypeNullable.g.cs index ca2f30e..556b3ec 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatusNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelContentTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationAudioResponseAuthorStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ChannelContentTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationAudioResponseAuthorStatus? Read( + public override global::ModerationAPI.ChannelContentType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationAudioResponseAuthorStatusNullableJsonConverter : g var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationAudioResponseAuthorStatusExtensions.ToEnum(stringValue); + return global::ModerationAPI.ChannelContentTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationAudioResponseAuthorStatusNullableJsonConverter : g case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationAudioResponseAuthorStatus)numValue; + return (global::ModerationAPI.ChannelContentType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationAudioResponseAuthorStatus?); + return default(global::ModerationAPI.ChannelContentType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationAudioResponseAuthorStatusNullableJsonConverter : g /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationAudioResponseAuthorStatus? value, + global::ModerationAPI.ChannelContentType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationAudioResponseAuthorStatusExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.ChannelContentTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelFlaggingMode.g.cs similarity index 63% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatus.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelFlaggingMode.g.cs index 1b443c5..b1867ee 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatus.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelFlaggingMode.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationImageResponseAuthorStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ChannelFlaggingModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationImageResponseAuthorStatus Read( + public override global::ModerationAPI.ChannelFlaggingMode Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationImageResponseAuthorStatusJsonConverter : global::S var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationImageResponseAuthorStatusExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.ChannelFlaggingModeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationImageResponseAuthorStatusJsonConverter : global::S case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationImageResponseAuthorStatus)numValue; + return (global::ModerationAPI.ChannelFlaggingMode)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationImageResponseAuthorStatus); + return default(global::ModerationAPI.ChannelFlaggingMode); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationImageResponseAuthorStatusJsonConverter : global::S /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationImageResponseAuthorStatus value, + global::ModerationAPI.ChannelFlaggingMode value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationImageResponseAuthorStatusExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.ChannelFlaggingModeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatusNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelFlaggingModeNullable.g.cs similarity index 65% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatusNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelFlaggingModeNullable.g.cs index 42ad19b..61e2775 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatusNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelFlaggingModeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationImageResponseAuthorStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ChannelFlaggingModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationImageResponseAuthorStatus? Read( + public override global::ModerationAPI.ChannelFlaggingMode? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationImageResponseAuthorStatusNullableJsonConverter : g var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationImageResponseAuthorStatusExtensions.ToEnum(stringValue); + return global::ModerationAPI.ChannelFlaggingModeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationImageResponseAuthorStatusNullableJsonConverter : g case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationImageResponseAuthorStatus)numValue; + return (global::ModerationAPI.ChannelFlaggingMode)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationImageResponseAuthorStatus?); + return default(global::ModerationAPI.ChannelFlaggingMode?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationImageResponseAuthorStatusNullableJsonConverter : g /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationImageResponseAuthorStatus? value, + global::ModerationAPI.ChannelFlaggingMode? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationImageResponseAuthorStatusExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.ChannelFlaggingModeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelTranscriptionQuality.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelTranscriptionQuality.g.cs new file mode 100644 index 0000000..f79a78c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelTranscriptionQuality.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class ChannelTranscriptionQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.ChannelTranscriptionQuality 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::ModerationAPI.ChannelTranscriptionQualityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.ChannelTranscriptionQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.ChannelTranscriptionQuality); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.ChannelTranscriptionQuality value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.ChannelTranscriptionQualityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelTranscriptionQualityNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelTranscriptionQualityNullable.g.cs new file mode 100644 index 0000000..962d66f --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ChannelTranscriptionQualityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class ChannelTranscriptionQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.ChannelTranscriptionQuality? 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::ModerationAPI.ChannelTranscriptionQualityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.ChannelTranscriptionQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.ChannelTranscriptionQuality?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.ChannelTranscriptionQuality? 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::ModerationAPI.ChannelTranscriptionQualityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentType.g.cs similarity index 62% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameMode.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentType.g.cs index 2abf79d..f89f73d 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameMode.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentType.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1UsernameModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ManagementChannelsCreateRequestContentTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1UsernameMode Read( + public override global::ModerationAPI.ManagementChannelsCreateRequestContentType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1UsernameModeJsonConverter : gl var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1UsernameModeExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.ManagementChannelsCreateRequestContentTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1UsernameModeJsonConverter : gl case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1UsernameMode)numValue; + return (global::ModerationAPI.ManagementChannelsCreateRequestContentType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1UsernameMode); + return default(global::ModerationAPI.ManagementChannelsCreateRequestContentType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationTextResponseVariant1UsernameModeJsonConverter : gl /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1UsernameMode value, + global::ModerationAPI.ManagementChannelsCreateRequestContentType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1UsernameModeExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.ManagementChannelsCreateRequestContentTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentTypeNullable.g.cs similarity index 64% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameModeNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentTypeNullable.g.cs index 9f3de5c..cb54135 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameModeNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1UsernameModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ManagementChannelsCreateRequestContentTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1UsernameMode? Read( + public override global::ModerationAPI.ManagementChannelsCreateRequestContentType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1UsernameModeNullableJsonConver var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1UsernameModeExtensions.ToEnum(stringValue); + return global::ModerationAPI.ManagementChannelsCreateRequestContentTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1UsernameModeNullableJsonConver case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1UsernameMode)numValue; + return (global::ModerationAPI.ManagementChannelsCreateRequestContentType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1UsernameMode?); + return default(global::ModerationAPI.ManagementChannelsCreateRequestContentType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationTextResponseVariant1UsernameModeNullableJsonConver /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1UsernameMode? value, + global::ModerationAPI.ManagementChannelsCreateRequestContentType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1UsernameModeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.ManagementChannelsCreateRequestContentTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentType.g.cs similarity index 62% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentType.g.cs index cd0ba6b..4f41924 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentType.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1WordlistModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ManagementChannelsUpdateRequestContentTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1WordlistMode Read( + public override global::ModerationAPI.ManagementChannelsUpdateRequestContentType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1WordlistModeJsonConverter : gl var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1WordlistModeExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.ManagementChannelsUpdateRequestContentTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1WordlistModeJsonConverter : gl case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1WordlistMode)numValue; + return (global::ModerationAPI.ManagementChannelsUpdateRequestContentType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1WordlistMode); + return default(global::ModerationAPI.ManagementChannelsUpdateRequestContentType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationTextResponseVariant1WordlistModeJsonConverter : gl /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1WordlistMode value, + global::ModerationAPI.ManagementChannelsUpdateRequestContentType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1WordlistModeExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.ManagementChannelsUpdateRequestContentTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentTypeNullable.g.cs similarity index 64% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistModeNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentTypeNullable.g.cs index 0af25d6..fd19770 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistModeNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1WordlistModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ManagementChannelsUpdateRequestContentTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1WordlistMode? Read( + public override global::ModerationAPI.ManagementChannelsUpdateRequestContentType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1WordlistModeNullableJsonConver var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1WordlistModeExtensions.ToEnum(stringValue); + return global::ModerationAPI.ManagementChannelsUpdateRequestContentTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1WordlistModeNullableJsonConver case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1WordlistMode)numValue; + return (global::ModerationAPI.ManagementChannelsUpdateRequestContentType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1WordlistMode?); + return default(global::ModerationAPI.ManagementChannelsUpdateRequestContentType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationTextResponseVariant1WordlistModeNullableJsonConver /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1WordlistMode? value, + global::ModerationAPI.ManagementChannelsUpdateRequestContentType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1WordlistModeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.ManagementChannelsUpdateRequestContentTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingMode.g.cs similarity index 65% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityMode.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingMode.g.cs index 966ff36..dfb34ac 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityMode.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingMode.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1ProfanityModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ManagementChannelsUpdateRequestFlaggingModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode Read( + public override global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1ProfanityModeJsonConverter : g var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1ProfanityModeExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingModeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1ProfanityModeJsonConverter : g case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode)numValue; + return (global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode); + return default(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationTextResponseVariant1ProfanityModeJsonConverter : g /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode value, + global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1ProfanityModeExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingModeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingModeNullable.g.cs similarity index 66% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityModeNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingModeNullable.g.cs index 7d10291..ce1fbfd 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityModeNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingModeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1ProfanityModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ManagementChannelsUpdateRequestFlaggingModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode? Read( + public override global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1ProfanityModeNullableJsonConve var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1ProfanityModeExtensions.ToEnum(stringValue); + return global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingModeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1ProfanityModeNullableJsonConve case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode)numValue; + return (global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode?); + return default(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationTextResponseVariant1ProfanityModeNullableJsonConve /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode? value, + global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1ProfanityModeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingModeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQuality.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQuality.g.cs new file mode 100644 index 0000000..cef7842 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQuality.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class ManagementChannelsUpdateRequestTranscriptionQualityJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality 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::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQualityExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQualityExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQualityNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQualityNullable.g.cs new file mode 100644 index 0000000..0c2ae2e --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQualityNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class ManagementChannelsUpdateRequestTranscriptionQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? 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::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQualityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? 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::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQualityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingMode.g.cs new file mode 100644 index 0000000..07b3230 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingMode.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class ManagementProjectsUpdateRequestGlobalFlaggingModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode 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::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingModeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingModeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingModeNullable.g.cs new file mode 100644 index 0000000..8387a6f --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingModeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class ManagementProjectsUpdateRequestGlobalFlaggingModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? 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::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? 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::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseLabelLabel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatus.g.cs similarity index 75% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseLabelLabel.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatus.g.cs index 8f08ba9..9521b86 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseLabelLabel.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatus.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationImageResponseLabelLabelJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ModerationImageResponseVariant1AuthorStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationImageResponseLabelLabel Read( + public override global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationImageResponseLabelLabelJsonConverter : global::Sys var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationImageResponseLabelLabelExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.ModerationImageResponseVariant1AuthorStatusExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationImageResponseLabelLabelJsonConverter : global::Sys case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationImageResponseLabelLabel)numValue; + return (global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationImageResponseLabelLabel); + return default(global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationImageResponseLabelLabelJsonConverter : global::Sys /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationImageResponseLabelLabel value, + global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationImageResponseLabelLabelExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.ModerationImageResponseVariant1AuthorStatusExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseLabelLabelNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatusNullable.g.cs similarity index 76% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseLabelLabelNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatusNullable.g.cs index b47e08c..1cb7cb6 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseLabelLabelNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatusNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationImageResponseLabelLabelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ModerationImageResponseVariant1AuthorStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationImageResponseLabelLabel? Read( + public override global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationImageResponseLabelLabelNullableJsonConverter : glo var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationImageResponseLabelLabelExtensions.ToEnum(stringValue); + return global::ModerationAPI.ModerationImageResponseVariant1AuthorStatusExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationImageResponseLabelLabelNullableJsonConverter : glo case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationImageResponseLabelLabel)numValue; + return (global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationImageResponseLabelLabel?); + return default(global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationImageResponseLabelLabelNullableJsonConverter : glo /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationImageResponseLabelLabel? value, + global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationImageResponseLabelLabelExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.ModerationImageResponseVariant1AuthorStatusExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistMode.g.cs deleted file mode 100644 index 7cffadd..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistMode.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationObjectResponseVariant1WordlistModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode 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::ModerationAPI.ModerationObjectResponseVariant1WordlistModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::ModerationAPI.ModerationObjectResponseVariant1WordlistModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistModeNullable.g.cs deleted file mode 100644 index b9aa9d2..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistModeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationObjectResponseVariant1WordlistModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode? 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::ModerationAPI.ModerationObjectResponseVariant1WordlistModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode? 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::ModerationAPI.ModerationObjectResponseVariant1WordlistModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressMode.g.cs deleted file mode 100644 index e8c1de1..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressMode.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationTextResponseVariant1AddressModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationTextResponseVariant1AddressMode 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::ModerationAPI.ModerationTextResponseVariant1AddressModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1AddressMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationTextResponseVariant1AddressMode); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1AddressMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1AddressModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressModeNullable.g.cs deleted file mode 100644 index 4b137ec..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressModeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationTextResponseVariant1AddressModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationTextResponseVariant1AddressMode? 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::ModerationAPI.ModerationTextResponseVariant1AddressModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1AddressMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationTextResponseVariant1AddressMode?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1AddressMode? 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::ModerationAPI.ModerationTextResponseVariant1AddressModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameMode.g.cs deleted file mode 100644 index 3d5345d..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameMode.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationTextResponseVariant1NameModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationTextResponseVariant1NameMode 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::ModerationAPI.ModerationTextResponseVariant1NameModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1NameMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationTextResponseVariant1NameMode); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1NameMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1NameModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameModeNullable.g.cs deleted file mode 100644 index 5ef7101..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameModeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationTextResponseVariant1NameModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationTextResponseVariant1NameMode? 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::ModerationAPI.ModerationTextResponseVariant1NameModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1NameMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationTextResponseVariant1NameMode?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1NameMode? 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::ModerationAPI.ModerationTextResponseVariant1NameModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveMode.g.cs deleted file mode 100644 index 0e9a8d5..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveMode.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationTextResponseVariant1SensitiveModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode 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::ModerationAPI.ModerationTextResponseVariant1SensitiveModeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1SensitiveModeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveModeNullable.g.cs deleted file mode 100644 index 38ff2ba..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveModeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationTextResponseVariant1SensitiveModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode? 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::ModerationAPI.ModerationTextResponseVariant1SensitiveModeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode? 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::ModerationAPI.ModerationTextResponseVariant1SensitiveModeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2.g.cs deleted file mode 100644 index 0dc76c3..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationTextResponseVariant1WordlistMode2JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2 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::ModerationAPI.ModerationTextResponseVariant1WordlistMode2Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2Nullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2Nullable.g.cs deleted file mode 100644 index 215a07e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationTextResponseVariant1WordlistMode2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2? 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::ModerationAPI.ModerationTextResponseVariant1WordlistMode2Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2? 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::ModerationAPI.ModerationTextResponseVariant1WordlistMode2Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatus.g.cs deleted file mode 100644 index 3018343..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatus.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationVideoResponseVariant1AuthorStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus 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::ModerationAPI.ModerationVideoResponseVariant1AuthorStatusExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatusExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatusNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatusNullable.g.cs deleted file mode 100644 index e5abd1f..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatusNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class ModerationVideoResponseVariant1AuthorStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus? 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::ModerationAPI.ModerationVideoResponseVariant1AuthorStatusExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus? 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::ModerationAPI.ModerationVideoResponseVariant1AuthorStatusExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdict.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdict.g.cs new file mode 100644 index 0000000..c296e28 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdict.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class NewModerateModerateResponseCasebookVerdictJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.NewModerateModerateResponseCasebookVerdict 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::ModerationAPI.NewModerateModerateResponseCasebookVerdictExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.NewModerateModerateResponseCasebookVerdict)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.NewModerateModerateResponseCasebookVerdict); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.NewModerateModerateResponseCasebookVerdict value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.NewModerateModerateResponseCasebookVerdictExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdictNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdictNullable.g.cs new file mode 100644 index 0000000..dc61639 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdictNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class NewModerateModerateResponseCasebookVerdictNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.NewModerateModerateResponseCasebookVerdict? 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::ModerationAPI.NewModerateModerateResponseCasebookVerdictExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.NewModerateModerateResponseCasebookVerdict)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.NewModerateModerateResponseCasebookVerdict?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.NewModerateModerateResponseCasebookVerdict? 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::ModerationAPI.NewModerateModerateResponseCasebookVerdictExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf29.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf31.g.cs similarity index 90% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf29.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf31.g.cs index d12993a..3faa728 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf29.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf31.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public class OneOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + public class OneOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> { /// - public override global::ModerationAPI.OneOf Read( + public override global::ModerationAPI.OneOf Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -345,6 +345,28 @@ public class OneOfJsonConverter __bestScore) { __bestScore = __score0; __bestIndex = 0; } @@ -376,6 +398,8 @@ public class OneOfJsonConverter __bestScore) { __bestScore = __score26; __bestIndex = 26; } if (__score27 > __bestScore) { __bestScore = __score27; __bestIndex = 27; } if (__score28 > __bestScore) { __bestScore = __score28; __bestIndex = 28; } + if (__score29 > __bestScore) { __bestScore = __score29; __bestIndex = 29; } + if (__score30 > __bestScore) { __bestScore = __score30; __bestIndex = 30; } T1? value1 = default; T2? value2 = default; @@ -406,6 +430,8 @@ public class OneOfJsonConverter= 0) { if (__bestIndex == 0) @@ -900,9 +926,43 @@ public class OneOfJsonConverter ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T30).Name}"); + value30 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 30) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T31), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T31).Name}"); + value31 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } } - if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null && value10 == null && value11 == null && value12 == null && value13 == null && value14 == null && value15 == null && value16 == null && value17 == null && value18 == null && value19 == null && value20 == null && value21 == null && value22 == null && value23 == null && value24 == null && value25 == null && value26 == null && value27 == null && value28 == null && value29 == null) + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null && value10 == null && value11 == null && value12 == null && value13 == null && value14 == null && value15 == null && value16 == null && value17 == null && value18 == null && value19 == null && value20 == null && value21 == null && value22 == null && value23 == null && value24 == null && value25 == null && value26 == null && value27 == null && value28 == null && value29 == null && value30 == null && value31 == null) { try { @@ -919,7 +979,7 @@ public class OneOfJsonConverter( + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null && value10 == null && value11 == null && value12 == null && value13 == null && value14 == null && value15 == null && value16 == null && value17 == null && value18 == null && value19 == null && value20 == null && value21 == null && value22 == null && value23 == null && value24 == null && value25 == null && value26 == null && value27 == null && value28 == null && value29 == null && value30 == null && value31 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T30), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T30).Name}"); + value30 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null && value10 == null && value11 == null && value12 == null && value13 == null && value14 == null && value15 == null && value16 == null && value17 == null && value18 == null && value19 == null && value20 == null && value21 == null && value22 == null && value23 == null && value24 == null && value25 == null && value26 == null && value27 == null && value28 == null && value29 == null && value30 == null && value31 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T31), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T31).Name}"); + value31 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::ModerationAPI.OneOf( value1, value2, @@ -1452,7 +1546,11 @@ public class OneOfJsonConverter public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.OneOf value, + global::ModerationAPI.OneOf value, global::System.Text.Json.JsonSerializerOptions options) { options = options ?? throw new global::System.ArgumentNullException(nameof(options)); @@ -1641,6 +1739,18 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T29).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue29(), typeInfo); } + else if (value.IsValue30) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T30), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T30).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue30(), typeInfo); + } + else if (value.IsValue31) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T31), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T31).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue31(), typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectGlobalFlaggingMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectGlobalFlaggingMode.g.cs new file mode 100644 index 0000000..e171b3b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectGlobalFlaggingMode.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class ProjectGlobalFlaggingModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.ProjectGlobalFlaggingMode 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::ModerationAPI.ProjectGlobalFlaggingModeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.ProjectGlobalFlaggingMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.ProjectGlobalFlaggingMode); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.ProjectGlobalFlaggingMode value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.ProjectGlobalFlaggingModeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectGlobalFlaggingModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectGlobalFlaggingModeNullable.g.cs new file mode 100644 index 0000000..c60f225 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectGlobalFlaggingModeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class ProjectGlobalFlaggingModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.ProjectGlobalFlaggingMode? 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::ModerationAPI.ProjectGlobalFlaggingModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.ProjectGlobalFlaggingMode)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.ProjectGlobalFlaggingMode?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.ProjectGlobalFlaggingMode? 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::ModerationAPI.ProjectGlobalFlaggingModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingMode.g.cs similarity index 66% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueType.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingMode.g.cs index 3bd270b..20ad893 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueType.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingMode.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationObjectRequestValueTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ProjectWithKeyGlobalFlaggingModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationObjectRequestValueType Read( + public override global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationObjectRequestValueTypeJsonConverter : global::Syst var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationObjectRequestValueTypeExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.ProjectWithKeyGlobalFlaggingModeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationObjectRequestValueTypeJsonConverter : global::Syst case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationObjectRequestValueType)numValue; + return (global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationObjectRequestValueType); + return default(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationObjectRequestValueTypeJsonConverter : global::Syst /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationObjectRequestValueType value, + global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationObjectRequestValueTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.ProjectWithKeyGlobalFlaggingModeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueTypeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingModeNullable.g.cs similarity index 68% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueTypeNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingModeNullable.g.cs index 3040ba3..9f7c008 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueTypeNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingModeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationObjectRequestValueTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ProjectWithKeyGlobalFlaggingModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationObjectRequestValueType? Read( + public override global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationObjectRequestValueTypeNullableJsonConverter : glob var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationObjectRequestValueTypeExtensions.ToEnum(stringValue); + return global::ModerationAPI.ProjectWithKeyGlobalFlaggingModeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationObjectRequestValueTypeNullableJsonConverter : glob case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationObjectRequestValueType)numValue; + return (global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationObjectRequestValueType?); + return default(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationObjectRequestValueTypeNullableJsonConverter : glob /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationObjectRequestValueType? value, + global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationObjectRequestValueTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.ProjectWithKeyGlobalFlaggingModeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.g.cs new file mode 100644 index 0000000..2e352e8 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementNullable.g.cs new file mode 100644 index 0000000..49b5042 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.g.cs new file mode 100644 index 0000000..3bc7233 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerNullable.g.cs new file mode 100644 index 0000000..5299c41 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatus.g.cs new file mode 100644 index 0000000..d3875a5 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterCheckStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatusNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatusNullable.g.cs new file mode 100644 index 0000000..8bd677c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterCheckStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentType.g.cs new file mode 100644 index 0000000..8f5eb2d --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterContentTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentTypeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentTypeNullable.g.cs new file mode 100644 index 0000000..87210b0 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterContentTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlagged.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlagged.g.cs new file mode 100644 index 0000000..d90f9c4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlagged.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterIsFlaggedJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedNullable.g.cs new file mode 100644 index 0000000..bc79ab7 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterIsFlaggedNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaType.g.cs new file mode 100644 index 0000000..bb5d2ee --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterMediaTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaTypeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaTypeNullable.g.cs new file mode 100644 index 0000000..6f65286 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterMediaTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnit.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnit.g.cs new file mode 100644 index 0000000..5014821 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnit.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterWithinUnitJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnitExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnitExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnitNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnitNullable.g.cs new file mode 100644 index 0000000..55f45a1 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnitNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class QueueViewOpenGetQueueResponseQueueFilterWithinUnitNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnitExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit? 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::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnitExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueDataType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventType.g.cs similarity index 66% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueDataType.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventType.g.cs index 36aa34b..9436256 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueDataType.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventType.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationObjectRequestValueDataTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicCreateRequestEventTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationObjectRequestValueDataType Read( + public override global::ModerationAPI.WebhooksPublicCreateRequestEventType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationObjectRequestValueDataTypeJsonConverter : global:: var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationObjectRequestValueDataTypeExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.WebhooksPublicCreateRequestEventTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationObjectRequestValueDataTypeJsonConverter : global:: case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationObjectRequestValueDataType)numValue; + return (global::ModerationAPI.WebhooksPublicCreateRequestEventType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationObjectRequestValueDataType); + return default(global::ModerationAPI.WebhooksPublicCreateRequestEventType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationObjectRequestValueDataTypeJsonConverter : global:: /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationObjectRequestValueDataType value, + global::ModerationAPI.WebhooksPublicCreateRequestEventType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationObjectRequestValueDataTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicCreateRequestEventTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueDataTypeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventTypeNullable.g.cs similarity index 68% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueDataTypeNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventTypeNullable.g.cs index 7925187..9132f99 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectRequestValueDataTypeNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationObjectRequestValueDataTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicCreateRequestEventTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationObjectRequestValueDataType? Read( + public override global::ModerationAPI.WebhooksPublicCreateRequestEventType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationObjectRequestValueDataTypeNullableJsonConverter : var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationObjectRequestValueDataTypeExtensions.ToEnum(stringValue); + return global::ModerationAPI.WebhooksPublicCreateRequestEventTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationObjectRequestValueDataTypeNullableJsonConverter : case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationObjectRequestValueDataType)numValue; + return (global::ModerationAPI.WebhooksPublicCreateRequestEventType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationObjectRequestValueDataType?); + return default(global::ModerationAPI.WebhooksPublicCreateRequestEventType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationObjectRequestValueDataTypeNullableJsonConverter : /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationObjectRequestValueDataType? value, + global::ModerationAPI.WebhooksPublicCreateRequestEventType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationObjectRequestValueDataTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicCreateRequestEventTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventType.g.cs similarity index 65% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlMode.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventType.g.cs index 24cd805..75403c4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlMode.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventType.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1UrlModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicCreateResponseEventTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1UrlMode Read( + public override global::ModerationAPI.WebhooksPublicCreateResponseEventType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1UrlModeJsonConverter : global: var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1UrlModeExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.WebhooksPublicCreateResponseEventTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1UrlModeJsonConverter : global: case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1UrlMode)numValue; + return (global::ModerationAPI.WebhooksPublicCreateResponseEventType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1UrlMode); + return default(global::ModerationAPI.WebhooksPublicCreateResponseEventType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationTextResponseVariant1UrlModeJsonConverter : global: /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1UrlMode value, + global::ModerationAPI.WebhooksPublicCreateResponseEventType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1UrlModeExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicCreateResponseEventTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventTypeNullable.g.cs similarity index 67% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlModeNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventTypeNullable.g.cs index 4384a1b..c0920c1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlModeNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1UrlModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicCreateResponseEventTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1UrlMode? Read( + public override global::ModerationAPI.WebhooksPublicCreateResponseEventType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1UrlModeNullableJsonConverter : var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1UrlModeExtensions.ToEnum(stringValue); + return global::ModerationAPI.WebhooksPublicCreateResponseEventTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1UrlModeNullableJsonConverter : case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1UrlMode)numValue; + return (global::ModerationAPI.WebhooksPublicCreateResponseEventType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1UrlMode?); + return default(global::ModerationAPI.WebhooksPublicCreateResponseEventType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationTextResponseVariant1UrlModeNullableJsonConverter : /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1UrlMode? value, + global::ModerationAPI.WebhooksPublicCreateResponseEventType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1UrlModeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicCreateResponseEventTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersion.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersion.g.cs new file mode 100644 index 0000000..a64bf61 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersion.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicCreateResponsePayloadVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion 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::ModerationAPI.WebhooksPublicCreateResponsePayloadVersionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersionNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersionNullable.g.cs new file mode 100644 index 0000000..5792782 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicCreateResponsePayloadVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion? 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::ModerationAPI.WebhooksPublicCreateResponsePayloadVersionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion? 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::ModerationAPI.WebhooksPublicCreateResponsePayloadVersionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventType.g.cs new file mode 100644 index 0000000..fac4165 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicGetResponseEventTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicGetResponseEventType 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::ModerationAPI.WebhooksPublicGetResponseEventTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicGetResponseEventType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicGetResponseEventType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicGetResponseEventType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicGetResponseEventTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventTypeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventTypeNullable.g.cs new file mode 100644 index 0000000..323df8b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicGetResponseEventTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicGetResponseEventType? 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::ModerationAPI.WebhooksPublicGetResponseEventTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicGetResponseEventType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicGetResponseEventType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicGetResponseEventType? 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::ModerationAPI.WebhooksPublicGetResponseEventTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersion.g.cs similarity index 65% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneMode.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersion.g.cs index 222f795..7fa7b71 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneMode.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersion.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1PhoneModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicGetResponsePayloadVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1PhoneMode Read( + public override global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1PhoneModeJsonConverter : globa var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1PhoneModeExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.WebhooksPublicGetResponsePayloadVersionExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1PhoneModeJsonConverter : globa case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1PhoneMode)numValue; + return (global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1PhoneMode); + return default(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationTextResponseVariant1PhoneModeJsonConverter : globa /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1PhoneMode value, + global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1PhoneModeExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersionExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersionNullable.g.cs similarity index 67% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailModeNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersionNullable.g.cs index 1e7e6e7..86628b2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailModeNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersionNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1EmailModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicGetResponsePayloadVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1EmailMode? Read( + public override global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1EmailModeNullableJsonConverter var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1EmailModeExtensions.ToEnum(stringValue); + return global::ModerationAPI.WebhooksPublicGetResponsePayloadVersionExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1EmailModeNullableJsonConverter case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1EmailMode)numValue; + return (global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1EmailMode?); + return default(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationTextResponseVariant1EmailModeNullableJsonConverter /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1EmailMode? value, + global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1EmailModeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersionExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventType.g.cs similarity index 65% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailMode.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventType.g.cs index d52c4ca..78c2a4c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailMode.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventType.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1EmailModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicListResponseItemEventTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1EmailMode Read( + public override global::ModerationAPI.WebhooksPublicListResponseItemEventType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1EmailModeJsonConverter : globa var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1EmailModeExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.WebhooksPublicListResponseItemEventTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1EmailModeJsonConverter : globa case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1EmailMode)numValue; + return (global::ModerationAPI.WebhooksPublicListResponseItemEventType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1EmailMode); + return default(global::ModerationAPI.WebhooksPublicListResponseItemEventType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationTextResponseVariant1EmailModeJsonConverter : globa /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1EmailMode value, + global::ModerationAPI.WebhooksPublicListResponseItemEventType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1EmailModeExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicListResponseItemEventTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneModeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventTypeNullable.g.cs similarity index 67% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneModeNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventTypeNullable.g.cs index 2873f8d..4c59baf 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneModeNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationTextResponseVariant1PhoneModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicListResponseItemEventTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationTextResponseVariant1PhoneMode? Read( + public override global::ModerationAPI.WebhooksPublicListResponseItemEventType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationTextResponseVariant1PhoneModeNullableJsonConverter var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationTextResponseVariant1PhoneModeExtensions.ToEnum(stringValue); + return global::ModerationAPI.WebhooksPublicListResponseItemEventTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationTextResponseVariant1PhoneModeNullableJsonConverter case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationTextResponseVariant1PhoneMode)numValue; + return (global::ModerationAPI.WebhooksPublicListResponseItemEventType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationTextResponseVariant1PhoneMode?); + return default(global::ModerationAPI.WebhooksPublicListResponseItemEventType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationTextResponseVariant1PhoneModeNullableJsonConverter /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationTextResponseVariant1PhoneMode? value, + global::ModerationAPI.WebhooksPublicListResponseItemEventType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationTextResponseVariant1PhoneModeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicListResponseItemEventTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersion.g.cs similarity index 62% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatus.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersion.g.cs index f931003..9f331a7 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatus.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersion.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationObjectResponseVariant1AuthorStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicListResponseItemPayloadVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus Read( + public override global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationObjectResponseVariant1AuthorStatusJsonConverter : var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatusExtensions.ToEnum(stringValue) ?? default; + return global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersionExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ModerationObjectResponseVariant1AuthorStatusJsonConverter : case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus)numValue; + return (global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus); + return default(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ModerationObjectResponseVariant1AuthorStatusJsonConverter : /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus value, + global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatusExtensions.ToValueString(value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersionExtensions.ToValueString(value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatusNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersionNullable.g.cs similarity index 64% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatusNullable.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersionNullable.g.cs index aed067f..428332e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatusNullable.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersionNullable.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public sealed class ModerationObjectResponseVariant1AuthorStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class WebhooksPublicListResponseItemPayloadVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus? Read( + public override global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ModerationObjectResponseVariant1AuthorStatusNullableJsonConv var stringValue = reader.GetString(); if (stringValue != null) { - return global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatusExtensions.ToEnum(stringValue); + return global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersionExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ModerationObjectResponseVariant1AuthorStatusNullableJsonConv case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus)numValue; + return (global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus?); + return default(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ModerationObjectResponseVariant1AuthorStatusNullableJsonConv /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus? value, + global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatusExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersionExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventType.g.cs new file mode 100644 index 0000000..fe30ce0 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicUpdateRequestEventTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicUpdateRequestEventType 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::ModerationAPI.WebhooksPublicUpdateRequestEventTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicUpdateRequestEventType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicUpdateRequestEventType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicUpdateRequestEventType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicUpdateRequestEventTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventTypeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventTypeNullable.g.cs new file mode 100644 index 0000000..3d7d780 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicUpdateRequestEventTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicUpdateRequestEventType? 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::ModerationAPI.WebhooksPublicUpdateRequestEventTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicUpdateRequestEventType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicUpdateRequestEventType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicUpdateRequestEventType? 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::ModerationAPI.WebhooksPublicUpdateRequestEventTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventType.g.cs new file mode 100644 index 0000000..be4654b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicUpdateResponseEventTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicUpdateResponseEventType 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::ModerationAPI.WebhooksPublicUpdateResponseEventTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicUpdateResponseEventType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicUpdateResponseEventType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicUpdateResponseEventType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicUpdateResponseEventTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventTypeNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventTypeNullable.g.cs new file mode 100644 index 0000000..8088acc --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicUpdateResponseEventTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicUpdateResponseEventType? 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::ModerationAPI.WebhooksPublicUpdateResponseEventTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicUpdateResponseEventType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicUpdateResponseEventType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicUpdateResponseEventType? 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::ModerationAPI.WebhooksPublicUpdateResponseEventTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersion.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersion.g.cs new file mode 100644 index 0000000..9d66647 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersion.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicUpdateResponsePayloadVersionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion 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::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersionNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersionNullable.g.cs new file mode 100644 index 0000000..0aeedaf --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public sealed class WebhooksPublicUpdateResponsePayloadVersionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion? 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::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion? 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::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs index a1f02d3..d205505 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs @@ -15,6 +15,26 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.PublicAuthorStatusNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.ProjectGlobalFlaggingModeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ProjectGlobalFlaggingModeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingModeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingModeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ChannelContentTypeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ChannelContentTypeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ChannelFlaggingModeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ChannelFlaggingModeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ChannelTranscriptionQualityJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ChannelTranscriptionQualityNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.PublicQueueItemClientActionActionJsonConverter), typeof(global::ModerationAPI.JsonConverters.PublicQueueItemClientActionActionNullableJsonConverter), @@ -95,13 +115,13 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.ActionsUpdateRequestPositionNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationObjectRequestValueTypeJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventTypeJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationObjectRequestValueTypeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventTypeNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationObjectRequestValueDataTypeJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventTypeJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationObjectRequestValueDataTypeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventTypeNullableJsonConverter), typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestMetaTypeJsonConverter), @@ -119,6 +139,26 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieFaceDetectionComparatorNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingModeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingModeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentTypeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentTypeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentTypeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentTypeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingModeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingModeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQualityJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQualityNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.GetStreamRequestDiscriminatorEventJsonConverter), typeof(global::ModerationAPI.JsonConverters.GetStreamRequestDiscriminatorEventNullableJsonConverter), @@ -143,14 +183,42 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.GetStreamSecWebSocketProtocolNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterFilterLabelTypeJsonConverter), typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterFilterLabelTypeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentTypeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentTypeNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaTypeJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaTypeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterRecommendationActionJsonConverter), typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterRecommendationActionNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnitJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnitNullableJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatusJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatusNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetItemsResponseItemStatusJsonConverter), typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetItemsResponseItemStatusNullableJsonConverter), @@ -203,73 +271,45 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.ActionsUpdateResponsePositionNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1AuthorStatusJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1AuthorStatusNullableJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailModeJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailModeNullableJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneModeJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneModeNullableJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlModeJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlModeNullableJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressModeJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressModeNullableJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameModeJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameModeNullableJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameModeJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameModeNullableJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityModeJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventTypeJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityModeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventTypeNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveModeJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersionJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveModeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersionNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistModeJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventTypeJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistModeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventTypeNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2JsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersionJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2NullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersionNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatusJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventTypeJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatusNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventTypeNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistModeJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersionJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistModeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersionNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatusJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventTypeJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatusNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventTypeNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseLabelLabelJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersionJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseLabelLabelNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersionNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatusJsonConverter), + typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1AuthorStatusJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatusNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1AuthorStatusNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatusJsonConverter), + typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatusJsonConverter), - typeof(global::ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatusNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatusNullableJsonConverter), typeof(global::ModerationAPI.JsonConverters.NewModerateModerateResponseAuthorStatusJsonConverter), @@ -283,6 +323,10 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.NewModerateModerateResponseRecommendationReasonCodeNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdictJsonConverter), + + typeof(global::ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdictNullableJsonConverter), + typeof(global::ModerationAPI.JsonConverters.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonationMethodJsonConverter), typeof(global::ModerationAPI.JsonConverters.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonationMethodNullableJsonConverter), @@ -353,18 +397,18 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), - typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), + typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), typeof(global::ModerationAPI.JsonConverters.AllOfJsonConverter), - typeof(global::ModerationAPI.JsonConverters.AllOfJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.AllOfJsonConverter), + typeof(global::ModerationAPI.JsonConverters.AllOfJsonConverter), typeof(global::ModerationAPI.JsonConverters.AnyOfJsonConverter>>), typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), + typeof(global::ModerationAPI.JsonConverters.AnyOfJsonConverter), + typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), @@ -403,6 +447,15 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorConflict))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorConflictIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.Project))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ProjectGlobalFlaggingMode), TypeInfoPropertyName = "ProjectGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ProjectWithKey))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode), TypeInfoPropertyName = "ProjectWithKeyGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.Channel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelContentType), TypeInfoPropertyName = "ChannelContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelFlaggingMode), TypeInfoPropertyName = "ChannelFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ChannelTranscriptionQuality), TypeInfoPropertyName = "ChannelTranscriptionQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorBlockedEvent))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorBlockedEventData))] @@ -427,7 +480,7 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemLabelsVariant1Item))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatche))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), TypeInfoPropertyName = "IListString_System_Collections_Generic_IList_string")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignals))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignalsBrandImpersonation))] @@ -461,7 +514,6 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrame))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameEvent), TypeInfoPropertyName = "VoiceStartFrameEvent2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameMediaFormat))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameTrack))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameTrackName), TypeInfoPropertyName = "VoiceStartFrameTrackName2")] @@ -503,16 +555,14 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsUpdateRequestPossibleValue))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsExecuteRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsExecuteDeprecatedRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateRequestEventType), TypeInfoPropertyName = "WebhooksPublicCreateRequestEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateRequestEventType), TypeInfoPropertyName = "WebhooksPublicUpdateRequestEventType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectRequestValue))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectRequestValueType), TypeInfoPropertyName = "ModerationObjectRequestValueType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectRequestValueData2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectRequestValueDataType), TypeInfoPropertyName = "ModerationObjectRequestValueDataType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationVideoRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationAudioRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WordlistUpdateRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WordlistAddWordsRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequest))] @@ -532,8 +582,8 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestClientAction))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestClientActionAction), TypeInfoPropertyName = "NewModerateModerateRequestClientActionAction2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestClientActionBehavior), TypeInfoPropertyName = "NewModerateModerateRequestClientActionBehavior2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "NewModerateModerateRequestPolicieGuideline_d0eb5495177f1379")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "NewModerateModerateRequestPolicieGuideline_b9fa603267e85329")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "NewModerateModerateRequestPolicieGuideline_325051709c2bce8b")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "NewModerateModerateRequestPolicieGuideline_33b5add9dcf47ca3")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieToxicity))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPoliciePersonalInformation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieToxicitySevere))] @@ -548,6 +598,7 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieAdult))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieCrypto))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieSexual))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieFlirtation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieProfanity))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieViolence))] @@ -560,6 +611,9 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPoliciePolitical))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieReligion))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieCodeAbuse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPoliciePiiMasking))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities2))] @@ -568,6 +622,17 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUrlRisk))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieGuideline))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsUpdateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode), TypeInfoPropertyName = "ManagementProjectsUpdateRequestGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsDuplicateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsCreateRequestContentType), TypeInfoPropertyName = "ManagementChannelsCreateRequestContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestContentType), TypeInfoPropertyName = "ManagementChannelsUpdateRequestContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode), TypeInfoPropertyName = "ManagementChannelsUpdateRequestFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality), TypeInfoPropertyName = "ManagementChannelsUpdateRequestTranscriptionQuality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsDuplicateRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.GetStreamRequest), TypeInfoPropertyName = "GetStreamRequest2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.GetStreamRequestDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.GetStreamRequestDiscriminatorEvent), TypeInfoPropertyName = "GetStreamRequestDiscriminatorEvent2")] @@ -583,12 +648,24 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueue))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilter))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), TypeInfoPropertyName = "IListString_System_Collections_Generic_IList_string_3")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterIsFlagged2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabel))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterFilterLabelType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterMediaType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterRecommendationAction), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterRecommendationAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterWithinUnit2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterCheckStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), TypeInfoPropertyName = "IListString_System_Collections_Generic_IList_string_3")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetStatsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetStatsResponseReviewStats))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -641,6 +718,25 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsDeleteResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsExecuteResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ActionsExecuteDeprecatedResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseItemEventType), TypeInfoPropertyName = "WebhooksPublicListResponseItemEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion), TypeInfoPropertyName = "WebhooksPublicListResponseItemPayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateResponseEventType), TypeInfoPropertyName = "WebhooksPublicCreateResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion), TypeInfoPropertyName = "WebhooksPublicCreateResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetResponseEventType), TypeInfoPropertyName = "WebhooksPublicGetResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion), TypeInfoPropertyName = "WebhooksPublicGetResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateResponseEventType), TypeInfoPropertyName = "WebhooksPublicUpdateResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion), TypeInfoPropertyName = "WebhooksPublicUpdateResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicDeleteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetSecretResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AllOf), TypeInfoPropertyName = "AllOfModerationTextResponseVariant1Object2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Request))] @@ -648,75 +744,15 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1AuthorBlock))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1AuthorStatus), TypeInfoPropertyName = "ModerationTextResponseVariant1AuthorStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1AuthorTrustLevel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Nsfw))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Toxicity))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Quality))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Sentiment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Propriety))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Email))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1EmailMode), TypeInfoPropertyName = "ModerationTextResponseVariant1EmailMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Phone))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1PhoneMode), TypeInfoPropertyName = "ModerationTextResponseVariant1PhoneMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Url))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1UrlMode), TypeInfoPropertyName = "ModerationTextResponseVariant1UrlMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Address))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1AddressMode), TypeInfoPropertyName = "ModerationTextResponseVariant1AddressMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Name))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1NameMode), TypeInfoPropertyName = "ModerationTextResponseVariant1NameMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Username))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1UsernameMode), TypeInfoPropertyName = "ModerationTextResponseVariant1UsernameMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Profanity))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode), TypeInfoPropertyName = "ModerationTextResponseVariant1ProfanityMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Sensitive))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode), TypeInfoPropertyName = "ModerationTextResponseVariant1SensitiveMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Wordlist))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1WordlistMode), TypeInfoPropertyName = "ModerationTextResponseVariant1WordlistMode2_3")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1Wordlist2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2), TypeInfoPropertyName = "ModerationTextResponseVariant1WordlistMode22")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AllOf), TypeInfoPropertyName = "AllOfModerationObjectResponseVariant1Object2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1Author))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus), TypeInfoPropertyName = "ModerationObjectResponseVariant1AuthorStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1Label))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1Entitie))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1Wordlist))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode), TypeInfoPropertyName = "ModerationObjectResponseVariant1WordlistMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationObjectResponseVariant1Field))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseAuthor))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseAuthorBlock))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseAuthorStatus), TypeInfoPropertyName = "ModerationImageResponseAuthorStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseAuthorTrustLevel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseLabel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseLabelLabel), TypeInfoPropertyName = "ModerationImageResponseLabelLabel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AllOf), TypeInfoPropertyName = "AllOfModerationVideoResponseVariant1Object2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationVideoResponseVariant1))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationVideoResponseVariant1Request))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationVideoResponseVariant1Author))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus), TypeInfoPropertyName = "ModerationVideoResponseVariant1AuthorStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationAudioResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationAudioResponseRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationAudioResponseAuthor))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationAudioResponseAuthorBlock))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationAudioResponseAuthorStatus), TypeInfoPropertyName = "ModerationAudioResponseAuthorStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AllOf), TypeInfoPropertyName = "AllOfModerationImageResponseVariant1Object2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseVariant1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseVariant1Request))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseVariant1Author))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus), TypeInfoPropertyName = "ModerationImageResponseVariant1AuthorStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ModerationImageResponseVariant1Label))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AccountGetResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AccountGetResponseCurrentProject))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AccountLegacyAuthGetResponse))] @@ -744,10 +780,14 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseEvaluation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseRecommendation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseRecommendationAction), TypeInfoPropertyName = "NewModerateModerateResponseRecommendationAction2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AnyOf), TypeInfoPropertyName = "AnyOfNewModerateModerateResponseRecommendationReasonCodeString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseRecommendationReasonCode), TypeInfoPropertyName = "NewModerateModerateResponseRecommendationReasonCode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseRecommendationMatchedRule))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseCasebook))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseCasebookVerdict), TypeInfoPropertyName = "NewModerateModerateResponseCasebookVerdict2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseCasebookTopic))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "OneOfNewModerateModerateResponsePolicieClassifierOutputNewModerateModerateResponsePolicieEntityMatcherOutput2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutput))] @@ -756,7 +796,6 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutput))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatche))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignals))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonationMethod), TypeInfoPropertyName = "NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonationMethod2")] @@ -769,6 +808,10 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseMetaStatus), TypeInfoPropertyName = "NewModerateModerateResponseMetaStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsDeleteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementChannelsDeleteResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.GetStreamResponse), TypeInfoPropertyName = "GetStreamResponse2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.GetStreamResponseDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.GetStreamResponseDiscriminatorEvent), TypeInfoPropertyName = "GetStreamResponseDiscriminatorEvent2")] @@ -786,7 +829,7 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?), TypeInfoPropertyName = "PublicQueueItemContentObjectDataAudio_6d0dbf1252fb5aa2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?), TypeInfoPropertyName = "NewModerateModerateRequestContentObject_1ce3d97371b2fe4b")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?), TypeInfoPropertyName = "NewModerateModerateRequestContentObjectDataAudio_8997c1844e8527ae")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?), TypeInfoPropertyName = "NewModerateModerateRequestPolicieGuideline_27d68f053178e486")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?), TypeInfoPropertyName = "NewModerateModerateRequestPolicieGuideline_8e778a0de3fc0bed")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?), TypeInfoPropertyName = "NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio_2070a92914ebe6c9")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -796,15 +839,22 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "ListString_System_Collections_Generic_List_string")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "NewModerateModerateRequestPolicieGuideline_04f5af6f80588c35")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "NewModerateModerateRequestPolicieGuideline_8069246a7863ab80")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "ListString_System_Collections_Generic_List_string_3")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "ListString_System_Collections_Generic_List_string_3")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -818,21 +868,22 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs index ce78cc6..4620178 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs @@ -149,1463 +149,1459 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::ModerationAPI.AuthorBlockedEvent? Type29 { get; set; } + public global::ModerationAPI.Project? Type29 { get; set; } /// /// /// - public global::System.DateTime? Type30 { get; set; } + public global::ModerationAPI.ProjectGlobalFlaggingMode? Type30 { get; set; } /// /// /// - public global::ModerationAPI.AuthorBlockedEventData? Type31 { get; set; } + public global::ModerationAPI.ProjectWithKey? Type31 { get; set; } /// /// /// - public global::ModerationAPI.PublicActionPerformedAuthor? Type32 { get; set; } + public global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode? Type32 { get; set; } /// /// /// - public global::ModerationAPI.PublicActionPerformedAuthorQueue? Type33 { get; set; } + public global::ModerationAPI.Channel? Type33 { get; set; } /// /// /// - public global::ModerationAPI.AuthorUnblockedEvent? Type34 { get; set; } + public global::ModerationAPI.ChannelContentType? Type34 { get; set; } /// /// /// - public global::ModerationAPI.AuthorUnblockedEventData? Type35 { get; set; } + public global::ModerationAPI.ChannelFlaggingMode? Type35 { get; set; } /// /// /// - public global::ModerationAPI.AuthorSuspendedEvent? Type36 { get; set; } + public global::ModerationAPI.ChannelTranscriptionQuality? Type36 { get; set; } /// /// /// - public global::ModerationAPI.AuthorSuspendedEventData? Type37 { get; set; } + public int? Type37 { get; set; } /// /// /// - public global::ModerationAPI.AuthorUpdatedEvent? Type38 { get; set; } + public global::ModerationAPI.AuthorBlockedEvent? Type38 { get; set; } /// /// /// - public global::ModerationAPI.AuthorUpdatedEventData? Type39 { get; set; } + public global::System.DateTime? Type39 { get; set; } /// /// /// - public global::ModerationAPI.AuthorTrustLevelChangedEvent? Type40 { get; set; } + public global::ModerationAPI.AuthorBlockedEventData? Type40 { get; set; } /// /// /// - public global::ModerationAPI.AuthorTrustLevelChangedEventData? Type41 { get; set; } + public global::ModerationAPI.PublicActionPerformedAuthor? Type41 { get; set; } /// /// /// - public global::ModerationAPI.AuthorActionEvent? Type42 { get; set; } + public global::ModerationAPI.PublicActionPerformedAuthorQueue? Type42 { get; set; } /// /// /// - public global::ModerationAPI.AuthorActionEventData? Type43 { get; set; } + public global::ModerationAPI.AuthorUnblockedEvent? Type43 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemCompletedEvent? Type44 { get; set; } + public global::ModerationAPI.AuthorUnblockedEventData? Type44 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemCompletedEventData? Type45 { get; set; } + public global::ModerationAPI.AuthorSuspendedEvent? Type45 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemEvent? Type46 { get; set; } + public global::ModerationAPI.AuthorSuspendedEventData? Type46 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItem? Type47 { get; set; } + public global::ModerationAPI.AuthorUpdatedEvent? Type47 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemEventQueue? Type48 { get; set; } + public global::ModerationAPI.AuthorUpdatedEventData? Type48 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type49 { get; set; } + public global::ModerationAPI.AuthorTrustLevelChangedEvent? Type49 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemLabelsVariant1Item? Type50 { get; set; } + public global::ModerationAPI.AuthorTrustLevelChangedEventData? Type50 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type51 { get; set; } + public global::ModerationAPI.AuthorActionEvent? Type51 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatche? Type52 { get; set; } + public global::ModerationAPI.AuthorActionEventData? Type52 { get; set; } /// /// /// - public byte[]? Type53 { get; set; } + public global::ModerationAPI.QueueItemCompletedEvent? Type53 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignals? Type54 { get; set; } + public global::ModerationAPI.QueueItemCompletedEventData? Type54 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignalsBrandImpersonation? Type55 { get; set; } + public global::ModerationAPI.PublicQueueItemEvent? Type55 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentText? Type56 { get; set; } + public global::ModerationAPI.PublicQueueItem? Type56 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentImage? Type57 { get; set; } + public global::ModerationAPI.PublicQueueItemEventQueue? Type57 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentVideo? Type58 { get; set; } + public global::System.Collections.Generic.IList? Type58 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentAudio? Type59 { get; set; } + public global::ModerationAPI.PublicQueueItemLabelsVariant1Item? Type59 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentObject? Type60 { get; set; } + public global::System.Collections.Generic.IList? Type60 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentObjectDataText? Type61 { get; set; } + public global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatche? Type61 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentObjectDataImage? Type62 { get; set; } + public global::System.Collections.Generic.IList? Type62 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentObjectDataVideo? Type63 { get; set; } + public global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignals? Type63 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemContentObjectDataAudio? Type64 { get; set; } + public global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignalsBrandImpersonation? Type64 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemClientAction? Type65 { get; set; } + public global::ModerationAPI.PublicQueueItemContentText? Type65 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemClientActionAction? Type66 { get; set; } + public global::ModerationAPI.PublicQueueItemContentImage? Type66 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemClientActionBehavior? Type67 { get; set; } + public global::ModerationAPI.PublicQueueItemContentVideo? Type67 { get; set; } /// /// /// - public global::ModerationAPI.PublicQueueItemMetaType? Type68 { get; set; } + public global::ModerationAPI.PublicQueueItemContentAudio? Type68 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemActionEvent? Type69 { get; set; } + public global::ModerationAPI.PublicQueueItemContentObject? Type69 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemActionEventData? Type70 { get; set; } + public global::ModerationAPI.PublicQueueItemContentObjectDataText? Type70 { get; set; } /// /// /// - public global::ModerationAPI.PublicActionPerformed? Type71 { get; set; } + public global::ModerationAPI.PublicQueueItemContentObjectDataImage? Type71 { get; set; } /// /// /// - public global::ModerationAPI.PublicActionPerformedQueue? Type72 { get; set; } + public global::ModerationAPI.PublicQueueItemContentObjectDataVideo? Type72 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemRejectedEvent? Type73 { get; set; } + public global::ModerationAPI.PublicQueueItemContentObjectDataAudio? Type73 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemRejectedEventData? Type74 { get; set; } + public global::ModerationAPI.PublicQueueItemClientAction? Type74 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemAllowedEvent? Type75 { get; set; } + public global::ModerationAPI.PublicQueueItemClientActionAction? Type75 { get; set; } /// /// /// - public global::ModerationAPI.QueueItemAllowedEventData? Type76 { get; set; } + public global::ModerationAPI.PublicQueueItemClientActionBehavior? Type76 { get; set; } /// /// /// - public global::ModerationAPI.WebhookEvent? Type77 { get; set; } + public global::ModerationAPI.PublicQueueItemMetaType? Type77 { get; set; } /// /// /// - public global::ModerationAPI.WebhookEventDiscriminator? Type78 { get; set; } + public global::ModerationAPI.QueueItemActionEvent? Type78 { get; set; } /// /// /// - public global::ModerationAPI.WebhookEventDiscriminatorType? Type79 { get; set; } + public global::ModerationAPI.QueueItemActionEventData? Type79 { get; set; } /// /// /// - public global::ModerationAPI.VoiceStartFrame? Type80 { get; set; } + public global::ModerationAPI.PublicActionPerformed? Type80 { get; set; } /// /// /// - public global::ModerationAPI.VoiceStartFrameEvent? Type81 { get; set; } + public global::ModerationAPI.PublicActionPerformedQueue? Type81 { get; set; } /// /// /// - public global::ModerationAPI.VoiceStartFrameMediaFormat? Type82 { get; set; } + public global::ModerationAPI.QueueItemRejectedEvent? Type82 { get; set; } /// /// /// - public int? Type83 { get; set; } + public global::ModerationAPI.QueueItemRejectedEventData? Type83 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type84 { get; set; } + public global::ModerationAPI.QueueItemAllowedEvent? Type84 { get; set; } /// /// /// - public global::ModerationAPI.VoiceStartFrameTrack? Type85 { get; set; } + public global::ModerationAPI.QueueItemAllowedEventData? Type85 { get; set; } /// /// /// - public global::ModerationAPI.VoiceStartFrameTrackName? Type86 { get; set; } + public global::ModerationAPI.WebhookEvent? Type86 { get; set; } /// /// /// - public global::ModerationAPI.VoiceMediaFrame? Type87 { get; set; } + public global::ModerationAPI.WebhookEventDiscriminator? Type87 { get; set; } /// /// /// - public global::ModerationAPI.VoiceMediaFrameEvent? Type88 { get; set; } + public global::ModerationAPI.WebhookEventDiscriminatorType? Type88 { get; set; } /// /// /// - public global::ModerationAPI.VoiceMediaFrameMedia? Type89 { get; set; } + public global::ModerationAPI.VoiceStartFrame? Type89 { get; set; } /// /// /// - public global::ModerationAPI.VoiceMediaFrameMediaTrack? Type90 { get; set; } + public global::ModerationAPI.VoiceStartFrameEvent? Type90 { get; set; } /// /// /// - public global::ModerationAPI.VoiceStopFrame? Type91 { get; set; } + public global::ModerationAPI.VoiceStartFrameMediaFormat? Type91 { get; set; } /// /// /// - public global::ModerationAPI.VoiceStopFrameEvent? Type92 { get; set; } + public global::System.Collections.Generic.IList? Type92 { get; set; } /// /// /// - public global::ModerationAPI.VoiceSessionStarted? Type93 { get; set; } + public global::ModerationAPI.VoiceStartFrameTrack? Type93 { get; set; } /// /// /// - public global::ModerationAPI.VoiceSessionStartedEvent? Type94 { get; set; } + public global::ModerationAPI.VoiceStartFrameTrackName? Type94 { get; set; } /// /// /// - public global::ModerationAPI.VoiceUtteranceFinal? Type95 { get; set; } + public global::ModerationAPI.VoiceMediaFrame? Type95 { get; set; } /// /// /// - public global::ModerationAPI.VoiceUtteranceFinalEvent? Type96 { get; set; } + public global::ModerationAPI.VoiceMediaFrameEvent? Type96 { get; set; } /// /// /// - public global::ModerationAPI.VoiceUtteranceFinalTrack? Type97 { get; set; } + public global::ModerationAPI.VoiceMediaFrameMedia? Type97 { get; set; } /// /// /// - public global::ModerationAPI.VoiceUtteranceFinalRecommendation? Type98 { get; set; } + public global::ModerationAPI.VoiceMediaFrameMediaTrack? Type98 { get; set; } /// /// /// - public global::ModerationAPI.VoiceUtteranceFinalRecommendationAction? Type99 { get; set; } + public global::ModerationAPI.VoiceStopFrame? Type99 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type100 { get; set; } + public global::ModerationAPI.VoiceStopFrameEvent? Type100 { get; set; } /// /// /// - public global::ModerationAPI.VoiceSessionEnded? Type101 { get; set; } + public global::ModerationAPI.VoiceSessionStarted? Type101 { get; set; } /// /// /// - public global::ModerationAPI.VoiceSessionEndedEvent? Type102 { get; set; } + public global::ModerationAPI.VoiceSessionStartedEvent? Type102 { get; set; } /// /// /// - public global::ModerationAPI.VoiceSessionEndedStats? Type103 { get; set; } + public global::ModerationAPI.VoiceUtteranceFinal? Type103 { get; set; } /// /// /// - public global::ModerationAPI.VoiceSessionEndedStatsActions? Type104 { get; set; } + public global::ModerationAPI.VoiceUtteranceFinalEvent? Type104 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenCreateRequest? Type105 { get; set; } + public global::ModerationAPI.VoiceUtteranceFinalTrack? Type105 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenCreateRequestMetadata? Type106 { get; set; } + public global::ModerationAPI.VoiceUtteranceFinalRecommendation? Type106 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenUpdateRequest? Type107 { get; set; } + public global::ModerationAPI.VoiceUtteranceFinalRecommendationAction? Type107 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenUpdateRequestMetadata? Type108 { get; set; } + public global::System.Collections.Generic.IList? Type108 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenResolveItemRequest? Type109 { get; set; } + public global::ModerationAPI.VoiceSessionEnded? Type109 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenUnresolveItemRequest? Type110 { get; set; } + public global::ModerationAPI.VoiceSessionEndedEvent? Type110 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateRequest? Type111 { get; set; } + public global::ModerationAPI.VoiceSessionEndedStats? Type111 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateRequestType? Type112 { get; set; } + public global::ModerationAPI.VoiceSessionEndedStatsActions? Type112 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateRequestQueueBehaviour? Type113 { get; set; } + public global::ModerationAPI.AuthorOpenCreateRequest? Type113 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateRequestPosition? Type114 { get; set; } + public global::ModerationAPI.AuthorOpenCreateRequestMetadata? Type114 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type115 { get; set; } + public global::ModerationAPI.AuthorOpenUpdateRequest? Type115 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateRequestPossibleValue? Type116 { get; set; } + public global::ModerationAPI.AuthorOpenUpdateRequestMetadata? Type116 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateRequest? Type117 { get; set; } + public global::ModerationAPI.QueueViewOpenResolveItemRequest? Type117 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateRequestType? Type118 { get; set; } + public global::ModerationAPI.QueueViewOpenUnresolveItemRequest? Type118 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateRequestQueueBehaviour? Type119 { get; set; } + public global::ModerationAPI.ActionsCreateRequest? Type119 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateRequestPosition? Type120 { get; set; } + public global::ModerationAPI.ActionsCreateRequestType? Type120 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type121 { get; set; } + public global::ModerationAPI.ActionsCreateRequestQueueBehaviour? Type121 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateRequestPossibleValue? Type122 { get; set; } + public global::ModerationAPI.ActionsCreateRequestPosition? Type122 { get; set; } /// /// /// - public global::ModerationAPI.ActionsExecuteRequest? Type123 { get; set; } + public global::System.Collections.Generic.IList? Type123 { get; set; } /// /// /// - public global::ModerationAPI.ActionsExecuteDeprecatedRequest? Type124 { get; set; } + public global::ModerationAPI.ActionsCreateRequestPossibleValue? Type124 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextRequest? Type125 { get; set; } + public global::ModerationAPI.ActionsUpdateRequest? Type125 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectRequest? Type126 { get; set; } + public global::ModerationAPI.ActionsUpdateRequestType? Type126 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectRequestValue? Type127 { get; set; } + public global::ModerationAPI.ActionsUpdateRequestQueueBehaviour? Type127 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectRequestValueType? Type128 { get; set; } + public global::ModerationAPI.ActionsUpdateRequestPosition? Type128 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type129 { get; set; } + public global::System.Collections.Generic.IList? Type129 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectRequestValueData2? Type130 { get; set; } + public global::ModerationAPI.ActionsUpdateRequestPossibleValue? Type130 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectRequestValueDataType? Type131 { get; set; } + public global::ModerationAPI.ActionsExecuteRequest? Type131 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageRequest? Type132 { get; set; } + public global::ModerationAPI.ActionsExecuteDeprecatedRequest? Type132 { get; set; } /// /// /// - public global::ModerationAPI.ModerationVideoRequest? Type133 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateRequest? Type133 { get; set; } /// /// /// - public global::ModerationAPI.ModerationAudioRequest? Type134 { get; set; } + public global::System.Collections.Generic.IList? Type134 { get; set; } /// /// /// - public global::ModerationAPI.WordlistUpdateRequest? Type135 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateRequestEventType? Type135 { get; set; } /// /// /// - public global::ModerationAPI.WordlistAddWordsRequest? Type136 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateRequest? Type136 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequest? Type137 { get; set; } + public global::System.Collections.Generic.IList? Type137 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentText? Type138 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateRequestEventType? Type138 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentImage? Type139 { get; set; } + public global::ModerationAPI.ModerationTextRequest? Type139 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentVideo? Type140 { get; set; } + public global::ModerationAPI.ModerationImageRequest? Type140 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentAudio? Type141 { get; set; } + public global::ModerationAPI.WordlistUpdateRequest? Type141 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObject? Type142 { get; set; } + public global::ModerationAPI.WordlistAddWordsRequest? Type142 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataText? Type143 { get; set; } + public global::ModerationAPI.NewModerateModerateRequest? Type143 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataImage? Type144 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentText? Type144 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataVideo? Type145 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentImage? Type145 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataAudio? Type146 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentVideo? Type146 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestMetaType? Type147 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentAudio? Type147 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestClientAction? Type148 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObject? Type148 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestClientActionAction? Type149 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataText? Type149 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestClientActionBehavior? Type150 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataImage? Type150 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieToxicity? Type151 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataVideo? Type151 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePersonalInformation? Type152 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataAudio? Type152 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieToxicitySevere? Type153 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestMetaType? Type153 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieHate? Type154 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestClientAction? Type154 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicit? Type155 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestClientActionAction? Type155 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitDrugs? Type156 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestClientActionBehavior? Type156 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitAlcohol? Type157 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieToxicity? Type157 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitFirearms? Type158 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePersonalInformation? Type158 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitTobacco? Type159 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieToxicitySevere? Type159 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitGambling? Type160 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieHate? Type160 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieCannabis? Type161 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicit? Type161 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieAdult? Type162 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitDrugs? Type162 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieCrypto? Type163 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitAlcohol? Type163 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSexual? Type164 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitFirearms? Type164 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieFlirtation? Type165 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitTobacco? Type165 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieProfanity? Type166 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitGambling? Type166 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieViolence? Type167 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCannabis? Type167 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSelfHarm? Type168 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieAdult? Type168 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSpam? Type169 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCrypto? Type169 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieLowQualityContent? Type170 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSexual? Type170 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieFaceDetection? Type171 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors? Type171 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieFaceDetectionComparator? Type172 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieFlirtation? Type172 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSelfPromotion? Type173 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieProfanity? Type173 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePolitical? Type174 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieViolence? Type174 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieReligion? Type175 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSelfHarm? Type175 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieCodeAbuse? Type176 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSpam? Type176 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMasking? Type177 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieLowQualityContent? Type177 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type178 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieFaceDetection? Type178 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities2? Type179 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieFaceDetectionComparator? Type179 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMasking? Type180 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSelfPromotion? Type180 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type181 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePolitical? Type181 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities2? Type182 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieReligion? Type182 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlRisk? Type183 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCodeAbuse? Type183 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieGuideline? Type184 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing? Type184 { get; set; } /// /// /// - public global::ModerationAPI.GetStreamRequest? Type185 { get; set; } + public global::System.Collections.Generic.Dictionary? Type185 { get; set; } /// /// /// - public global::ModerationAPI.GetStreamRequestDiscriminator? Type186 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2? Type186 { get; set; } /// /// /// - public global::ModerationAPI.GetStreamRequestDiscriminatorEvent? Type187 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMasking? Type187 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenListAuthorsSortBy? Type188 { get; set; } + public global::System.Collections.Generic.Dictionary? Type188 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenListAuthorsSortDirection? Type189 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities2? Type189 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsSortField? Type190 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMasking? Type190 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsSortDirection? Type191 { get; set; } + public global::System.Collections.Generic.Dictionary? Type191 { get; set; } /// /// /// - public global::ModerationAPI.GetStreamSecWebSocketProtocol? Type192 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities2? Type192 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenListAuthorsResponse? Type193 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUrlRisk? Type193 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type194 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieGuideline? Type194 { get; set; } /// /// /// - public global::ModerationAPI.AuthorOpenListAuthorsResponsePagination? Type195 { get; set; } + public global::ModerationAPI.ManagementProjectsCreateRequest? Type195 { get; set; } /// /// /// - public global::ModerationAPI.AuthorDeleteResponse? Type196 { get; set; } + public global::ModerationAPI.ManagementProjectsUpdateRequest? Type196 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetQueueResponse? Type197 { get; set; } + public global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? Type197 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetQueueResponseQueue? Type198 { get; set; } + public global::ModerationAPI.ManagementProjectsDuplicateRequest? Type198 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilter? Type199 { get; set; } + public global::ModerationAPI.ManagementChannelsCreateRequest? Type199 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type200 { get; set; } + public global::ModerationAPI.ManagementChannelsCreateRequestContentType? Type200 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabel? Type201 { get; set; } + public global::ModerationAPI.ManagementChannelsUpdateRequest? Type201 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType? Type202 { get; set; } + public global::ModerationAPI.ManagementChannelsUpdateRequestContentType? Type202 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type203 { get; set; } + public global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? Type203 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterRecommendationAction? Type204 { get; set; } + public global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? Type204 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponse? Type205 { get; set; } + public global::ModerationAPI.ManagementChannelsDuplicateRequest? Type205 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseReviewStats? Type206 { get; set; } + public global::ModerationAPI.GetStreamRequest? Type206 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type207 { get; set; } + public global::ModerationAPI.GetStreamRequestDiscriminator? Type207 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseActionStat? Type208 { get; set; } + public global::ModerationAPI.GetStreamRequestDiscriminatorEvent? Type208 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type209 { get; set; } + public global::ModerationAPI.AuthorOpenListAuthorsSortBy? Type209 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseTopReviewer? Type210 { get; set; } + public global::ModerationAPI.AuthorOpenListAuthorsSortDirection? Type210 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type211 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsSortField? Type211 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseTopReviewerTopAction? Type212 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsSortDirection? Type212 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseTrends? Type213 { get; set; } + public global::ModerationAPI.GetStreamSecWebSocketProtocol? Type213 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type214 { get; set; } + public global::ModerationAPI.AuthorOpenListAuthorsResponse? Type214 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseTrendsDailyReviewCount? Type215 { get; set; } + public global::System.Collections.Generic.IList? Type215 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type216 { get; set; } + public global::ModerationAPI.AuthorOpenListAuthorsResponsePagination? Type216 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetStatsResponseTrendsFlaggedContentTrend? Type217 { get; set; } + public global::ModerationAPI.AuthorDeleteResponse? Type217 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsResponse? Type218 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponse? Type218 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type219 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueue? Type219 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsResponseItem? Type220 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilter? Type220 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type221 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged? Type221 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsResponseItemLabel? Type222 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer? Type222 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type223 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement? Type223 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsResponseItemAction? Type224 { get; set; } + public global::System.Collections.Generic.IList? Type224 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsResponseItemStatus? Type225 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabel? Type225 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenGetItemsResponsePagination? Type226 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType? Type226 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenResolveItemResponse? Type227 { get; set; } + public global::System.Collections.Generic.IList? Type227 { get; set; } /// /// /// - public global::ModerationAPI.QueueViewOpenUnresolveItemResponse? Type228 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter? Type228 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type229 { get; set; } + public global::System.Collections.Generic.IList? Type229 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseItem? Type230 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType? Type230 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseItemType? Type231 { get; set; } + public global::System.Collections.Generic.IList? Type231 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseItemQueueBehaviour? Type232 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType? Type232 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseItemPosition? Type233 { get; set; } + public global::System.Collections.Generic.IList? Type233 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type234 { get; set; } + public global::System.Collections.Generic.IList? Type234 { get; set; } /// /// /// - public global::ModerationAPI.ActionsListResponseItemPossibleValue? Type235 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterRecommendationAction? Type235 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponse? Type236 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit? Type236 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponseType? Type237 { get; set; } + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus? Type237 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponseQueueBehaviour? Type238 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponse? Type238 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponsePosition? Type239 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseReviewStats? Type239 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type240 { get; set; } + public global::System.Collections.Generic.IList? Type240 { get; set; } /// /// /// - public global::ModerationAPI.ActionsCreateResponsePossibleValue? Type241 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseActionStat? Type241 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponse? Type242 { get; set; } + public global::System.Collections.Generic.IList? Type242 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponseType? Type243 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseTopReviewer? Type243 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponseQueueBehaviour? Type244 { get; set; } + public global::System.Collections.Generic.IList? Type244 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponsePosition? Type245 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseTopReviewerTopAction? Type245 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type246 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseTrends? Type246 { get; set; } /// /// /// - public global::ModerationAPI.ActionsGetResponsePossibleValue? Type247 { get; set; } + public global::System.Collections.Generic.IList? Type247 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponse? Type248 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseTrendsDailyReviewCount? Type248 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponseType? Type249 { get; set; } + public global::System.Collections.Generic.IList? Type249 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponseQueueBehaviour? Type250 { get; set; } + public global::ModerationAPI.QueueViewOpenGetStatsResponseTrendsFlaggedContentTrend? Type250 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponsePosition? Type251 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsResponse? Type251 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type252 { get; set; } + public global::System.Collections.Generic.IList? Type252 { get; set; } /// /// /// - public global::ModerationAPI.ActionsUpdateResponsePossibleValue? Type253 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsResponseItem? Type253 { get; set; } /// /// /// - public global::ModerationAPI.ActionsDeleteResponse? Type254 { get; set; } + public global::System.Collections.Generic.IList? Type254 { get; set; } /// /// /// - public global::ModerationAPI.ActionsExecuteResponse? Type255 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsResponseItemLabel? Type255 { get; set; } /// /// /// - public global::ModerationAPI.ActionsExecuteDeprecatedResponse? Type256 { get; set; } + public global::System.Collections.Generic.IList? Type256 { get; set; } /// /// /// - public global::ModerationAPI.AllOf? Type257 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsResponseItemAction? Type257 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1? Type258 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsResponseItemStatus? Type258 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Request? Type259 { get; set; } + public global::ModerationAPI.QueueViewOpenGetItemsResponsePagination? Type259 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Author? Type260 { get; set; } + public global::ModerationAPI.QueueViewOpenResolveItemResponse? Type260 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1AuthorBlock? Type261 { get; set; } + public global::ModerationAPI.QueueViewOpenUnresolveItemResponse? Type261 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1AuthorStatus? Type262 { get; set; } + public global::System.Collections.Generic.IList? Type262 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1AuthorTrustLevel? Type263 { get; set; } + public global::ModerationAPI.ActionsListResponseItem? Type263 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Nsfw? Type264 { get; set; } + public global::ModerationAPI.ActionsListResponseItemType? Type264 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores? Type265 { get; set; } + public global::ModerationAPI.ActionsListResponseItemQueueBehaviour? Type265 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Toxicity? Type266 { get; set; } + public global::ModerationAPI.ActionsListResponseItemPosition? Type266 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores? Type267 { get; set; } + public global::System.Collections.Generic.IList? Type267 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Quality? Type268 { get; set; } + public global::ModerationAPI.ActionsListResponseItemPossibleValue? Type268 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores? Type269 { get; set; } + public global::ModerationAPI.ActionsCreateResponse? Type269 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Sentiment? Type270 { get; set; } + public global::ModerationAPI.ActionsCreateResponseType? Type270 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores? Type271 { get; set; } + public global::ModerationAPI.ActionsCreateResponseQueueBehaviour? Type271 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Propriety? Type272 { get; set; } + public global::ModerationAPI.ActionsCreateResponsePosition? Type272 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores? Type273 { get; set; } + public global::System.Collections.Generic.IList? Type273 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Email? Type274 { get; set; } + public global::ModerationAPI.ActionsCreateResponsePossibleValue? Type274 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1EmailMode? Type275 { get; set; } + public global::ModerationAPI.ActionsGetResponse? Type275 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Phone? Type276 { get; set; } + public global::ModerationAPI.ActionsGetResponseType? Type276 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1PhoneMode? Type277 { get; set; } + public global::ModerationAPI.ActionsGetResponseQueueBehaviour? Type277 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Url? Type278 { get; set; } + public global::ModerationAPI.ActionsGetResponsePosition? Type278 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1UrlMode? Type279 { get; set; } + public global::System.Collections.Generic.IList? Type279 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Address? Type280 { get; set; } + public global::ModerationAPI.ActionsGetResponsePossibleValue? Type280 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1AddressMode? Type281 { get; set; } + public global::ModerationAPI.ActionsUpdateResponse? Type281 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Name? Type282 { get; set; } + public global::ModerationAPI.ActionsUpdateResponseType? Type282 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1NameMode? Type283 { get; set; } + public global::ModerationAPI.ActionsUpdateResponseQueueBehaviour? Type283 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Username? Type284 { get; set; } + public global::ModerationAPI.ActionsUpdateResponsePosition? Type284 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1UsernameMode? Type285 { get; set; } + public global::System.Collections.Generic.IList? Type285 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Profanity? Type286 { get; set; } + public global::ModerationAPI.ActionsUpdateResponsePossibleValue? Type286 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode? Type287 { get; set; } + public global::ModerationAPI.ActionsDeleteResponse? Type287 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Sensitive? Type288 { get; set; } + public global::ModerationAPI.ActionsExecuteResponse? Type288 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode? Type289 { get; set; } + public global::ModerationAPI.ActionsExecuteDeprecatedResponse? Type289 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Wordlist? Type290 { get; set; } + public global::System.Collections.Generic.IList? Type290 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1WordlistMode? Type291 { get; set; } + public global::ModerationAPI.WebhooksPublicListResponseItem? Type291 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type292 { get; set; } + public global::System.Collections.Generic.IList? Type292 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1Wordlist2? Type293 { get; set; } + public global::ModerationAPI.WebhooksPublicListResponseItemEventType? Type293 { get; set; } /// /// /// - public global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2? Type294 { get; set; } + public global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion? Type294 { get; set; } /// /// /// - public global::ModerationAPI.AllOf? Type295 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateResponse? Type295 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1? Type296 { get; set; } + public global::System.Collections.Generic.IList? Type296 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1Request? Type297 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateResponseEventType? Type297 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1Author? Type298 { get; set; } + public global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion? Type298 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock? Type299 { get; set; } + public global::ModerationAPI.WebhooksPublicGetResponse? Type299 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus? Type300 { get; set; } + public global::System.Collections.Generic.IList? Type300 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel? Type301 { get; set; } + public global::ModerationAPI.WebhooksPublicGetResponseEventType? Type301 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type302 { get; set; } + public global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion? Type302 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1Label? Type303 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateResponse? Type303 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type304 { get; set; } + public global::System.Collections.Generic.IList? Type304 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1Entitie? Type305 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateResponseEventType? Type305 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type306 { get; set; } + public global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion? Type306 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1Wordlist? Type307 { get; set; } + public global::ModerationAPI.WebhooksPublicDeleteResponse? Type307 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode? Type308 { get; set; } + public global::ModerationAPI.WebhooksPublicGetSecretResponse? Type308 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type309 { get; set; } + public global::ModerationAPI.AllOf? Type309 { get; set; } /// /// /// - public global::ModerationAPI.ModerationObjectResponseVariant1Field? Type310 { get; set; } + public global::ModerationAPI.ModerationTextResponseVariant1? Type310 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageResponse? Type311 { get; set; } + public global::ModerationAPI.ModerationTextResponseVariant1Request? Type311 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageResponseRequest? Type312 { get; set; } + public global::ModerationAPI.ModerationTextResponseVariant1Author? Type312 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageResponseAuthor? Type313 { get; set; } + public global::ModerationAPI.ModerationTextResponseVariant1AuthorBlock? Type313 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageResponseAuthorBlock? Type314 { get; set; } + public global::ModerationAPI.ModerationTextResponseVariant1AuthorStatus? Type314 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageResponseAuthorStatus? Type315 { get; set; } + public global::ModerationAPI.ModerationTextResponseVariant1AuthorTrustLevel? Type315 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageResponseAuthorTrustLevel? Type316 { get; set; } + public global::ModerationAPI.AllOf? Type316 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type317 { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1? Type317 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageResponseLabel? Type318 { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1Request? Type318 { get; set; } /// /// /// - public global::ModerationAPI.ModerationImageResponseLabelLabel? Type319 { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1Author? Type319 { get; set; } /// /// /// - public global::ModerationAPI.AllOf? Type320 { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock? Type320 { get; set; } /// /// /// - public global::ModerationAPI.ModerationVideoResponseVariant1? Type321 { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus? Type321 { get; set; } /// /// /// - public global::ModerationAPI.ModerationVideoResponseVariant1Request? Type322 { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel? Type322 { get; set; } /// /// /// - public global::ModerationAPI.ModerationVideoResponseVariant1Author? Type323 { get; set; } + public global::System.Collections.Generic.IList? Type323 { get; set; } /// /// /// - public global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock? Type324 { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1Label? Type324 { get; set; } /// /// /// - public global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus? Type325 { get; set; } + public global::ModerationAPI.AccountGetResponse? Type325 { get; set; } /// /// /// - public global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel? Type326 { get; set; } + public global::ModerationAPI.AccountGetResponseCurrentProject? Type326 { get; set; } /// /// /// - public global::ModerationAPI.ModerationAudioResponse? Type327 { get; set; } + public global::ModerationAPI.AccountLegacyAuthGetResponse? Type327 { get; set; } /// /// /// - public global::ModerationAPI.ModerationAudioResponseRequest? Type328 { get; set; } + public global::ModerationAPI.AccountLegacyAuthPostResponse? Type328 { get; set; } /// /// /// - public global::ModerationAPI.ModerationAudioResponseAuthor? Type329 { get; set; } + public global::System.Collections.Generic.IList? Type329 { get; set; } /// /// /// - public global::ModerationAPI.ModerationAudioResponseAuthorBlock? Type330 { get; set; } + public global::ModerationAPI.WordlistListResponseItem? Type330 { get; set; } /// /// /// - public global::ModerationAPI.ModerationAudioResponseAuthorStatus? Type331 { get; set; } + public global::ModerationAPI.WordlistGetWordlistPublicResponse? Type331 { get; set; } /// /// /// - public global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel? Type332 { get; set; } + public global::ModerationAPI.WordlistUpdateResponse? Type332 { get; set; } /// /// /// - public global::ModerationAPI.AccountGetResponse? Type333 { get; set; } + public global::ModerationAPI.WordlistWordlistEmbeddingStatusResponse? Type333 { get; set; } /// /// /// - public global::ModerationAPI.AccountGetResponseCurrentProject? Type334 { get; set; } + public global::ModerationAPI.WordlistAddWordsResponse? Type334 { get; set; } /// /// /// - public global::ModerationAPI.AccountLegacyAuthGetResponse? Type335 { get; set; } + public global::ModerationAPI.WordlistRemoveWordsResponse? Type335 { get; set; } /// /// /// - public global::ModerationAPI.AccountLegacyAuthPostResponse? Type336 { get; set; } + public global::ModerationAPI.NewModerateModerateResponse? Type336 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type337 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContent? Type337 { get; set; } /// /// /// - public global::ModerationAPI.WordlistListResponseItem? Type338 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText? Type338 { get; set; } /// /// /// - public global::ModerationAPI.WordlistGetWordlistPublicResponse? Type339 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage? Type339 { get; set; } /// /// /// - public global::ModerationAPI.WordlistUpdateResponse? Type340 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo? Type340 { get; set; } /// /// /// - public global::ModerationAPI.WordlistWordlistEmbeddingStatusResponse? Type341 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio? Type341 { get; set; } /// /// /// - public global::ModerationAPI.WordlistAddWordsResponse? Type342 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseAuthor? Type342 { get; set; } /// /// /// - public global::ModerationAPI.WordlistRemoveWordsResponse? Type343 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseAuthorBlock? Type343 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponse? Type344 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseAuthorStatus? Type344 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContent? Type345 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseAuthorTrustLevel? Type345 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText? Type346 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseEvaluation? Type346 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage? Type347 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseRecommendation? Type347 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo? Type348 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseRecommendationAction? Type348 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio? Type349 { get; set; } + public global::System.Collections.Generic.IList>? Type349 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseAuthor? Type350 { get; set; } + public global::ModerationAPI.AnyOf? Type350 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseAuthorBlock? Type351 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseRecommendationReasonCode? Type351 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseAuthorStatus? Type352 { get; set; } + public global::System.Collections.Generic.IList? Type352 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseAuthorTrustLevel? Type353 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseRecommendationMatchedRule? Type353 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseEvaluation? Type354 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseCasebook? Type354 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseRecommendation? Type355 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseCasebookVerdict? Type355 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseRecommendationAction? Type356 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseCasebookTopic? Type356 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type357 { get; set; } + public global::ModerationAPI.OneOf? Type357 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseRecommendationReasonCode? Type358 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutput? Type358 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type359 { get; set; } + public global::System.Collections.Generic.IList? Type359 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseRecommendationMatchedRule? Type360 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutputLabel? Type360 { get; set; } /// /// /// - public global::ModerationAPI.OneOf? Type361 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutput? Type361 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutput? Type362 { get; set; } + public global::System.Collections.Generic.IList? Type362 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type363 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatche? Type363 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieClassifierOutputLabel? Type364 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignals? Type364 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutput? Type365 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonation? Type365 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type366 { get; set; } + public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonationMethod? Type366 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatche? Type367 { get; set; } + public global::System.Collections.Generic.IList>? Type367 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type368 { get; set; } + public global::ModerationAPI.OneOf? Type368 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignals? Type369 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsight? Type369 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonation? Type370 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsightValue? Type370 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponsePolicieEntityMatcherOutputMatcheSignalsBrandImpersonationMethod? Type371 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseInsightLanguageInsight? Type371 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type372 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseMeta? Type372 { get; set; } /// /// /// - public global::ModerationAPI.OneOf? Type373 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseMetaStatus? Type373 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsight? Type374 { get; set; } + public global::System.Collections.Generic.IList? Type374 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightSentimentInsightValue? Type375 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseError? Type375 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseInsightLanguageInsight? Type376 { get; set; } + public global::System.Collections.Generic.IList? Type376 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseMeta? Type377 { get; set; } + public global::ModerationAPI.ManagementProjectsDeleteResponse? Type377 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseMetaStatus? Type378 { get; set; } + public global::System.Collections.Generic.IList? Type378 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type379 { get; set; } + public global::ModerationAPI.ManagementChannelsDeleteResponse? Type379 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseError? Type380 { get; set; } + public global::ModerationAPI.GetStreamResponse? Type380 { get; set; } /// /// /// - public global::ModerationAPI.GetStreamResponse? Type381 { get; set; } + public global::ModerationAPI.GetStreamResponseDiscriminator? Type381 { get; set; } /// /// /// - public global::ModerationAPI.GetStreamResponseDiscriminator? Type382 { get; set; } + public global::ModerationAPI.GetStreamResponseDiscriminatorEvent? Type382 { get; set; } /// /// /// - public global::ModerationAPI.GetStreamResponseDiscriminatorEvent? Type383 { get; set; } + public global::ModerationAPI.CreateAuthorBlockedWebhookVersion? Type383 { get; set; } /// /// /// - public global::ModerationAPI.CreateAuthorBlockedWebhookVersion? Type384 { get; set; } + public global::ModerationAPI.CreateAuthorUnblockedWebhookVersion? Type384 { get; set; } /// /// /// - public global::ModerationAPI.CreateAuthorUnblockedWebhookVersion? Type385 { get; set; } + public global::ModerationAPI.CreateAuthorSuspendedWebhookVersion? Type385 { get; set; } /// /// /// - public global::ModerationAPI.CreateAuthorSuspendedWebhookVersion? Type386 { get; set; } + public global::ModerationAPI.CreateAuthorUpdatedWebhookVersion? Type386 { get; set; } /// /// /// - public global::ModerationAPI.CreateAuthorUpdatedWebhookVersion? Type387 { get; set; } + public global::ModerationAPI.CreateAuthorTrustLevelChangedWebhookVersion? Type387 { get; set; } /// /// /// - public global::ModerationAPI.CreateAuthorTrustLevelChangedWebhookVersion? Type388 { get; set; } + public global::ModerationAPI.CreateAuthorActionWebhookVersion? Type388 { get; set; } /// /// /// - public global::ModerationAPI.CreateAuthorActionWebhookVersion? Type389 { get; set; } + public global::ModerationAPI.CreateQueueItemResolvedWebhookVersion? Type389 { get; set; } /// /// /// - public global::ModerationAPI.CreateQueueItemResolvedWebhookVersion? Type390 { get; set; } + public global::ModerationAPI.CreateQueueItemActionWebhookVersion? Type390 { get; set; } /// /// /// - public global::ModerationAPI.CreateQueueItemActionWebhookVersion? Type391 { get; set; } + public global::ModerationAPI.CreateQueueItemRejectedWebhookVersion? Type391 { get; set; } /// /// /// - public global::ModerationAPI.CreateQueueItemRejectedWebhookVersion? Type392 { get; set; } - /// - /// - /// - public global::ModerationAPI.CreateQueueItemAllowedWebhookVersion? Type393 { get; set; } + public global::ModerationAPI.CreateQueueItemAllowedWebhookVersion? Type392 { get; set; } /// /// @@ -1642,142 +1638,174 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType8 { get; set; } + public global::System.Collections.Generic.List? ListType8 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType9 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType10 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType11 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType12 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType13 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType14 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType15 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType16 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType17 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType10 { get; set; } + public global::System.Collections.Generic.List? ListType18 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType11 { get; set; } + public global::System.Collections.Generic.List? ListType19 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType12 { get; set; } + public global::System.Collections.Generic.List? ListType20 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType13 { get; set; } + public global::System.Collections.Generic.List? ListType21 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::System.Collections.Generic.List? ListType22 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType15 { get; set; } + public global::System.Collections.Generic.List? ListType23 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType16 { get; set; } + public global::System.Collections.Generic.List? ListType24 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType17 { get; set; } + public global::System.Collections.Generic.List? ListType25 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType18 { get; set; } + public global::System.Collections.Generic.List? ListType26 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType19 { get; set; } + public global::System.Collections.Generic.List? ListType27 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType20 { get; set; } + public global::System.Collections.Generic.List? ListType28 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType21 { get; set; } + public global::System.Collections.Generic.List? ListType29 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType30 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::System.Collections.Generic.List? ListType31 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::System.Collections.Generic.List? ListType32 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::System.Collections.Generic.List? ListType33 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::System.Collections.Generic.List? ListType34 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType27 { get; set; } + public global::System.Collections.Generic.List? ListType35 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType28 { get; set; } + public global::System.Collections.Generic.List? ListType36 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType29 { get; set; } + public global::System.Collections.Generic.List? ListType37 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType30 { get; set; } + public global::System.Collections.Generic.List? ListType38 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::System.Collections.Generic.List? ListType39 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType40 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List? ListType41 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List>? ListType42 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::System.Collections.Generic.List? ListType43 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType36 { get; set; } + public global::System.Collections.Generic.List>? ListType44 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType37 { get; set; } + public global::System.Collections.Generic.List? ListType45 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType38 { get; set; } + public global::System.Collections.Generic.List? ListType46 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType39 { get; set; } + public global::System.Collections.Generic.List>? ListType47 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType40 { get; set; } + public global::System.Collections.Generic.List? ListType48 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType41 { get; set; } + public global::System.Collections.Generic.List? ListType49 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType42 { get; set; } + public global::System.Collections.Generic.List? ListType50 { get; set; } } } \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorActionEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorActionEvent.g.cs index 34156fe..6c99b4d 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorActionEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorActionEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.action","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_warn_111","key":"send_warning","name":"Send warning email","value":"violation_notice","created_at":"2026-05-08T12:42:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.action","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_warn_111","key":"send_warning","name":"Send warning email","value":"violation_notice","created_at":"2026-05-08T12:42:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// public sealed partial class AuthorActionEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorBlockedEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorBlockedEvent.g.cs index 0992924..83bdcdd 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorBlockedEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorBlockedEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.blocked","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_block_123","key":"block","name":"Block author","value":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","created_at":"2026-05-08T12:38:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"blocked","trust_level":{"level":-1,"manual":false},"block":{"until":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","reason":"Repeated spam violations"},"risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.blocked","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_block_123","key":"block","name":"Block author","value":null,"created_at":"2026-05-08T12:38:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"blocked","trust_level":{"level":-1,"manual":false},"block":{"until":null,"reason":"Repeated spam violations"},"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// public sealed partial class AuthorBlockedEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorSuspendedEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorSuspendedEvent.g.cs index b8ce8fb..053eeca 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorSuspendedEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorSuspendedEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.suspended","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_suspend_456","key":"suspend_24h","name":"Suspend (24h)","value":"24h","created_at":"2026-05-08T12:39:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"suspended","trust_level":{"level":0,"manual":false},"block":{"until":1746878400000,"reason":"Cooling-off period"},"risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.suspended","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_suspend_456","key":"suspend_24h","name":"Suspend (24h)","value":"24h","created_at":"2026-05-08T12:39:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"suspended","trust_level":{"level":0,"manual":false},"block":{"until":1746878400000,"reason":"Cooling-off period"},"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// public sealed partial class AuthorSuspendedEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorTrustLevelChangedEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorTrustLevelChangedEvent.g.cs index bf9abcb..67ad5f2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorTrustLevelChangedEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorTrustLevelChangedEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.trust_level_changed","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":3,"manual":true},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.trust_level_changed","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":3,"manual":true},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}} /// public sealed partial class AuthorTrustLevelChangedEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorUnblockedEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorUnblockedEvent.g.cs index b378b18..dd335a4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorUnblockedEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorUnblockedEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.unblocked","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_unblock_789","key":"auto_unblock","name":"Auto unblock","value":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","created_at":"2026-05-09T12:39:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":0,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.unblocked","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_unblock_789","key":"auto_unblock","name":"Auto unblock","value":null,"created_at":"2026-05-09T12:39:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":0,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// public sealed partial class AuthorUnblockedEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorUpdatedEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorUpdatedEvent.g.cs index 7360d9e..98dddff 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorUpdatedEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.AuthorUpdatedEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.updated","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.updated","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}} /// public sealed partial class AuthorUpdatedEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Channel.Json.g.cs similarity index 88% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequest.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.Channel.Json.g.cs index 8a43fb1..059a74a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequest.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Channel.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationVideoRequest + public sealed partial class Channel { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationVideoRequest? FromJson( + public static global::ModerationAPI.Channel? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationVideoRequest), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoRequest; + typeof(global::ModerationAPI.Channel), + jsonSerializerContext) as global::ModerationAPI.Channel; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationVideoRequest? FromJson( + public static global::ModerationAPI.Channel? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationVideoRequest? FromJson( + public static global::ModerationAPI.Channel? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationVideoRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoRequest; + typeof(global::ModerationAPI.Channel), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.Channel; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Channel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Channel.g.cs new file mode 100644 index 0000000..389d76c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Channel.g.cs @@ -0,0 +1,285 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class Channel + { + /// + /// The ID of the channel. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The ID of the project the channel is in. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("projectId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } + + /// + /// The key you pass as `channel` when you moderate content. Unique in the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Key { get; set; } + + /// + /// The channel's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The channel's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Whether requests that name no channel use this one. Each project has one default channel. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("isDefault")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsDefault { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contentType")] + public global::ModerationAPI.ChannelContentType? ContentType { get; set; } + + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("flaggingMode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ChannelFlaggingModeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.ChannelFlaggingMode FlaggingMode { get; set; } + + /// + /// Whether earlier messages in the conversation are read when moderating a message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contextEnabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool ContextEnabled { get; set; } + + /// + /// Whether images are moderated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableImageModeration")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool EnableImageModeration { get; set; } + + /// + /// Whether videos are moderated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableVideoModeration")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool EnableVideoModeration { get; set; } + + /// + /// Whether audio is moderated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableAudioModeration")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool EnableAudioModeration { get; set; } + + /// + /// Whether real-time voice streams are moderated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableVoiceModeration")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool EnableVoiceModeration { get; set; } + + /// + /// Whether audio and video transcripts are returned in responses. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("includeTranscriptInResponse")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IncludeTranscriptInResponse { get; set; } + + /// + /// Trade-off between transcription speed and accuracy. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("transcriptionQuality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ChannelTranscriptionQualityJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.ChannelTranscriptionQuality TranscriptionQuality { get; set; } + + /// + /// Whether look-alike Unicode characters are normalized before moderation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("unicodeSpoofDetectionEnabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool UnicodeSpoofDetectionEnabled { get; set; } + + /// + /// Seconds between frames captured from a video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("frameCaptureInterval")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double FrameCaptureInterval { get; set; } + + /// + /// The most frames moderated per video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxFramesPerVideo")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxFramesPerVideo { get; set; } + + /// + /// Whether frames are spread evenly across the whole video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("spreadFrames")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool SpreadFrames { get; set; } + + /// + /// When the channel was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// When the channel was last changed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the channel. + /// + /// + /// The ID of the project the channel is in. + /// + /// + /// The key you pass as `channel` when you moderate content. Unique in the project. + /// + /// + /// The channel's name. + /// + /// + /// Whether requests that name no channel use this one. Each project has one default channel. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + /// + /// + /// Whether earlier messages in the conversation are read when moderating a message. + /// + /// + /// Whether images are moderated. + /// + /// + /// Whether videos are moderated. + /// + /// + /// Whether audio is moderated. + /// + /// + /// Whether real-time voice streams are moderated. + /// + /// + /// Whether audio and video transcripts are returned in responses. + /// + /// + /// Trade-off between transcription speed and accuracy. + /// + /// + /// Whether look-alike Unicode characters are normalized before moderation. + /// + /// + /// Seconds between frames captured from a video. + /// + /// + /// The most frames moderated per video. + /// + /// + /// Whether frames are spread evenly across the whole video. + /// + /// + /// When the channel was created. + /// + /// + /// When the channel was last changed. + /// + /// + /// The channel's description. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Channel( + string id, + string projectId, + string key, + string name, + bool isDefault, + global::ModerationAPI.ChannelFlaggingMode flaggingMode, + bool contextEnabled, + bool enableImageModeration, + bool enableVideoModeration, + bool enableAudioModeration, + bool enableVoiceModeration, + bool includeTranscriptInResponse, + global::ModerationAPI.ChannelTranscriptionQuality transcriptionQuality, + bool unicodeSpoofDetectionEnabled, + double frameCaptureInterval, + int maxFramesPerVideo, + bool spreadFrames, + string createdAt, + string updatedAt, + string? description, + global::ModerationAPI.ChannelContentType? contentType) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.Key = key ?? throw new global::System.ArgumentNullException(nameof(key)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.IsDefault = isDefault; + this.ContentType = contentType; + this.FlaggingMode = flaggingMode; + this.ContextEnabled = contextEnabled; + this.EnableImageModeration = enableImageModeration; + this.EnableVideoModeration = enableVideoModeration; + this.EnableAudioModeration = enableAudioModeration; + this.EnableVoiceModeration = enableVoiceModeration; + this.IncludeTranscriptInResponse = includeTranscriptInResponse; + this.TranscriptionQuality = transcriptionQuality; + this.UnicodeSpoofDetectionEnabled = unicodeSpoofDetectionEnabled; + this.FrameCaptureInterval = frameCaptureInterval; + this.MaxFramesPerVideo = maxFramesPerVideo; + this.SpreadFrames = spreadFrames; + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.UpdatedAt = updatedAt ?? throw new global::System.ArgumentNullException(nameof(updatedAt)); + } + + /// + /// Initializes a new instance of the class. + /// + public Channel() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelContentType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelContentType.g.cs new file mode 100644 index 0000000..3a97243 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelContentType.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// The kind of content the channel moderates. + /// + public enum ChannelContentType + { + /// + /// + /// + Comment, + /// + /// + /// + Event, + /// + /// + /// + Message, + /// + /// + /// + Other, + /// + /// + /// + Post, + /// + /// + /// + Product, + /// + /// + /// + Profile, + /// + /// + /// + Review, + /// + /// + /// + Voice, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ChannelContentTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ChannelContentType value) + { + return value switch + { + ChannelContentType.Comment => "comment", + ChannelContentType.Event => "event", + ChannelContentType.Message => "message", + ChannelContentType.Other => "other", + ChannelContentType.Post => "post", + ChannelContentType.Product => "product", + ChannelContentType.Profile => "profile", + ChannelContentType.Review => "review", + ChannelContentType.Voice => "voice", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ChannelContentType? ToEnum(string value) + { + return value switch + { + "comment" => ChannelContentType.Comment, + "event" => ChannelContentType.Event, + "message" => ChannelContentType.Message, + "other" => ChannelContentType.Other, + "post" => ChannelContentType.Post, + "product" => ChannelContentType.Product, + "profile" => ChannelContentType.Profile, + "review" => ChannelContentType.Review, + "voice" => ChannelContentType.Voice, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelFlaggingMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelFlaggingMode.g.cs new file mode 100644 index 0000000..0819a5c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelFlaggingMode.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + /// + public enum ChannelFlaggingMode + { + /// + /// + /// + Active, + /// + /// + /// + DryRun, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ChannelFlaggingModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ChannelFlaggingMode value) + { + return value switch + { + ChannelFlaggingMode.Active => "ACTIVE", + ChannelFlaggingMode.DryRun => "DRY_RUN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ChannelFlaggingMode? ToEnum(string value) + { + return value switch + { + "ACTIVE" => ChannelFlaggingMode.Active, + "DRY_RUN" => ChannelFlaggingMode.DryRun, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelTranscriptionQuality.g.cs similarity index 50% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorStatus.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelTranscriptionQuality.g.cs index 1ec1f64..46a5459 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorStatus.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ChannelTranscriptionQuality.g.cs @@ -4,52 +4,52 @@ namespace ModerationAPI { /// - /// Current author status + /// Trade-off between transcription speed and accuracy. /// - public enum ModerationImageResponseAuthorStatus + public enum ChannelTranscriptionQuality { /// /// /// - Blocked, + Accuracy, /// /// /// - Enabled, + Balanced, /// /// /// - Suspended, + Speed, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ModerationImageResponseAuthorStatusExtensions + public static class ChannelTranscriptionQualityExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ModerationImageResponseAuthorStatus value) + public static string ToValueString(this ChannelTranscriptionQuality value) { return value switch { - ModerationImageResponseAuthorStatus.Blocked => "blocked", - ModerationImageResponseAuthorStatus.Enabled => "enabled", - ModerationImageResponseAuthorStatus.Suspended => "suspended", + ChannelTranscriptionQuality.Accuracy => "ACCURACY", + ChannelTranscriptionQuality.Balanced => "BALANCED", + ChannelTranscriptionQuality.Speed => "SPEED", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ModerationImageResponseAuthorStatus? ToEnum(string value) + public static ChannelTranscriptionQuality? ToEnum(string value) { return value switch { - "blocked" => ModerationImageResponseAuthorStatus.Blocked, - "enabled" => ModerationImageResponseAuthorStatus.Enabled, - "suspended" => ModerationImageResponseAuthorStatus.Suspended, + "ACCURACY" => ChannelTranscriptionQuality.Accuracy, + "BALANCED" => ChannelTranscriptionQuality.Balanced, + "SPEED" => ChannelTranscriptionQuality.Speed, _ => null, }; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequest.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequest.Json.g.cs index a4f19be..fcc41f6 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequest.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationObjectRequestMetadata + public sealed partial class ManagementChannelsCreateRequest { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequestMetadata? FromJson( + public static global::ModerationAPI.ManagementChannelsCreateRequest? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationObjectRequestMetadata), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectRequestMetadata; + typeof(global::ModerationAPI.ManagementChannelsCreateRequest), + jsonSerializerContext) as global::ModerationAPI.ManagementChannelsCreateRequest; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequestMetadata? FromJson( + public static global::ModerationAPI.ManagementChannelsCreateRequest? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationObjectRequestMetadata? FromJson( + public static global::ModerationAPI.ManagementChannelsCreateRequest? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationObjectRequestMetadata), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectRequestMetadata; + typeof(global::ModerationAPI.ManagementChannelsCreateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ManagementChannelsCreateRequest; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequest.g.cs new file mode 100644 index 0000000..58c2f3b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequest.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class ManagementChannelsCreateRequest + { + /// + /// The channel's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The key you pass as `channel` when you moderate content. Defaults to the name in lowercase with dashes. Must be unique in the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The channel's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The kind of content the channel moderates. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contentType")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ManagementChannelsCreateRequestContentTypeJsonConverter))] + public global::ModerationAPI.ManagementChannelsCreateRequestContentType? ContentType { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The channel's name. + /// + /// + /// The key you pass as `channel` when you moderate content. Defaults to the name in lowercase with dashes. Must be unique in the project. + /// + /// + /// The channel's description. + /// + /// + /// The kind of content the channel moderates. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ManagementChannelsCreateRequest( + string name, + string? key, + string? description, + global::ModerationAPI.ManagementChannelsCreateRequestContentType? contentType) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Key = key; + this.Description = description; + this.ContentType = contentType; + } + + /// + /// Initializes a new instance of the class. + /// + public ManagementChannelsCreateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequestContentType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequestContentType.g.cs new file mode 100644 index 0000000..fd8ced6 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsCreateRequestContentType.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// The kind of content the channel moderates. + /// + public enum ManagementChannelsCreateRequestContentType + { + /// + /// + /// + Comment, + /// + /// + /// + Event, + /// + /// + /// + Message, + /// + /// + /// + Other, + /// + /// + /// + Post, + /// + /// + /// + Product, + /// + /// + /// + Profile, + /// + /// + /// + Review, + /// + /// + /// + Voice, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ManagementChannelsCreateRequestContentTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ManagementChannelsCreateRequestContentType value) + { + return value switch + { + ManagementChannelsCreateRequestContentType.Comment => "comment", + ManagementChannelsCreateRequestContentType.Event => "event", + ManagementChannelsCreateRequestContentType.Message => "message", + ManagementChannelsCreateRequestContentType.Other => "other", + ManagementChannelsCreateRequestContentType.Post => "post", + ManagementChannelsCreateRequestContentType.Product => "product", + ManagementChannelsCreateRequestContentType.Profile => "profile", + ManagementChannelsCreateRequestContentType.Review => "review", + ManagementChannelsCreateRequestContentType.Voice => "voice", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ManagementChannelsCreateRequestContentType? ToEnum(string value) + { + return value switch + { + "comment" => ManagementChannelsCreateRequestContentType.Comment, + "event" => ManagementChannelsCreateRequestContentType.Event, + "message" => ManagementChannelsCreateRequestContentType.Message, + "other" => ManagementChannelsCreateRequestContentType.Other, + "post" => ManagementChannelsCreateRequestContentType.Post, + "product" => ManagementChannelsCreateRequestContentType.Product, + "profile" => ManagementChannelsCreateRequestContentType.Profile, + "review" => ManagementChannelsCreateRequestContentType.Review, + "voice" => ManagementChannelsCreateRequestContentType.Voice, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDeleteResponse.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata2.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDeleteResponse.Json.g.cs index 41e2961..9565cf9 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata2.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDeleteResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationObjectRequestMetadata2 + public sealed partial class ManagementChannelsDeleteResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementChannelsDeleteResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationObjectRequestMetadata2), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectRequestMetadata2; + typeof(global::ModerationAPI.ManagementChannelsDeleteResponse), + jsonSerializerContext) as global::ModerationAPI.ManagementChannelsDeleteResponse; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementChannelsDeleteResponse? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationObjectRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementChannelsDeleteResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationObjectRequestMetadata2), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectRequestMetadata2; + typeof(global::ModerationAPI.ManagementChannelsDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ManagementChannelsDeleteResponse; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDeleteResponse.g.cs similarity index 54% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseRequest.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDeleteResponse.g.cs index 3432bd4..1d77a5f 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseRequest.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDeleteResponse.g.cs @@ -4,23 +4,23 @@ namespace ModerationAPI { /// - /// Information about the request + /// /// - public sealed partial class ModerationImageResponseRequest + public sealed partial class ManagementChannelsDeleteResponse { /// - /// The timestamp of the request + /// Whether the channel was deleted. /// - [global::System.Text.Json.Serialization.JsonPropertyName("timestamp")] + [global::System.Text.Json.Serialization.JsonPropertyName("deleted")] [global::System.Text.Json.Serialization.JsonRequired] - public required double Timestamp { get; set; } + public required bool Deleted { get; set; } /// - /// The quota usage of the request + /// The ID of the channel. /// - [global::System.Text.Json.Serialization.JsonPropertyName("quota_usage")] + [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] - public required double QuotaUsage { get; set; } + public required string Id { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,29 +29,29 @@ public sealed partial class ModerationImageResponseRequest public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// The timestamp of the request + /// + /// Whether the channel was deleted. /// - /// - /// The quota usage of the request + /// + /// The ID of the channel. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationImageResponseRequest( - double timestamp, - double quotaUsage) + public ManagementChannelsDeleteResponse( + bool deleted, + string id) { - this.Timestamp = timestamp; - this.QuotaUsage = quotaUsage; + this.Deleted = deleted; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationImageResponseRequest() + public ManagementChannelsDeleteResponse() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorBlock.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDuplicateRequest.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorBlock.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDuplicateRequest.Json.g.cs index 8032534..ef85a81 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorBlock.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDuplicateRequest.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationAudioResponseAuthorBlock + public sealed partial class ManagementChannelsDuplicateRequest { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioResponseAuthorBlock? FromJson( + public static global::ModerationAPI.ManagementChannelsDuplicateRequest? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationAudioResponseAuthorBlock), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioResponseAuthorBlock; + typeof(global::ModerationAPI.ManagementChannelsDuplicateRequest), + jsonSerializerContext) as global::ModerationAPI.ManagementChannelsDuplicateRequest; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioResponseAuthorBlock? FromJson( + public static global::ModerationAPI.ManagementChannelsDuplicateRequest? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationAudioResponseAuthorBlock? FromJson( + public static global::ModerationAPI.ManagementChannelsDuplicateRequest? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationAudioResponseAuthorBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioResponseAuthorBlock; + typeof(global::ModerationAPI.ManagementChannelsDuplicateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ManagementChannelsDuplicateRequest; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDuplicateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDuplicateRequest.g.cs new file mode 100644 index 0000000..75f0b6c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsDuplicateRequest.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class ManagementChannelsDuplicateRequest + { + /// + /// Name of the copy. Defaults to the original name with "(copy)". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Key of the copy. Defaults to the original key with a timestamp. Must be unique in the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Name of the copy. Defaults to the original name with "(copy)". + /// + /// + /// Key of the copy. Defaults to the original key with a timestamp. Must be unique in the project. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ManagementChannelsDuplicateRequest( + string? name, + string? key) + { + this.Name = name; + this.Key = key; + } + + /// + /// Initializes a new instance of the class. + /// + public ManagementChannelsDuplicateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequest.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata2.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequest.Json.g.cs index 41d37e1..236313a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata2.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequest.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationVideoRequestMetadata2 + public sealed partial class ManagementChannelsUpdateRequest { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationVideoRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementChannelsUpdateRequest? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationVideoRequestMetadata2), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoRequestMetadata2; + typeof(global::ModerationAPI.ManagementChannelsUpdateRequest), + jsonSerializerContext) as global::ModerationAPI.ManagementChannelsUpdateRequest; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationVideoRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementChannelsUpdateRequest? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationVideoRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementChannelsUpdateRequest? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationVideoRequestMetadata2), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoRequestMetadata2; + typeof(global::ModerationAPI.ManagementChannelsUpdateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ManagementChannelsUpdateRequest; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequest.g.cs new file mode 100644 index 0000000..5d793fd --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequest.g.cs @@ -0,0 +1,214 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class ManagementChannelsUpdateRequest + { + /// + /// The channel's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The key you pass as `channel` when you moderate content. Changing it breaks integrations that send the old key. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + public string? Key { get; set; } + + /// + /// The channel's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The kind of content the channel moderates. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contentType")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestContentTypeJsonConverter))] + public global::ModerationAPI.ManagementChannelsUpdateRequestContentType? ContentType { get; set; } + + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("flaggingMode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestFlaggingModeJsonConverter))] + public global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? FlaggingMode { get; set; } + + /// + /// Whether earlier messages in the conversation are read when moderating a message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contextEnabled")] + public bool? ContextEnabled { get; set; } + + /// + /// Whether images are moderated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableImageModeration")] + public bool? EnableImageModeration { get; set; } + + /// + /// Whether videos are moderated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableVideoModeration")] + public bool? EnableVideoModeration { get; set; } + + /// + /// Whether audio is moderated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableAudioModeration")] + public bool? EnableAudioModeration { get; set; } + + /// + /// Whether real-time voice streams are moderated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableVoiceModeration")] + public bool? EnableVoiceModeration { get; set; } + + /// + /// Whether audio and video transcripts are returned in responses. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("includeTranscriptInResponse")] + public bool? IncludeTranscriptInResponse { get; set; } + + /// + /// Trade-off between transcription speed and accuracy. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("transcriptionQuality")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ManagementChannelsUpdateRequestTranscriptionQualityJsonConverter))] + public global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? TranscriptionQuality { get; set; } + + /// + /// Whether look-alike Unicode characters are normalized before moderation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("unicodeSpoofDetectionEnabled")] + public bool? UnicodeSpoofDetectionEnabled { get; set; } + + /// + /// Seconds between frames captured from a video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("frameCaptureInterval")] + public double? FrameCaptureInterval { get; set; } + + /// + /// The most frames moderated per video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxFramesPerVideo")] + public int? MaxFramesPerVideo { get; set; } + + /// + /// Whether frames are spread evenly across the whole video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("spreadFrames")] + public bool? SpreadFrames { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The channel's name. + /// + /// + /// The key you pass as `channel` when you moderate content. Changing it breaks integrations that send the old key. + /// + /// + /// The channel's description. + /// + /// + /// The kind of content the channel moderates. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + /// + /// + /// Whether earlier messages in the conversation are read when moderating a message. + /// + /// + /// Whether images are moderated. + /// + /// + /// Whether videos are moderated. + /// + /// + /// Whether audio is moderated. + /// + /// + /// Whether real-time voice streams are moderated. + /// + /// + /// Whether audio and video transcripts are returned in responses. + /// + /// + /// Trade-off between transcription speed and accuracy. + /// + /// + /// Whether look-alike Unicode characters are normalized before moderation. + /// + /// + /// Seconds between frames captured from a video. + /// + /// + /// The most frames moderated per video. + /// + /// + /// Whether frames are spread evenly across the whole video. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ManagementChannelsUpdateRequest( + string? name, + string? key, + string? description, + global::ModerationAPI.ManagementChannelsUpdateRequestContentType? contentType, + global::ModerationAPI.ManagementChannelsUpdateRequestFlaggingMode? flaggingMode, + bool? contextEnabled, + bool? enableImageModeration, + bool? enableVideoModeration, + bool? enableAudioModeration, + bool? enableVoiceModeration, + bool? includeTranscriptInResponse, + global::ModerationAPI.ManagementChannelsUpdateRequestTranscriptionQuality? transcriptionQuality, + bool? unicodeSpoofDetectionEnabled, + double? frameCaptureInterval, + int? maxFramesPerVideo, + bool? spreadFrames) + { + this.Name = name; + this.Key = key; + this.Description = description; + this.ContentType = contentType; + this.FlaggingMode = flaggingMode; + this.ContextEnabled = contextEnabled; + this.EnableImageModeration = enableImageModeration; + this.EnableVideoModeration = enableVideoModeration; + this.EnableAudioModeration = enableAudioModeration; + this.EnableVoiceModeration = enableVoiceModeration; + this.IncludeTranscriptInResponse = includeTranscriptInResponse; + this.TranscriptionQuality = transcriptionQuality; + this.UnicodeSpoofDetectionEnabled = unicodeSpoofDetectionEnabled; + this.FrameCaptureInterval = frameCaptureInterval; + this.MaxFramesPerVideo = maxFramesPerVideo; + this.SpreadFrames = spreadFrames; + } + + /// + /// Initializes a new instance of the class. + /// + public ManagementChannelsUpdateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestContentType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestContentType.g.cs new file mode 100644 index 0000000..1c1ffa8 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestContentType.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// The kind of content the channel moderates. + /// + public enum ManagementChannelsUpdateRequestContentType + { + /// + /// + /// + Comment, + /// + /// + /// + Event, + /// + /// + /// + Message, + /// + /// + /// + Other, + /// + /// + /// + Post, + /// + /// + /// + Product, + /// + /// + /// + Profile, + /// + /// + /// + Review, + /// + /// + /// + Voice, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ManagementChannelsUpdateRequestContentTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ManagementChannelsUpdateRequestContentType value) + { + return value switch + { + ManagementChannelsUpdateRequestContentType.Comment => "comment", + ManagementChannelsUpdateRequestContentType.Event => "event", + ManagementChannelsUpdateRequestContentType.Message => "message", + ManagementChannelsUpdateRequestContentType.Other => "other", + ManagementChannelsUpdateRequestContentType.Post => "post", + ManagementChannelsUpdateRequestContentType.Product => "product", + ManagementChannelsUpdateRequestContentType.Profile => "profile", + ManagementChannelsUpdateRequestContentType.Review => "review", + ManagementChannelsUpdateRequestContentType.Voice => "voice", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ManagementChannelsUpdateRequestContentType? ToEnum(string value) + { + return value switch + { + "comment" => ManagementChannelsUpdateRequestContentType.Comment, + "event" => ManagementChannelsUpdateRequestContentType.Event, + "message" => ManagementChannelsUpdateRequestContentType.Message, + "other" => ManagementChannelsUpdateRequestContentType.Other, + "post" => ManagementChannelsUpdateRequestContentType.Post, + "product" => ManagementChannelsUpdateRequestContentType.Product, + "profile" => ManagementChannelsUpdateRequestContentType.Profile, + "review" => ManagementChannelsUpdateRequestContentType.Review, + "voice" => ManagementChannelsUpdateRequestContentType.Voice, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestFlaggingMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestFlaggingMode.g.cs new file mode 100644 index 0000000..44f4aaa --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestFlaggingMode.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + /// + public enum ManagementChannelsUpdateRequestFlaggingMode + { + /// + /// + /// + Active, + /// + /// + /// + DryRun, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ManagementChannelsUpdateRequestFlaggingModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ManagementChannelsUpdateRequestFlaggingMode value) + { + return value switch + { + ManagementChannelsUpdateRequestFlaggingMode.Active => "ACTIVE", + ManagementChannelsUpdateRequestFlaggingMode.DryRun => "DRY_RUN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ManagementChannelsUpdateRequestFlaggingMode? ToEnum(string value) + { + return value switch + { + "ACTIVE" => ManagementChannelsUpdateRequestFlaggingMode.Active, + "DRY_RUN" => ManagementChannelsUpdateRequestFlaggingMode.DryRun, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestTranscriptionQuality.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestTranscriptionQuality.g.cs new file mode 100644 index 0000000..4110a37 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementChannelsUpdateRequestTranscriptionQuality.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Trade-off between transcription speed and accuracy. + /// + public enum ManagementChannelsUpdateRequestTranscriptionQuality + { + /// + /// + /// + Accuracy, + /// + /// + /// + Balanced, + /// + /// + /// + Speed, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ManagementChannelsUpdateRequestTranscriptionQualityExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ManagementChannelsUpdateRequestTranscriptionQuality value) + { + return value switch + { + ManagementChannelsUpdateRequestTranscriptionQuality.Accuracy => "ACCURACY", + ManagementChannelsUpdateRequestTranscriptionQuality.Balanced => "BALANCED", + ManagementChannelsUpdateRequestTranscriptionQuality.Speed => "SPEED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ManagementChannelsUpdateRequestTranscriptionQuality? ToEnum(string value) + { + return value switch + { + "ACCURACY" => ManagementChannelsUpdateRequestTranscriptionQuality.Accuracy, + "BALANCED" => ManagementChannelsUpdateRequestTranscriptionQuality.Balanced, + "SPEED" => ManagementChannelsUpdateRequestTranscriptionQuality.Speed, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsCreateRequest.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsCreateRequest.Json.g.cs index 4225ac3..570c94a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsCreateRequest.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationVideoResponseVariant1 + public sealed partial class ManagementProjectsCreateRequest { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationVideoResponseVariant1? FromJson( + public static global::ModerationAPI.ManagementProjectsCreateRequest? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoResponseVariant1; + typeof(global::ModerationAPI.ManagementProjectsCreateRequest), + jsonSerializerContext) as global::ModerationAPI.ManagementProjectsCreateRequest; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationVideoResponseVariant1? FromJson( + public static global::ModerationAPI.ManagementProjectsCreateRequest? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationVideoResponseVariant1? FromJson( + public static global::ModerationAPI.ManagementProjectsCreateRequest? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoResponseVariant1; + typeof(global::ModerationAPI.ManagementProjectsCreateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ManagementProjectsCreateRequest; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsCreateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsCreateRequest.g.cs new file mode 100644 index 0000000..98367c0 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsCreateRequest.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class ManagementProjectsCreateRequest + { + /// + /// The project's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The website or app the project moderates content for. Used to write the context when none is given. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("domain")] + public string? Domain { get; set; } + + /// + /// What the platform is and who uses it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("context")] + public string? Context { get; set; } + + /// + /// What you moderate, the problems you see and your guidelines. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("brief")] + public string? Brief { get; set; } + + /// + /// Whether children use the platform.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("usedByMinors")] + public bool? UsedByMinors { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The project's name. + /// + /// + /// The website or app the project moderates content for. Used to write the context when none is given. + /// + /// + /// What the platform is and who uses it. + /// + /// + /// What you moderate, the problems you see and your guidelines. + /// + /// + /// Whether children use the platform.
+ /// Default Value: false + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ManagementProjectsCreateRequest( + string name, + string? domain, + string? context, + string? brief, + bool? usedByMinors) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Domain = domain; + this.Context = context; + this.Brief = brief; + this.UsedByMinors = usedByMinors; + } + + /// + /// Initializes a new instance of the class. + /// + public ManagementProjectsCreateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDeleteResponse.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDeleteResponse.Json.g.cs index c40b1c1..681cb35 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDeleteResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationObjectRequestValueData + public sealed partial class ManagementProjectsDeleteResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequestValueData? FromJson( + public static global::ModerationAPI.ManagementProjectsDeleteResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationObjectRequestValueData), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectRequestValueData; + typeof(global::ModerationAPI.ManagementProjectsDeleteResponse), + jsonSerializerContext) as global::ModerationAPI.ManagementProjectsDeleteResponse; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequestValueData? FromJson( + public static global::ModerationAPI.ManagementProjectsDeleteResponse? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationObjectRequestValueData? FromJson( + public static global::ModerationAPI.ManagementProjectsDeleteResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationObjectRequestValueData), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectRequestValueData; + typeof(global::ModerationAPI.ManagementProjectsDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ManagementProjectsDeleteResponse; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDeleteResponse.g.cs similarity index 54% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseRequest.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDeleteResponse.g.cs index f113a62..70423a5 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseRequest.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDeleteResponse.g.cs @@ -4,23 +4,23 @@ namespace ModerationAPI { /// - /// Information about the request + /// /// - public sealed partial class ModerationAudioResponseRequest + public sealed partial class ManagementProjectsDeleteResponse { /// - /// The timestamp of the request + /// Whether the project was deleted. /// - [global::System.Text.Json.Serialization.JsonPropertyName("timestamp")] + [global::System.Text.Json.Serialization.JsonPropertyName("deleted")] [global::System.Text.Json.Serialization.JsonRequired] - public required double Timestamp { get; set; } + public required bool Deleted { get; set; } /// - /// The quota usage of the request + /// The ID of the project. /// - [global::System.Text.Json.Serialization.JsonPropertyName("quota_usage")] + [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] - public required double QuotaUsage { get; set; } + public required string Id { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,29 +29,29 @@ public sealed partial class ModerationAudioResponseRequest public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// The timestamp of the request + /// + /// Whether the project was deleted. /// - /// - /// The quota usage of the request + /// + /// The ID of the project. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationAudioResponseRequest( - double timestamp, - double quotaUsage) + public ManagementProjectsDeleteResponse( + bool deleted, + string id) { - this.Timestamp = timestamp; - this.QuotaUsage = quotaUsage; + this.Deleted = deleted; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationAudioResponseRequest() + public ManagementProjectsDeleteResponse() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Name.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDuplicateRequest.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Name.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDuplicateRequest.Json.g.cs index aa27d9c..765d444 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Name.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDuplicateRequest.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationTextResponseVariant1Name + public sealed partial class ManagementProjectsDuplicateRequest { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationTextResponseVariant1Name? FromJson( + public static global::ModerationAPI.ManagementProjectsDuplicateRequest? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Name), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Name; + typeof(global::ModerationAPI.ManagementProjectsDuplicateRequest), + jsonSerializerContext) as global::ModerationAPI.ManagementProjectsDuplicateRequest; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationTextResponseVariant1Name? FromJson( + public static global::ModerationAPI.ManagementProjectsDuplicateRequest? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationTextResponseVariant1Name? FromJson( + public static global::ModerationAPI.ManagementProjectsDuplicateRequest? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Name), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Name; + typeof(global::ModerationAPI.ManagementProjectsDuplicateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ManagementProjectsDuplicateRequest; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDuplicateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDuplicateRequest.g.cs new file mode 100644 index 0000000..eb4aa21 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsDuplicateRequest.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class ManagementProjectsDuplicateRequest + { + /// + /// Name of the copy. Defaults to the original name with "(copy)". + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Name of the copy. Defaults to the original name with "(copy)". + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ManagementProjectsDuplicateRequest( + string? name) + { + this.Name = name; + } + + /// + /// Initializes a new instance of the class. + /// + public ManagementProjectsDuplicateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequest.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata2.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequest.Json.g.cs index e07ac9b..b28ede2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata2.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequest.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationAudioRequestMetadata2 + public sealed partial class ManagementProjectsUpdateRequest { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementProjectsUpdateRequest? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationAudioRequestMetadata2), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioRequestMetadata2; + typeof(global::ModerationAPI.ManagementProjectsUpdateRequest), + jsonSerializerContext) as global::ModerationAPI.ManagementProjectsUpdateRequest; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementProjectsUpdateRequest? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationAudioRequestMetadata2? FromJson( + public static global::ModerationAPI.ManagementProjectsUpdateRequest? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationAudioRequestMetadata2), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioRequestMetadata2; + typeof(global::ModerationAPI.ManagementProjectsUpdateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ManagementProjectsUpdateRequest; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequest.g.cs new file mode 100644 index 0000000..1d54265 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequest.g.cs @@ -0,0 +1,113 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class ManagementProjectsUpdateRequest + { + /// + /// The project's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The project's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The website or app the project moderates content for. Setting it on a project without context writes one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("domain")] + public string? Domain { get; set; } + + /// + /// What the platform is and who uses it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("context")] + public string? Context { get; set; } + + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates without flagging. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("globalFlaggingMode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingModeJsonConverter))] + public global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? GlobalFlaggingMode { get; set; } + + /// + /// Whether moderated content is stored and shown in the dashboard. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableRequestLogging")] + public bool? EnableRequestLogging { get; set; } + + /// + /// Whether review queue decisions are recorded in the casebook. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("casebookEnabled")] + public bool? CasebookEnabled { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The project's name. + /// + /// + /// The project's description. + /// + /// + /// The website or app the project moderates content for. Setting it on a project without context writes one. + /// + /// + /// What the platform is and who uses it. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates without flagging. + /// + /// + /// Whether moderated content is stored and shown in the dashboard. + /// + /// + /// Whether review queue decisions are recorded in the casebook. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ManagementProjectsUpdateRequest( + string? name, + string? description, + string? domain, + string? context, + global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? globalFlaggingMode, + bool? enableRequestLogging, + bool? casebookEnabled) + { + this.Name = name; + this.Description = description; + this.Domain = domain; + this.Context = context; + this.GlobalFlaggingMode = globalFlaggingMode; + this.EnableRequestLogging = enableRequestLogging; + this.CasebookEnabled = casebookEnabled; + } + + /// + /// Initializes a new instance of the class. + /// + public ManagementProjectsUpdateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequestGlobalFlaggingMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequestGlobalFlaggingMode.g.cs new file mode 100644 index 0000000..4012105 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ManagementProjectsUpdateRequestGlobalFlaggingMode.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates without flagging. + /// + public enum ManagementProjectsUpdateRequestGlobalFlaggingMode + { + /// + /// + /// + Active, + /// + /// + /// + DryRun, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ManagementProjectsUpdateRequestGlobalFlaggingModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ManagementProjectsUpdateRequestGlobalFlaggingMode value) + { + return value switch + { + ManagementProjectsUpdateRequestGlobalFlaggingMode.Active => "ACTIVE", + ManagementProjectsUpdateRequestGlobalFlaggingMode.DryRun => "DRY_RUN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ManagementProjectsUpdateRequestGlobalFlaggingMode? ToEnum(string value) + { + return value switch + { + "ACTIVE" => ManagementProjectsUpdateRequestGlobalFlaggingMode.Active, + "DRY_RUN" => ManagementProjectsUpdateRequestGlobalFlaggingMode.DryRun, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequest.g.cs deleted file mode 100644 index fa23d89..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequest.g.cs +++ /dev/null @@ -1,113 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Input parameters for audio moderation - /// - public sealed partial class ModerationAudioRequest - { - /// - /// The unique ID of the content in your database. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] - public string? ContentId { get; set; } - - /// - /// The key of the channel. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("channelKey")] - public string? ChannelKey { get; set; } - - /// - /// Do not store the content. The content won't enter the review queue - /// - [global::System.Text.Json.Serialization.JsonPropertyName("doNotStore")] - public bool? DoNotStore { get; set; } - - /// - /// The author of the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("authorId")] - public string? AuthorId { get; set; } - - /// - /// For example the ID of a chat room or a post - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contextId")] - public string? ContextId { get; set; } - - /// - /// Any metadata you want to store with the content - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public object? Metadata { get; set; } - - /// - /// The URL of the audio you want to analyze. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The URL of the audio you want to analyze. - /// - /// - /// The unique ID of the content in your database. - /// - /// - /// The key of the channel. - /// - /// - /// Do not store the content. The content won't enter the review queue - /// - /// - /// The author of the content. - /// - /// - /// For example the ID of a chat room or a post - /// - /// - /// Any metadata you want to store with the content - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationAudioRequest( - string url, - string? contentId, - string? channelKey, - bool? doNotStore, - string? authorId, - string? contextId, - object? metadata) - { - this.ContentId = contentId; - this.ChannelKey = channelKey; - this.DoNotStore = doNotStore; - this.AuthorId = authorId; - this.ContextId = contextId; - this.Metadata = metadata; - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationAudioRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata2.g.cs deleted file mode 100644 index 3ea5ff1..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata2.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationAudioRequestMetadata2 - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponse.g.cs deleted file mode 100644 index 70f0cbd..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponse.g.cs +++ /dev/null @@ -1,104 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Audio moderation analysis results - /// - public sealed partial class ModerationAudioResponse - { - /// - /// Success if the request was successful - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Status { get; set; } - - /// - /// Error message if the request failed - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public object? Error { get; set; } - - /// - /// The ID of the content. Only returned if the content was stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] - public string? ContentId { get; set; } - - /// - /// Information about the request - /// - [global::System.Text.Json.Serialization.JsonPropertyName("request")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationAudioResponseRequest Request { get; set; } - - /// - /// Whether the content was flagged by any models - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flagged")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Flagged { get; set; } - - /// - /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("author")] - public global::ModerationAPI.ModerationAudioResponseAuthor? Author { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Success if the request was successful - /// - /// - /// Information about the request - /// - /// - /// Whether the content was flagged by any models - /// - /// - /// Error message if the request failed - /// - /// - /// The ID of the content. Only returned if the content was stored. - /// - /// - /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationAudioResponse( - string status, - global::ModerationAPI.ModerationAudioResponseRequest request, - bool flagged, - object? error, - string? contentId, - global::ModerationAPI.ModerationAudioResponseAuthor? author) - { - this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); - this.Error = error; - this.ContentId = contentId; - this.Request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - this.Flagged = flagged; - this.Author = author; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationAudioResponse() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthor.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthor.Json.g.cs deleted file mode 100644 index 3f31197..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthor.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationAudioResponseAuthor - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationAudioResponseAuthor? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationAudioResponseAuthor), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioResponseAuthor; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationAudioResponseAuthor? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationAudioResponseAuthor? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationAudioResponseAuthor), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioResponseAuthor; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthor.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthor.g.cs deleted file mode 100644 index d02caa8..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthor.g.cs +++ /dev/null @@ -1,92 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationAudioResponseAuthor - { - /// - /// Author ID in Moderation API - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// The author's ID from your system - /// - [global::System.Text.Json.Serialization.JsonPropertyName("external_id")] - public string? ExternalId { get; set; } - - /// - /// Block or suspension details, if applicable. Null if the author is enabled. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("block")] - public global::ModerationAPI.ModerationAudioResponseAuthorBlock? Block { get; set; } - - /// - /// Current author status - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationAudioResponseAuthorStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationAudioResponseAuthorStatus Status { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("trust_level")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel TrustLevel { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Author ID in Moderation API - /// - /// - /// Current author status - /// - /// - /// - /// The author's ID from your system - /// - /// - /// Block or suspension details, if applicable. Null if the author is enabled. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationAudioResponseAuthor( - string id, - global::ModerationAPI.ModerationAudioResponseAuthorStatus status, - global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel trustLevel, - string? externalId, - global::ModerationAPI.ModerationAudioResponseAuthorBlock? block) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.ExternalId = externalId; - this.Block = block; - this.Status = status; - this.TrustLevel = trustLevel ?? throw new global::System.ArgumentNullException(nameof(trustLevel)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationAudioResponseAuthor() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorBlock.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorBlock.g.cs deleted file mode 100644 index 8b9de3a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorBlock.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationAudioResponseAuthorBlock - { - /// - /// The timestamp until which they are blocked if the author is suspended. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("until")] - public double? Until { get; set; } - - /// - /// The moderators reason why the author was blocked or suspended. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reason")] - public string? Reason { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The timestamp until which they are blocked if the author is suspended. - /// - /// - /// The moderators reason why the author was blocked or suspended. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationAudioResponseAuthorBlock( - double? until, - string? reason) - { - this.Until = until; - this.Reason = reason; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationAudioResponseAuthorBlock() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorStatus.g.cs deleted file mode 100644 index 6b4bb4d..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorStatus.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Current author status - /// - public enum ModerationAudioResponseAuthorStatus - { - /// - /// - /// - Blocked, - /// - /// - /// - Enabled, - /// - /// - /// - Suspended, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationAudioResponseAuthorStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationAudioResponseAuthorStatus value) - { - return value switch - { - ModerationAudioResponseAuthorStatus.Blocked => "blocked", - ModerationAudioResponseAuthorStatus.Enabled => "enabled", - ModerationAudioResponseAuthorStatus.Suspended => "suspended", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationAudioResponseAuthorStatus? ToEnum(string value) - { - return value switch - { - "blocked" => ModerationAudioResponseAuthorStatus.Blocked, - "enabled" => ModerationAudioResponseAuthorStatus.Enabled, - "suspended" => ModerationAudioResponseAuthorStatus.Suspended, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorTrustLevel.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorTrustLevel.Json.g.cs deleted file mode 100644 index 7f1a44a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorTrustLevel.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationAudioResponseAuthorTrustLevel - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioResponseAuthorTrustLevel; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseError.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseError.g.cs deleted file mode 100644 index 5f64411..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseError.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Error message if the request failed - /// - public sealed partial class ModerationAudioResponseError - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageRequest.g.cs index 5167d42..937cdb7 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageRequest.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageRequest.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// + /// Input parameters for image moderation /// public sealed partial class ModerationImageRequest { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthor.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthor.g.cs deleted file mode 100644 index cd5d1d5..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthor.g.cs +++ /dev/null @@ -1,92 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationImageResponseAuthor - { - /// - /// Author ID in Moderation API - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// The author's ID from your system - /// - [global::System.Text.Json.Serialization.JsonPropertyName("external_id")] - public string? ExternalId { get; set; } - - /// - /// Block or suspension details, if applicable. Null if the author is enabled. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("block")] - public global::ModerationAPI.ModerationImageResponseAuthorBlock? Block { get; set; } - - /// - /// Current author status - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseAuthorStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationImageResponseAuthorStatus Status { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("trust_level")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationImageResponseAuthorTrustLevel TrustLevel { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Author ID in Moderation API - /// - /// - /// Current author status - /// - /// - /// - /// The author's ID from your system - /// - /// - /// Block or suspension details, if applicable. Null if the author is enabled. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationImageResponseAuthor( - string id, - global::ModerationAPI.ModerationImageResponseAuthorStatus status, - global::ModerationAPI.ModerationImageResponseAuthorTrustLevel trustLevel, - string? externalId, - global::ModerationAPI.ModerationImageResponseAuthorBlock? block) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.ExternalId = externalId; - this.Block = block; - this.Status = status; - this.TrustLevel = trustLevel ?? throw new global::System.ArgumentNullException(nameof(trustLevel)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationImageResponseAuthor() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorBlock.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorBlock.g.cs deleted file mode 100644 index c9a9940..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorBlock.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationImageResponseAuthorBlock - { - /// - /// The timestamp until which they are blocked if the author is suspended. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("until")] - public double? Until { get; set; } - - /// - /// The moderators reason why the author was blocked or suspended. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reason")] - public string? Reason { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The timestamp until which they are blocked if the author is suspended. - /// - /// - /// The moderators reason why the author was blocked or suspended. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationImageResponseAuthorBlock( - double? until, - string? reason) - { - this.Until = until; - this.Reason = reason; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationImageResponseAuthorBlock() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseError.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseError.g.cs deleted file mode 100644 index fd0a0dc..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseError.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Error message if the request failed - /// - public sealed partial class ModerationImageResponseError - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabelLabel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabelLabel.g.cs deleted file mode 100644 index 64050a0..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabelLabel.g.cs +++ /dev/null @@ -1,105 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The label of the model - /// - public enum ModerationImageResponseLabelLabel - { - /// - /// - /// - Alcohol, - /// - /// - /// - Drugs, - /// - /// - /// - Gore, - /// - /// - /// - Hate, - /// - /// - /// - Nudity, - /// - /// - /// - Smoking, - /// - /// - /// - Suggestive, - /// - /// - /// - Text, - /// - /// - /// - Toxic, - /// - /// - /// - Violence, - /// - /// - /// - Weapon, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationImageResponseLabelLabelExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationImageResponseLabelLabel value) - { - return value switch - { - ModerationImageResponseLabelLabel.Alcohol => "alcohol", - ModerationImageResponseLabelLabel.Drugs => "drugs", - ModerationImageResponseLabelLabel.Gore => "gore", - ModerationImageResponseLabelLabel.Hate => "hate", - ModerationImageResponseLabelLabel.Nudity => "nudity", - ModerationImageResponseLabelLabel.Smoking => "smoking", - ModerationImageResponseLabelLabel.Suggestive => "suggestive", - ModerationImageResponseLabelLabel.Text => "text", - ModerationImageResponseLabelLabel.Toxic => "toxic", - ModerationImageResponseLabelLabel.Violence => "violence", - ModerationImageResponseLabelLabel.Weapon => "weapon", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationImageResponseLabelLabel? ToEnum(string value) - { - return value switch - { - "alcohol" => ModerationImageResponseLabelLabel.Alcohol, - "drugs" => ModerationImageResponseLabelLabel.Drugs, - "gore" => ModerationImageResponseLabelLabel.Gore, - "hate" => ModerationImageResponseLabelLabel.Hate, - "nudity" => ModerationImageResponseLabelLabel.Nudity, - "smoking" => ModerationImageResponseLabelLabel.Smoking, - "suggestive" => ModerationImageResponseLabelLabel.Suggestive, - "text" => ModerationImageResponseLabelLabel.Text, - "toxic" => ModerationImageResponseLabelLabel.Toxic, - "violence" => ModerationImageResponseLabelLabel.Violence, - "weapon" => ModerationImageResponseLabelLabel.Weapon, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1.Json.g.cs similarity index 91% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponse.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1.Json.g.cs index a31e256..0a9acd7 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponse.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationImageResponse + public sealed partial class ModerationImageResponseVariant1 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponse? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationImageResponse), - jsonSerializerContext) as global::ModerationAPI.ModerationImageResponse; + typeof(global::ModerationAPI.ModerationImageResponseVariant1), + jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseVariant1; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponse? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationImageResponse? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationImageResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponse; + typeof(global::ModerationAPI.ModerationImageResponseVariant1), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseVariant1; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1.g.cs similarity index 70% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponse.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1.g.cs index 20bf817..a571ab9 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponse.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationImageResponse + public sealed partial class ModerationImageResponseVariant1 { /// /// Success if the request was successful @@ -16,13 +16,7 @@ public sealed partial class ModerationImageResponse public required string Status { get; set; } /// - /// Error message if the request failed - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public object? Error { get; set; } - - /// - /// The ID of the content. Only returned if the content was stored. + /// The ID of the content. /// [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] public string? ContentId { get; set; } @@ -32,7 +26,7 @@ public sealed partial class ModerationImageResponse /// [global::System.Text.Json.Serialization.JsonPropertyName("request")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationImageResponseRequest Request { get; set; } + public required global::ModerationAPI.ModerationImageResponseVariant1Request Request { get; set; } /// /// Whether the content was flagged by any models @@ -45,20 +39,21 @@ public sealed partial class ModerationImageResponse /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. /// [global::System.Text.Json.Serialization.JsonPropertyName("author")] - public global::ModerationAPI.ModerationImageResponseAuthor? Author { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1Author? Author { get; set; } /// - /// The scores of each label + /// Whether any entity matchers found data for the content /// - [global::System.Text.Json.Serialization.JsonPropertyName("labels")] + [global::System.Text.Json.Serialization.JsonPropertyName("data_found")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Labels { get; set; } + public required bool DataFound { get; set; } /// - /// The texts found in the image, if the image text model is enabled + /// Legacy image labels, approximated from the equivalent policies. Use POST /moderate for the policy probabilities themselves. /// - [global::System.Text.Json.Serialization.JsonPropertyName("texts")] - public global::System.Collections.Generic.IList? Texts { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("labels")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Labels { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -67,7 +62,7 @@ public sealed partial class ModerationImageResponse public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Success if the request was successful @@ -78,48 +73,43 @@ public sealed partial class ModerationImageResponse /// /// Whether the content was flagged by any models /// - /// - /// The scores of each label + /// + /// Whether any entity matchers found data for the content /// - /// - /// Error message if the request failed + /// + /// Legacy image labels, approximated from the equivalent policies. Use POST /moderate for the policy probabilities themselves. /// /// - /// The ID of the content. Only returned if the content was stored. + /// The ID of the content. /// /// /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. /// - /// - /// The texts found in the image, if the image text model is enabled - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationImageResponse( + public ModerationImageResponseVariant1( string status, - global::ModerationAPI.ModerationImageResponseRequest request, + global::ModerationAPI.ModerationImageResponseVariant1Request request, bool flagged, - global::System.Collections.Generic.IList labels, - object? error, + bool dataFound, + global::System.Collections.Generic.IList labels, string? contentId, - global::ModerationAPI.ModerationImageResponseAuthor? author, - global::System.Collections.Generic.IList? texts) + global::ModerationAPI.ModerationImageResponseVariant1Author? author) { this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); - this.Error = error; this.ContentId = contentId; this.Request = request ?? throw new global::System.ArgumentNullException(nameof(request)); this.Flagged = flagged; this.Author = author; + this.DataFound = dataFound; this.Labels = labels ?? throw new global::System.ArgumentNullException(nameof(labels)); - this.Texts = texts; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationImageResponse() + public ModerationImageResponseVariant1() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorBlock.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Author.Json.g.cs similarity index 90% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorBlock.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Author.Json.g.cs index 4a47fa9..9618226 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorBlock.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Author.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationImageResponseAuthorBlock + public sealed partial class ModerationImageResponseVariant1Author { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseAuthorBlock? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Author? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationImageResponseAuthorBlock), - jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseAuthorBlock; + typeof(global::ModerationAPI.ModerationImageResponseVariant1Author), + jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseVariant1Author; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseAuthorBlock? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Author? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationImageResponseAuthorBlock? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Author? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationImageResponseAuthorBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseAuthorBlock; + typeof(global::ModerationAPI.ModerationImageResponseVariant1Author), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseVariant1Author; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Author.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Author.g.cs similarity index 81% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Author.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Author.g.cs index a828520..859618a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Author.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Author.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationVideoResponseVariant1Author + public sealed partial class ModerationImageResponseVariant1Author { /// /// Author ID in Moderation API @@ -25,22 +25,22 @@ public sealed partial class ModerationVideoResponseVariant1Author /// Block or suspension details, if applicable. Null if the author is enabled. /// [global::System.Text.Json.Serialization.JsonPropertyName("block")] - public global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock? Block { get; set; } + public global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock? Block { get; set; } /// /// Current author status /// [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationVideoResponseVariant1AuthorStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseVariant1AuthorStatusJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus Status { get; set; } + public required global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus Status { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("trust_level")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel TrustLevel { get; set; } + public required global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel TrustLevel { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -49,7 +49,7 @@ public sealed partial class ModerationVideoResponseVariant1Author public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Author ID in Moderation API @@ -67,12 +67,12 @@ public sealed partial class ModerationVideoResponseVariant1Author #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationVideoResponseVariant1Author( + public ModerationImageResponseVariant1Author( string id, - global::ModerationAPI.ModerationVideoResponseVariant1AuthorStatus status, - global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel trustLevel, + global::ModerationAPI.ModerationImageResponseVariant1AuthorStatus status, + global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel trustLevel, string? externalId, - global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock? block) + global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock? block) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.ExternalId = externalId; @@ -82,9 +82,9 @@ public ModerationVideoResponseVariant1Author( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationVideoResponseVariant1Author() + public ModerationImageResponseVariant1Author() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorTrustLevel.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorBlock.Json.g.cs similarity index 89% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorTrustLevel.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorBlock.Json.g.cs index 128798e..e7fe652 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorTrustLevel.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorBlock.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationImageResponseAuthorTrustLevel + public sealed partial class ModerationImageResponseVariant1AuthorBlock { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseAuthorTrustLevel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationImageResponseAuthorTrustLevel), - jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseAuthorTrustLevel; + typeof(global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock), + jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseAuthorTrustLevel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationImageResponseAuthorTrustLevel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationImageResponseAuthorTrustLevel), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseAuthorTrustLevel; + typeof(global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseVariant1AuthorBlock; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorBlock.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorBlock.g.cs similarity index 86% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorBlock.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorBlock.g.cs index d44e8b1..9a4f1e3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorBlock.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorBlock.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationVideoResponseVariant1AuthorBlock + public sealed partial class ModerationImageResponseVariant1AuthorBlock { /// /// The timestamp until which they are blocked if the author is suspended. @@ -27,7 +27,7 @@ public sealed partial class ModerationVideoResponseVariant1AuthorBlock public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The timestamp until which they are blocked if the author is suspended. @@ -38,7 +38,7 @@ public sealed partial class ModerationVideoResponseVariant1AuthorBlock #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationVideoResponseVariant1AuthorBlock( + public ModerationImageResponseVariant1AuthorBlock( double? until, string? reason) { @@ -47,9 +47,9 @@ public ModerationVideoResponseVariant1AuthorBlock( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationVideoResponseVariant1AuthorBlock() + public ModerationImageResponseVariant1AuthorBlock() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorStatus.g.cs similarity index 63% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorStatus.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorStatus.g.cs index e47aaee..3f275bf 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorStatus.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorStatus.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Current author status /// - public enum ModerationVideoResponseVariant1AuthorStatus + public enum ModerationImageResponseVariant1AuthorStatus { /// /// @@ -25,31 +25,31 @@ public enum ModerationVideoResponseVariant1AuthorStatus /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ModerationVideoResponseVariant1AuthorStatusExtensions + public static class ModerationImageResponseVariant1AuthorStatusExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ModerationVideoResponseVariant1AuthorStatus value) + public static string ToValueString(this ModerationImageResponseVariant1AuthorStatus value) { return value switch { - ModerationVideoResponseVariant1AuthorStatus.Blocked => "blocked", - ModerationVideoResponseVariant1AuthorStatus.Enabled => "enabled", - ModerationVideoResponseVariant1AuthorStatus.Suspended => "suspended", + ModerationImageResponseVariant1AuthorStatus.Blocked => "blocked", + ModerationImageResponseVariant1AuthorStatus.Enabled => "enabled", + ModerationImageResponseVariant1AuthorStatus.Suspended => "suspended", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ModerationVideoResponseVariant1AuthorStatus? ToEnum(string value) + public static ModerationImageResponseVariant1AuthorStatus? ToEnum(string value) { return value switch { - "blocked" => ModerationVideoResponseVariant1AuthorStatus.Blocked, - "enabled" => ModerationVideoResponseVariant1AuthorStatus.Enabled, - "suspended" => ModerationVideoResponseVariant1AuthorStatus.Suspended, + "blocked" => ModerationImageResponseVariant1AuthorStatus.Blocked, + "enabled" => ModerationImageResponseVariant1AuthorStatus.Enabled, + "suspended" => ModerationImageResponseVariant1AuthorStatus.Suspended, _ => null, }; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorTrustLevel.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorTrustLevel.Json.g.cs similarity index 88% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorTrustLevel.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorTrustLevel.Json.g.cs index 35fadcb..95a51ce 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorTrustLevel.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorTrustLevel.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationVideoResponseVariant1AuthorTrustLevel + public sealed partial class ModerationImageResponseVariant1AuthorTrustLevel { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel; + typeof(global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel), + jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoResponseVariant1AuthorTrustLevel; + typeof(global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseVariant1AuthorTrustLevel; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorTrustLevel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorTrustLevel.g.cs similarity index 85% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorTrustLevel.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorTrustLevel.g.cs index 48b550e..54c204e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorTrustLevel.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1AuthorTrustLevel.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationVideoResponseVariant1AuthorTrustLevel + public sealed partial class ModerationImageResponseVariant1AuthorTrustLevel { /// /// Author trust level (-1, 0, 1, 2, 3, or 4) @@ -29,7 +29,7 @@ public sealed partial class ModerationVideoResponseVariant1AuthorTrustLevel public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Author trust level (-1, 0, 1, 2, 3, or 4) @@ -40,7 +40,7 @@ public sealed partial class ModerationVideoResponseVariant1AuthorTrustLevel #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationVideoResponseVariant1AuthorTrustLevel( + public ModerationImageResponseVariant1AuthorTrustLevel( double level, bool manual) { @@ -49,9 +49,9 @@ public ModerationVideoResponseVariant1AuthorTrustLevel( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationVideoResponseVariant1AuthorTrustLevel() + public ModerationImageResponseVariant1AuthorTrustLevel() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Label.Json.g.cs similarity index 90% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseRequest.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Label.Json.g.cs index e974788..ed172f0 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseRequest.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Label.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationImageResponseRequest + public sealed partial class ModerationImageResponseVariant1Label { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseRequest? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Label? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationImageResponseRequest), - jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseRequest; + typeof(global::ModerationAPI.ModerationImageResponseVariant1Label), + jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseVariant1Label; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseRequest? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Label? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationImageResponseRequest? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Label? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationImageResponseRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseRequest; + typeof(global::ModerationAPI.ModerationImageResponseVariant1Label), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseVariant1Label; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Label.g.cs similarity index 61% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabel.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Label.g.cs index 276cc62..6438257 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabel.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Label.g.cs @@ -6,18 +6,17 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationImageResponseLabel + public sealed partial class ModerationImageResponseVariant1Label { /// - /// The label of the model + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("label")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationImageResponseLabelLabelJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationImageResponseLabelLabel Label { get; set; } + public required string Label { get; set; } /// - /// The confidence of the model + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("score")] [global::System.Text.Json.Serialization.JsonRequired] @@ -30,29 +29,25 @@ public sealed partial class ModerationImageResponseLabel public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// The label of the model - /// - /// - /// The confidence of the model - /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationImageResponseLabel( - global::ModerationAPI.ModerationImageResponseLabelLabel label, + public ModerationImageResponseVariant1Label( + string label, double score) { - this.Label = label; + this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); this.Score = score; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationImageResponseLabel() + public ModerationImageResponseVariant1Label() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseError.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Request.Json.g.cs similarity index 90% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseError.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Request.Json.g.cs index 5ad976f..1480c42 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseError.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Request.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationImageResponseError + public sealed partial class ModerationImageResponseVariant1Request { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseError? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Request? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationImageResponseError), - jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseError; + typeof(global::ModerationAPI.ModerationImageResponseVariant1Request), + jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseVariant1Request; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseError? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Request? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationImageResponseError? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant1Request? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationImageResponseError), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseError; + typeof(global::ModerationAPI.ModerationImageResponseVariant1Request), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseVariant1Request; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Request.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Request.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Request.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Request.g.cs index bed8c3b..a3fa96b 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Request.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant1Request.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Information about the request /// - public sealed partial class ModerationVideoResponseVariant1Request + public sealed partial class ModerationImageResponseVariant1Request { /// /// The timestamp of the request @@ -29,7 +29,7 @@ public sealed partial class ModerationVideoResponseVariant1Request public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The timestamp of the request @@ -40,7 +40,7 @@ public sealed partial class ModerationVideoResponseVariant1Request #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationVideoResponseVariant1Request( + public ModerationImageResponseVariant1Request( double timestamp, double quotaUsage) { @@ -49,9 +49,9 @@ public ModerationVideoResponseVariant1Request( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationVideoResponseVariant1Request() + public ModerationImageResponseVariant1Request() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthor.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant2.Json.g.cs similarity index 91% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthor.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant2.Json.g.cs index 2ac588d..7785c6f 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthor.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant2.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationImageResponseAuthor + public sealed partial class ModerationImageResponseVariant2 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseAuthor? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant2? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationImageResponseAuthor), - jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseAuthor; + typeof(global::ModerationAPI.ModerationImageResponseVariant2), + jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseVariant2; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseAuthor? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant2? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationImageResponseAuthor? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant2? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationImageResponseAuthor), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseAuthor; + typeof(global::ModerationAPI.ModerationImageResponseVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseVariant2; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant2.g.cs similarity index 88% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata2.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant2.g.cs index 3e970ce..13412c3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata2.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant2.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationVideoRequestMetadata2 + public sealed partial class ModerationImageResponseVariant2 { /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabel.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant22.Json.g.cs similarity index 91% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabel.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant22.Json.g.cs index 45114fd..0f7d3a4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseLabel.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant22.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationImageResponseLabel + public sealed partial class ModerationImageResponseVariant22 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseLabel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant22? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationImageResponseLabel), - jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseLabel; + typeof(global::ModerationAPI.ModerationImageResponseVariant22), + jsonSerializerContext) as global::ModerationAPI.ModerationImageResponseVariant22; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationImageResponseLabel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant22? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationImageResponseLabel? FromJson( + public static global::ModerationAPI.ModerationImageResponseVariant22? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationImageResponseLabel), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseLabel; + typeof(global::ModerationAPI.ModerationImageResponseVariant22), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationImageResponseVariant22; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant22.g.cs similarity index 88% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata2.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant22.g.cs index 218ebff..421f7ce 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata2.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseVariant22.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationObjectRequestMetadata2 + public sealed partial class ModerationImageResponseVariant22 { /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequest.g.cs deleted file mode 100644 index e450b21..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequest.g.cs +++ /dev/null @@ -1,113 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectRequest - { - /// - /// The unique ID of the content in your database. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] - public string? ContentId { get; set; } - - /// - /// The key of the channel. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("channelKey")] - public string? ChannelKey { get; set; } - - /// - /// Do not store the content. The content won't enter the review queue - /// - [global::System.Text.Json.Serialization.JsonPropertyName("doNotStore")] - public bool? DoNotStore { get; set; } - - /// - /// The author of the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("authorId")] - public string? AuthorId { get; set; } - - /// - /// For example the ID of a chat room or a post - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contextId")] - public string? ContextId { get; set; } - - /// - /// Any metadata you want to store with the content - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public object? Metadata { get; set; } - - /// - /// The object you want to analyze. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("value")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationObjectRequestValue Value { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The object you want to analyze. - /// - /// - /// The unique ID of the content in your database. - /// - /// - /// The key of the channel. - /// - /// - /// Do not store the content. The content won't enter the review queue - /// - /// - /// The author of the content. - /// - /// - /// For example the ID of a chat room or a post - /// - /// - /// Any metadata you want to store with the content - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectRequest( - global::ModerationAPI.ModerationObjectRequestValue value, - string? contentId, - string? channelKey, - bool? doNotStore, - string? authorId, - string? contextId, - object? metadata) - { - this.ContentId = contentId; - this.ChannelKey = channelKey; - this.DoNotStore = doNotStore; - this.AuthorId = authorId; - this.ContextId = contextId; - this.Metadata = metadata; - this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata.g.cs deleted file mode 100644 index c7c851b..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestMetadata.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Any metadata you want to store with the content - /// - public sealed partial class ModerationObjectRequestMetadata - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValue.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValue.g.cs deleted file mode 100644 index 7824662..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValue.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The object you want to analyze. - /// - public sealed partial class ModerationObjectRequestValue - { - /// - /// The type of the object you want to analyze. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationObjectRequestValueTypeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationObjectRequestValueType Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.Dictionary Data { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The type of the object you want to analyze. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectRequestValue( - global::ModerationAPI.ModerationObjectRequestValueType type, - global::System.Collections.Generic.Dictionary data) - { - this.Type = type; - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectRequestValue() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData.g.cs deleted file mode 100644 index a10261a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectRequestValueData - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData2.Json.g.cs deleted file mode 100644 index 36f2bc4..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData2.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectRequestValueData2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectRequestValueData2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectRequestValueData2), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectRequestValueData2; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectRequestValueData2? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectRequestValueData2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectRequestValueData2), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectRequestValueData2; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData2.g.cs deleted file mode 100644 index af5e79b..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueData2.g.cs +++ /dev/null @@ -1,71 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectRequestValueData2 - { - /// - /// The type of content (e.g., "text", "image", "video") - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationObjectRequestValueDataTypeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationObjectRequestValueDataType Type { get; set; } - - /// - /// Optional array of specific model IDs to use - /// - [global::System.Text.Json.Serialization.JsonPropertyName("modelIds")] - public global::System.Collections.Generic.IList? ModelIds { get; set; } - - /// - /// The content to analyze - /// - [global::System.Text.Json.Serialization.JsonPropertyName("value")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Value { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The type of content (e.g., "text", "image", "video") - /// - /// - /// The content to analyze - /// - /// - /// Optional array of specific model IDs to use - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectRequestValueData2( - global::ModerationAPI.ModerationObjectRequestValueDataType type, - string value, - global::System.Collections.Generic.IList? modelIds) - { - this.Type = type; - this.ModelIds = modelIds; - this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectRequestValueData2() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueDataType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueDataType.g.cs deleted file mode 100644 index 598fb40..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueDataType.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The type of content (e.g., "text", "image", "video") - /// - public enum ModerationObjectRequestValueDataType - { - /// - /// - /// - Audio, - /// - /// - /// - Image, - /// - /// - /// - Text, - /// - /// - /// - Video, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationObjectRequestValueDataTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationObjectRequestValueDataType value) - { - return value switch - { - ModerationObjectRequestValueDataType.Audio => "audio", - ModerationObjectRequestValueDataType.Image => "image", - ModerationObjectRequestValueDataType.Text => "text", - ModerationObjectRequestValueDataType.Video => "video", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationObjectRequestValueDataType? ToEnum(string value) - { - return value switch - { - "audio" => ModerationObjectRequestValueDataType.Audio, - "image" => ModerationObjectRequestValueDataType.Image, - "text" => ModerationObjectRequestValueDataType.Text, - "video" => ModerationObjectRequestValueDataType.Video, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueType.g.cs deleted file mode 100644 index 79a273f..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValueType.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The type of the object you want to analyze. - /// - public enum ModerationObjectRequestValueType - { - /// - /// - /// - Event, - /// - /// - /// - Object, - /// - /// - /// - Product, - /// - /// - /// - Profile, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationObjectRequestValueTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationObjectRequestValueType value) - { - return value switch - { - ModerationObjectRequestValueType.Event => "event", - ModerationObjectRequestValueType.Object => "object", - ModerationObjectRequestValueType.Product => "product", - ModerationObjectRequestValueType.Profile => "profile", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationObjectRequestValueType? ToEnum(string value) - { - return value switch - { - "event" => ModerationObjectRequestValueType.Event, - "object" => ModerationObjectRequestValueType.Object, - "product" => ModerationObjectRequestValueType.Product, - "profile" => ModerationObjectRequestValueType.Profile, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1.Json.g.cs deleted file mode 100644 index 7e78170..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1.g.cs deleted file mode 100644 index 78ea5d7..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1.g.cs +++ /dev/null @@ -1,175 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant1 - { - /// - /// Success if the request was successful - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Status { get; set; } - - /// - /// Error message if the request failed - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public object? Error { get; set; } - - /// - /// The ID of the content. Only returned if the content was stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] - public string? ContentId { get; set; } - - /// - /// Information about the request - /// - [global::System.Text.Json.Serialization.JsonPropertyName("request")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationObjectResponseVariant1Request Request { get; set; } - - /// - /// Whether the content was flagged by any models - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flagged")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Flagged { get; set; } - - /// - /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("author")] - public global::ModerationAPI.ModerationObjectResponseVariant1Author? Author { get; set; } - - /// - /// Whether the content is using look-alike characters. Often used by spammers. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("unicode_spoofing")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool UnicodeSpoofing { get; set; } - - /// - /// Whether any entity matchers found data for the content - /// - [global::System.Text.Json.Serialization.JsonPropertyName("data_found")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool DataFound { get; set; } - - /// - /// The scores of each label - /// - [global::System.Text.Json.Serialization.JsonPropertyName("labels")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Labels { get; set; } - - /// - /// The entities found in the content - /// - [global::System.Text.Json.Serialization.JsonPropertyName("entities")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Entities { get; set; } - - /// - /// The wordlist entity matcher outputs if enabled in your project. Read more at https://docs.moderationapi.com/models/word - /// - [global::System.Text.Json.Serialization.JsonPropertyName("wordlists")] - public global::System.Collections.Generic.IList? Wordlists { get; set; } - - /// - /// The fields in the object and their flags - /// - [global::System.Text.Json.Serialization.JsonPropertyName("fields")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Fields { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Success if the request was successful - /// - /// - /// Information about the request - /// - /// - /// Whether the content was flagged by any models - /// - /// - /// Whether the content is using look-alike characters. Often used by spammers. - /// - /// - /// Whether any entity matchers found data for the content - /// - /// - /// The scores of each label - /// - /// - /// The entities found in the content - /// - /// - /// The fields in the object and their flags - /// - /// - /// Error message if the request failed - /// - /// - /// The ID of the content. Only returned if the content was stored. - /// - /// - /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. - /// - /// - /// The wordlist entity matcher outputs if enabled in your project. Read more at https://docs.moderationapi.com/models/word - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1( - string status, - global::ModerationAPI.ModerationObjectResponseVariant1Request request, - bool flagged, - bool unicodeSpoofing, - bool dataFound, - global::System.Collections.Generic.IList labels, - global::System.Collections.Generic.IList entities, - global::System.Collections.Generic.IList fields, - object? error, - string? contentId, - global::ModerationAPI.ModerationObjectResponseVariant1Author? author, - global::System.Collections.Generic.IList? wordlists) - { - this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); - this.Error = error; - this.ContentId = contentId; - this.Request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - this.Flagged = flagged; - this.Author = author; - this.UnicodeSpoofing = unicodeSpoofing; - this.DataFound = dataFound; - this.Labels = labels ?? throw new global::System.ArgumentNullException(nameof(labels)); - this.Entities = entities ?? throw new global::System.ArgumentNullException(nameof(entities)); - this.Wordlists = wordlists; - this.Fields = fields ?? throw new global::System.ArgumentNullException(nameof(fields)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Author.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Author.Json.g.cs deleted file mode 100644 index 99ba99d..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Author.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1Author - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Author? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Author), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1Author; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Author? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1Author? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Author), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1Author; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Author.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Author.g.cs deleted file mode 100644 index 34368ce..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Author.g.cs +++ /dev/null @@ -1,92 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant1Author - { - /// - /// Author ID in Moderation API - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// The author's ID from your system - /// - [global::System.Text.Json.Serialization.JsonPropertyName("external_id")] - public string? ExternalId { get; set; } - - /// - /// Block or suspension details, if applicable. Null if the author is enabled. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("block")] - public global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock? Block { get; set; } - - /// - /// Current author status - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationObjectResponseVariant1AuthorStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus Status { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("trust_level")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel TrustLevel { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Author ID in Moderation API - /// - /// - /// Current author status - /// - /// - /// - /// The author's ID from your system - /// - /// - /// Block or suspension details, if applicable. Null if the author is enabled. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1Author( - string id, - global::ModerationAPI.ModerationObjectResponseVariant1AuthorStatus status, - global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel trustLevel, - string? externalId, - global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock? block) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.ExternalId = externalId; - this.Block = block; - this.Status = status; - this.TrustLevel = trustLevel ?? throw new global::System.ArgumentNullException(nameof(trustLevel)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1Author() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorBlock.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorBlock.Json.g.cs deleted file mode 100644 index bff5d1a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorBlock.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1AuthorBlock - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1AuthorBlock; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorBlock.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorBlock.g.cs deleted file mode 100644 index 7997ff1..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorBlock.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant1AuthorBlock - { - /// - /// The timestamp until which they are blocked if the author is suspended. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("until")] - public double? Until { get; set; } - - /// - /// The moderators reason why the author was blocked or suspended. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reason")] - public string? Reason { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The timestamp until which they are blocked if the author is suspended. - /// - /// - /// The moderators reason why the author was blocked or suspended. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1AuthorBlock( - double? until, - string? reason) - { - this.Until = until; - this.Reason = reason; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1AuthorBlock() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorStatus.g.cs deleted file mode 100644 index 59898cb..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorStatus.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Current author status - /// - public enum ModerationObjectResponseVariant1AuthorStatus - { - /// - /// - /// - Blocked, - /// - /// - /// - Enabled, - /// - /// - /// - Suspended, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationObjectResponseVariant1AuthorStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationObjectResponseVariant1AuthorStatus value) - { - return value switch - { - ModerationObjectResponseVariant1AuthorStatus.Blocked => "blocked", - ModerationObjectResponseVariant1AuthorStatus.Enabled => "enabled", - ModerationObjectResponseVariant1AuthorStatus.Suspended => "suspended", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationObjectResponseVariant1AuthorStatus? ToEnum(string value) - { - return value switch - { - "blocked" => ModerationObjectResponseVariant1AuthorStatus.Blocked, - "enabled" => ModerationObjectResponseVariant1AuthorStatus.Enabled, - "suspended" => ModerationObjectResponseVariant1AuthorStatus.Suspended, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorTrustLevel.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorTrustLevel.Json.g.cs deleted file mode 100644 index 8ba2621..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorTrustLevel.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1AuthorTrustLevel - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1AuthorTrustLevel; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorTrustLevel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorTrustLevel.g.cs deleted file mode 100644 index 64eff8e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1AuthorTrustLevel.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant1AuthorTrustLevel - { - /// - /// Author trust level (-1, 0, 1, 2, 3, or 4) - /// - [global::System.Text.Json.Serialization.JsonPropertyName("level")] - [global::System.Text.Json.Serialization.JsonRequired] - public required double Level { get; set; } - - /// - /// True if the trust level was set manually by a moderator - /// - [global::System.Text.Json.Serialization.JsonPropertyName("manual")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Manual { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Author trust level (-1, 0, 1, 2, 3, or 4) - /// - /// - /// True if the trust level was set manually by a moderator - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1AuthorTrustLevel( - double level, - bool manual) - { - this.Level = level; - this.Manual = manual; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1AuthorTrustLevel() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Entitie.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Entitie.Json.g.cs deleted file mode 100644 index 5e8d54b..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Entitie.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1Entitie - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Entitie? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Entitie), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1Entitie; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Entitie? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1Entitie? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Entitie), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1Entitie; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Entitie.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Entitie.g.cs deleted file mode 100644 index 74d7265..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Entitie.g.cs +++ /dev/null @@ -1,70 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant1Entitie - { - /// - /// The model that found the entity - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { get; set; } - - /// - /// The matches of the entity - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Matches { get; set; } - - /// - /// The similarity score of the matches - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - public double? Score { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The model that found the entity - /// - /// - /// The matches of the entity - /// - /// - /// The similarity score of the matches - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1Entitie( - string model, - global::System.Collections.Generic.IList matches, - double? score) - { - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - this.Matches = matches ?? throw new global::System.ArgumentNullException(nameof(matches)); - this.Score = score; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1Entitie() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Error.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Error.Json.g.cs deleted file mode 100644 index 44eb1a7..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Error.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1Error - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Error? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Error), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1Error; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Error? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1Error? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Error), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1Error; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Error.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Error.g.cs deleted file mode 100644 index 6df8f23..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Error.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Error message if the request failed - /// - public sealed partial class ModerationObjectResponseVariant1Error - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Field.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Field.Json.g.cs deleted file mode 100644 index e6616bd..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Field.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1Field - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Field? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Field), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1Field; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Field? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1Field? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Field), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1Field; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Field.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Field.g.cs deleted file mode 100644 index bb6e37f..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Field.g.cs +++ /dev/null @@ -1,71 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant1Field - { - /// - /// The key of the field - /// - [global::System.Text.Json.Serialization.JsonPropertyName("key")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Key { get; set; } - - /// - /// Whether the field was flagged - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flagged")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Flagged { get; set; } - - /// - /// The models that flagged the field - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flagged_by")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList FlaggedBy { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The key of the field - /// - /// - /// Whether the field was flagged - /// - /// - /// The models that flagged the field - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1Field( - string key, - bool flagged, - global::System.Collections.Generic.IList flaggedBy) - { - this.Key = key ?? throw new global::System.ArgumentNullException(nameof(key)); - this.Flagged = flagged; - this.FlaggedBy = flaggedBy ?? throw new global::System.ArgumentNullException(nameof(flaggedBy)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1Field() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Label.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Label.Json.g.cs deleted file mode 100644 index 56eb5d7..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Label.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1Label - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Label? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Label), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1Label; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Label? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1Label? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Label), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1Label; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Label.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Label.g.cs deleted file mode 100644 index ffe3fe4..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Label.g.cs +++ /dev/null @@ -1,71 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant1Label - { - /// - /// The label of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Label { get; set; } - - /// - /// The model that found the label - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { get; set; } - - /// - /// The confidence of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - [global::System.Text.Json.Serialization.JsonRequired] - public required double Score { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The label of the model - /// - /// - /// The model that found the label - /// - /// - /// The confidence of the model - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1Label( - string label, - string model, - double score) - { - this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - this.Score = score; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1Label() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Request.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Request.Json.g.cs deleted file mode 100644 index ce3da2f..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Request), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Request? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Request), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Request.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Request.g.cs deleted file mode 100644 index a340a42..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Request.g.cs +++ /dev/null @@ -1,59 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Information about the request - /// - public sealed partial class ModerationObjectResponseVariant1Request - { - /// - /// The timestamp of the request - /// - [global::System.Text.Json.Serialization.JsonPropertyName("timestamp")] - [global::System.Text.Json.Serialization.JsonRequired] - public required double Timestamp { get; set; } - - /// - /// The quota usage of the request - /// - [global::System.Text.Json.Serialization.JsonPropertyName("quota_usage")] - [global::System.Text.Json.Serialization.JsonRequired] - public required double QuotaUsage { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The timestamp of the request - /// - /// - /// The quota usage of the request - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1Request( - double timestamp, - double quotaUsage) - { - this.Timestamp = timestamp; - this.QuotaUsage = quotaUsage; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1Request() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Wordlist.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Wordlist.g.cs deleted file mode 100644 index a08e457..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Wordlist.g.cs +++ /dev/null @@ -1,151 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant1Wordlist - { - /// - /// The flagging mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationObjectResponseVariant1WordlistModeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Whether the wordlists flagged the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flagged")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Flagged { get; set; } - - /// - /// The name of the wordlist - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// The ID of the wordlist - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// The score of the wordlist - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - [global::System.Text.Json.Serialization.JsonRequired] - public required double Score { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The flagging mode. - /// - /// - /// Whether the wordlists flagged the content. - /// - /// - /// The name of the wordlist - /// - /// - /// The ID of the wordlist - /// - /// - /// The score of the wordlist - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationObjectResponseVariant1Wordlist( - global::ModerationAPI.ModerationObjectResponseVariant1WordlistMode mode, - bool flagged, - string name, - string id, - double score, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - this.Flagged = flagged; - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Score = score; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationObjectResponseVariant1Wordlist() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistComponents.Json.g.cs deleted file mode 100644 index 1cbea12..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant1WordlistComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1WordlistComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1WordlistComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1WordlistComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant1WordlistComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant1WordlistComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1WordlistComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1WordlistComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistComponents.g.cs deleted file mode 100644 index 3878dc6..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationObjectResponseVariant1WordlistComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistMode.g.cs deleted file mode 100644 index 1cd4cec..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1WordlistMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The flagging mode. - /// - public enum ModerationObjectResponseVariant1WordlistMode - { - /// - /// - /// - BlockList, - /// - /// - /// - PassList, - /// - /// - /// - RequireList, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationObjectResponseVariant1WordlistModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationObjectResponseVariant1WordlistMode value) - { - return value switch - { - ModerationObjectResponseVariant1WordlistMode.BlockList => "BLOCK_LIST", - ModerationObjectResponseVariant1WordlistMode.PassList => "PASS_LIST", - ModerationObjectResponseVariant1WordlistMode.RequireList => "REQUIRE_LIST", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationObjectResponseVariant1WordlistMode? ToEnum(string value) - { - return value switch - { - "BLOCK_LIST" => ModerationObjectResponseVariant1WordlistMode.BlockList, - "PASS_LIST" => ModerationObjectResponseVariant1WordlistMode.PassList, - "REQUIRE_LIST" => ModerationObjectResponseVariant1WordlistMode.RequireList, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant2.Json.g.cs deleted file mode 100644 index af4ff4a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant2.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant2), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant2; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant2? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant2), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant2; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant2.g.cs deleted file mode 100644 index 5063ace..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant2.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant2 - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant22.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant22.Json.g.cs deleted file mode 100644 index 46e7666..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant22.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationObjectResponseVariant22 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant22? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant22), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant22; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationObjectResponseVariant22? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationObjectResponseVariant22? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant22), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant22; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant22.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant22.g.cs deleted file mode 100644 index ea19c56..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant22.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationObjectResponseVariant22 - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextRequest.g.cs index a34019d..4c25254 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextRequest.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextRequest.g.cs @@ -14,13 +14,6 @@ public sealed partial class ModerationTextRequest [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] public string? ContentId { get; set; } - /// - /// The text you'd like to analyze. We recommend to submit plain text or HTML - /// - [global::System.Text.Json.Serialization.JsonPropertyName("value")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Value { get; set; } - /// /// The key of the channel. /// @@ -51,6 +44,13 @@ public sealed partial class ModerationTextRequest [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] public object? Metadata { get; set; } + /// + /// The text you'd like to analyze. We recommend to submit plain text or HTML + /// + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Value { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -94,12 +94,12 @@ public ModerationTextRequest( object? metadata) { this.ContentId = contentId; - this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); this.ChannelKey = channelKey; this.DoNotStore = doNotStore; this.AuthorId = authorId; this.ContextId = contextId; this.Metadata = metadata; + this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); } /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1.g.cs index a9906dc..a466d86 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1.g.cs @@ -16,13 +16,7 @@ public sealed partial class ModerationTextResponseVariant1 public required string Status { get; set; } /// - /// Error message if the request failed - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public object? Error { get; set; } - - /// - /// The ID of the content. Only returned if the content was stored. + /// The ID of the content. /// [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] public string? ContentId { get; set; } @@ -82,96 +76,6 @@ public sealed partial class ModerationTextResponseVariant1 [global::System.Text.Json.Serialization.JsonRequired] public required string Content { get; set; } - /// - /// The NSFW model output if enabled in your project. Read more at https://docs.moderationapi.com/models/nsfw - /// - [global::System.Text.Json.Serialization.JsonPropertyName("nsfw")] - public global::ModerationAPI.ModerationTextResponseVariant1Nsfw? Nsfw { get; set; } - - /// - /// The toxicity model output if enabled in your project. Read more at https://docs.moderationapi.com/models/toxicity - /// - [global::System.Text.Json.Serialization.JsonPropertyName("toxicity")] - public global::ModerationAPI.ModerationTextResponseVariant1Toxicity? Toxicity { get; set; } - - /// - /// The spam model output if enabled in your project. Read more at https://docs.moderationapi.com/models/spam - /// - [global::System.Text.Json.Serialization.JsonPropertyName("quality")] - public global::ModerationAPI.ModerationTextResponseVariant1Quality? Quality { get; set; } - - /// - /// The sentiment model output if enabled in your project. Read more at https://docs.moderationapi.com/models/sentiment - /// - [global::System.Text.Json.Serialization.JsonPropertyName("sentiment")] - public global::ModerationAPI.ModerationTextResponseVariant1Sentiment? Sentiment { get; set; } - - /// - /// The propriety model output if enabled in your project. Read more at https://docs.moderationapi.com/models/propriety - /// - [global::System.Text.Json.Serialization.JsonPropertyName("propriety")] - public global::ModerationAPI.ModerationTextResponseVariant1Propriety? Propriety { get; set; } - - /// - /// The email entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/email - /// - [global::System.Text.Json.Serialization.JsonPropertyName("email")] - public global::ModerationAPI.ModerationTextResponseVariant1Email? Email { get; set; } - - /// - /// The phone entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/phone - /// - [global::System.Text.Json.Serialization.JsonPropertyName("phone")] - public global::ModerationAPI.ModerationTextResponseVariant1Phone? Phone { get; set; } - - /// - /// The url entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/url - /// - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public global::ModerationAPI.ModerationTextResponseVariant1Url? Url { get; set; } - - /// - /// The address entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/address - /// - [global::System.Text.Json.Serialization.JsonPropertyName("address")] - public global::ModerationAPI.ModerationTextResponseVariant1Address? Address { get; set; } - - /// - /// The name entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/name - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - public global::ModerationAPI.ModerationTextResponseVariant1Name? Name { get; set; } - - /// - /// The username entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/username - /// - [global::System.Text.Json.Serialization.JsonPropertyName("username")] - public global::ModerationAPI.ModerationTextResponseVariant1Username? Username { get; set; } - - /// - /// The profanity entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/profanity - /// - [global::System.Text.Json.Serialization.JsonPropertyName("profanity")] - public global::ModerationAPI.ModerationTextResponseVariant1Profanity? Profanity { get; set; } - - /// - /// The sensitive numbers entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/sensitive - /// - [global::System.Text.Json.Serialization.JsonPropertyName("sensitive")] - public global::ModerationAPI.ModerationTextResponseVariant1Sensitive? Sensitive { get; set; } - - /// - /// The wordlist entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/word - /// - [global::System.Text.Json.Serialization.JsonPropertyName("wordlist")] - public global::ModerationAPI.ModerationTextResponseVariant1Wordlist? Wordlist { get; set; } - - /// - /// The wordlist entity matcher outputs if enabled in your project. Read more at https://docs.moderationapi.com/models/word - /// - [global::System.Text.Json.Serialization.JsonPropertyName("wordlists")] - public global::System.Collections.Generic.IList? Wordlists { get; set; } - /// /// Additional properties that are not explicitly defined in the schema /// @@ -205,60 +109,12 @@ public sealed partial class ModerationTextResponseVariant1 /// /// The content after moderation. With all mask replacements applied and look-alike characters replaced with the original characters. /// - /// - /// Error message if the request failed - /// /// - /// The ID of the content. Only returned if the content was stored. + /// The ID of the content. /// /// /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. /// - /// - /// The NSFW model output if enabled in your project. Read more at https://docs.moderationapi.com/models/nsfw - /// - /// - /// The toxicity model output if enabled in your project. Read more at https://docs.moderationapi.com/models/toxicity - /// - /// - /// The spam model output if enabled in your project. Read more at https://docs.moderationapi.com/models/spam - /// - /// - /// The sentiment model output if enabled in your project. Read more at https://docs.moderationapi.com/models/sentiment - /// - /// - /// The propriety model output if enabled in your project. Read more at https://docs.moderationapi.com/models/propriety - /// - /// - /// The email entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/email - /// - /// - /// The phone entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/phone - /// - /// - /// The url entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/url - /// - /// - /// The address entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/address - /// - /// - /// The name entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/name - /// - /// - /// The username entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/username - /// - /// - /// The profanity entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/profanity - /// - /// - /// The sensitive numbers entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/sensitive - /// - /// - /// The wordlist entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/word - /// - /// - /// The wordlist entity matcher outputs if enabled in your project. Read more at https://docs.moderationapi.com/models/word - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -271,27 +127,10 @@ public ModerationTextResponseVariant1( bool dataFound, string original, string content, - object? error, string? contentId, - global::ModerationAPI.ModerationTextResponseVariant1Author? author, - global::ModerationAPI.ModerationTextResponseVariant1Nsfw? nsfw, - global::ModerationAPI.ModerationTextResponseVariant1Toxicity? toxicity, - global::ModerationAPI.ModerationTextResponseVariant1Quality? quality, - global::ModerationAPI.ModerationTextResponseVariant1Sentiment? sentiment, - global::ModerationAPI.ModerationTextResponseVariant1Propriety? propriety, - global::ModerationAPI.ModerationTextResponseVariant1Email? email, - global::ModerationAPI.ModerationTextResponseVariant1Phone? phone, - global::ModerationAPI.ModerationTextResponseVariant1Url? url, - global::ModerationAPI.ModerationTextResponseVariant1Address? address, - global::ModerationAPI.ModerationTextResponseVariant1Name? name, - global::ModerationAPI.ModerationTextResponseVariant1Username? username, - global::ModerationAPI.ModerationTextResponseVariant1Profanity? profanity, - global::ModerationAPI.ModerationTextResponseVariant1Sensitive? sensitive, - global::ModerationAPI.ModerationTextResponseVariant1Wordlist? wordlist, - global::System.Collections.Generic.IList? wordlists) + global::ModerationAPI.ModerationTextResponseVariant1Author? author) { this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); - this.Error = error; this.ContentId = contentId; this.Request = request ?? throw new global::System.ArgumentNullException(nameof(request)); this.Flagged = flagged; @@ -301,21 +140,6 @@ public ModerationTextResponseVariant1( this.DataFound = dataFound; this.Original = original ?? throw new global::System.ArgumentNullException(nameof(original)); this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); - this.Nsfw = nsfw; - this.Toxicity = toxicity; - this.Quality = quality; - this.Sentiment = sentiment; - this.Propriety = propriety; - this.Email = email; - this.Phone = phone; - this.Url = url; - this.Address = address; - this.Name = name; - this.Username = username; - this.Profanity = profanity; - this.Sensitive = sensitive; - this.Wordlist = wordlist; - this.Wordlists = wordlists; } /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Address.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Address.Json.g.cs deleted file mode 100644 index f7ea8dd..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Address.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Address - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Address? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Address), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Address; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Address? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Address? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Address), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Address; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Address.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Address.g.cs deleted file mode 100644 index e12c4bf..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Address.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The address entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/address - /// - public sealed partial class ModerationTextResponseVariant1Address - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1AddressModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1AddressMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Address( - global::ModerationAPI.ModerationTextResponseVariant1AddressMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Address() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressComponents.Json.g.cs deleted file mode 100644 index b22eb56..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1AddressComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1AddressComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1AddressComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1AddressComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1AddressComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1AddressComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1AddressComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1AddressComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressComponents.g.cs deleted file mode 100644 index df6bbc6..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1AddressComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressMode.g.cs deleted file mode 100644 index ae8f17a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1AddressMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1AddressMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1AddressModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1AddressMode value) - { - return value switch - { - ModerationTextResponseVariant1AddressMode.Normal => "NORMAL", - ModerationTextResponseVariant1AddressMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1AddressMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1AddressMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1AddressMode.Normal, - "PARANOID" => ModerationTextResponseVariant1AddressMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1AddressMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Email.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Email.Json.g.cs deleted file mode 100644 index 97204ca..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Email.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Email - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Email? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Email), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Email; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Email? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Email? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Email), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Email; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Email.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Email.g.cs deleted file mode 100644 index 1ecf369..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Email.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The email entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/email - /// - public sealed partial class ModerationTextResponseVariant1Email - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1EmailModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1EmailMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Email( - global::ModerationAPI.ModerationTextResponseVariant1EmailMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Email() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailComponents.Json.g.cs deleted file mode 100644 index 537505b..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1EmailComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1EmailComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1EmailComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1EmailComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1EmailComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1EmailComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1EmailComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1EmailComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailComponents.g.cs deleted file mode 100644 index 0754982..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1EmailComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailMode.g.cs deleted file mode 100644 index 9f463e3..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1EmailMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1EmailMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1EmailModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1EmailMode value) - { - return value switch - { - ModerationTextResponseVariant1EmailMode.Normal => "NORMAL", - ModerationTextResponseVariant1EmailMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1EmailMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1EmailMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1EmailMode.Normal, - "PARANOID" => ModerationTextResponseVariant1EmailMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1EmailMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Error.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Error.Json.g.cs deleted file mode 100644 index 78e0ed8..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Error.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Error - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Error? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Error), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Error; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Error? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Error? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Error), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Error; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Error.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Error.g.cs deleted file mode 100644 index 97ce0b0..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Error.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Error message if the request failed - /// - public sealed partial class ModerationTextResponseVariant1Error - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Name.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Name.g.cs deleted file mode 100644 index 1a7dea9..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Name.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The name entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/name - /// - public sealed partial class ModerationTextResponseVariant1Name - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1NameModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1NameMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Name( - global::ModerationAPI.ModerationTextResponseVariant1NameMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Name() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameComponents.Json.g.cs deleted file mode 100644 index 61f101b..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1NameComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1NameComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1NameComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1NameComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1NameComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1NameComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1NameComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1NameComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameComponents.g.cs deleted file mode 100644 index 41d19e0..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1NameComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameMode.g.cs deleted file mode 100644 index 13f6361..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NameMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1NameMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1NameModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1NameMode value) - { - return value switch - { - ModerationTextResponseVariant1NameMode.Normal => "NORMAL", - ModerationTextResponseVariant1NameMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1NameMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1NameMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1NameMode.Normal, - "PARANOID" => ModerationTextResponseVariant1NameMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1NameMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Nsfw.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Nsfw.Json.g.cs deleted file mode 100644 index 2741d9b..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Nsfw.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Nsfw - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Nsfw? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Nsfw), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Nsfw; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Nsfw? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Nsfw? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Nsfw), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Nsfw; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Nsfw.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Nsfw.g.cs deleted file mode 100644 index f2b2126..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Nsfw.g.cs +++ /dev/null @@ -1,90 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The NSFW model output if enabled in your project. Read more at https://docs.moderationapi.com/models/nsfw - /// - public sealed partial class ModerationTextResponseVariant1Nsfw - { - /// - /// The label of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// The confidence of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - public double? Score { get; set; } - - /// - /// Indicates an error with the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// The confidence of all labels - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label_scores")] - public global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores? LabelScores { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The label of the model - /// - /// - /// The confidence of the model - /// - /// - /// Indicates an error with the model - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - /// - /// The confidence of all labels - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Nsfw( - string? label, - double? score, - string? error, - string? warning, - global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores? labelScores) - { - this.Label = label; - this.Score = score; - this.Error = error; - this.Warning = warning; - this.LabelScores = labelScores; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Nsfw() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NsfwLabelScores.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NsfwLabelScores.Json.g.cs deleted file mode 100644 index eef2c4e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NsfwLabelScores.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1NsfwLabelScores - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1NsfwLabelScores; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NsfwLabelScores.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NsfwLabelScores.g.cs deleted file mode 100644 index cde6e53..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1NsfwLabelScores.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The confidence of all labels - /// - public sealed partial class ModerationTextResponseVariant1NsfwLabelScores - { - /// - /// Mentions religion, politics, race, etc., but is neutral or positive. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("SENSITIVE")] - public double? Sensitive { get; set; } - - /// - /// Sexual, hateful, profane, and inappropriate content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("UNSAFE")] - public double? Unsafe { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("NEUTRAL")] - public double? Neutral { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Mentions religion, politics, race, etc., but is neutral or positive. - /// - /// - /// Sexual, hateful, profane, and inappropriate content. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1NsfwLabelScores( - double? sensitive, - double? @unsafe, - double? neutral) - { - this.Sensitive = sensitive; - this.Unsafe = @unsafe; - this.Neutral = neutral; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1NsfwLabelScores() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Phone.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Phone.g.cs deleted file mode 100644 index 4152ec0..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Phone.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The phone entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/phone - /// - public sealed partial class ModerationTextResponseVariant1Phone - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1PhoneModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1PhoneMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Phone( - global::ModerationAPI.ModerationTextResponseVariant1PhoneMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Phone() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneComponents.Json.g.cs deleted file mode 100644 index dea6b3c..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1PhoneComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1PhoneComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1PhoneComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1PhoneComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1PhoneComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1PhoneComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1PhoneComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1PhoneComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneComponents.g.cs deleted file mode 100644 index f5d6d90..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1PhoneComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneMode.g.cs deleted file mode 100644 index 0fc3b8e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1PhoneMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1PhoneMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1PhoneModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1PhoneMode value) - { - return value switch - { - ModerationTextResponseVariant1PhoneMode.Normal => "NORMAL", - ModerationTextResponseVariant1PhoneMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1PhoneMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1PhoneMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1PhoneMode.Normal, - "PARANOID" => ModerationTextResponseVariant1PhoneMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1PhoneMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Profanity.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Profanity.Json.g.cs deleted file mode 100644 index a25fa95..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Profanity.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Profanity - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Profanity? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Profanity), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Profanity; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Profanity? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Profanity? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Profanity), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Profanity; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Profanity.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Profanity.g.cs deleted file mode 100644 index 9bea0f3..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Profanity.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The profanity entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/profanity - /// - public sealed partial class ModerationTextResponseVariant1Profanity - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1ProfanityModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Profanity( - global::ModerationAPI.ModerationTextResponseVariant1ProfanityMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Profanity() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityComponents.Json.g.cs deleted file mode 100644 index 103b7af..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1ProfanityComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1ProfanityComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1ProfanityComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1ProfanityComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1ProfanityComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1ProfanityComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1ProfanityComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1ProfanityComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityComponents.g.cs deleted file mode 100644 index b52d900..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1ProfanityComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityMode.g.cs deleted file mode 100644 index 5ce049f..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProfanityMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1ProfanityMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1ProfanityModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1ProfanityMode value) - { - return value switch - { - ModerationTextResponseVariant1ProfanityMode.Normal => "NORMAL", - ModerationTextResponseVariant1ProfanityMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1ProfanityMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1ProfanityMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1ProfanityMode.Normal, - "PARANOID" => ModerationTextResponseVariant1ProfanityMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1ProfanityMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Propriety.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Propriety.Json.g.cs deleted file mode 100644 index 8dd7d7d..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Propriety.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Propriety - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Propriety? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Propriety), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Propriety; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Propriety? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Propriety? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Propriety), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Propriety; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Propriety.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Propriety.g.cs deleted file mode 100644 index d2eea4d..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Propriety.g.cs +++ /dev/null @@ -1,90 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The propriety model output if enabled in your project. Read more at https://docs.moderationapi.com/models/propriety - /// - public sealed partial class ModerationTextResponseVariant1Propriety - { - /// - /// The label of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// The confidence of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - public double? Score { get; set; } - - /// - /// Indicates an error with the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// The confidence of all labels - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label_scores")] - public global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores? LabelScores { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The label of the model - /// - /// - /// The confidence of the model - /// - /// - /// Indicates an error with the model - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - /// - /// The confidence of all labels - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Propriety( - string? label, - double? score, - string? error, - string? warning, - global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores? labelScores) - { - this.Label = label; - this.Score = score; - this.Error = error; - this.Warning = warning; - this.LabelScores = labelScores; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Propriety() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProprietyLabelScores.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProprietyLabelScores.Json.g.cs deleted file mode 100644 index bda88eb..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProprietyLabelScores.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1ProprietyLabelScores - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1ProprietyLabelScores; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProprietyLabelScores.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProprietyLabelScores.g.cs deleted file mode 100644 index b7407b1..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ProprietyLabelScores.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The confidence of all labels - /// - public sealed partial class ModerationTextResponseVariant1ProprietyLabelScores - { - /// - /// Pickup lines, compliments on appearance, etc. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("FLIRTATION")] - public double? Flirtation { get; set; } - - /// - /// References to sexual acts, body parts, etc. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("SEXUALLY_EXPLICIT")] - public double? SexuallyExplicit { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("NEUTRAL")] - public double? Neutral { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Pickup lines, compliments on appearance, etc. - /// - /// - /// References to sexual acts, body parts, etc. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1ProprietyLabelScores( - double? flirtation, - double? sexuallyExplicit, - double? neutral) - { - this.Flirtation = flirtation; - this.SexuallyExplicit = sexuallyExplicit; - this.Neutral = neutral; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1ProprietyLabelScores() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Quality.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Quality.Json.g.cs deleted file mode 100644 index 82331d4..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Quality.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Quality - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Quality? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Quality), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Quality; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Quality? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Quality? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Quality), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Quality; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Quality.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Quality.g.cs deleted file mode 100644 index ed28461..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Quality.g.cs +++ /dev/null @@ -1,90 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The spam model output if enabled in your project. Read more at https://docs.moderationapi.com/models/spam - /// - public sealed partial class ModerationTextResponseVariant1Quality - { - /// - /// The label of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// The confidence of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - public double? Score { get; set; } - - /// - /// Indicates an error with the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// The confidence of all labels - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label_scores")] - public global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores? LabelScores { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The label of the model - /// - /// - /// The confidence of the model - /// - /// - /// Indicates an error with the model - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - /// - /// The confidence of all labels - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Quality( - string? label, - double? score, - string? error, - string? warning, - global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores? labelScores) - { - this.Label = label; - this.Score = score; - this.Error = error; - this.Warning = warning; - this.LabelScores = labelScores; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Quality() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1QualityLabelScores.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1QualityLabelScores.Json.g.cs deleted file mode 100644 index f27cb99..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1QualityLabelScores.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1QualityLabelScores - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1QualityLabelScores; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1QualityLabelScores.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1QualityLabelScores.g.cs deleted file mode 100644 index 003cf52..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1QualityLabelScores.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The confidence of all labels - /// - public sealed partial class ModerationTextResponseVariant1QualityLabelScores - { - /// - /// Trivial or short content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("UNSUBSTANTIAL")] - public double? Unsubstantial { get; set; } - - /// - /// Difficult to understand, nonsensical. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("INCOHERENT")] - public double? Incoherent { get; set; } - - /// - /// Irrelevant and unsolicited commercial content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("SPAM")] - public double? Spam { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("NEUTRAL")] - public double? Neutral { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Trivial or short content. - /// - /// - /// Difficult to understand, nonsensical. - /// - /// - /// Irrelevant and unsolicited commercial content. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1QualityLabelScores( - double? unsubstantial, - double? incoherent, - double? spam, - double? neutral) - { - this.Unsubstantial = unsubstantial; - this.Incoherent = incoherent; - this.Spam = spam; - this.Neutral = neutral; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1QualityLabelScores() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sensitive.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sensitive.Json.g.cs deleted file mode 100644 index 7152c2e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sensitive.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Sensitive - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Sensitive? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Sensitive), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Sensitive; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Sensitive? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Sensitive? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Sensitive), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Sensitive; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sensitive.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sensitive.g.cs deleted file mode 100644 index a4da6db..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sensitive.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The sensitive numbers entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/sensitive - /// - public sealed partial class ModerationTextResponseVariant1Sensitive - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1SensitiveModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Sensitive( - global::ModerationAPI.ModerationTextResponseVariant1SensitiveMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Sensitive() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveComponents.Json.g.cs deleted file mode 100644 index 24be142..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1SensitiveComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1SensitiveComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1SensitiveComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1SensitiveComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1SensitiveComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1SensitiveComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1SensitiveComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1SensitiveComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveComponents.g.cs deleted file mode 100644 index 9b88f9e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1SensitiveComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveMode.g.cs deleted file mode 100644 index 275ebd9..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SensitiveMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1SensitiveMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1SensitiveModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1SensitiveMode value) - { - return value switch - { - ModerationTextResponseVariant1SensitiveMode.Normal => "NORMAL", - ModerationTextResponseVariant1SensitiveMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1SensitiveMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1SensitiveMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1SensitiveMode.Normal, - "PARANOID" => ModerationTextResponseVariant1SensitiveMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1SensitiveMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sentiment.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sentiment.Json.g.cs deleted file mode 100644 index 64f7f76..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sentiment.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Sentiment - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Sentiment? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Sentiment), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Sentiment; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Sentiment? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Sentiment? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Sentiment), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Sentiment; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sentiment.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sentiment.g.cs deleted file mode 100644 index 18eb726..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Sentiment.g.cs +++ /dev/null @@ -1,90 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The sentiment model output if enabled in your project. Read more at https://docs.moderationapi.com/models/sentiment - /// - public sealed partial class ModerationTextResponseVariant1Sentiment - { - /// - /// The label of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// The confidence of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - public double? Score { get; set; } - - /// - /// Indicates an error with the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// The confidence of all labels - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label_scores")] - public global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores? LabelScores { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The label of the model - /// - /// - /// The confidence of the model - /// - /// - /// Indicates an error with the model - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - /// - /// The confidence of all labels - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Sentiment( - string? label, - double? score, - string? error, - string? warning, - global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores? labelScores) - { - this.Label = label; - this.Score = score; - this.Error = error; - this.Warning = warning; - this.LabelScores = labelScores; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Sentiment() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SentimentLabelScores.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SentimentLabelScores.Json.g.cs deleted file mode 100644 index 4acc7f5..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SentimentLabelScores.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1SentimentLabelScores - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1SentimentLabelScores; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SentimentLabelScores.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SentimentLabelScores.g.cs deleted file mode 100644 index d9a5418..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1SentimentLabelScores.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The confidence of all labels - /// - public sealed partial class ModerationTextResponseVariant1SentimentLabelScores - { - /// - /// Positive sentiment. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("POSITIVE")] - public double? Positive { get; set; } - - /// - /// Negative sentiment. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("NEGATIVE")] - public double? Negative { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("NEUTRAL")] - public double? Neutral { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Positive sentiment. - /// - /// - /// Negative sentiment. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1SentimentLabelScores( - double? positive, - double? negative, - double? neutral) - { - this.Positive = positive; - this.Negative = negative; - this.Neutral = neutral; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1SentimentLabelScores() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Toxicity.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Toxicity.g.cs deleted file mode 100644 index 40176ae..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Toxicity.g.cs +++ /dev/null @@ -1,90 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The toxicity model output if enabled in your project. Read more at https://docs.moderationapi.com/models/toxicity - /// - public sealed partial class ModerationTextResponseVariant1Toxicity - { - /// - /// The label of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label")] - public string? Label { get; set; } - - /// - /// The confidence of the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - public double? Score { get; set; } - - /// - /// Indicates an error with the model - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// The confidence of all labels - /// - [global::System.Text.Json.Serialization.JsonPropertyName("label_scores")] - public global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores? LabelScores { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The label of the model - /// - /// - /// The confidence of the model - /// - /// - /// Indicates an error with the model - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate - /// - /// - /// The confidence of all labels - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Toxicity( - string? label, - double? score, - string? error, - string? warning, - global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores? labelScores) - { - this.Label = label; - this.Score = score; - this.Error = error; - this.Warning = warning; - this.LabelScores = labelScores; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Toxicity() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ToxicityLabelScores.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ToxicityLabelScores.g.cs deleted file mode 100644 index da54d9a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ToxicityLabelScores.g.cs +++ /dev/null @@ -1,110 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The confidence of all labels - /// - public sealed partial class ModerationTextResponseVariant1ToxicityLabelScores - { - /// - /// Rude or disrespectful content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("TOXICITY")] - public double? Toxicity { get; set; } - - /// - /// Swearing, curse words, and other obscene language. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("PROFANITY")] - public double? Profanity { get; set; } - - /// - /// Discrimination of race, religion, gender, etc. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("DISCRIMINATION")] - public double? Discrimination { get; set; } - - /// - /// Very hateful and aggressive content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("SEVERE_TOXICITY")] - public double? SevereToxicity { get; set; } - - /// - /// Negative comments about looks or personality etc. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("INSULT")] - public double? Insult { get; set; } - - /// - /// Content containing intention to harm or violence. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("THREAT")] - public double? Threat { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("NEUTRAL")] - public double? Neutral { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Rude or disrespectful content. - /// - /// - /// Swearing, curse words, and other obscene language. - /// - /// - /// Discrimination of race, religion, gender, etc. - /// - /// - /// Very hateful and aggressive content. - /// - /// - /// Negative comments about looks or personality etc. - /// - /// - /// Content containing intention to harm or violence. - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1ToxicityLabelScores( - double? toxicity, - double? profanity, - double? discrimination, - double? severeToxicity, - double? insult, - double? threat, - double? neutral) - { - this.Toxicity = toxicity; - this.Profanity = profanity; - this.Discrimination = discrimination; - this.SevereToxicity = severeToxicity; - this.Insult = insult; - this.Threat = threat; - this.Neutral = neutral; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1ToxicityLabelScores() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Url.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Url.Json.g.cs deleted file mode 100644 index ef1f2b9..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Url.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Url - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Url? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Url), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Url; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Url? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Url? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Url), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Url; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Url.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Url.g.cs deleted file mode 100644 index a35cb2d..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Url.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The url entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/url - /// - public sealed partial class ModerationTextResponseVariant1Url - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1UrlModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1UrlMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Url( - global::ModerationAPI.ModerationTextResponseVariant1UrlMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Url() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlComponents.Json.g.cs deleted file mode 100644 index 4e9c40a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1UrlComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1UrlComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1UrlComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1UrlComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1UrlComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1UrlComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1UrlComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1UrlComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlComponents.g.cs deleted file mode 100644 index 1c79b36..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1UrlComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlMode.g.cs deleted file mode 100644 index 3586e8b..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UrlMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1UrlMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1UrlModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1UrlMode value) - { - return value switch - { - ModerationTextResponseVariant1UrlMode.Normal => "NORMAL", - ModerationTextResponseVariant1UrlMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1UrlMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1UrlMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1UrlMode.Normal, - "PARANOID" => ModerationTextResponseVariant1UrlMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1UrlMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Username.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Username.Json.g.cs deleted file mode 100644 index 160f0b4..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Username.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Username - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Username? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Username), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Username; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Username? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Username? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Username), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Username; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Username.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Username.g.cs deleted file mode 100644 index 91571b8..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Username.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The username entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/username - /// - public sealed partial class ModerationTextResponseVariant1Username - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1UsernameModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1UsernameMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Username( - global::ModerationAPI.ModerationTextResponseVariant1UsernameMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Username() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameComponents.Json.g.cs deleted file mode 100644 index f094b41..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1UsernameComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1UsernameComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1UsernameComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1UsernameComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1UsernameComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1UsernameComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1UsernameComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1UsernameComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameComponents.g.cs deleted file mode 100644 index db1a389..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1UsernameComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameMode.g.cs deleted file mode 100644 index d0b522e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1UsernameMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1UsernameMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1UsernameModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1UsernameMode value) - { - return value switch - { - ModerationTextResponseVariant1UsernameMode.Normal => "NORMAL", - ModerationTextResponseVariant1UsernameMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1UsernameMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1UsernameMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1UsernameMode.Normal, - "PARANOID" => ModerationTextResponseVariant1UsernameMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1UsernameMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist.Json.g.cs deleted file mode 100644 index b4523ea..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Wordlist - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Wordlist? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Wordlist), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Wordlist; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Wordlist? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Wordlist? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Wordlist), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Wordlist; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist.g.cs deleted file mode 100644 index 5fc643e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist.g.cs +++ /dev/null @@ -1,102 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The wordlist entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/word - /// - public sealed partial class ModerationTextResponseVariant1Wordlist - { - /// - /// The detection mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistModeJsonConverter))] - public global::ModerationAPI.ModerationTextResponseVariant1WordlistMode? Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The detection mode. - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Wordlist( - global::ModerationAPI.ModerationTextResponseVariant1WordlistMode? mode, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Wordlist() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist2.Json.g.cs deleted file mode 100644 index 5429ab6..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist2.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1Wordlist2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Wordlist2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Wordlist2), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Wordlist2; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1Wordlist2? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1Wordlist2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Wordlist2), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Wordlist2; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist2.g.cs deleted file mode 100644 index 1a6d279..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Wordlist2.g.cs +++ /dev/null @@ -1,151 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationTextResponseVariant1Wordlist2 - { - /// - /// The flagging mode. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mode")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ModerationTextResponseVariant1WordlistMode2JsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2 Mode { get; set; } - - /// - /// Whether a match was found or not. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("found")] - public bool? Found { get; set; } - - /// - /// The matches of the entity matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("matches")] - public global::System.Collections.Generic.IList? Matches { get; set; } - - /// - /// The components of the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("components")] - public object? Components { get; set; } - - /// - /// Indicates an error with the matcher. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public string? Error { get; set; } - - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("warning")] - public string? Warning { get; set; } - - /// - /// Whether the wordlists flagged the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flagged")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Flagged { get; set; } - - /// - /// The name of the wordlist - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// The ID of the wordlist - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// The score of the wordlist - /// - [global::System.Text.Json.Serialization.JsonPropertyName("score")] - [global::System.Text.Json.Serialization.JsonRequired] - public required double Score { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The flagging mode. - /// - /// - /// Whether the wordlists flagged the content. - /// - /// - /// The name of the wordlist - /// - /// - /// The ID of the wordlist - /// - /// - /// The score of the wordlist - /// - /// - /// Whether a match was found or not. - /// - /// - /// The matches of the entity matcher. - /// - /// - /// The components of the matcher. - /// - /// - /// Indicates an error with the matcher. - /// - /// - /// Indicates a warning from the model, e.g. if the text is too short or long and the model might not be accurate. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationTextResponseVariant1Wordlist2( - global::ModerationAPI.ModerationTextResponseVariant1WordlistMode2 mode, - bool flagged, - string name, - string id, - double score, - bool? found, - global::System.Collections.Generic.IList? matches, - object? components, - string? error, - string? warning) - { - this.Mode = mode; - this.Found = found; - this.Matches = matches; - this.Components = components; - this.Error = error; - this.Warning = warning; - this.Flagged = flagged; - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Score = score; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationTextResponseVariant1Wordlist2() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents.Json.g.cs deleted file mode 100644 index 024b58f..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1WordlistComponents - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents.g.cs deleted file mode 100644 index 44b44cf..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1WordlistComponents - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents2.Json.g.cs deleted file mode 100644 index 647eec1..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents2.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationTextResponseVariant1WordlistComponents2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents2), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents2; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents2? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents2), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1WordlistComponents2; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents2.g.cs deleted file mode 100644 index 389c6a7..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistComponents2.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The components of the matcher. - /// - public sealed partial class ModerationTextResponseVariant1WordlistComponents2 - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistMode.g.cs deleted file mode 100644 index 46b2c16..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistMode.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The detection mode. - /// - public enum ModerationTextResponseVariant1WordlistMode - { - /// - /// - /// - Normal, - /// - /// - /// - Paranoid, - /// - /// - /// - Suspicious, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1WordlistModeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1WordlistMode value) - { - return value switch - { - ModerationTextResponseVariant1WordlistMode.Normal => "NORMAL", - ModerationTextResponseVariant1WordlistMode.Paranoid => "PARANOID", - ModerationTextResponseVariant1WordlistMode.Suspicious => "SUSPICIOUS", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1WordlistMode? ToEnum(string value) - { - return value switch - { - "NORMAL" => ModerationTextResponseVariant1WordlistMode.Normal, - "PARANOID" => ModerationTextResponseVariant1WordlistMode.Paranoid, - "SUSPICIOUS" => ModerationTextResponseVariant1WordlistMode.Suspicious, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistMode2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistMode2.g.cs deleted file mode 100644 index cace294..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1WordlistMode2.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// The flagging mode. - /// - public enum ModerationTextResponseVariant1WordlistMode2 - { - /// - /// - /// - BlockList, - /// - /// - /// - PassList, - /// - /// - /// - RequireList, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ModerationTextResponseVariant1WordlistMode2Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ModerationTextResponseVariant1WordlistMode2 value) - { - return value switch - { - ModerationTextResponseVariant1WordlistMode2.BlockList => "BLOCK_LIST", - ModerationTextResponseVariant1WordlistMode2.PassList => "PASS_LIST", - ModerationTextResponseVariant1WordlistMode2.RequireList => "REQUIRE_LIST", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ModerationTextResponseVariant1WordlistMode2? ToEnum(string value) - { - return value switch - { - "BLOCK_LIST" => ModerationTextResponseVariant1WordlistMode2.BlockList, - "PASS_LIST" => ModerationTextResponseVariant1WordlistMode2.PassList, - "REQUIRE_LIST" => ModerationTextResponseVariant1WordlistMode2.RequireList, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequest.g.cs deleted file mode 100644 index 925d82f..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequest.g.cs +++ /dev/null @@ -1,113 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Input parameters for video moderation - /// - public sealed partial class ModerationVideoRequest - { - /// - /// The unique ID of the content in your database. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] - public string? ContentId { get; set; } - - /// - /// The key of the channel. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("channelKey")] - public string? ChannelKey { get; set; } - - /// - /// Do not store the content. The content won't enter the review queue - /// - [global::System.Text.Json.Serialization.JsonPropertyName("doNotStore")] - public bool? DoNotStore { get; set; } - - /// - /// The author of the content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("authorId")] - public string? AuthorId { get; set; } - - /// - /// For example the ID of a chat room or a post - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contextId")] - public string? ContextId { get; set; } - - /// - /// Any metadata you want to store with the content - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public object? Metadata { get; set; } - - /// - /// The URL of the video you want to analyze. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The URL of the video you want to analyze. - /// - /// - /// The unique ID of the content in your database. - /// - /// - /// The key of the channel. - /// - /// - /// Do not store the content. The content won't enter the review queue - /// - /// - /// The author of the content. - /// - /// - /// For example the ID of a chat room or a post - /// - /// - /// Any metadata you want to store with the content - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationVideoRequest( - string url, - string? contentId, - string? channelKey, - bool? doNotStore, - string? authorId, - string? contextId, - object? metadata) - { - this.ContentId = contentId; - this.ChannelKey = channelKey; - this.DoNotStore = doNotStore; - this.AuthorId = authorId; - this.ContextId = contextId; - this.Metadata = metadata; - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationVideoRequest() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata.Json.g.cs deleted file mode 100644 index 8208608..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationVideoRequestMetadata - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoRequestMetadata? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationVideoRequestMetadata), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoRequestMetadata; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoRequestMetadata? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationVideoRequestMetadata? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationVideoRequestMetadata), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoRequestMetadata; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata.g.cs deleted file mode 100644 index 559ce7e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoRequestMetadata.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Any metadata you want to store with the content - /// - public sealed partial class ModerationVideoRequestMetadata - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1.g.cs deleted file mode 100644 index f333b83..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1.g.cs +++ /dev/null @@ -1,104 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationVideoResponseVariant1 - { - /// - /// Success if the request was successful - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Status { get; set; } - - /// - /// Error message if the request failed - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error")] - public object? Error { get; set; } - - /// - /// The ID of the content. Only returned if the content was stored. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("contentId")] - public string? ContentId { get; set; } - - /// - /// Information about the request - /// - [global::System.Text.Json.Serialization.JsonPropertyName("request")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.ModerationVideoResponseVariant1Request Request { get; set; } - - /// - /// Whether the content was flagged by any models - /// - [global::System.Text.Json.Serialization.JsonPropertyName("flagged")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Flagged { get; set; } - - /// - /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("author")] - public global::ModerationAPI.ModerationVideoResponseVariant1Author? Author { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Success if the request was successful - /// - /// - /// Information about the request - /// - /// - /// Whether the content was flagged by any models - /// - /// - /// Error message if the request failed - /// - /// - /// The ID of the content. Only returned if the content was stored. - /// - /// - /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ModerationVideoResponseVariant1( - string status, - global::ModerationAPI.ModerationVideoResponseVariant1Request request, - bool flagged, - object? error, - string? contentId, - global::ModerationAPI.ModerationVideoResponseVariant1Author? author) - { - this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); - this.Error = error; - this.ContentId = contentId; - this.Request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - this.Flagged = flagged; - this.Author = author; - } - - /// - /// Initializes a new instance of the class. - /// - public ModerationVideoResponseVariant1() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Author.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Author.Json.g.cs deleted file mode 100644 index 017dc7e..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Author.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationVideoResponseVariant1Author - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant1Author? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1Author), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoResponseVariant1Author; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant1Author? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationVideoResponseVariant1Author? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1Author), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoResponseVariant1Author; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorBlock.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorBlock.Json.g.cs deleted file mode 100644 index a90f809..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1AuthorBlock.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationVideoResponseVariant1AuthorBlock - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoResponseVariant1AuthorBlock; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Error.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Error.Json.g.cs deleted file mode 100644 index 8a56a6f..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Error.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationVideoResponseVariant1Error - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant1Error? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1Error), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoResponseVariant1Error; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant1Error? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationVideoResponseVariant1Error? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1Error), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoResponseVariant1Error; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Error.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Error.g.cs deleted file mode 100644 index 411be43..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Error.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// Error message if the request failed - /// - public sealed partial class ModerationVideoResponseVariant1Error - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Request.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Request.Json.g.cs deleted file mode 100644 index c267d5a..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant1Request.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationVideoResponseVariant1Request - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant1Request? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1Request), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoResponseVariant1Request; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant1Request? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationVideoResponseVariant1Request? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationVideoResponseVariant1Request), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoResponseVariant1Request; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant2.Json.g.cs deleted file mode 100644 index 896a8d5..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant2.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationVideoResponseVariant2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationVideoResponseVariant2), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoResponseVariant2; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant2? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationVideoResponseVariant2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationVideoResponseVariant2), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoResponseVariant2; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant2.g.cs deleted file mode 100644 index 6289ec1..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant2.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationVideoResponseVariant2 - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant22.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant22.Json.g.cs deleted file mode 100644 index 12b8e89..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant22.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class ModerationVideoResponseVariant22 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant22? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.ModerationVideoResponseVariant22), - jsonSerializerContext) as global::ModerationAPI.ModerationVideoResponseVariant22; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::ModerationAPI.ModerationVideoResponseVariant22? FromJson( - string json) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::ModerationAPI.ModerationVideoResponseVariant22? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::ModerationAPI.ModerationVideoResponseVariant22), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationVideoResponseVariant22; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::ModerationAPI.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant22.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant22.g.cs deleted file mode 100644 index c2012d1..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationVideoResponseVariant22.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public sealed partial class ModerationVideoResponseVariant22 - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequest.g.cs index 0de96a2..12747ec 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequest.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequest.g.cs @@ -75,7 +75,7 @@ public sealed partial class NewModerateModerateRequest /// (Enterprise) override the channel policies for this moderation request only. /// [global::System.Text.Json.Serialization.JsonPropertyName("policies")] - public global::System.Collections.Generic.IList>? Policies { get; set; } + public global::System.Collections.Generic.IList>? Policies { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -133,7 +133,7 @@ public NewModerateModerateRequest( object? metadata, global::ModerationAPI.NewModerateModerateRequestClientAction? clientAction, bool? doNotStore, - global::System.Collections.Generic.IList>? policies) + global::System.Collections.Generic.IList>? policies) { this.Content = content; this.Timestamp = timestamp; diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexualMinors.Json.g.cs similarity index 84% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexualMinors.Json.g.cs index cb506ec..f66775c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexualMinors.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationAudioRequestMetadata + public sealed partial class NewModerateModerateRequestPolicieSexualMinors { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioRequestMetadata? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationAudioRequestMetadata), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioRequestMetadata; + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioRequestMetadata? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationAudioRequestMetadata? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationAudioRequestMetadata), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioRequestMetadata; + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPolicieSexualMinors; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexualMinors.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexualMinors.g.cs new file mode 100644 index 0000000..bc78e65 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexualMinors.g.cs @@ -0,0 +1,76 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateRequestPolicieSexualMinors + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("flag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Flag { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + + /// + /// + /// + /// "sexual_minors" + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = "sexual_minors"; + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public NewModerateModerateRequestPolicieSexualMinors( + bool flag, + double? threshold, + string id = "sexual_minors") + { + this.Flag = flag; + this.Threshold = threshold; + this.Id = id; + } + + /// + /// Initializes a new instance of the class. + /// + public NewModerateModerateRequestPolicieSexualMinors() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static NewModerateModerateRequestPolicieSexualMinors FromFlag(bool flag) + { + return new NewModerateModerateRequestPolicieSexualMinors + { + Flag = flag, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.Json.g.cs new file mode 100644 index 0000000..9bb4958 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofing + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofing; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.g.cs new file mode 100644 index 0000000..8a0d98c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofing.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofing + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("flag")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Flag { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + + /// + /// + /// + /// "unicode_spoofing" + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = "unicode_spoofing"; + + /// + /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("signals")] + public global::System.Collections.Generic.Dictionary? Signals { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public NewModerateModerateRequestPolicieUnicodeSpoofing( + bool flag, + double? threshold, + global::System.Collections.Generic.Dictionary? signals, + string id = "unicode_spoofing") + { + this.Flag = flag; + this.Threshold = threshold; + this.Id = id; + this.Signals = signals; + } + + /// + /// Initializes a new instance of the class. + /// + public NewModerateModerateRequestPolicieUnicodeSpoofing() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static NewModerateModerateRequestPolicieUnicodeSpoofing FromFlag(bool flag) + { + return new NewModerateModerateRequestPolicieUnicodeSpoofing + { + Flag = flag, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ToxicityLabelScores.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.Json.g.cs similarity index 83% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ToxicityLabelScores.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.Json.g.cs index c4cf2b9..565773a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1ToxicityLabelScores.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationTextResponseVariant1ToxicityLabelScores + public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofingSignals { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores; + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1ToxicityLabelScores; + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.g.cs similarity index 56% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.g.cs index 56af8a3..b1bbddd 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioRequestMetadata.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals.g.cs @@ -4,9 +4,9 @@ namespace ModerationAPI { /// - /// Any metadata you want to store with the content + /// Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. /// - public sealed partial class ModerationAudioRequestMetadata + public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofingSignals { /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2.Json.g.cs new file mode 100644 index 0000000..d15c9a0 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofingSignals2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2.g.cs new file mode 100644 index 0000000..be97552 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUnicodeSpoofingSignals2.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateRequestPolicieUnicodeSpoofingSignals2 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("flag")] + public bool? Flag { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public NewModerateModerateRequestPolicieUnicodeSpoofingSignals2( + bool? flag) + { + this.Flag = flag; + } + + /// + /// Initializes a new instance of the class. + /// + public NewModerateModerateRequestPolicieUnicodeSpoofingSignals2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponse.g.cs index a70764a..3637256 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponse.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponse.g.cs @@ -35,6 +35,12 @@ public sealed partial class NewModerateModerateResponse [global::System.Text.Json.Serialization.JsonRequired] public required global::ModerationAPI.NewModerateModerateResponseRecommendation Recommendation { get; set; } + /// + /// What your casebook — the record of your past moderation decisions — found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in `recommendation`, where a higher-priority rule may have settled the item first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("casebook")] + public global::ModerationAPI.NewModerateModerateResponseCasebook? Casebook { get; set; } + /// /// Results of all policies in the channel. Sorted by highest probability. /// @@ -92,6 +98,9 @@ public sealed partial class NewModerateModerateResponse /// /// The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. /// + /// + /// What your casebook — the record of your past moderation decisions — found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in `recommendation`, where a higher-priority rule may have settled the item first. + /// /// /// Policies that had errors /// @@ -106,12 +115,14 @@ public NewModerateModerateResponse( global::System.Collections.Generic.IList> insights, global::ModerationAPI.NewModerateModerateResponseMeta meta, global::ModerationAPI.NewModerateModerateResponseAuthor? author, + global::ModerationAPI.NewModerateModerateResponseCasebook? casebook, global::System.Collections.Generic.IList? errors) { this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); this.Author = author; this.Evaluation = evaluation ?? throw new global::System.ArgumentNullException(nameof(evaluation)); this.Recommendation = recommendation ?? throw new global::System.ArgumentNullException(nameof(recommendation)); + this.Casebook = casebook; this.Policies = policies ?? throw new global::System.ArgumentNullException(nameof(policies)); this.Insights = insights ?? throw new global::System.ArgumentNullException(nameof(insights)); this.Meta = meta ?? throw new global::System.ArgumentNullException(nameof(meta)); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Phone.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebook.Json.g.cs similarity index 86% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Phone.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebook.Json.g.cs index e83b5cb..07354c7 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Phone.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebook.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationTextResponseVariant1Phone + public sealed partial class NewModerateModerateResponseCasebook { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationTextResponseVariant1Phone? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseCasebook? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Phone), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Phone; + typeof(global::ModerationAPI.NewModerateModerateResponseCasebook), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseCasebook; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationTextResponseVariant1Phone? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseCasebook? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationTextResponseVariant1Phone? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseCasebook? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Phone), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Phone; + typeof(global::ModerationAPI.NewModerateModerateResponseCasebook), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseCasebook; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebook.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebook.g.cs new file mode 100644 index 0000000..d9e6b49 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebook.g.cs @@ -0,0 +1,107 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateResponseCasebook + { + /// + /// The ruling your past decisions point to for this content. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("verdict")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.NewModerateModerateResponseCasebookVerdictJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.NewModerateModerateResponseCasebookVerdict Verdict { get; set; } + + /// + /// How close the nearest matching case is, from 0 to 1. 1 means the content is identical to something you have already decided. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("similarity")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Similarity { get; set; } + + /// + /// How unanimous the matching cases are, from 0 to 1: the share of them that decided this way, ignoring how many there are. Always at least 0.8 when a ruling is returned — below that the casebook reports a disagreement instead of picking a side — so it tells you how clean the consensus was, and is not a threshold to re-apply yourself. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agreement")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Agreement { get; set; } + + /// + /// How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled by how much evidence backs it, so a handful of close, recent cases outweighs one distant one. Older cases count for less, halving in weight roughly every 180 days. This is the number to use in rules when you want a strength condition. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("confidence")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Confidence { get; set; } + + /// + /// How many of your past cases backed this ruling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("case_count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double CaseCount { get; set; } + + /// + /// The topic the closest matching case is filed under, or null when it has not been grouped into one yet. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("topic")] + public global::ModerationAPI.NewModerateModerateResponseCasebookTopic? Topic { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ruling your past decisions point to for this content. + /// + /// + /// How close the nearest matching case is, from 0 to 1. 1 means the content is identical to something you have already decided. + /// + /// + /// How unanimous the matching cases are, from 0 to 1: the share of them that decided this way, ignoring how many there are. Always at least 0.8 when a ruling is returned — below that the casebook reports a disagreement instead of picking a side — so it tells you how clean the consensus was, and is not a threshold to re-apply yourself. + /// + /// + /// How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled by how much evidence backs it, so a handful of close, recent cases outweighs one distant one. Older cases count for less, halving in weight roughly every 180 days. This is the number to use in rules when you want a strength condition. + /// + /// + /// How many of your past cases backed this ruling. + /// + /// + /// The topic the closest matching case is filed under, or null when it has not been grouped into one yet. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public NewModerateModerateResponseCasebook( + global::ModerationAPI.NewModerateModerateResponseCasebookVerdict verdict, + double similarity, + double agreement, + double confidence, + double caseCount, + global::ModerationAPI.NewModerateModerateResponseCasebookTopic? topic) + { + this.Verdict = verdict; + this.Similarity = similarity; + this.Agreement = agreement; + this.Confidence = confidence; + this.CaseCount = caseCount; + this.Topic = topic; + } + + /// + /// Initializes a new instance of the class. + /// + public NewModerateModerateResponseCasebook() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Wordlist.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookTopic.Json.g.cs similarity index 85% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Wordlist.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookTopic.Json.g.cs index 15bdabf..186768c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectResponseVariant1Wordlist.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookTopic.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationObjectResponseVariant1Wordlist + public sealed partial class NewModerateModerateResponseCasebookTopic { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Wordlist? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseCasebookTopic? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Wordlist), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectResponseVariant1Wordlist; + typeof(global::ModerationAPI.NewModerateModerateResponseCasebookTopic), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseCasebookTopic; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectResponseVariant1Wordlist? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseCasebookTopic? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationObjectResponseVariant1Wordlist? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseCasebookTopic? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationObjectResponseVariant1Wordlist), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectResponseVariant1Wordlist; + typeof(global::ModerationAPI.NewModerateModerateResponseCasebookTopic), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseCasebookTopic; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorTrustLevel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookTopic.g.cs similarity index 51% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorTrustLevel.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookTopic.g.cs index 164d27a..7f6d2ad 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseAuthorTrustLevel.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookTopic.g.cs @@ -6,21 +6,21 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationAudioResponseAuthorTrustLevel + public sealed partial class NewModerateModerateResponseCasebookTopic { /// - /// Author trust level (-1, 0, 1, 2, 3, or 4) + /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("level")] + [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] - public required double Level { get; set; } + public required string Id { get; set; } /// - /// True if the trust level was set manually by a moderator + /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("manual")] + [global::System.Text.Json.Serialization.JsonPropertyName("label")] [global::System.Text.Json.Serialization.JsonRequired] - public required bool Manual { get; set; } + public required string Label { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,29 +29,25 @@ public sealed partial class ModerationAudioResponseAuthorTrustLevel public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// Author trust level (-1, 0, 1, 2, 3, or 4) - /// - /// - /// True if the trust level was set manually by a moderator - /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationAudioResponseAuthorTrustLevel( - double level, - bool manual) + public NewModerateModerateResponseCasebookTopic( + string id, + string label) { - this.Level = level; - this.Manual = manual; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationAudioResponseAuthorTrustLevel() + public NewModerateModerateResponseCasebookTopic() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookVerdict.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookVerdict.g.cs new file mode 100644 index 0000000..e3676a7 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseCasebookVerdict.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// The ruling your past decisions point to for this content. + /// + public enum NewModerateModerateResponseCasebookVerdict + { + /// + /// + /// + Allow, + /// + /// + /// + Reject, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class NewModerateModerateResponseCasebookVerdictExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this NewModerateModerateResponseCasebookVerdict value) + { + return value switch + { + NewModerateModerateResponseCasebookVerdict.Allow => "allow", + NewModerateModerateResponseCasebookVerdict.Reject => "reject", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static NewModerateModerateResponseCasebookVerdict? ToEnum(string value) + { + return value switch + { + "allow" => NewModerateModerateResponseCasebookVerdict.Allow, + "reject" => NewModerateModerateResponseCasebookVerdict.Reject, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContent.g.cs index d3b8654..30c1f7e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContent.g.cs @@ -22,6 +22,13 @@ public sealed partial class NewModerateModerateResponseContent [global::System.Text.Json.Serialization.JsonRequired] public required bool Masked { get; set; } + /// + /// Whether Unicode spoofing normalization rewrote the content — confusables folded to their Latin lookalikes, invisible characters and combining-mark abuse stripped. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("unicode_cleaned")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool UnicodeCleaned { get; set; } + /// /// The modified content, if any. /// @@ -49,6 +56,9 @@ public sealed partial class NewModerateModerateResponseContent /// /// Whether any values have been masked. /// + /// + /// Whether Unicode spoofing normalization rewrote the content — confusables folded to their Latin lookalikes, invisible characters and combining-mark abuse stripped. + /// /// /// The modified content, if any. /// @@ -61,11 +71,13 @@ public sealed partial class NewModerateModerateResponseContent public NewModerateModerateResponseContent( string id, bool masked, + bool unicodeCleaned, global::ModerationAPI.AnyOf>>? modified, string? transcript) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.Masked = masked; + this.UnicodeCleaned = unicodeCleaned; this.Modified = modified; this.Transcript = transcript; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponsePolicieClassifierOutputLabel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponsePolicieClassifierOutputLabel.g.cs index 9764c54..7a90643 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponsePolicieClassifierOutputLabel.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponsePolicieClassifierOutputLabel.g.cs @@ -29,6 +29,12 @@ public sealed partial class NewModerateModerateResponsePolicieClassifierOutputLa [global::System.Text.Json.Serialization.JsonRequired] public required bool Flagged { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("shadowFlagged")] + public bool? ShadowFlagged { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -41,17 +47,20 @@ public sealed partial class NewModerateModerateResponsePolicieClassifierOutputLa /// /// /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateResponsePolicieClassifierOutputLabel( string id, double probability, - bool flagged) + bool flagged, + bool? shadowFlagged) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.Probability = probability; this.Flagged = flagged; + this.ShadowFlagged = shadowFlagged; } /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendation.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendation.g.cs index 44fba3e..46c5c3d 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendation.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendation.g.cs @@ -17,11 +17,11 @@ public sealed partial class NewModerateModerateResponseRecommendation public required global::ModerationAPI.NewModerateModerateResponseRecommendationAction Action { get; set; } /// - /// The reason code for the recommendation. Can be used to display a reason to the user. + /// Reason codes for the recommendation. Standard codes plus a `rule:<key>` code identifying the rule that produced the action. Can be used to display a reason to the user. /// [global::System.Text.Json.Serialization.JsonPropertyName("reason_codes")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList ReasonCodes { get; set; } + public required global::System.Collections.Generic.IList> ReasonCodes { get; set; } /// /// Rules that matched during evaluation, if rules engine is active. @@ -42,7 +42,7 @@ public sealed partial class NewModerateModerateResponseRecommendation /// The action to take based on the recommendation /// /// - /// The reason code for the recommendation. Can be used to display a reason to the user. + /// Reason codes for the recommendation. Standard codes plus a `rule:<key>` code identifying the rule that produced the action. Can be used to display a reason to the user. /// /// /// Rules that matched during evaluation, if rules engine is active. @@ -52,7 +52,7 @@ public sealed partial class NewModerateModerateResponseRecommendation #endif public NewModerateModerateResponseRecommendation( global::ModerationAPI.NewModerateModerateResponseRecommendationAction action, - global::System.Collections.Generic.IList reasonCodes, + global::System.Collections.Generic.IList> reasonCodes, global::System.Collections.Generic.IList? matchedRules) { this.Action = action; diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendationReasonCode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendationReasonCode.g.cs index 29cdf1b..9ffa7a1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendationReasonCode.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendationReasonCode.g.cs @@ -15,6 +15,10 @@ public enum NewModerateModerateResponseRecommendationReasonCode /// /// /// + CasebookMatch, + /// + /// + /// ClientOverride, /// /// @@ -63,6 +67,7 @@ public static string ToValueString(this NewModerateModerateResponseRecommendatio return value switch { NewModerateModerateResponseRecommendationReasonCode.AuthorBlock => "author_block", + NewModerateModerateResponseRecommendationReasonCode.CasebookMatch => "casebook_match", NewModerateModerateResponseRecommendationReasonCode.ClientOverride => "client_override", NewModerateModerateResponseRecommendationReasonCode.DryRun => "dry_run", NewModerateModerateResponseRecommendationReasonCode.RuleDefault => "rule_default", @@ -83,6 +88,7 @@ public static string ToValueString(this NewModerateModerateResponseRecommendatio return value switch { "author_block" => NewModerateModerateResponseRecommendationReasonCode.AuthorBlock, + "casebook_match" => NewModerateModerateResponseRecommendationReasonCode.CasebookMatch, "client_override" => NewModerateModerateResponseRecommendationReasonCode.ClientOverride, "dry_run" => NewModerateModerateResponseRecommendationReasonCode.DryRun, "rule_default" => NewModerateModerateResponseRecommendationReasonCode.RuleDefault, diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Project.Json.g.cs similarity index 88% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequest.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.Project.Json.g.cs index 24e35b0..6aa35b3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequest.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Project.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationObjectRequest + public sealed partial class Project { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequest? FromJson( + public static global::ModerationAPI.Project? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationObjectRequest), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectRequest; + typeof(global::ModerationAPI.Project), + jsonSerializerContext) as global::ModerationAPI.Project; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequest? FromJson( + public static global::ModerationAPI.Project? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationObjectRequest? FromJson( + public static global::ModerationAPI.Project? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationObjectRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectRequest; + typeof(global::ModerationAPI.Project), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.Project; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Project.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Project.g.cs new file mode 100644 index 0000000..e7d5ff2 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.Project.g.cs @@ -0,0 +1,153 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class Project + { + /// + /// The ID of the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The project's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The project's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The website or app the project moderates content for. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("domain")] + public string? Domain { get; set; } + + /// + /// What the platform is and who uses it. AI moderation reads it to judge content in context. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("context")] + public string? Context { get; set; } + + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("globalFlaggingMode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ProjectGlobalFlaggingModeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.ProjectGlobalFlaggingMode GlobalFlaggingMode { get; set; } + + /// + /// Whether moderated content is stored and shown in the dashboard. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableRequestLogging")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool EnableRequestLogging { get; set; } + + /// + /// Whether decisions made in the review queue are recorded in the project's casebook. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("casebookEnabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool CasebookEnabled { get; set; } + + /// + /// When the project was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// When the project was last changed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the project. + /// + /// + /// The project's name. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + /// + /// + /// Whether moderated content is stored and shown in the dashboard. + /// + /// + /// Whether decisions made in the review queue are recorded in the project's casebook. + /// + /// + /// When the project was created. + /// + /// + /// When the project was last changed. + /// + /// + /// The project's description. + /// + /// + /// The website or app the project moderates content for. + /// + /// + /// What the platform is and who uses it. AI moderation reads it to judge content in context. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Project( + string id, + string name, + global::ModerationAPI.ProjectGlobalFlaggingMode globalFlaggingMode, + bool enableRequestLogging, + bool casebookEnabled, + string createdAt, + string updatedAt, + string? description, + string? domain, + string? context) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Domain = domain; + this.Context = context; + this.GlobalFlaggingMode = globalFlaggingMode; + this.EnableRequestLogging = enableRequestLogging; + this.CasebookEnabled = casebookEnabled; + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.UpdatedAt = updatedAt ?? throw new global::System.ArgumentNullException(nameof(updatedAt)); + } + + /// + /// Initializes a new instance of the class. + /// + public Project() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectGlobalFlaggingMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectGlobalFlaggingMode.g.cs new file mode 100644 index 0000000..1619fd4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectGlobalFlaggingMode.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + /// + public enum ProjectGlobalFlaggingMode + { + /// + /// + /// + Active, + /// + /// + /// + DryRun, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ProjectGlobalFlaggingModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ProjectGlobalFlaggingMode value) + { + return value switch + { + ProjectGlobalFlaggingMode.Active => "ACTIVE", + ProjectGlobalFlaggingMode.DryRun => "DRY_RUN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ProjectGlobalFlaggingMode? ToEnum(string value) + { + return value switch + { + "ACTIVE" => ProjectGlobalFlaggingMode.Active, + "DRY_RUN" => ProjectGlobalFlaggingMode.DryRun, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKey.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKey.Json.g.cs new file mode 100644 index 0000000..205ce78 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class ProjectWithKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.ProjectWithKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.ProjectWithKey), + jsonSerializerContext) as global::ModerationAPI.ProjectWithKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.ProjectWithKey? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.ProjectWithKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.ProjectWithKey), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ProjectWithKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKey.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKey.g.cs new file mode 100644 index 0000000..2dfa057 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKey.g.cs @@ -0,0 +1,165 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class ProjectWithKey + { + /// + /// The ID of the project. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The project's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The project's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The website or app the project moderates content for. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("domain")] + public string? Domain { get; set; } + + /// + /// What the platform is and who uses it. AI moderation reads it to judge content in context. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("context")] + public string? Context { get; set; } + + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("globalFlaggingMode")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingModeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode GlobalFlaggingMode { get; set; } + + /// + /// Whether moderated content is stored and shown in the dashboard. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enableRequestLogging")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool EnableRequestLogging { get; set; } + + /// + /// Whether decisions made in the review queue are recorded in the project's casebook. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("casebookEnabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool CasebookEnabled { get; set; } + + /// + /// When the project was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// When the project was last changed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string UpdatedAt { get; set; } + + /// + /// A secret API key for the new project. Use it to moderate content in this project. It is also shown in the project's settings. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secretKey")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SecretKey { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the project. + /// + /// + /// The project's name. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + /// + /// + /// Whether moderated content is stored and shown in the dashboard. + /// + /// + /// Whether decisions made in the review queue are recorded in the project's casebook. + /// + /// + /// When the project was created. + /// + /// + /// When the project was last changed. + /// + /// + /// A secret API key for the new project. Use it to moderate content in this project. It is also shown in the project's settings. + /// + /// + /// The project's description. + /// + /// + /// The website or app the project moderates content for. + /// + /// + /// What the platform is and who uses it. AI moderation reads it to judge content in context. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ProjectWithKey( + string id, + string name, + global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode globalFlaggingMode, + bool enableRequestLogging, + bool casebookEnabled, + string createdAt, + string updatedAt, + string secretKey, + string? description, + string? domain, + string? context) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Domain = domain; + this.Context = context; + this.GlobalFlaggingMode = globalFlaggingMode; + this.EnableRequestLogging = enableRequestLogging; + this.CasebookEnabled = casebookEnabled; + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.UpdatedAt = updatedAt ?? throw new global::System.ArgumentNullException(nameof(updatedAt)); + this.SecretKey = secretKey ?? throw new global::System.ArgumentNullException(nameof(secretKey)); + } + + /// + /// Initializes a new instance of the class. + /// + public ProjectWithKey() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKeyGlobalFlaggingMode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKeyGlobalFlaggingMode.g.cs new file mode 100644 index 0000000..8af228d --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ProjectWithKeyGlobalFlaggingMode.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + /// + public enum ProjectWithKeyGlobalFlaggingMode + { + /// + /// + /// + Active, + /// + /// + /// + DryRun, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ProjectWithKeyGlobalFlaggingModeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ProjectWithKeyGlobalFlaggingMode value) + { + return value switch + { + ProjectWithKeyGlobalFlaggingMode.Active => "ACTIVE", + ProjectWithKeyGlobalFlaggingMode.DryRun => "DRY_RUN", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ProjectWithKeyGlobalFlaggingMode? ToEnum(string value) + { + return value switch + { + "ACTIVE" => ProjectWithKeyGlobalFlaggingMode.Active, + "DRY_RUN" => ProjectWithKeyGlobalFlaggingMode.DryRun, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.PublicQueueItemLabelsVariant1Item.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.PublicQueueItemLabelsVariant1Item.g.cs index 19877d1..03c2735 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.PublicQueueItemLabelsVariant1Item.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.PublicQueueItemLabelsVariant1Item.g.cs @@ -34,6 +34,12 @@ public sealed partial class PublicQueueItemLabelsVariant1Item [global::System.Text.Json.Serialization.JsonPropertyName("flagged")] public bool? Flagged { get; set; } + /// + /// Whether this label crossed its threshold under a shadowed policy — reported for visibility, never counted toward a flagging decision + /// + [global::System.Text.Json.Serialization.JsonPropertyName("shadow_flagged")] + public bool? ShadowFlagged { get; set; } + /// /// /// @@ -61,6 +67,9 @@ public sealed partial class PublicQueueItemLabelsVariant1Item /// /// Whether this label crossed its flagging threshold /// + /// + /// Whether this label crossed its threshold under a shadowed policy — reported for visibility, never counted toward a flagging decision + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -70,12 +79,14 @@ public PublicQueueItemLabelsVariant1Item( double score, bool? manual, bool? flagged, + bool? shadowFlagged, global::System.Collections.Generic.IList? matches) { this.Label = label ?? throw new global::System.ArgumentNullException(nameof(label)); this.Score = score; this.Manual = manual; this.Flagged = flagged; + this.ShadowFlagged = shadowFlagged; this.Matches = matches; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.PublicQueueItemLabelsVariant1ItemMatche.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.PublicQueueItemLabelsVariant1ItemMatche.g.cs index 1ad2d2b..3f8bea4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.PublicQueueItemLabelsVariant1ItemMatche.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.PublicQueueItemLabelsVariant1ItemMatche.g.cs @@ -27,7 +27,7 @@ public sealed partial class PublicQueueItemLabelsVariant1ItemMatche /// [global::System.Text.Json.Serialization.JsonPropertyName("span")] [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Span { get; set; } + public required global::System.Collections.Generic.IList Span { get; set; } /// /// @@ -53,6 +53,18 @@ public sealed partial class PublicQueueItemLabelsVariant1ItemMatche [global::System.Text.Json.Serialization.JsonPropertyName("entity_type")] public string? EntityType { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("scripts")] + public global::System.Collections.Generic.IList? Scripts { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("skeleton")] + public string? Skeleton { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -75,17 +87,21 @@ public sealed partial class PublicQueueItemLabelsVariant1ItemMatche /// /// /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public PublicQueueItemLabelsVariant1ItemMatche( string match, double probability, - byte[] span, + global::System.Collections.Generic.IList span, string? mask, global::System.Collections.Generic.IList? reasons, global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignals? signals, - string? entityType) + string? entityType, + global::System.Collections.Generic.IList? scripts, + string? skeleton) { this.Match = match ?? throw new global::System.ArgumentNullException(nameof(match)); this.Probability = probability; @@ -94,6 +110,8 @@ public PublicQueueItemLabelsVariant1ItemMatche( this.Reasons = reasons; this.Signals = signals; this.EntityType = entityType; + this.Scripts = scripts; + this.Skeleton = skeleton; } /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemActionEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemActionEvent.g.cs index ff9bc25..5553f5b 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemActionEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemActionEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.action","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_99999","key":"shadow_ban","name":"Shadow ban","value":"24h","created_at":"2026-05-08T12:36:00.000Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz791","flagged":true,"labels":[{"label":"spam/SPAM","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","client_action":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","conversation_id":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","author_id":"user-555","channel_key":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.action","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_99999","key":"shadow_ban","name":"Shadow ban","value":"24h","created_at":"2026-05-08T12:36:00.000Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz791","flagged":true,"labels":[{"label":"classifier/spam","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":null,"client_action":null,"conversation_id":null,"author_id":"user-555","channel_key":null,"meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// public sealed partial class QueueItemActionEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemAllowedEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemAllowedEvent.g.cs index f06193f..3902d67 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemAllowedEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemAllowedEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.allowed","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_11111","key":"allow","name":"Allow","value":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","created_at":"2026-05-08T12:35:10.123Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz790","flagged":false,"labels":[],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","client_action":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","conversation_id":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","author_id":"user-555","channel_key":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.allowed","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_11111","key":"allow","name":"Allow","value":null,"created_at":"2026-05-08T12:35:10.123Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz790","flagged":false,"labels":[],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":null,"client_action":null,"conversation_id":null,"author_id":"user-555","channel_key":null,"meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// public sealed partial class QueueItemAllowedEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemCompletedEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemCompletedEvent.g.cs index e533149..64c2c55 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemCompletedEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemCompletedEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.resolved","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"item":{"id":"item_xyz789","flagged":true,"labels":[{"label":"spam/SPAM","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","client_action":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","conversation_id":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","author_id":"user-555","channel_key":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"blocked","trust_level":{"level":-1,"manual":false},"block":{"until":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","reason":"Repeated spam violations"},"risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}},"queue":{"id":"que_abc123"}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.resolved","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"item":{"id":"item_xyz789","flagged":true,"labels":[{"label":"classifier/spam","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":null,"client_action":null,"conversation_id":null,"author_id":"user-555","channel_key":null,"meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"blocked","trust_level":{"level":-1,"manual":false},"block":{"until":null,"reason":"Repeated spam violations"},"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}},"queue":{"id":"que_abc123"}}}} /// public sealed partial class QueueItemCompletedEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemRejectedEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemRejectedEvent.g.cs index a760c46..145d492 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemRejectedEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueItemRejectedEvent.g.cs @@ -4,7 +4,7 @@ namespace ModerationAPI { /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.rejected","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_67890","key":"reject","name":"Reject","value":"spam","created_at":"2026-05-08T12:34:56.789Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz789","flagged":true,"labels":[{"label":"spam/SPAM","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","client_action":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","conversation_id":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","author_id":"user-555","channel_key":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.rejected","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_67890","key":"reject","name":"Reject","value":"spam","created_at":"2026-05-08T12:34:56.789Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz789","flagged":true,"labels":[{"label":"classifier/spam","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":null,"client_action":null,"conversation_id":null,"author_id":"user-555","channel_key":null,"meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// public sealed partial class QueueItemRejectedEvent { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilter.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilter.g.cs index 07f5d54..7856d2e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilter.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilter.g.cs @@ -11,14 +11,23 @@ public sealed partial class QueueViewOpenGetQueueResponseQueueFilter /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("conversationIds")] - public global::System.Collections.Generic.IList? ConversationIds { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("isFlagged")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedJsonConverter))] + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged? IsFlagged { get; set; } /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("filterLabels")] - public global::System.Collections.Generic.IList? FilterLabels { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("casebookAnswer")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerJsonConverter))] + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer? CasebookAnswer { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("casebookAgreement")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementJsonConverter))] + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement? CasebookAgreement { get; set; } /// /// @@ -26,6 +35,72 @@ public sealed partial class QueueViewOpenGetQueueResponseQueueFilter [global::System.Text.Json.Serialization.JsonPropertyName("labels")] public global::System.Collections.Generic.IList? Labels { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("filterLabels")] + public global::System.Collections.Generic.IList? FilterLabels { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metadataFilters")] + public global::System.Collections.Generic.IList? MetadataFilters { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("filteredChannelIds")] + public global::System.Collections.Generic.IList? FilteredChannelIds { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("filteredActionIds")] + public global::System.Collections.Generic.IList? FilteredActionIds { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("languages")] + public global::System.Collections.Generic.IList? Languages { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contentTypes")] + public global::System.Collections.Generic.IList? ContentTypes { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mediaTypes")] + public global::System.Collections.Generic.IList? MediaTypes { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("authorTrustLevels")] + public global::System.Collections.Generic.IList? AuthorTrustLevels { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("recommendationActions")] + public global::System.Collections.Generic.IList? RecommendationActions { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("minSeverity")] + public int? MinSeverity { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("maxSeverity")] + public int? MaxSeverity { get; set; } + /// /// /// @@ -41,8 +116,27 @@ public sealed partial class QueueViewOpenGetQueueResponseQueueFilter /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("showChecked")] - public bool? ShowChecked { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("within")] + public double? Within { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("withinUnit")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnitJsonConverter))] + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit? WithinUnit { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("clearDateWindow")] + public bool? ClearDateWindow { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("checkStatus")] + public global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus? CheckStatus { get; set; } /// /// @@ -53,20 +147,20 @@ public sealed partial class QueueViewOpenGetQueueResponseQueueFilter /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("filteredActionIds")] - public global::System.Collections.Generic.IList? FilteredActionIds { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("contentID")] + public string? ContentID { get; set; } /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("filteredChannelIds")] - public global::System.Collections.Generic.IList? FilteredChannelIds { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("conversationIds")] + public global::System.Collections.Generic.IList? ConversationIds { get; set; } /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("recommendationActions")] - public global::System.Collections.Generic.IList? RecommendationActions { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("search")] + public global::System.Collections.Generic.IList? Search { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -77,41 +171,86 @@ public sealed partial class QueueViewOpenGetQueueResponseQueueFilter /// /// Initializes a new instance of the class. /// - /// - /// + /// + /// + /// /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// /// - /// + /// + /// + /// + /// /// - /// - /// - /// + /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public QueueViewOpenGetQueueResponseQueueFilter( - global::System.Collections.Generic.IList? conversationIds, - global::System.Collections.Generic.IList? filterLabels, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged? isFlagged, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer? casebookAnswer, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement? casebookAgreement, global::System.Collections.Generic.IList? labels, + global::System.Collections.Generic.IList? filterLabels, + global::System.Collections.Generic.IList? metadataFilters, + global::System.Collections.Generic.IList? filteredChannelIds, + global::System.Collections.Generic.IList? filteredActionIds, + global::System.Collections.Generic.IList? languages, + global::System.Collections.Generic.IList? contentTypes, + global::System.Collections.Generic.IList? mediaTypes, + global::System.Collections.Generic.IList? authorTrustLevels, + global::System.Collections.Generic.IList? recommendationActions, + int? minSeverity, + int? maxSeverity, string? afterDate, string? beforeDate, - bool? showChecked, + double? within, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit? withinUnit, + bool? clearDateWindow, + global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus? checkStatus, string? authorID, - global::System.Collections.Generic.IList? filteredActionIds, - global::System.Collections.Generic.IList? filteredChannelIds, - global::System.Collections.Generic.IList? recommendationActions) + string? contentID, + global::System.Collections.Generic.IList? conversationIds, + global::System.Collections.Generic.IList? search) { - this.ConversationIds = conversationIds; - this.FilterLabels = filterLabels; + this.IsFlagged = isFlagged; + this.CasebookAnswer = casebookAnswer; + this.CasebookAgreement = casebookAgreement; this.Labels = labels; + this.FilterLabels = filterLabels; + this.MetadataFilters = metadataFilters; + this.FilteredChannelIds = filteredChannelIds; + this.FilteredActionIds = filteredActionIds; + this.Languages = languages; + this.ContentTypes = contentTypes; + this.MediaTypes = mediaTypes; + this.AuthorTrustLevels = authorTrustLevels; + this.RecommendationActions = recommendationActions; + this.MinSeverity = minSeverity; + this.MaxSeverity = maxSeverity; this.AfterDate = afterDate; this.BeforeDate = beforeDate; - this.ShowChecked = showChecked; + this.Within = within; + this.WithinUnit = withinUnit; + this.ClearDateWindow = clearDateWindow; + this.CheckStatus = checkStatus; this.AuthorID = authorID; - this.FilteredActionIds = filteredActionIds; - this.FilteredChannelIds = filteredChannelIds; - this.RecommendationActions = recommendationActions; + this.ContentID = contentID; + this.ConversationIds = conversationIds; + this.Search = search; } /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.g.cs new file mode 100644 index 0000000..5a7d87c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement + { + /// + /// + /// + Agreed, + /// + /// + /// + All, + /// + /// + /// + Overruled, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement value) + { + return value switch + { + QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.Agreed => "AGREED", + QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.All => "ALL", + QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.Overruled => "OVERRULED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement? ToEnum(string value) + { + return value switch + { + "AGREED" => QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.Agreed, + "ALL" => QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.All, + "OVERRULED" => QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement.Overruled, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.g.cs new file mode 100644 index 0000000..cb967f4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer + { + /// + /// + /// + All, + /// + /// + /// + Allowed, + /// + /// + /// + NoAnswer, + /// + /// + /// + Rejected, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer value) + { + return value switch + { + QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.All => "ALL", + QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.Allowed => "ALLOWED", + QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.NoAnswer => "NO_ANSWER", + QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.Rejected => "REJECTED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer? ToEnum(string value) + { + return value switch + { + "ALL" => QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.All, + "ALLOWED" => QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.Allowed, + "NO_ANSWER" => QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.NoAnswer, + "REJECTED" => QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer.Rejected, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCheckStatus.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCheckStatus.g.cs new file mode 100644 index 0000000..8ba34ab --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterCheckStatus.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum QueueViewOpenGetQueueResponseQueueFilterCheckStatus + { + /// + /// + /// + All, + /// + /// + /// + Checked, + /// + /// + /// + Unchecked, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class QueueViewOpenGetQueueResponseQueueFilterCheckStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilterCheckStatus value) + { + return value switch + { + QueueViewOpenGetQueueResponseQueueFilterCheckStatus.All => "all", + QueueViewOpenGetQueueResponseQueueFilterCheckStatus.Checked => "checked", + QueueViewOpenGetQueueResponseQueueFilterCheckStatus.Unchecked => "unchecked", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static QueueViewOpenGetQueueResponseQueueFilterCheckStatus? ToEnum(string value) + { + return value switch + { + "all" => QueueViewOpenGetQueueResponseQueueFilterCheckStatus.All, + "checked" => QueueViewOpenGetQueueResponseQueueFilterCheckStatus.Checked, + "unchecked" => QueueViewOpenGetQueueResponseQueueFilterCheckStatus.Unchecked, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterContentType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterContentType.g.cs new file mode 100644 index 0000000..5f052be --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterContentType.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum QueueViewOpenGetQueueResponseQueueFilterContentType + { + /// + /// + /// + Comment, + /// + /// + /// + Event, + /// + /// + /// + Message, + /// + /// + /// + Other, + /// + /// + /// + Post, + /// + /// + /// + Product, + /// + /// + /// + Profile, + /// + /// + /// + Review, + /// + /// + /// + Voice, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class QueueViewOpenGetQueueResponseQueueFilterContentTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilterContentType value) + { + return value switch + { + QueueViewOpenGetQueueResponseQueueFilterContentType.Comment => "comment", + QueueViewOpenGetQueueResponseQueueFilterContentType.Event => "event", + QueueViewOpenGetQueueResponseQueueFilterContentType.Message => "message", + QueueViewOpenGetQueueResponseQueueFilterContentType.Other => "other", + QueueViewOpenGetQueueResponseQueueFilterContentType.Post => "post", + QueueViewOpenGetQueueResponseQueueFilterContentType.Product => "product", + QueueViewOpenGetQueueResponseQueueFilterContentType.Profile => "profile", + QueueViewOpenGetQueueResponseQueueFilterContentType.Review => "review", + QueueViewOpenGetQueueResponseQueueFilterContentType.Voice => "voice", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static QueueViewOpenGetQueueResponseQueueFilterContentType? ToEnum(string value) + { + return value switch + { + "comment" => QueueViewOpenGetQueueResponseQueueFilterContentType.Comment, + "event" => QueueViewOpenGetQueueResponseQueueFilterContentType.Event, + "message" => QueueViewOpenGetQueueResponseQueueFilterContentType.Message, + "other" => QueueViewOpenGetQueueResponseQueueFilterContentType.Other, + "post" => QueueViewOpenGetQueueResponseQueueFilterContentType.Post, + "product" => QueueViewOpenGetQueueResponseQueueFilterContentType.Product, + "profile" => QueueViewOpenGetQueueResponseQueueFilterContentType.Profile, + "review" => QueueViewOpenGetQueueResponseQueueFilterContentType.Review, + "voice" => QueueViewOpenGetQueueResponseQueueFilterContentType.Voice, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.g.cs index d2df02f..d0bc6ce 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.g.cs @@ -15,6 +15,10 @@ public enum QueueViewOpenGetQueueResponseQueueFilterFilterLabelType /// /// /// + Matched, + /// + /// + /// NotFlagged, /// /// @@ -35,6 +39,7 @@ public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilter return value switch { QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.Flagged => "FLAGGED", + QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.Matched => "MATCHED", QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.NotFlagged => "NOT_FLAGGED", QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.Thresholds => "THRESHOLDS", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), @@ -48,6 +53,7 @@ public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilter return value switch { "FLAGGED" => QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.Flagged, + "MATCHED" => QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.Matched, "NOT_FLAGGED" => QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.NotFlagged, "THRESHOLDS" => QueueViewOpenGetQueueResponseQueueFilterFilterLabelType.Thresholds, _ => null, diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterIsFlagged.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterIsFlagged.g.cs new file mode 100644 index 0000000..5233656 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterIsFlagged.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum QueueViewOpenGetQueueResponseQueueFilterIsFlagged + { + /// + /// + /// + All, + /// + /// + /// + Flagged, + /// + /// + /// + NotFlagged, + /// + /// + /// + ShadowFlagged, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class QueueViewOpenGetQueueResponseQueueFilterIsFlaggedExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilterIsFlagged value) + { + return value switch + { + QueueViewOpenGetQueueResponseQueueFilterIsFlagged.All => "ALL", + QueueViewOpenGetQueueResponseQueueFilterIsFlagged.Flagged => "FLAGGED", + QueueViewOpenGetQueueResponseQueueFilterIsFlagged.NotFlagged => "NOT_FLAGGED", + QueueViewOpenGetQueueResponseQueueFilterIsFlagged.ShadowFlagged => "SHADOW_FLAGGED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static QueueViewOpenGetQueueResponseQueueFilterIsFlagged? ToEnum(string value) + { + return value switch + { + "ALL" => QueueViewOpenGetQueueResponseQueueFilterIsFlagged.All, + "FLAGGED" => QueueViewOpenGetQueueResponseQueueFilterIsFlagged.Flagged, + "NOT_FLAGGED" => QueueViewOpenGetQueueResponseQueueFilterIsFlagged.NotFlagged, + "SHADOW_FLAGGED" => QueueViewOpenGetQueueResponseQueueFilterIsFlagged.ShadowFlagged, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMediaType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMediaType.g.cs new file mode 100644 index 0000000..597edb6 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMediaType.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum QueueViewOpenGetQueueResponseQueueFilterMediaType + { + /// + /// + /// + Audio, + /// + /// + /// + Image, + /// + /// + /// + Object, + /// + /// + /// + Text, + /// + /// + /// + Video, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class QueueViewOpenGetQueueResponseQueueFilterMediaTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilterMediaType value) + { + return value switch + { + QueueViewOpenGetQueueResponseQueueFilterMediaType.Audio => "audio", + QueueViewOpenGetQueueResponseQueueFilterMediaType.Image => "image", + QueueViewOpenGetQueueResponseQueueFilterMediaType.Object => "object", + QueueViewOpenGetQueueResponseQueueFilterMediaType.Text => "text", + QueueViewOpenGetQueueResponseQueueFilterMediaType.Video => "video", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static QueueViewOpenGetQueueResponseQueueFilterMediaType? ToEnum(string value) + { + return value switch + { + "audio" => QueueViewOpenGetQueueResponseQueueFilterMediaType.Audio, + "image" => QueueViewOpenGetQueueResponseQueueFilterMediaType.Image, + "object" => QueueViewOpenGetQueueResponseQueueFilterMediaType.Object, + "text" => QueueViewOpenGetQueueResponseQueueFilterMediaType.Text, + "video" => QueueViewOpenGetQueueResponseQueueFilterMediaType.Video, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Toxicity.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter.Json.g.cs similarity index 83% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Toxicity.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter.Json.g.cs index 727e440..e96fe58 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationTextResponseVariant1Toxicity.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationTextResponseVariant1Toxicity + public sealed partial class QueueViewOpenGetQueueResponseQueueFilterMetadataFilter { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationTextResponseVariant1Toxicity? FromJson( + public static global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Toxicity), - jsonSerializerContext) as global::ModerationAPI.ModerationTextResponseVariant1Toxicity; + typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter), + jsonSerializerContext) as global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationTextResponseVariant1Toxicity? FromJson( + public static global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationTextResponseVariant1Toxicity? FromJson( + public static global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationTextResponseVariant1Toxicity), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationTextResponseVariant1Toxicity; + typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter.g.cs new file mode 100644 index 0000000..c6b90d4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter.g.cs @@ -0,0 +1,55 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class QueueViewOpenGetQueueResponseQueueFilterMetadataFilter + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("key")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Key { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Value { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public QueueViewOpenGetQueueResponseQueueFilterMetadataFilter( + string key, + string value) + { + this.Key = key ?? throw new global::System.ArgumentNullException(nameof(key)); + this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); + } + + /// + /// Initializes a new instance of the class. + /// + public QueueViewOpenGetQueueResponseQueueFilterMetadataFilter() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterWithinUnit.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterWithinUnit.g.cs new file mode 100644 index 0000000..00980fb --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.QueueViewOpenGetQueueResponseQueueFilterWithinUnit.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum QueueViewOpenGetQueueResponseQueueFilterWithinUnit + { + /// + /// + /// + Days, + /// + /// + /// + Hours, + /// + /// + /// + Minutes, + /// + /// + /// + Months, + /// + /// + /// + Weeks, + /// + /// + /// + Years, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class QueueViewOpenGetQueueResponseQueueFilterWithinUnitExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this QueueViewOpenGetQueueResponseQueueFilterWithinUnit value) + { + return value switch + { + QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Days => "DAYS", + QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Hours => "HOURS", + QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Minutes => "MINUTES", + QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Months => "MONTHS", + QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Weeks => "WEEKS", + QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Years => "YEARS", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static QueueViewOpenGetQueueResponseQueueFilterWithinUnit? ToEnum(string value) + { + return value switch + { + "DAYS" => QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Days, + "HOURS" => QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Hours, + "MINUTES" => QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Minutes, + "MONTHS" => QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Months, + "WEEKS" => QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Weeks, + "YEARS" => QueueViewOpenGetQueueResponseQueueFilterWithinUnit.Years, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhookEvent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhookEvent.g.cs index 3e81f6a..60277ca 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhookEvent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhookEvent.g.cs @@ -15,7 +15,7 @@ namespace ModerationAPI public global::ModerationAPI.WebhookEventDiscriminatorType? Type { get; } /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.blocked","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_block_123","key":"block","name":"Block author","value":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","created_at":"2026-05-08T12:38:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"blocked","trust_level":{"level":-1,"manual":false},"block":{"until":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","reason":"Repeated spam violations"},"risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.blocked","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_block_123","key":"block","name":"Block author","value":null,"created_at":"2026-05-08T12:38:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"blocked","trust_level":{"level":-1,"manual":false},"block":{"until":null,"reason":"Repeated spam violations"},"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.AuthorBlockedEvent? AuthorBlocked { get; init; } @@ -52,7 +52,7 @@ public bool TryPickAuthorBlocked( : throw new global::System.InvalidOperationException($"Expected union variant 'AuthorBlocked' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.unblocked","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_unblock_789","key":"auto_unblock","name":"Auto unblock","value":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","created_at":"2026-05-09T12:39:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":0,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.unblocked","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_unblock_789","key":"auto_unblock","name":"Auto unblock","value":null,"created_at":"2026-05-09T12:39:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":0,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.AuthorUnblockedEvent? AuthorUnblocked { get; init; } @@ -89,7 +89,7 @@ public bool TryPickAuthorUnblocked( : throw new global::System.InvalidOperationException($"Expected union variant 'AuthorUnblocked' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.suspended","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_suspend_456","key":"suspend_24h","name":"Suspend (24h)","value":"24h","created_at":"2026-05-08T12:39:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"suspended","trust_level":{"level":0,"manual":false},"block":{"until":1746878400000,"reason":"Cooling-off period"},"risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.suspended","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_suspend_456","key":"suspend_24h","name":"Suspend (24h)","value":"24h","created_at":"2026-05-08T12:39:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"suspended","trust_level":{"level":0,"manual":false},"block":{"until":1746878400000,"reason":"Cooling-off period"},"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.AuthorSuspendedEvent? AuthorSuspended { get; init; } @@ -126,7 +126,7 @@ public bool TryPickAuthorSuspended( : throw new global::System.InvalidOperationException($"Expected union variant 'AuthorSuspended' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.updated","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.updated","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.AuthorUpdatedEvent? AuthorUpdated { get; init; } @@ -163,7 +163,7 @@ public bool TryPickAuthorUpdated( : throw new global::System.InvalidOperationException($"Expected union variant 'AuthorUpdated' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.trust_level_changed","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":3,"manual":true},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.trust_level_changed","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":3,"manual":true},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.AuthorTrustLevelChangedEvent? AuthorTrustLevelChanged { get; init; } @@ -200,7 +200,7 @@ public bool TryPickAuthorTrustLevelChanged( : throw new global::System.InvalidOperationException($"Expected union variant 'AuthorTrustLevelChanged' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.action","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_warn_111","key":"send_warning","name":"Send warning email","value":"violation_notice","created_at":"2026-05-08T12:42:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"author.action","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_warn_111","key":"send_warning","name":"Send warning email","value":"violation_notice","created_at":"2026-05-08T12:42:00.000Z","author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.AuthorActionEvent? AuthorAction { get; init; } @@ -237,7 +237,7 @@ public bool TryPickAuthorAction( : throw new global::System.InvalidOperationException($"Expected union variant 'AuthorAction' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.resolved","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"item":{"id":"item_xyz789","flagged":true,"labels":[{"label":"spam/SPAM","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","client_action":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","conversation_id":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","author_id":"user-555","channel_key":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"blocked","trust_level":{"level":-1,"manual":false},"block":{"until":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","reason":"Repeated spam violations"},"risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}},"queue":{"id":"que_abc123"}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.resolved","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"item":{"id":"item_xyz789","flagged":true,"labels":[{"label":"classifier/spam","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":null,"client_action":null,"conversation_id":null,"author_id":"user-555","channel_key":null,"meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"blocked","trust_level":{"level":-1,"manual":false},"block":{"until":null,"reason":"Repeated spam violations"},"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}},"queue":{"id":"que_abc123"}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.QueueItemCompletedEvent? QueueItemResolved { get; init; } @@ -274,7 +274,7 @@ public bool TryPickQueueItemResolved( : throw new global::System.InvalidOperationException($"Expected union variant 'QueueItemResolved' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.action","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_99999","key":"shadow_ban","name":"Shadow ban","value":"24h","created_at":"2026-05-08T12:36:00.000Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz791","flagged":true,"labels":[{"label":"spam/SPAM","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","client_action":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","conversation_id":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","author_id":"user-555","channel_key":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.action","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_99999","key":"shadow_ban","name":"Shadow ban","value":"24h","created_at":"2026-05-08T12:36:00.000Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz791","flagged":true,"labels":[{"label":"classifier/spam","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":null,"client_action":null,"conversation_id":null,"author_id":"user-555","channel_key":null,"meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.QueueItemActionEvent? QueueItemAction { get; init; } @@ -311,7 +311,7 @@ public bool TryPickQueueItemAction( : throw new global::System.InvalidOperationException($"Expected union variant 'QueueItemAction' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.rejected","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_67890","key":"reject","name":"Reject","value":"spam","created_at":"2026-05-08T12:34:56.789Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz789","flagged":true,"labels":[{"label":"spam/SPAM","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","client_action":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","conversation_id":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","author_id":"user-555","channel_key":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.rejected","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_67890","key":"reject","name":"Reject","value":"spam","created_at":"2026-05-08T12:34:56.789Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz789","flagged":true,"labels":[{"label":"classifier/spam","score":0.94,"flagged":true,"manual":false}],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":null,"client_action":null,"conversation_id":null,"author_id":"user-555","channel_key":null,"meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.QueueItemRejectedEvent? QueueItemRejected { get; init; } @@ -348,7 +348,7 @@ public bool TryPickQueueItemRejected( : throw new global::System.InvalidOperationException($"Expected union variant 'QueueItemRejected' but the value was {ToString()}."); /// - /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.allowed","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_11111","key":"allow","name":"Allow","value":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","created_at":"2026-05-08T12:35:10.123Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz790","flagged":false,"labels":[],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","client_action":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","conversation_id":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","author_id":"user-555","channel_key":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","external_link":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","name":"Jane Doe","email":"jane@example.com","company":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","first_seen":1746792000000,"last_seen":1746792000000,"last_incident":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","status":"enabled","trust_level":{"level":1,"manual":false},"block":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","risk_evaluation":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464","metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} + /// Example: {"id":"evt_clx9f2k0a0001abcd1234","type":"queue_item.allowed","api_version":"v2","created":"2026-05-08T12:34:56.789Z","data":{"object":{"id":"act_11111","key":"allow","name":"Allow","value":null,"created_at":"2026-05-08T12:35:10.123Z","queue":{"id":"que_abc123"},"item":{"id":"item_xyz790","flagged":false,"labels":[],"flagged_fields":[],"language":"en","content":{"type":"text","text":"Buy crypto now!"},"timestamp":"2026-05-08T12:34:56.789Z","metadata":null,"client_action":null,"conversation_id":null,"author_id":"user-555","channel_key":null,"meta_type":"comment"},"author":{"id":"auth_555","external_id":"user-555","profile_picture":null,"external_link":null,"name":"Jane Doe","email":"jane@example.com","company":null,"first_seen":1746792000000,"last_seen":1746792000000,"last_incident":null,"status":"enabled","trust_level":{"level":1,"manual":false},"block":null,"risk_evaluation":null,"metrics":{"total_content":42,"flagged_content":7,"average_sentiment":-0.1},"metadata":{}}}}} /// #if NET6_0_OR_GREATER public global::ModerationAPI.QueueItemAllowedEvent? QueueItemAllowed { get; init; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequest.Json.g.cs new file mode 100644 index 0000000..c4ae504 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class WebhooksPublicCreateRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.WebhooksPublicCreateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.WebhooksPublicCreateRequest), + jsonSerializerContext) as global::ModerationAPI.WebhooksPublicCreateRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.WebhooksPublicCreateRequest? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.WebhooksPublicCreateRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.WebhooksPublicCreateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.WebhooksPublicCreateRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequest.g.cs new file mode 100644 index 0000000..1e03d36 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequest.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class WebhooksPublicCreateRequest + { + /// + /// The webhook's name, used to identify it in the dashboard + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The webhook's description + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The webhook's URL. We'll call this URL when an event occurs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// Event types this webhook subscribes to. One webhook URL receives all events you list here. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("eventTypes")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList EventTypes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The webhook's name, used to identify it in the dashboard + /// + /// + /// The webhook's URL. We'll call this URL when an event occurs. + /// + /// + /// Event types this webhook subscribes to. One webhook URL receives all events you list here. + /// + /// + /// The webhook's description + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WebhooksPublicCreateRequest( + string name, + string url, + global::System.Collections.Generic.IList eventTypes, + string? description) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.EventTypes = eventTypes ?? throw new global::System.ArgumentNullException(nameof(eventTypes)); + } + + /// + /// Initializes a new instance of the class. + /// + public WebhooksPublicCreateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequestEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequestEventType.g.cs new file mode 100644 index 0000000..c2a3995 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateRequestEventType.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum WebhooksPublicCreateRequestEventType + { + /// + /// + /// + AuthorAction, + /// + /// + /// + AuthorBlocked, + /// + /// + /// + AuthorSuspended, + /// + /// + /// + AuthorTrustLevelChanged, + /// + /// + /// + AuthorUnblocked, + /// + /// + /// + AuthorUpdated, + /// + /// + /// + QueueItemAction, + /// + /// + /// + QueueItemAllowed, + /// + /// + /// + QueueItemCompleted, + /// + /// + /// + QueueItemNew, + /// + /// + /// + QueueItemRejected, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicCreateRequestEventTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicCreateRequestEventType value) + { + return value switch + { + WebhooksPublicCreateRequestEventType.AuthorAction => "AUTHOR_ACTION", + WebhooksPublicCreateRequestEventType.AuthorBlocked => "AUTHOR_BLOCKED", + WebhooksPublicCreateRequestEventType.AuthorSuspended => "AUTHOR_SUSPENDED", + WebhooksPublicCreateRequestEventType.AuthorTrustLevelChanged => "AUTHOR_TRUST_LEVEL_CHANGED", + WebhooksPublicCreateRequestEventType.AuthorUnblocked => "AUTHOR_UNBLOCKED", + WebhooksPublicCreateRequestEventType.AuthorUpdated => "AUTHOR_UPDATED", + WebhooksPublicCreateRequestEventType.QueueItemAction => "QUEUE_ITEM_ACTION", + WebhooksPublicCreateRequestEventType.QueueItemAllowed => "QUEUE_ITEM_ALLOWED", + WebhooksPublicCreateRequestEventType.QueueItemCompleted => "QUEUE_ITEM_COMPLETED", + WebhooksPublicCreateRequestEventType.QueueItemNew => "QUEUE_ITEM_NEW", + WebhooksPublicCreateRequestEventType.QueueItemRejected => "QUEUE_ITEM_REJECTED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicCreateRequestEventType? ToEnum(string value) + { + return value switch + { + "AUTHOR_ACTION" => WebhooksPublicCreateRequestEventType.AuthorAction, + "AUTHOR_BLOCKED" => WebhooksPublicCreateRequestEventType.AuthorBlocked, + "AUTHOR_SUSPENDED" => WebhooksPublicCreateRequestEventType.AuthorSuspended, + "AUTHOR_TRUST_LEVEL_CHANGED" => WebhooksPublicCreateRequestEventType.AuthorTrustLevelChanged, + "AUTHOR_UNBLOCKED" => WebhooksPublicCreateRequestEventType.AuthorUnblocked, + "AUTHOR_UPDATED" => WebhooksPublicCreateRequestEventType.AuthorUpdated, + "QUEUE_ITEM_ACTION" => WebhooksPublicCreateRequestEventType.QueueItemAction, + "QUEUE_ITEM_ALLOWED" => WebhooksPublicCreateRequestEventType.QueueItemAllowed, + "QUEUE_ITEM_COMPLETED" => WebhooksPublicCreateRequestEventType.QueueItemCompleted, + "QUEUE_ITEM_NEW" => WebhooksPublicCreateRequestEventType.QueueItemNew, + "QUEUE_ITEM_REJECTED" => WebhooksPublicCreateRequestEventType.QueueItemRejected, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValue.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponse.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValue.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponse.Json.g.cs index 6a95dce..0a00894 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationObjectRequestValue.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationObjectRequestValue + public sealed partial class WebhooksPublicCreateResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequestValue? FromJson( + public static global::ModerationAPI.WebhooksPublicCreateResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationObjectRequestValue), - jsonSerializerContext) as global::ModerationAPI.ModerationObjectRequestValue; + typeof(global::ModerationAPI.WebhooksPublicCreateResponse), + jsonSerializerContext) as global::ModerationAPI.WebhooksPublicCreateResponse; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationObjectRequestValue? FromJson( + public static global::ModerationAPI.WebhooksPublicCreateResponse? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationObjectRequestValue? FromJson( + public static global::ModerationAPI.WebhooksPublicCreateResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationObjectRequestValue), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationObjectRequestValue; + typeof(global::ModerationAPI.WebhooksPublicCreateResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.WebhooksPublicCreateResponse; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponse.g.cs new file mode 100644 index 0000000..7e02600 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class WebhooksPublicCreateResponse + { + /// + /// The ID of the webhook. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The webhook's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The webhook's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The URL we call when a subscribed event occurs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.
+ /// Default Value: [] + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("eventTypes")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList EventTypes { get; set; } + + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("payloadVersion")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersionJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion PayloadVersion { get; set; } + + /// + /// The date the webhook was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the webhook. + /// + /// + /// The webhook's name. + /// + /// + /// The URL we call when a subscribed event occurs. + /// + /// + /// Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.
+ /// Default Value: [] + /// + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + /// + /// The date the webhook was created. + /// + /// + /// The webhook's description. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WebhooksPublicCreateResponse( + string id, + string name, + string url, + global::System.Collections.Generic.IList eventTypes, + global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion payloadVersion, + string createdAt, + string? description) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.EventTypes = eventTypes ?? throw new global::System.ArgumentNullException(nameof(eventTypes)); + this.PayloadVersion = payloadVersion; + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + } + + /// + /// Initializes a new instance of the class. + /// + public WebhooksPublicCreateResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponseEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponseEventType.g.cs new file mode 100644 index 0000000..e0a562c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponseEventType.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum WebhooksPublicCreateResponseEventType + { + /// + /// + /// + AuthorAction, + /// + /// + /// + AuthorBlocked, + /// + /// + /// + AuthorSuspended, + /// + /// + /// + AuthorTrustLevelChanged, + /// + /// + /// + AuthorUnblocked, + /// + /// + /// + AuthorUpdated, + /// + /// + /// + QueueItemAction, + /// + /// + /// + QueueItemAllowed, + /// + /// + /// + QueueItemCompleted, + /// + /// + /// + QueueItemNew, + /// + /// + /// + QueueItemRejected, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicCreateResponseEventTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicCreateResponseEventType value) + { + return value switch + { + WebhooksPublicCreateResponseEventType.AuthorAction => "AUTHOR_ACTION", + WebhooksPublicCreateResponseEventType.AuthorBlocked => "AUTHOR_BLOCKED", + WebhooksPublicCreateResponseEventType.AuthorSuspended => "AUTHOR_SUSPENDED", + WebhooksPublicCreateResponseEventType.AuthorTrustLevelChanged => "AUTHOR_TRUST_LEVEL_CHANGED", + WebhooksPublicCreateResponseEventType.AuthorUnblocked => "AUTHOR_UNBLOCKED", + WebhooksPublicCreateResponseEventType.AuthorUpdated => "AUTHOR_UPDATED", + WebhooksPublicCreateResponseEventType.QueueItemAction => "QUEUE_ITEM_ACTION", + WebhooksPublicCreateResponseEventType.QueueItemAllowed => "QUEUE_ITEM_ALLOWED", + WebhooksPublicCreateResponseEventType.QueueItemCompleted => "QUEUE_ITEM_COMPLETED", + WebhooksPublicCreateResponseEventType.QueueItemNew => "QUEUE_ITEM_NEW", + WebhooksPublicCreateResponseEventType.QueueItemRejected => "QUEUE_ITEM_REJECTED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicCreateResponseEventType? ToEnum(string value) + { + return value switch + { + "AUTHOR_ACTION" => WebhooksPublicCreateResponseEventType.AuthorAction, + "AUTHOR_BLOCKED" => WebhooksPublicCreateResponseEventType.AuthorBlocked, + "AUTHOR_SUSPENDED" => WebhooksPublicCreateResponseEventType.AuthorSuspended, + "AUTHOR_TRUST_LEVEL_CHANGED" => WebhooksPublicCreateResponseEventType.AuthorTrustLevelChanged, + "AUTHOR_UNBLOCKED" => WebhooksPublicCreateResponseEventType.AuthorUnblocked, + "AUTHOR_UPDATED" => WebhooksPublicCreateResponseEventType.AuthorUpdated, + "QUEUE_ITEM_ACTION" => WebhooksPublicCreateResponseEventType.QueueItemAction, + "QUEUE_ITEM_ALLOWED" => WebhooksPublicCreateResponseEventType.QueueItemAllowed, + "QUEUE_ITEM_COMPLETED" => WebhooksPublicCreateResponseEventType.QueueItemCompleted, + "QUEUE_ITEM_NEW" => WebhooksPublicCreateResponseEventType.QueueItemNew, + "QUEUE_ITEM_REJECTED" => WebhooksPublicCreateResponseEventType.QueueItemRejected, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponsePayloadVersion.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponsePayloadVersion.g.cs new file mode 100644 index 0000000..f8b073f --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicCreateResponsePayloadVersion.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + public enum WebhooksPublicCreateResponsePayloadVersion + { + /// + /// + /// + V1, + /// + /// + /// + V2, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicCreateResponsePayloadVersionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicCreateResponsePayloadVersion value) + { + return value switch + { + WebhooksPublicCreateResponsePayloadVersion.V1 => "V1", + WebhooksPublicCreateResponsePayloadVersion.V2 => "V2", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicCreateResponsePayloadVersion? ToEnum(string value) + { + return value switch + { + "V1" => WebhooksPublicCreateResponsePayloadVersion.V1, + "V2" => WebhooksPublicCreateResponsePayloadVersion.V2, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseError.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicDeleteResponse.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseError.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicDeleteResponse.Json.g.cs index db50136..a83f2a1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseError.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicDeleteResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationAudioResponseError + public sealed partial class WebhooksPublicDeleteResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioResponseError? FromJson( + public static global::ModerationAPI.WebhooksPublicDeleteResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationAudioResponseError), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioResponseError; + typeof(global::ModerationAPI.WebhooksPublicDeleteResponse), + jsonSerializerContext) as global::ModerationAPI.WebhooksPublicDeleteResponse; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioResponseError? FromJson( + public static global::ModerationAPI.WebhooksPublicDeleteResponse? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationAudioResponseError? FromJson( + public static global::ModerationAPI.WebhooksPublicDeleteResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationAudioResponseError), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioResponseError; + typeof(global::ModerationAPI.WebhooksPublicDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.WebhooksPublicDeleteResponse; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorTrustLevel.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicDeleteResponse.g.cs similarity index 53% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorTrustLevel.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicDeleteResponse.g.cs index fe43f96..b6a3380 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationImageResponseAuthorTrustLevel.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicDeleteResponse.g.cs @@ -6,21 +6,21 @@ namespace ModerationAPI /// /// /// - public sealed partial class ModerationImageResponseAuthorTrustLevel + public sealed partial class WebhooksPublicDeleteResponse { /// - /// Author trust level (-1, 0, 1, 2, 3, or 4) + /// Whether the webhook was deleted. /// - [global::System.Text.Json.Serialization.JsonPropertyName("level")] + [global::System.Text.Json.Serialization.JsonPropertyName("deleted")] [global::System.Text.Json.Serialization.JsonRequired] - public required double Level { get; set; } + public required bool Deleted { get; set; } /// - /// True if the trust level was set manually by a moderator + /// The ID of the webhook. /// - [global::System.Text.Json.Serialization.JsonPropertyName("manual")] + [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] - public required bool Manual { get; set; } + public required string Id { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,29 +29,29 @@ public sealed partial class ModerationImageResponseAuthorTrustLevel public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// Author trust level (-1, 0, 1, 2, 3, or 4) + /// + /// Whether the webhook was deleted. /// - /// - /// True if the trust level was set manually by a moderator + /// + /// The ID of the webhook. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ModerationImageResponseAuthorTrustLevel( - double level, - bool manual) + public WebhooksPublicDeleteResponse( + bool deleted, + string id) { - this.Level = level; - this.Manual = manual; + this.Deleted = deleted; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ModerationImageResponseAuthorTrustLevel() + public WebhooksPublicDeleteResponse() { } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponse.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponse.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponse.Json.g.cs index 94025c8..4ba6c52 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponse.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationAudioResponse + public sealed partial class WebhooksPublicGetResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioResponse? FromJson( + public static global::ModerationAPI.WebhooksPublicGetResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationAudioResponse), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioResponse; + typeof(global::ModerationAPI.WebhooksPublicGetResponse), + jsonSerializerContext) as global::ModerationAPI.WebhooksPublicGetResponse; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioResponse? FromJson( + public static global::ModerationAPI.WebhooksPublicGetResponse? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationAudioResponse? FromJson( + public static global::ModerationAPI.WebhooksPublicGetResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationAudioResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioResponse; + typeof(global::ModerationAPI.WebhooksPublicGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.WebhooksPublicGetResponse; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponse.g.cs new file mode 100644 index 0000000..dfc6a17 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class WebhooksPublicGetResponse + { + /// + /// The ID of the webhook. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The webhook's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The webhook's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The URL we call when a subscribed event occurs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.
+ /// Default Value: [] + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("eventTypes")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList EventTypes { get; set; } + + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("payloadVersion")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersionJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion PayloadVersion { get; set; } + + /// + /// The date the webhook was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the webhook. + /// + /// + /// The webhook's name. + /// + /// + /// The URL we call when a subscribed event occurs. + /// + /// + /// Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.
+ /// Default Value: [] + /// + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + /// + /// The date the webhook was created. + /// + /// + /// The webhook's description. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WebhooksPublicGetResponse( + string id, + string name, + string url, + global::System.Collections.Generic.IList eventTypes, + global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion payloadVersion, + string createdAt, + string? description) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.EventTypes = eventTypes ?? throw new global::System.ArgumentNullException(nameof(eventTypes)); + this.PayloadVersion = payloadVersion; + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + } + + /// + /// Initializes a new instance of the class. + /// + public WebhooksPublicGetResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponseEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponseEventType.g.cs new file mode 100644 index 0000000..7ccbb94 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponseEventType.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum WebhooksPublicGetResponseEventType + { + /// + /// + /// + AuthorAction, + /// + /// + /// + AuthorBlocked, + /// + /// + /// + AuthorSuspended, + /// + /// + /// + AuthorTrustLevelChanged, + /// + /// + /// + AuthorUnblocked, + /// + /// + /// + AuthorUpdated, + /// + /// + /// + QueueItemAction, + /// + /// + /// + QueueItemAllowed, + /// + /// + /// + QueueItemCompleted, + /// + /// + /// + QueueItemNew, + /// + /// + /// + QueueItemRejected, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicGetResponseEventTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicGetResponseEventType value) + { + return value switch + { + WebhooksPublicGetResponseEventType.AuthorAction => "AUTHOR_ACTION", + WebhooksPublicGetResponseEventType.AuthorBlocked => "AUTHOR_BLOCKED", + WebhooksPublicGetResponseEventType.AuthorSuspended => "AUTHOR_SUSPENDED", + WebhooksPublicGetResponseEventType.AuthorTrustLevelChanged => "AUTHOR_TRUST_LEVEL_CHANGED", + WebhooksPublicGetResponseEventType.AuthorUnblocked => "AUTHOR_UNBLOCKED", + WebhooksPublicGetResponseEventType.AuthorUpdated => "AUTHOR_UPDATED", + WebhooksPublicGetResponseEventType.QueueItemAction => "QUEUE_ITEM_ACTION", + WebhooksPublicGetResponseEventType.QueueItemAllowed => "QUEUE_ITEM_ALLOWED", + WebhooksPublicGetResponseEventType.QueueItemCompleted => "QUEUE_ITEM_COMPLETED", + WebhooksPublicGetResponseEventType.QueueItemNew => "QUEUE_ITEM_NEW", + WebhooksPublicGetResponseEventType.QueueItemRejected => "QUEUE_ITEM_REJECTED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicGetResponseEventType? ToEnum(string value) + { + return value switch + { + "AUTHOR_ACTION" => WebhooksPublicGetResponseEventType.AuthorAction, + "AUTHOR_BLOCKED" => WebhooksPublicGetResponseEventType.AuthorBlocked, + "AUTHOR_SUSPENDED" => WebhooksPublicGetResponseEventType.AuthorSuspended, + "AUTHOR_TRUST_LEVEL_CHANGED" => WebhooksPublicGetResponseEventType.AuthorTrustLevelChanged, + "AUTHOR_UNBLOCKED" => WebhooksPublicGetResponseEventType.AuthorUnblocked, + "AUTHOR_UPDATED" => WebhooksPublicGetResponseEventType.AuthorUpdated, + "QUEUE_ITEM_ACTION" => WebhooksPublicGetResponseEventType.QueueItemAction, + "QUEUE_ITEM_ALLOWED" => WebhooksPublicGetResponseEventType.QueueItemAllowed, + "QUEUE_ITEM_COMPLETED" => WebhooksPublicGetResponseEventType.QueueItemCompleted, + "QUEUE_ITEM_NEW" => WebhooksPublicGetResponseEventType.QueueItemNew, + "QUEUE_ITEM_REJECTED" => WebhooksPublicGetResponseEventType.QueueItemRejected, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponsePayloadVersion.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponsePayloadVersion.g.cs new file mode 100644 index 0000000..2b5f42c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetResponsePayloadVersion.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + public enum WebhooksPublicGetResponsePayloadVersion + { + /// + /// + /// + V1, + /// + /// + /// + V2, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicGetResponsePayloadVersionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicGetResponsePayloadVersion value) + { + return value switch + { + WebhooksPublicGetResponsePayloadVersion.V1 => "V1", + WebhooksPublicGetResponsePayloadVersion.V2 => "V2", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicGetResponsePayloadVersion? ToEnum(string value) + { + return value switch + { + "V1" => WebhooksPublicGetResponsePayloadVersion.V1, + "V2" => WebhooksPublicGetResponsePayloadVersion.V2, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetSecretResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetSecretResponse.Json.g.cs new file mode 100644 index 0000000..84e0cba --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetSecretResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class WebhooksPublicGetSecretResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.WebhooksPublicGetSecretResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.WebhooksPublicGetSecretResponse), + jsonSerializerContext) as global::ModerationAPI.WebhooksPublicGetSecretResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.WebhooksPublicGetSecretResponse? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.WebhooksPublicGetSecretResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.WebhooksPublicGetSecretResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.WebhooksPublicGetSecretResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetSecretResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetSecretResponse.g.cs new file mode 100644 index 0000000..2d3dc27 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicGetSecretResponse.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class WebhooksPublicGetSecretResponse + { + /// + /// The signing secret for this project. Every webhook delivery is signed with HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` header. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("secret")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Secret { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The signing secret for this project. Every webhook delivery is signed with HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` header. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WebhooksPublicGetSecretResponse( + string secret) + { + this.Secret = secret ?? throw new global::System.ArgumentNullException(nameof(secret)); + } + + /// + /// Initializes a new instance of the class. + /// + public WebhooksPublicGetSecretResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItem.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseRequest.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItem.Json.g.cs index ee1e880..1c18af3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.ModerationAudioResponseRequest.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItem.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class ModerationAudioResponseRequest + public sealed partial class WebhooksPublicListResponseItem { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioResponseRequest? FromJson( + public static global::ModerationAPI.WebhooksPublicListResponseItem? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.ModerationAudioResponseRequest), - jsonSerializerContext) as global::ModerationAPI.ModerationAudioResponseRequest; + typeof(global::ModerationAPI.WebhooksPublicListResponseItem), + jsonSerializerContext) as global::ModerationAPI.WebhooksPublicListResponseItem; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.ModerationAudioResponseRequest? FromJson( + public static global::ModerationAPI.WebhooksPublicListResponseItem? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.ModerationAudioResponseRequest? FromJson( + public static global::ModerationAPI.WebhooksPublicListResponseItem? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.ModerationAudioResponseRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.ModerationAudioResponseRequest; + typeof(global::ModerationAPI.WebhooksPublicListResponseItem), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.WebhooksPublicListResponseItem; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItem.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItem.g.cs new file mode 100644 index 0000000..00e92da --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItem.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class WebhooksPublicListResponseItem + { + /// + /// The ID of the webhook. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The webhook's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The webhook's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The URL we call when a subscribed event occurs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.
+ /// Default Value: [] + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("eventTypes")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList EventTypes { get; set; } + + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("payloadVersion")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersionJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion PayloadVersion { get; set; } + + /// + /// The date the webhook was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the webhook. + /// + /// + /// The webhook's name. + /// + /// + /// The URL we call when a subscribed event occurs. + /// + /// + /// Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.
+ /// Default Value: [] + /// + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + /// + /// The date the webhook was created. + /// + /// + /// The webhook's description. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WebhooksPublicListResponseItem( + string id, + string name, + string url, + global::System.Collections.Generic.IList eventTypes, + global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion payloadVersion, + string createdAt, + string? description) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.EventTypes = eventTypes ?? throw new global::System.ArgumentNullException(nameof(eventTypes)); + this.PayloadVersion = payloadVersion; + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + } + + /// + /// Initializes a new instance of the class. + /// + public WebhooksPublicListResponseItem() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItemEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItemEventType.g.cs new file mode 100644 index 0000000..df972fb --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItemEventType.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum WebhooksPublicListResponseItemEventType + { + /// + /// + /// + AuthorAction, + /// + /// + /// + AuthorBlocked, + /// + /// + /// + AuthorSuspended, + /// + /// + /// + AuthorTrustLevelChanged, + /// + /// + /// + AuthorUnblocked, + /// + /// + /// + AuthorUpdated, + /// + /// + /// + QueueItemAction, + /// + /// + /// + QueueItemAllowed, + /// + /// + /// + QueueItemCompleted, + /// + /// + /// + QueueItemNew, + /// + /// + /// + QueueItemRejected, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicListResponseItemEventTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicListResponseItemEventType value) + { + return value switch + { + WebhooksPublicListResponseItemEventType.AuthorAction => "AUTHOR_ACTION", + WebhooksPublicListResponseItemEventType.AuthorBlocked => "AUTHOR_BLOCKED", + WebhooksPublicListResponseItemEventType.AuthorSuspended => "AUTHOR_SUSPENDED", + WebhooksPublicListResponseItemEventType.AuthorTrustLevelChanged => "AUTHOR_TRUST_LEVEL_CHANGED", + WebhooksPublicListResponseItemEventType.AuthorUnblocked => "AUTHOR_UNBLOCKED", + WebhooksPublicListResponseItemEventType.AuthorUpdated => "AUTHOR_UPDATED", + WebhooksPublicListResponseItemEventType.QueueItemAction => "QUEUE_ITEM_ACTION", + WebhooksPublicListResponseItemEventType.QueueItemAllowed => "QUEUE_ITEM_ALLOWED", + WebhooksPublicListResponseItemEventType.QueueItemCompleted => "QUEUE_ITEM_COMPLETED", + WebhooksPublicListResponseItemEventType.QueueItemNew => "QUEUE_ITEM_NEW", + WebhooksPublicListResponseItemEventType.QueueItemRejected => "QUEUE_ITEM_REJECTED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicListResponseItemEventType? ToEnum(string value) + { + return value switch + { + "AUTHOR_ACTION" => WebhooksPublicListResponseItemEventType.AuthorAction, + "AUTHOR_BLOCKED" => WebhooksPublicListResponseItemEventType.AuthorBlocked, + "AUTHOR_SUSPENDED" => WebhooksPublicListResponseItemEventType.AuthorSuspended, + "AUTHOR_TRUST_LEVEL_CHANGED" => WebhooksPublicListResponseItemEventType.AuthorTrustLevelChanged, + "AUTHOR_UNBLOCKED" => WebhooksPublicListResponseItemEventType.AuthorUnblocked, + "AUTHOR_UPDATED" => WebhooksPublicListResponseItemEventType.AuthorUpdated, + "QUEUE_ITEM_ACTION" => WebhooksPublicListResponseItemEventType.QueueItemAction, + "QUEUE_ITEM_ALLOWED" => WebhooksPublicListResponseItemEventType.QueueItemAllowed, + "QUEUE_ITEM_COMPLETED" => WebhooksPublicListResponseItemEventType.QueueItemCompleted, + "QUEUE_ITEM_NEW" => WebhooksPublicListResponseItemEventType.QueueItemNew, + "QUEUE_ITEM_REJECTED" => WebhooksPublicListResponseItemEventType.QueueItemRejected, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItemPayloadVersion.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItemPayloadVersion.g.cs new file mode 100644 index 0000000..bc65854 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicListResponseItemPayloadVersion.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + public enum WebhooksPublicListResponseItemPayloadVersion + { + /// + /// + /// + V1, + /// + /// + /// + V2, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicListResponseItemPayloadVersionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicListResponseItemPayloadVersion value) + { + return value switch + { + WebhooksPublicListResponseItemPayloadVersion.V1 => "V1", + WebhooksPublicListResponseItemPayloadVersion.V2 => "V2", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicListResponseItemPayloadVersion? ToEnum(string value) + { + return value switch + { + "V1" => WebhooksPublicListResponseItemPayloadVersion.V1, + "V2" => WebhooksPublicListResponseItemPayloadVersion.V2, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequest.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequest.Json.g.cs new file mode 100644 index 0000000..8ca7749 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class WebhooksPublicUpdateRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.WebhooksPublicUpdateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.WebhooksPublicUpdateRequest), + jsonSerializerContext) as global::ModerationAPI.WebhooksPublicUpdateRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.WebhooksPublicUpdateRequest? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.WebhooksPublicUpdateRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.WebhooksPublicUpdateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.WebhooksPublicUpdateRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequest.g.cs new file mode 100644 index 0000000..5187f38 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequest.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class WebhooksPublicUpdateRequest + { + /// + /// The webhook's name, used to identify it in the dashboard + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The webhook's description + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The webhook's URL. We'll call this URL when an event occurs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// Event types this webhook subscribes to. One webhook URL receives all events you list here. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("eventTypes")] + public global::System.Collections.Generic.IList? EventTypes { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The webhook's name, used to identify it in the dashboard + /// + /// + /// The webhook's description + /// + /// + /// The webhook's URL. We'll call this URL when an event occurs. + /// + /// + /// Event types this webhook subscribes to. One webhook URL receives all events you list here. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WebhooksPublicUpdateRequest( + string? name, + string? description, + string? url, + global::System.Collections.Generic.IList? eventTypes) + { + this.Name = name; + this.Description = description; + this.Url = url; + this.EventTypes = eventTypes; + } + + /// + /// Initializes a new instance of the class. + /// + public WebhooksPublicUpdateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequestEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequestEventType.g.cs new file mode 100644 index 0000000..5f8816e --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateRequestEventType.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum WebhooksPublicUpdateRequestEventType + { + /// + /// + /// + AuthorAction, + /// + /// + /// + AuthorBlocked, + /// + /// + /// + AuthorSuspended, + /// + /// + /// + AuthorTrustLevelChanged, + /// + /// + /// + AuthorUnblocked, + /// + /// + /// + AuthorUpdated, + /// + /// + /// + QueueItemAction, + /// + /// + /// + QueueItemAllowed, + /// + /// + /// + QueueItemCompleted, + /// + /// + /// + QueueItemNew, + /// + /// + /// + QueueItemRejected, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicUpdateRequestEventTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicUpdateRequestEventType value) + { + return value switch + { + WebhooksPublicUpdateRequestEventType.AuthorAction => "AUTHOR_ACTION", + WebhooksPublicUpdateRequestEventType.AuthorBlocked => "AUTHOR_BLOCKED", + WebhooksPublicUpdateRequestEventType.AuthorSuspended => "AUTHOR_SUSPENDED", + WebhooksPublicUpdateRequestEventType.AuthorTrustLevelChanged => "AUTHOR_TRUST_LEVEL_CHANGED", + WebhooksPublicUpdateRequestEventType.AuthorUnblocked => "AUTHOR_UNBLOCKED", + WebhooksPublicUpdateRequestEventType.AuthorUpdated => "AUTHOR_UPDATED", + WebhooksPublicUpdateRequestEventType.QueueItemAction => "QUEUE_ITEM_ACTION", + WebhooksPublicUpdateRequestEventType.QueueItemAllowed => "QUEUE_ITEM_ALLOWED", + WebhooksPublicUpdateRequestEventType.QueueItemCompleted => "QUEUE_ITEM_COMPLETED", + WebhooksPublicUpdateRequestEventType.QueueItemNew => "QUEUE_ITEM_NEW", + WebhooksPublicUpdateRequestEventType.QueueItemRejected => "QUEUE_ITEM_REJECTED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicUpdateRequestEventType? ToEnum(string value) + { + return value switch + { + "AUTHOR_ACTION" => WebhooksPublicUpdateRequestEventType.AuthorAction, + "AUTHOR_BLOCKED" => WebhooksPublicUpdateRequestEventType.AuthorBlocked, + "AUTHOR_SUSPENDED" => WebhooksPublicUpdateRequestEventType.AuthorSuspended, + "AUTHOR_TRUST_LEVEL_CHANGED" => WebhooksPublicUpdateRequestEventType.AuthorTrustLevelChanged, + "AUTHOR_UNBLOCKED" => WebhooksPublicUpdateRequestEventType.AuthorUnblocked, + "AUTHOR_UPDATED" => WebhooksPublicUpdateRequestEventType.AuthorUpdated, + "QUEUE_ITEM_ACTION" => WebhooksPublicUpdateRequestEventType.QueueItemAction, + "QUEUE_ITEM_ALLOWED" => WebhooksPublicUpdateRequestEventType.QueueItemAllowed, + "QUEUE_ITEM_COMPLETED" => WebhooksPublicUpdateRequestEventType.QueueItemCompleted, + "QUEUE_ITEM_NEW" => WebhooksPublicUpdateRequestEventType.QueueItemNew, + "QUEUE_ITEM_REJECTED" => WebhooksPublicUpdateRequestEventType.QueueItemRejected, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponse.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponse.Json.g.cs new file mode 100644 index 0000000..42ad5a2 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class WebhooksPublicUpdateResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.WebhooksPublicUpdateResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.WebhooksPublicUpdateResponse), + jsonSerializerContext) as global::ModerationAPI.WebhooksPublicUpdateResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::ModerationAPI.WebhooksPublicUpdateResponse? FromJson( + string json) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::ModerationAPI.WebhooksPublicUpdateResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::ModerationAPI.WebhooksPublicUpdateResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.WebhooksPublicUpdateResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::ModerationAPI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponse.g.cs new file mode 100644 index 0000000..5df74a0 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class WebhooksPublicUpdateResponse + { + /// + /// The ID of the webhook. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The webhook's name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The webhook's description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The URL we call when a subscribed event occurs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.
+ /// Default Value: [] + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("eventTypes")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList EventTypes { get; set; } + + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("payloadVersion")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersionJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion PayloadVersion { get; set; } + + /// + /// The date the webhook was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The ID of the webhook. + /// + /// + /// The webhook's name. + /// + /// + /// The URL we call when a subscribed event occurs. + /// + /// + /// Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.
+ /// Default Value: [] + /// + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + /// + /// The date the webhook was created. + /// + /// + /// The webhook's description. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WebhooksPublicUpdateResponse( + string id, + string name, + string url, + global::System.Collections.Generic.IList eventTypes, + global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion payloadVersion, + string createdAt, + string? description) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.EventTypes = eventTypes ?? throw new global::System.ArgumentNullException(nameof(eventTypes)); + this.PayloadVersion = payloadVersion; + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + } + + /// + /// Initializes a new instance of the class. + /// + public WebhooksPublicUpdateResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponseEventType.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponseEventType.g.cs new file mode 100644 index 0000000..7f408d8 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponseEventType.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public enum WebhooksPublicUpdateResponseEventType + { + /// + /// + /// + AuthorAction, + /// + /// + /// + AuthorBlocked, + /// + /// + /// + AuthorSuspended, + /// + /// + /// + AuthorTrustLevelChanged, + /// + /// + /// + AuthorUnblocked, + /// + /// + /// + AuthorUpdated, + /// + /// + /// + QueueItemAction, + /// + /// + /// + QueueItemAllowed, + /// + /// + /// + QueueItemCompleted, + /// + /// + /// + QueueItemNew, + /// + /// + /// + QueueItemRejected, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicUpdateResponseEventTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicUpdateResponseEventType value) + { + return value switch + { + WebhooksPublicUpdateResponseEventType.AuthorAction => "AUTHOR_ACTION", + WebhooksPublicUpdateResponseEventType.AuthorBlocked => "AUTHOR_BLOCKED", + WebhooksPublicUpdateResponseEventType.AuthorSuspended => "AUTHOR_SUSPENDED", + WebhooksPublicUpdateResponseEventType.AuthorTrustLevelChanged => "AUTHOR_TRUST_LEVEL_CHANGED", + WebhooksPublicUpdateResponseEventType.AuthorUnblocked => "AUTHOR_UNBLOCKED", + WebhooksPublicUpdateResponseEventType.AuthorUpdated => "AUTHOR_UPDATED", + WebhooksPublicUpdateResponseEventType.QueueItemAction => "QUEUE_ITEM_ACTION", + WebhooksPublicUpdateResponseEventType.QueueItemAllowed => "QUEUE_ITEM_ALLOWED", + WebhooksPublicUpdateResponseEventType.QueueItemCompleted => "QUEUE_ITEM_COMPLETED", + WebhooksPublicUpdateResponseEventType.QueueItemNew => "QUEUE_ITEM_NEW", + WebhooksPublicUpdateResponseEventType.QueueItemRejected => "QUEUE_ITEM_REJECTED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicUpdateResponseEventType? ToEnum(string value) + { + return value switch + { + "AUTHOR_ACTION" => WebhooksPublicUpdateResponseEventType.AuthorAction, + "AUTHOR_BLOCKED" => WebhooksPublicUpdateResponseEventType.AuthorBlocked, + "AUTHOR_SUSPENDED" => WebhooksPublicUpdateResponseEventType.AuthorSuspended, + "AUTHOR_TRUST_LEVEL_CHANGED" => WebhooksPublicUpdateResponseEventType.AuthorTrustLevelChanged, + "AUTHOR_UNBLOCKED" => WebhooksPublicUpdateResponseEventType.AuthorUnblocked, + "AUTHOR_UPDATED" => WebhooksPublicUpdateResponseEventType.AuthorUpdated, + "QUEUE_ITEM_ACTION" => WebhooksPublicUpdateResponseEventType.QueueItemAction, + "QUEUE_ITEM_ALLOWED" => WebhooksPublicUpdateResponseEventType.QueueItemAllowed, + "QUEUE_ITEM_COMPLETED" => WebhooksPublicUpdateResponseEventType.QueueItemCompleted, + "QUEUE_ITEM_NEW" => WebhooksPublicUpdateResponseEventType.QueueItemNew, + "QUEUE_ITEM_REJECTED" => WebhooksPublicUpdateResponseEventType.QueueItemRejected, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponsePayloadVersion.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponsePayloadVersion.g.cs new file mode 100644 index 0000000..321633b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.WebhooksPublicUpdateResponsePayloadVersion.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + /// + public enum WebhooksPublicUpdateResponsePayloadVersion + { + /// + /// + /// + V1, + /// + /// + /// + V2, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WebhooksPublicUpdateResponsePayloadVersionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WebhooksPublicUpdateResponsePayloadVersion value) + { + return value switch + { + WebhooksPublicUpdateResponsePayloadVersion.V1 => "V1", + WebhooksPublicUpdateResponsePayloadVersion.V2 => "V2", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WebhooksPublicUpdateResponsePayloadVersion? ToEnum(string value) + { + return value switch + { + "V1" => WebhooksPublicUpdateResponsePayloadVersion.V1, + "V2" => WebhooksPublicUpdateResponsePayloadVersion.V2, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs index 231a424..ac338b5 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs @@ -657,7 +657,7 @@ partial void ProcessNewModerateModerateResponseContent( object? metadata = default, global::ModerationAPI.NewModerateModerateRequestClientAction? clientAction = default, bool? doNotStore = default, - global::System.Collections.Generic.IList>? policies = default, + global::System.Collections.Generic.IList>? policies = default, global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.g.cs index 2b7e5ba..d188568 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.g.cs @@ -80,6 +80,26 @@ public sealed partial class ModerationAPIClient : global::ModerationAPI.IModerat AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public ChannelsClient Channels => new ChannelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + + /// + /// + /// + public ProjectsClient Projects => new ProjectsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -100,6 +120,16 @@ public sealed partial class ModerationAPIClient : global::ModerationAPI.IModerat AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public WebhooksClient Webhooks => new WebhooksClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.29.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.31.Json.g.cs similarity index 90% rename from src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.29.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.31.Json.g.cs index 718eee6..63bf7e2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.29.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.31.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public readonly partial struct OneOf + public readonly partial struct OneOf { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.OneOf? FromJson( + public static global::ModerationAPI.OneOf? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.OneOf), - jsonSerializerContext) as global::ModerationAPI.OneOf?; + typeof(global::ModerationAPI.OneOf), + jsonSerializerContext) as global::ModerationAPI.OneOf?; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::ModerationAPI.OneOf? FromJson( + public static global::ModerationAPI.OneOf? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::ModerationAPI.OneOf? FromJson( + public static global::ModerationAPI.OneOf? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize>( + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::ModerationAPI.OneOf), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.OneOf?; + typeof(global::ModerationAPI.OneOf), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.OneOf?; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::ModerationAPI.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.29.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.31.g.cs similarity index 70% rename from src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.29.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.31.g.cs index 26f7564..dea4d3b 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.29.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.31.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public readonly partial struct OneOf : global::System.IEquatable> + public readonly partial struct OneOf : global::System.IEquatable> { /// /// @@ -1080,15 +1080,89 @@ public bool TryPickValue29( public T29 PickValue29() => Value29 is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'Value29' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T30? Value30 { get; init; } +#else + public T30? Value30 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value30))] +#endif + public bool IsValue30 => Value30 != null; + + /// + /// + /// + public bool TryPickValue30( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T30? value) + { + value = Value30; + return IsValue30; + } + + /// + /// + /// + public T30 PickValue30() => Value30 is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Value30' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T31? Value31 { get; init; } +#else + public T31? Value31 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value31))] +#endif + public bool IsValue31 => Value31 != null; + + /// + /// + /// + public bool TryPickValue31( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T31? value) + { + value = Value31; + return IsValue31; + } + + /// + /// + /// + public T31 PickValue31() => Value31 is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Value31' but the value was {ToString()}."); /// /// /// - public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); + public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); /// /// /// - public static implicit operator T1?(OneOf @this) => @this.Value1; + public static implicit operator T1?(OneOf @this) => @this.Value1; /// /// @@ -1101,17 +1175,17 @@ public OneOf(T1? value) /// /// /// - public static OneOf FromValue1(T1? value) => new OneOf(value); + public static OneOf FromValue1(T1? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T2 value) => new OneOf((T2?)value); + public static implicit operator OneOf(T2 value) => new OneOf((T2?)value); /// /// /// - public static implicit operator T2?(OneOf @this) => @this.Value2; + public static implicit operator T2?(OneOf @this) => @this.Value2; /// /// @@ -1124,17 +1198,17 @@ public OneOf(T2? value) /// /// /// - public static OneOf FromValue2(T2? value) => new OneOf(value); + public static OneOf FromValue2(T2? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T3 value) => new OneOf((T3?)value); + public static implicit operator OneOf(T3 value) => new OneOf((T3?)value); /// /// /// - public static implicit operator T3?(OneOf @this) => @this.Value3; + public static implicit operator T3?(OneOf @this) => @this.Value3; /// /// @@ -1147,17 +1221,17 @@ public OneOf(T3? value) /// /// /// - public static OneOf FromValue3(T3? value) => new OneOf(value); + public static OneOf FromValue3(T3? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T4 value) => new OneOf((T4?)value); + public static implicit operator OneOf(T4 value) => new OneOf((T4?)value); /// /// /// - public static implicit operator T4?(OneOf @this) => @this.Value4; + public static implicit operator T4?(OneOf @this) => @this.Value4; /// /// @@ -1170,17 +1244,17 @@ public OneOf(T4? value) /// /// /// - public static OneOf FromValue4(T4? value) => new OneOf(value); + public static OneOf FromValue4(T4? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T5 value) => new OneOf((T5?)value); + public static implicit operator OneOf(T5 value) => new OneOf((T5?)value); /// /// /// - public static implicit operator T5?(OneOf @this) => @this.Value5; + public static implicit operator T5?(OneOf @this) => @this.Value5; /// /// @@ -1193,17 +1267,17 @@ public OneOf(T5? value) /// /// /// - public static OneOf FromValue5(T5? value) => new OneOf(value); + public static OneOf FromValue5(T5? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T6 value) => new OneOf((T6?)value); + public static implicit operator OneOf(T6 value) => new OneOf((T6?)value); /// /// /// - public static implicit operator T6?(OneOf @this) => @this.Value6; + public static implicit operator T6?(OneOf @this) => @this.Value6; /// /// @@ -1216,17 +1290,17 @@ public OneOf(T6? value) /// /// /// - public static OneOf FromValue6(T6? value) => new OneOf(value); + public static OneOf FromValue6(T6? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T7 value) => new OneOf((T7?)value); + public static implicit operator OneOf(T7 value) => new OneOf((T7?)value); /// /// /// - public static implicit operator T7?(OneOf @this) => @this.Value7; + public static implicit operator T7?(OneOf @this) => @this.Value7; /// /// @@ -1239,17 +1313,17 @@ public OneOf(T7? value) /// /// /// - public static OneOf FromValue7(T7? value) => new OneOf(value); + public static OneOf FromValue7(T7? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T8 value) => new OneOf((T8?)value); + public static implicit operator OneOf(T8 value) => new OneOf((T8?)value); /// /// /// - public static implicit operator T8?(OneOf @this) => @this.Value8; + public static implicit operator T8?(OneOf @this) => @this.Value8; /// /// @@ -1262,17 +1336,17 @@ public OneOf(T8? value) /// /// /// - public static OneOf FromValue8(T8? value) => new OneOf(value); + public static OneOf FromValue8(T8? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T9 value) => new OneOf((T9?)value); + public static implicit operator OneOf(T9 value) => new OneOf((T9?)value); /// /// /// - public static implicit operator T9?(OneOf @this) => @this.Value9; + public static implicit operator T9?(OneOf @this) => @this.Value9; /// /// @@ -1285,17 +1359,17 @@ public OneOf(T9? value) /// /// /// - public static OneOf FromValue9(T9? value) => new OneOf(value); + public static OneOf FromValue9(T9? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T10 value) => new OneOf((T10?)value); + public static implicit operator OneOf(T10 value) => new OneOf((T10?)value); /// /// /// - public static implicit operator T10?(OneOf @this) => @this.Value10; + public static implicit operator T10?(OneOf @this) => @this.Value10; /// /// @@ -1308,17 +1382,17 @@ public OneOf(T10? value) /// /// /// - public static OneOf FromValue10(T10? value) => new OneOf(value); + public static OneOf FromValue10(T10? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T11 value) => new OneOf((T11?)value); + public static implicit operator OneOf(T11 value) => new OneOf((T11?)value); /// /// /// - public static implicit operator T11?(OneOf @this) => @this.Value11; + public static implicit operator T11?(OneOf @this) => @this.Value11; /// /// @@ -1331,17 +1405,17 @@ public OneOf(T11? value) /// /// /// - public static OneOf FromValue11(T11? value) => new OneOf(value); + public static OneOf FromValue11(T11? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T12 value) => new OneOf((T12?)value); + public static implicit operator OneOf(T12 value) => new OneOf((T12?)value); /// /// /// - public static implicit operator T12?(OneOf @this) => @this.Value12; + public static implicit operator T12?(OneOf @this) => @this.Value12; /// /// @@ -1354,17 +1428,17 @@ public OneOf(T12? value) /// /// /// - public static OneOf FromValue12(T12? value) => new OneOf(value); + public static OneOf FromValue12(T12? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T13 value) => new OneOf((T13?)value); + public static implicit operator OneOf(T13 value) => new OneOf((T13?)value); /// /// /// - public static implicit operator T13?(OneOf @this) => @this.Value13; + public static implicit operator T13?(OneOf @this) => @this.Value13; /// /// @@ -1377,17 +1451,17 @@ public OneOf(T13? value) /// /// /// - public static OneOf FromValue13(T13? value) => new OneOf(value); + public static OneOf FromValue13(T13? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T14 value) => new OneOf((T14?)value); + public static implicit operator OneOf(T14 value) => new OneOf((T14?)value); /// /// /// - public static implicit operator T14?(OneOf @this) => @this.Value14; + public static implicit operator T14?(OneOf @this) => @this.Value14; /// /// @@ -1400,17 +1474,17 @@ public OneOf(T14? value) /// /// /// - public static OneOf FromValue14(T14? value) => new OneOf(value); + public static OneOf FromValue14(T14? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T15 value) => new OneOf((T15?)value); + public static implicit operator OneOf(T15 value) => new OneOf((T15?)value); /// /// /// - public static implicit operator T15?(OneOf @this) => @this.Value15; + public static implicit operator T15?(OneOf @this) => @this.Value15; /// /// @@ -1423,17 +1497,17 @@ public OneOf(T15? value) /// /// /// - public static OneOf FromValue15(T15? value) => new OneOf(value); + public static OneOf FromValue15(T15? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T16 value) => new OneOf((T16?)value); + public static implicit operator OneOf(T16 value) => new OneOf((T16?)value); /// /// /// - public static implicit operator T16?(OneOf @this) => @this.Value16; + public static implicit operator T16?(OneOf @this) => @this.Value16; /// /// @@ -1446,17 +1520,17 @@ public OneOf(T16? value) /// /// /// - public static OneOf FromValue16(T16? value) => new OneOf(value); + public static OneOf FromValue16(T16? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T17 value) => new OneOf((T17?)value); + public static implicit operator OneOf(T17 value) => new OneOf((T17?)value); /// /// /// - public static implicit operator T17?(OneOf @this) => @this.Value17; + public static implicit operator T17?(OneOf @this) => @this.Value17; /// /// @@ -1469,17 +1543,17 @@ public OneOf(T17? value) /// /// /// - public static OneOf FromValue17(T17? value) => new OneOf(value); + public static OneOf FromValue17(T17? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T18 value) => new OneOf((T18?)value); + public static implicit operator OneOf(T18 value) => new OneOf((T18?)value); /// /// /// - public static implicit operator T18?(OneOf @this) => @this.Value18; + public static implicit operator T18?(OneOf @this) => @this.Value18; /// /// @@ -1492,17 +1566,17 @@ public OneOf(T18? value) /// /// /// - public static OneOf FromValue18(T18? value) => new OneOf(value); + public static OneOf FromValue18(T18? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T19 value) => new OneOf((T19?)value); + public static implicit operator OneOf(T19 value) => new OneOf((T19?)value); /// /// /// - public static implicit operator T19?(OneOf @this) => @this.Value19; + public static implicit operator T19?(OneOf @this) => @this.Value19; /// /// @@ -1515,17 +1589,17 @@ public OneOf(T19? value) /// /// /// - public static OneOf FromValue19(T19? value) => new OneOf(value); + public static OneOf FromValue19(T19? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T20 value) => new OneOf((T20?)value); + public static implicit operator OneOf(T20 value) => new OneOf((T20?)value); /// /// /// - public static implicit operator T20?(OneOf @this) => @this.Value20; + public static implicit operator T20?(OneOf @this) => @this.Value20; /// /// @@ -1538,17 +1612,17 @@ public OneOf(T20? value) /// /// /// - public static OneOf FromValue20(T20? value) => new OneOf(value); + public static OneOf FromValue20(T20? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T21 value) => new OneOf((T21?)value); + public static implicit operator OneOf(T21 value) => new OneOf((T21?)value); /// /// /// - public static implicit operator T21?(OneOf @this) => @this.Value21; + public static implicit operator T21?(OneOf @this) => @this.Value21; /// /// @@ -1561,17 +1635,17 @@ public OneOf(T21? value) /// /// /// - public static OneOf FromValue21(T21? value) => new OneOf(value); + public static OneOf FromValue21(T21? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T22 value) => new OneOf((T22?)value); + public static implicit operator OneOf(T22 value) => new OneOf((T22?)value); /// /// /// - public static implicit operator T22?(OneOf @this) => @this.Value22; + public static implicit operator T22?(OneOf @this) => @this.Value22; /// /// @@ -1584,17 +1658,17 @@ public OneOf(T22? value) /// /// /// - public static OneOf FromValue22(T22? value) => new OneOf(value); + public static OneOf FromValue22(T22? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T23 value) => new OneOf((T23?)value); + public static implicit operator OneOf(T23 value) => new OneOf((T23?)value); /// /// /// - public static implicit operator T23?(OneOf @this) => @this.Value23; + public static implicit operator T23?(OneOf @this) => @this.Value23; /// /// @@ -1607,17 +1681,17 @@ public OneOf(T23? value) /// /// /// - public static OneOf FromValue23(T23? value) => new OneOf(value); + public static OneOf FromValue23(T23? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T24 value) => new OneOf((T24?)value); + public static implicit operator OneOf(T24 value) => new OneOf((T24?)value); /// /// /// - public static implicit operator T24?(OneOf @this) => @this.Value24; + public static implicit operator T24?(OneOf @this) => @this.Value24; /// /// @@ -1630,17 +1704,17 @@ public OneOf(T24? value) /// /// /// - public static OneOf FromValue24(T24? value) => new OneOf(value); + public static OneOf FromValue24(T24? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T25 value) => new OneOf((T25?)value); + public static implicit operator OneOf(T25 value) => new OneOf((T25?)value); /// /// /// - public static implicit operator T25?(OneOf @this) => @this.Value25; + public static implicit operator T25?(OneOf @this) => @this.Value25; /// /// @@ -1653,17 +1727,17 @@ public OneOf(T25? value) /// /// /// - public static OneOf FromValue25(T25? value) => new OneOf(value); + public static OneOf FromValue25(T25? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T26 value) => new OneOf((T26?)value); + public static implicit operator OneOf(T26 value) => new OneOf((T26?)value); /// /// /// - public static implicit operator T26?(OneOf @this) => @this.Value26; + public static implicit operator T26?(OneOf @this) => @this.Value26; /// /// @@ -1676,17 +1750,17 @@ public OneOf(T26? value) /// /// /// - public static OneOf FromValue26(T26? value) => new OneOf(value); + public static OneOf FromValue26(T26? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T27 value) => new OneOf((T27?)value); + public static implicit operator OneOf(T27 value) => new OneOf((T27?)value); /// /// /// - public static implicit operator T27?(OneOf @this) => @this.Value27; + public static implicit operator T27?(OneOf @this) => @this.Value27; /// /// @@ -1699,17 +1773,17 @@ public OneOf(T27? value) /// /// /// - public static OneOf FromValue27(T27? value) => new OneOf(value); + public static OneOf FromValue27(T27? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T28 value) => new OneOf((T28?)value); + public static implicit operator OneOf(T28 value) => new OneOf((T28?)value); /// /// /// - public static implicit operator T28?(OneOf @this) => @this.Value28; + public static implicit operator T28?(OneOf @this) => @this.Value28; /// /// @@ -1722,17 +1796,17 @@ public OneOf(T28? value) /// /// /// - public static OneOf FromValue28(T28? value) => new OneOf(value); + public static OneOf FromValue28(T28? value) => new OneOf(value); /// /// /// - public static implicit operator OneOf(T29 value) => new OneOf((T29?)value); + public static implicit operator OneOf(T29 value) => new OneOf((T29?)value); /// /// /// - public static implicit operator T29?(OneOf @this) => @this.Value29; + public static implicit operator T29?(OneOf @this) => @this.Value29; /// /// @@ -1745,7 +1819,53 @@ public OneOf(T29? value) /// /// /// - public static OneOf FromValue29(T29? value) => new OneOf(value); + public static OneOf FromValue29(T29? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T30 value) => new OneOf((T30?)value); + + /// + /// + /// + public static implicit operator T30?(OneOf @this) => @this.Value30; + + /// + /// + /// + public OneOf(T30? value) + { + Value30 = value; + } + + /// + /// + /// + public static OneOf FromValue30(T30? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T31 value) => new OneOf((T31?)value); + + /// + /// + /// + public static implicit operator T31?(OneOf @this) => @this.Value31; + + /// + /// + /// + public OneOf(T31? value) + { + Value31 = value; + } + + /// + /// + /// + public static OneOf FromValue31(T31? value) => new OneOf(value); /// /// @@ -1779,7 +1899,9 @@ public OneOf( T26? value26, T27? value27, T28? value28, - T29? value29 + T29? value29, + T30? value30, + T31? value31 ) { Value1 = value1; @@ -1811,12 +1933,16 @@ public OneOf( Value27 = value27; Value28 = value28; Value29 = value29; + Value30 = value30; + Value31 = value31; } /// /// /// public object? Object => + Value31 as object ?? + Value30 as object ?? Value29 as object ?? Value28 as object ?? Value27 as object ?? @@ -1880,7 +2006,9 @@ Value1 as object Value26?.ToString() ?? Value27?.ToString() ?? Value28?.ToString() ?? - Value29?.ToString() + Value29?.ToString() ?? + Value30?.ToString() ?? + Value31?.ToString() ; /// @@ -1888,7 +2016,7 @@ Value1 as object /// public bool Validate() { - return IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && IsValue27 && !IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && IsValue28 && !IsValue29 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && IsValue29; + return IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && IsValue28 && !IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && IsValue29 && !IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && IsValue30 && !IsValue31 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 && !IsValue24 && !IsValue25 && !IsValue26 && !IsValue27 && !IsValue28 && !IsValue29 && !IsValue30 && IsValue31; } /// @@ -1924,6 +2052,8 @@ public bool Validate() global::System.Func? value27 = null, global::System.Func? value28 = null, global::System.Func? value29 = null, + global::System.Func? value30 = null, + global::System.Func? value31 = null, bool validate = true) { if (validate) @@ -2047,6 +2177,14 @@ public bool Validate() { return value29(__value28); } + else if (Value30 is { } __value29 && value30 != null) + { + return value30(__value29); + } + else if (Value31 is { } __value30 && value31 != null) + { + return value31(__value30); + } return default(TResult); } @@ -2112,6 +2250,10 @@ public void Match( global::System.Action? value28 = null, global::System.Action? value29 = null, + + global::System.Action? value30 = null, + + global::System.Action? value31 = null, bool validate = true) { if (validate) @@ -2235,6 +2377,14 @@ public void Match( { value29?.Invoke(__value28); } + else if (Value30 is { } __value29) + { + value30?.Invoke(__value29); + } + else if (Value31 is { } __value30) + { + value31?.Invoke(__value30); + } } /// @@ -2270,6 +2420,8 @@ public void Switch( global::System.Action? value27 = null, global::System.Action? value28 = null, global::System.Action? value29 = null, + global::System.Action? value30 = null, + global::System.Action? value31 = null, bool validate = true) { if (validate) @@ -2393,6 +2545,14 @@ public void Switch( { value29?.Invoke(__value28); } + else if (Value30 is { } __value29) + { + value30?.Invoke(__value29); + } + else if (Value31 is { } __value30) + { + value31?.Invoke(__value30); + } } /// @@ -2460,6 +2620,10 @@ public override int GetHashCode() typeof(T28), Value29, typeof(T29), + Value30, + typeof(T30), + Value31, + typeof(T31), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -2473,7 +2637,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(OneOf other) + public bool Equals(OneOf other) { return global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && @@ -2504,22 +2668,24 @@ public bool Equals(OneOf.Default.Equals(Value26, other.Value26) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Value27, other.Value27) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Value28, other.Value28) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value29, other.Value29) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value29, other.Value29) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value30, other.Value30) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value31, other.Value31) ; } /// /// /// - public static bool operator ==(OneOf obj1, OneOf obj2) + public static bool operator ==(OneOf obj1, OneOf obj2) { - return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(OneOf obj1, OneOf obj2) + public static bool operator !=(OneOf obj1, OneOf obj2) { return !(obj1 == obj2); } @@ -2529,7 +2695,7 @@ public bool Equals(OneOf public override bool Equals(object? obj) { - return obj is OneOf o && Equals(o); + return obj is OneOf o && Equals(o); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Projects.JsonSerializerContext.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Projects.JsonSerializerContext.g.cs new file mode 100644 index 0000000..bc4f88b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Projects.JsonSerializerContext.g.cs @@ -0,0 +1,214 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorBadRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorBadRequestIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorUnauthorized))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorUnauthorizedIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorForbidden))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorForbiddenIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorNotFound))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorNotFoundIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.Project))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ProjectGlobalFlaggingMode), TypeInfoPropertyName = "ProjectGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ProjectWithKey))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode), TypeInfoPropertyName = "ProjectWithKeyGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsUpdateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode), TypeInfoPropertyName = "ManagementProjectsUpdateRequestGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsDuplicateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsDeleteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ProjectGlobalFlaggingMode?), TypeInfoPropertyName = "NullableProjectGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode?), TypeInfoPropertyName = "NullableProjectWithKeyGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode?), TypeInfoPropertyName = "NullableManagementProjectsUpdateRequestGlobalFlaggingMode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class ProjectsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ProjectsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ProjectsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ProjectsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::ModerationAPI.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::ModerationAPI.ProjectGlobalFlaggingMode) + + || typeToConvert == typeof(global::ModerationAPI.ProjectGlobalFlaggingMode?) + + || typeToConvert == typeof(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode) + + || typeToConvert == typeof(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode?) + + || typeToConvert == typeof(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode) + + || typeToConvert == typeof(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::ModerationAPI.ProjectGlobalFlaggingMode)) + { + return new global::ModerationAPI.JsonConverters.ProjectGlobalFlaggingModeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ProjectGlobalFlaggingMode?)) + { + return new global::ModerationAPI.JsonConverters.ProjectGlobalFlaggingModeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode)) + { + return new global::ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingModeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ProjectWithKeyGlobalFlaggingMode?)) + { + return new global::ModerationAPI.JsonConverters.ProjectWithKeyGlobalFlaggingModeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode)) + { + return new global::ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingModeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode?)) + { + return new global::ModerationAPI.JsonConverters.ManagementProjectsUpdateRequestGlobalFlaggingModeNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ProjectsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..74adf48 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class ProjectsClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::ModerationAPI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.Constructors.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..12a8ee8 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class ProjectsClient + { + /// + + public ProjectsClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsCreate.g.cs new file mode 100644 index 0000000..8233db9 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsCreate.g.cs @@ -0,0 +1,594 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ProjectsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementProjectsCreateSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementProjectsCreateSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementProjectsCreateSecurityRequirement0, + }; + partial void PrepareManagementProjectsCreateArguments( + global::System.Net.Http.HttpClient httpClient, + global::ModerationAPI.ManagementProjectsCreateRequest request); + partial void PrepareManagementProjectsCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::ModerationAPI.ManagementProjectsCreateRequest request); + partial void ProcessManagementProjectsCreateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementProjectsCreateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a project
+ /// Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementProjectsCreateAsync( + + global::ModerationAPI.ManagementProjectsCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementProjectsCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a project
+ /// Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementProjectsCreateAsResponseAsync( + + global::ModerationAPI.ManagementProjectsCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareManagementProjectsCreateArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementProjectsCreateSecurityRequirements, + operationName: "ManagementProjectsCreateAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: "/projects", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementProjectsCreateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsCreate", + methodName: "ManagementProjectsCreateAsync", + pathTemplate: "\"/projects\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsCreate", + methodName: "ManagementProjectsCreateAsync", + pathTemplate: "\"/projects\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsCreate", + methodName: "ManagementProjectsCreateAsync", + pathTemplate: "\"/projects\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementProjectsCreateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsCreate", + methodName: "ManagementProjectsCreateAsync", + pathTemplate: "\"/projects\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsCreate", + methodName: "ManagementProjectsCreateAsync", + pathTemplate: "\"/projects\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementProjectsCreateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.ProjectWithKey.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.ProjectWithKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a project
+ /// Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// The project's name. + /// + /// + /// The website or app the project moderates content for. Used to write the context when none is given. + /// + /// + /// What the platform is and who uses it. + /// + /// + /// What you moderate, the problems you see and your guidelines. + /// + /// + /// Whether children use the platform.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementProjectsCreateAsync( + string name, + string? domain = default, + string? context = default, + string? brief = default, + bool? usedByMinors = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.ManagementProjectsCreateRequest + { + Name = name, + Domain = domain, + Context = context, + Brief = brief, + UsedByMinors = usedByMinors, + }; + + return await ManagementProjectsCreateAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDelete.g.cs new file mode 100644 index 0000000..0b7bc76 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDelete.g.cs @@ -0,0 +1,541 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ProjectsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementProjectsDeleteSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementProjectsDeleteSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementProjectsDeleteSecurityRequirement0, + }; + partial void PrepareManagementProjectsDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareManagementProjectsDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessManagementProjectsDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementProjectsDeleteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a project
+ /// Delete a project with everything in it: channels, queues, API keys and stored content. This can't be undone. The project's API keys stop working at once. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementProjectsDeleteAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementProjectsDeleteAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a project
+ /// Delete a project with everything in it: channels, queues, API keys and stored content. This can't be undone. The project's API keys stop working at once. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementProjectsDeleteAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareManagementProjectsDeleteArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementProjectsDeleteSecurityRequirements, + operationName: "ManagementProjectsDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/projects/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementProjectsDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDelete", + methodName: "ManagementProjectsDeleteAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDelete", + methodName: "ManagementProjectsDeleteAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDelete", + methodName: "ManagementProjectsDeleteAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementProjectsDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDelete", + methodName: "ManagementProjectsDeleteAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDelete", + methodName: "ManagementProjectsDeleteAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementProjectsDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.ManagementProjectsDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.ManagementProjectsDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDuplicate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDuplicate.g.cs new file mode 100644 index 0000000..32c33ee --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsDuplicate.g.cs @@ -0,0 +1,628 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ProjectsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementProjectsDuplicateSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementProjectsDuplicateSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementProjectsDuplicateSecurityRequirement0, + }; + partial void PrepareManagementProjectsDuplicateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::ModerationAPI.ManagementProjectsDuplicateRequest request); + partial void PrepareManagementProjectsDuplicateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::ModerationAPI.ManagementProjectsDuplicateRequest request); + partial void ProcessManagementProjectsDuplicateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementProjectsDuplicateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Duplicate a project
+ /// Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// The ID of the project to copy. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementProjectsDuplicateAsync( + string id, + + global::ModerationAPI.ManagementProjectsDuplicateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementProjectsDuplicateAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Duplicate a project
+ /// Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// The ID of the project to copy. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementProjectsDuplicateAsResponseAsync( + string id, + + global::ModerationAPI.ManagementProjectsDuplicateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareManagementProjectsDuplicateArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementProjectsDuplicateSecurityRequirements, + operationName: "ManagementProjectsDuplicateAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/projects/{id}/duplicate", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementProjectsDuplicateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDuplicate", + methodName: "ManagementProjectsDuplicateAsync", + pathTemplate: "$\"/projects/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDuplicate", + methodName: "ManagementProjectsDuplicateAsync", + pathTemplate: "$\"/projects/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDuplicate", + methodName: "ManagementProjectsDuplicateAsync", + pathTemplate: "$\"/projects/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementProjectsDuplicateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDuplicate", + methodName: "ManagementProjectsDuplicateAsync", + pathTemplate: "$\"/projects/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsDuplicate", + methodName: "ManagementProjectsDuplicateAsync", + pathTemplate: "$\"/projects/{id}/duplicate\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementProjectsDuplicateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.ProjectWithKey.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.ProjectWithKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Duplicate a project
+ /// Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects. + ///
+ /// + /// The ID of the project to copy. + /// + /// + /// Name of the copy. Defaults to the original name with "(copy)". + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementProjectsDuplicateAsync( + string id, + string? name = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.ManagementProjectsDuplicateRequest + { + Name = name, + }; + + return await ManagementProjectsDuplicateAsync( + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsGet.g.cs new file mode 100644 index 0000000..dd2f8fe --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsGet.g.cs @@ -0,0 +1,541 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ProjectsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementProjectsGetSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementProjectsGetSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementProjectsGetSecurityRequirement0, + }; + partial void PrepareManagementProjectsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareManagementProjectsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessManagementProjectsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementProjectsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a project
+ /// Get a project by ID. Needs the `projects:read` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementProjectsGetAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementProjectsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a project
+ /// Get a project by ID. Needs the `projects:read` permission. + ///
+ /// + /// The ID of the project. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementProjectsGetAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareManagementProjectsGetArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementProjectsGetSecurityRequirements, + operationName: "ManagementProjectsGetAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/projects/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementProjectsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsGet", + methodName: "ManagementProjectsGetAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsGet", + methodName: "ManagementProjectsGetAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsGet", + methodName: "ManagementProjectsGetAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementProjectsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsGet", + methodName: "ManagementProjectsGetAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsGet", + methodName: "ManagementProjectsGetAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementProjectsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.Project.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsList.g.cs new file mode 100644 index 0000000..f3b7daa --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsList.g.cs @@ -0,0 +1,491 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ProjectsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementProjectsListSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementProjectsListSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementProjectsListSecurityRequirement0, + }; + partial void PrepareManagementProjectsListArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareManagementProjectsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessManagementProjectsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementProjectsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List projects
+ /// List every project in the organization. Needs the `projects:read` permission. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementProjectsListAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementProjectsListAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List projects
+ /// List every project in the organization. Needs the `projects:read` permission. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ManagementProjectsListAsResponseAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareManagementProjectsListArguments( + httpClient: HttpClient); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementProjectsListSecurityRequirements, + operationName: "ManagementProjectsListAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: "/projects", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementProjectsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsList", + methodName: "ManagementProjectsListAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsList", + methodName: "ManagementProjectsListAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsList", + methodName: "ManagementProjectsListAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementProjectsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsList", + methodName: "ManagementProjectsListAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsList", + methodName: "ManagementProjectsListAsync", + pathTemplate: "\"/projects\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementProjectsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsUpdate.g.cs new file mode 100644 index 0000000..e3ffde0 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.ManagementProjectsUpdate.g.cs @@ -0,0 +1,658 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class ProjectsClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_ManagementProjectsUpdateSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_ManagementProjectsUpdateSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_ManagementProjectsUpdateSecurityRequirement0, + }; + partial void PrepareManagementProjectsUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::ModerationAPI.ManagementProjectsUpdateRequest request); + partial void PrepareManagementProjectsUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::ModerationAPI.ManagementProjectsUpdateRequest request); + partial void ProcessManagementProjectsUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessManagementProjectsUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a project
+ /// Update a project. Fields you leave out keep their value. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementProjectsUpdateAsync( + string id, + + global::ModerationAPI.ManagementProjectsUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ManagementProjectsUpdateAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a project
+ /// Update a project. Fields you leave out keep their value. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ManagementProjectsUpdateAsResponseAsync( + string id, + + global::ModerationAPI.ManagementProjectsUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareManagementProjectsUpdateArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ManagementProjectsUpdateSecurityRequirements, + operationName: "ManagementProjectsUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/projects/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Put, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareManagementProjectsUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsUpdate", + methodName: "ManagementProjectsUpdateAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsUpdate", + methodName: "ManagementProjectsUpdateAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsUpdate", + methodName: "ManagementProjectsUpdateAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessManagementProjectsUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsUpdate", + methodName: "ManagementProjectsUpdateAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ManagementProjectsUpdate", + methodName: "ManagementProjectsUpdateAsync", + pathTemplate: "$\"/projects/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Insufficient access + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ModerationAPI.ErrorForbidden? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ModerationAPI.ErrorForbidden.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessManagementProjectsUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.Project.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a project
+ /// Update a project. Fields you leave out keep their value. Needs the `projects:write` permission. + ///
+ /// + /// The ID of the project to update. + /// + /// + /// The project's name. + /// + /// + /// The project's description. + /// + /// + /// The website or app the project moderates content for. Setting it on a project without context writes one. + /// + /// + /// What the platform is and who uses it. + /// + /// + /// `ACTIVE` flags content. `DRY_RUN` evaluates without flagging. + /// + /// + /// Whether moderated content is stored and shown in the dashboard. + /// + /// + /// Whether review queue decisions are recorded in the casebook. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ManagementProjectsUpdateAsync( + string id, + string? name = default, + string? description = default, + string? domain = default, + string? context = default, + global::ModerationAPI.ManagementProjectsUpdateRequestGlobalFlaggingMode? globalFlaggingMode = default, + bool? enableRequestLogging = default, + bool? casebookEnabled = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.ManagementProjectsUpdateRequest + { + Name = name, + Description = description, + Domain = domain, + Context = context, + GlobalFlaggingMode = globalFlaggingMode, + EnableRequestLogging = enableRequestLogging, + CasebookEnabled = casebookEnabled, + }; + + return await ManagementProjectsUpdateAsync( + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.g.cs new file mode 100644 index 0000000..b52937a --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ProjectsClient.g.cs @@ -0,0 +1,151 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ProjectsClient : global::ModerationAPI.IProjectsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.moderationapi.com/v1"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + + internal global::ModerationAPI.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::ModerationAPI.AutoSDKServerConfiguration(); + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::ModerationAPI.ProjectsSourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the ProjectsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ProjectsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ProjectsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ProjectsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ProjectsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ProjectsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::ModerationAPI.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueues.JsonSerializerContext.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueues.JsonSerializerContext.g.cs index 1521a8c..4c539c5 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueues.JsonSerializerContext.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ReviewQueues.JsonSerializerContext.g.cs @@ -36,6 +36,7 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorInternalServerError))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorInternalServerErrorIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenResolveItemRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenUnresolveItemRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetItemsSortField), TypeInfoPropertyName = "QueueViewOpenGetItemsSortField2")] @@ -43,11 +44,23 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueue))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilter))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterIsFlagged2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabel))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterFilterLabelType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMetadataFilter))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterMediaType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterRecommendationAction), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterRecommendationAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterWithinUnit2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus), TypeInfoPropertyName = "QueueViewOpenGetQueueResponseQueueFilterCheckStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetStatsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetStatsResponseReviewStats))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -74,10 +87,18 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenUnresolveItemResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetItemsSortField?), TypeInfoPropertyName = "NullableQueueViewOpenGetItemsSortField2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetItemsSortDirection?), TypeInfoPropertyName = "NullableQueueViewOpenGetItemsSortDirection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterIsFlagged2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterCasebookAnswer2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterCasebookAgreement2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterFilterLabelType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterContentType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterMediaType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterRecommendationAction?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterRecommendationAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterWithinUnit2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus?), TypeInfoPropertyName = "NullableQueueViewOpenGetQueueResponseQueueFilterCheckStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueViewOpenGetItemsResponseItemStatus?), TypeInfoPropertyName = "NullableQueueViewOpenGetItemsResponseItemStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -85,6 +106,10 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -171,14 +196,42 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetItemsSortDirection?) + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged?) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer?) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement?) + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType) || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType?) + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType?) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType?) + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterRecommendationAction) || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterRecommendationAction?) + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit?) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus) + + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus?) + || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetItemsResponseItemStatus) || typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetItemsResponseItemStatus?); @@ -208,6 +261,36 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::ModerationAPI.JsonConverters.QueueViewOpenGetItemsSortDirectionNullableJsonConverter(); } + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterIsFlagged?)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterIsFlaggedNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswer?)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAnswerNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreement?)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCasebookAgreementNullableJsonConverter(); + } + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterFilterLabelType)) { return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterFilterLabelTypeJsonConverter(); @@ -218,6 +301,26 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterFilterLabelTypeNullableJsonConverter(); } + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterContentType?)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterContentTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterMediaType?)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterMediaTypeNullableJsonConverter(); + } + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterRecommendationAction)) { return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterRecommendationActionJsonConverter(); @@ -228,6 +331,26 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterRecommendationActionNullableJsonConverter(); } + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnitJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterWithinUnit?)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterWithinUnitNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetQueueResponseQueueFilterCheckStatus?)) + { + return new global::ModerationAPI.JsonConverters.QueueViewOpenGetQueueResponseQueueFilterCheckStatusNullableJsonConverter(); + } + if (typeToConvert == typeof(global::ModerationAPI.QueueViewOpenGetItemsResponseItemStatus)) { return new global::ModerationAPI.JsonConverters.QueueViewOpenGetItemsResponseItemStatusJsonConverter(); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Voice.JsonSerializerContext.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Voice.JsonSerializerContext.g.cs index d8dd02f..9de7c5e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Voice.JsonSerializerContext.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Voice.JsonSerializerContext.g.cs @@ -17,11 +17,11 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrame))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameEvent), TypeInfoPropertyName = "VoiceStartFrameEvent2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameMediaFormat))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameTrack))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameTrackName), TypeInfoPropertyName = "VoiceStartFrameTrackName2")] @@ -52,8 +52,8 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.GetStreamResponseDiscriminatorEvent), TypeInfoPropertyName = "GetStreamResponseDiscriminatorEvent2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameEvent?), TypeInfoPropertyName = "NullableVoiceStartFrameEvent2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameEvent?), TypeInfoPropertyName = "NullableVoiceStartFrameEvent2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceStartFrameTrackName?), TypeInfoPropertyName = "NullableVoiceStartFrameTrackName2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceMediaFrameEvent?), TypeInfoPropertyName = "NullableVoiceMediaFrameEvent2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.VoiceMediaFrameMediaTrack?), TypeInfoPropertyName = "NullableVoiceMediaFrameMediaTrack2")] diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Webhooks.JsonSerializerContext.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Webhooks.JsonSerializerContext.g.cs new file mode 100644 index 0000000..ada1cd5 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Webhooks.JsonSerializerContext.g.cs @@ -0,0 +1,629 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "PublicQueueItemContentObject_a5b10a16560a2a90")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary>), TypeInfoPropertyName = "PublicQueueItemContentObjectDataAudio_9fba358e4ede806b")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "PublicQueueItemContentObjectDataAudio_f4551668b35ad437")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?), TypeInfoPropertyName = "PublicQueueItemContentObject_0f6ae51d7c9aeddc")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?), TypeInfoPropertyName = "PublicQueueItemContentObjectDataAudio_6d0dbf1252fb5aa2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicAuthor))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicAuthorStatus), TypeInfoPropertyName = "PublicAuthorStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicAuthorTrustLevel))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicAuthorBlock))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicAuthorRiskEvaluation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicAuthorMetrics))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicAuthorMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorBadRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorBadRequestIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorUnauthorized))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorUnauthorizedIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorNotFound))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.ErrorNotFoundIssue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorBlockedEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorBlockedEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicActionPerformedAuthor))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicActionPerformedAuthorQueue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorUnblockedEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorUnblockedEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorSuspendedEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorSuspendedEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorUpdatedEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorUpdatedEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorTrustLevelChangedEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorTrustLevelChangedEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorActionEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorActionEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueItemCompletedEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueItemCompletedEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemEventQueue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemLabelsVariant1Item))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatche))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignals))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemLabelsVariant1ItemMatcheSignalsBrandImpersonation))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentText))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentImage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentVideo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentAudio))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentObject))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentObjectDataText))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentObjectDataImage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentObjectDataVideo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemContentObjectDataAudio))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemClientAction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemClientActionAction), TypeInfoPropertyName = "PublicQueueItemClientActionAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemClientActionBehavior), TypeInfoPropertyName = "PublicQueueItemClientActionBehavior2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemMetaType), TypeInfoPropertyName = "PublicQueueItemMetaType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueItemActionEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueItemActionEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicActionPerformed))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicActionPerformedQueue))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueItemRejectedEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueItemRejectedEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueItemAllowedEvent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.QueueItemAllowedEventData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhookEvent), TypeInfoPropertyName = "WebhookEvent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateRequestEventType), TypeInfoPropertyName = "WebhooksPublicCreateRequestEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateRequestEventType), TypeInfoPropertyName = "WebhooksPublicUpdateRequestEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseItemEventType), TypeInfoPropertyName = "WebhooksPublicListResponseItemEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion), TypeInfoPropertyName = "WebhooksPublicListResponseItemPayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateResponseEventType), TypeInfoPropertyName = "WebhooksPublicCreateResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion), TypeInfoPropertyName = "WebhooksPublicCreateResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetResponseEventType), TypeInfoPropertyName = "WebhooksPublicGetResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion), TypeInfoPropertyName = "WebhooksPublicGetResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateResponseEventType), TypeInfoPropertyName = "WebhooksPublicUpdateResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion), TypeInfoPropertyName = "WebhooksPublicUpdateResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicDeleteResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetSecretResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorBlockedWebhookVersion), TypeInfoPropertyName = "CreateAuthorBlockedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorUnblockedWebhookVersion), TypeInfoPropertyName = "CreateAuthorUnblockedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorSuspendedWebhookVersion), TypeInfoPropertyName = "CreateAuthorSuspendedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorUpdatedWebhookVersion), TypeInfoPropertyName = "CreateAuthorUpdatedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorTrustLevelChangedWebhookVersion), TypeInfoPropertyName = "CreateAuthorTrustLevelChangedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorActionWebhookVersion), TypeInfoPropertyName = "CreateAuthorActionWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateQueueItemResolvedWebhookVersion), TypeInfoPropertyName = "CreateQueueItemResolvedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateQueueItemActionWebhookVersion), TypeInfoPropertyName = "CreateQueueItemActionWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateQueueItemRejectedWebhookVersion), TypeInfoPropertyName = "CreateQueueItemRejectedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateQueueItemAllowedWebhookVersion), TypeInfoPropertyName = "CreateQueueItemAllowedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicAuthorStatus?), TypeInfoPropertyName = "NullablePublicAuthorStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemClientActionAction?), TypeInfoPropertyName = "NullablePublicQueueItemClientActionAction2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemClientActionBehavior?), TypeInfoPropertyName = "NullablePublicQueueItemClientActionBehavior2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.PublicQueueItemMetaType?), TypeInfoPropertyName = "NullablePublicQueueItemMetaType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhookEvent?), TypeInfoPropertyName = "NullableWebhookEvent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateRequestEventType?), TypeInfoPropertyName = "NullableWebhooksPublicCreateRequestEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateRequestEventType?), TypeInfoPropertyName = "NullableWebhooksPublicUpdateRequestEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseItemEventType?), TypeInfoPropertyName = "NullableWebhooksPublicListResponseItemEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion?), TypeInfoPropertyName = "NullableWebhooksPublicListResponseItemPayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateResponseEventType?), TypeInfoPropertyName = "NullableWebhooksPublicCreateResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion?), TypeInfoPropertyName = "NullableWebhooksPublicCreateResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetResponseEventType?), TypeInfoPropertyName = "NullableWebhooksPublicGetResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion?), TypeInfoPropertyName = "NullableWebhooksPublicGetResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateResponseEventType?), TypeInfoPropertyName = "NullableWebhooksPublicUpdateResponseEventType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion?), TypeInfoPropertyName = "NullableWebhooksPublicUpdateResponsePayloadVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorBlockedWebhookVersion?), TypeInfoPropertyName = "NullableCreateAuthorBlockedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorUnblockedWebhookVersion?), TypeInfoPropertyName = "NullableCreateAuthorUnblockedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorSuspendedWebhookVersion?), TypeInfoPropertyName = "NullableCreateAuthorSuspendedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorUpdatedWebhookVersion?), TypeInfoPropertyName = "NullableCreateAuthorUpdatedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorTrustLevelChangedWebhookVersion?), TypeInfoPropertyName = "NullableCreateAuthorTrustLevelChangedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateAuthorActionWebhookVersion?), TypeInfoPropertyName = "NullableCreateAuthorActionWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateQueueItemResolvedWebhookVersion?), TypeInfoPropertyName = "NullableCreateQueueItemResolvedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateQueueItemActionWebhookVersion?), TypeInfoPropertyName = "NullableCreateQueueItemActionWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateQueueItemRejectedWebhookVersion?), TypeInfoPropertyName = "NullableCreateQueueItemRejectedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.CreateQueueItemAllowedWebhookVersion?), TypeInfoPropertyName = "NullableCreateQueueItemAllowedWebhookVersion2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class WebhooksSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class WebhooksSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static WebhooksSourceGenerationContext Default { get; } = new(DefaultOptions); + + private WebhooksSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::ModerationAPI.JsonConverters.WebhookEventJsonConverter()); + options.Converters.Add(new global::ModerationAPI.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::ModerationAPI.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::ModerationAPI.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::ModerationAPI.PublicAuthorStatus) + + || typeToConvert == typeof(global::ModerationAPI.PublicAuthorStatus?) + + || typeToConvert == typeof(global::ModerationAPI.PublicQueueItemClientActionAction) + + || typeToConvert == typeof(global::ModerationAPI.PublicQueueItemClientActionAction?) + + || typeToConvert == typeof(global::ModerationAPI.PublicQueueItemClientActionBehavior) + + || typeToConvert == typeof(global::ModerationAPI.PublicQueueItemClientActionBehavior?) + + || typeToConvert == typeof(global::ModerationAPI.PublicQueueItemMetaType) + + || typeToConvert == typeof(global::ModerationAPI.PublicQueueItemMetaType?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateRequestEventType) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateRequestEventType?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateRequestEventType) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateRequestEventType?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicListResponseItemEventType) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicListResponseItemEventType?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateResponseEventType) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateResponseEventType?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicGetResponseEventType) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicGetResponseEventType?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateResponseEventType) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateResponseEventType?) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion) + + || typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorBlockedWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorBlockedWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorUnblockedWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorUnblockedWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorSuspendedWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorSuspendedWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorUpdatedWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorUpdatedWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorTrustLevelChangedWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorTrustLevelChangedWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorActionWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateAuthorActionWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateQueueItemResolvedWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateQueueItemResolvedWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateQueueItemActionWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateQueueItemActionWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateQueueItemRejectedWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateQueueItemRejectedWebhookVersion?) + + || typeToConvert == typeof(global::ModerationAPI.CreateQueueItemAllowedWebhookVersion) + + || typeToConvert == typeof(global::ModerationAPI.CreateQueueItemAllowedWebhookVersion?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::ModerationAPI.PublicAuthorStatus)) + { + return new global::ModerationAPI.JsonConverters.PublicAuthorStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.PublicAuthorStatus?)) + { + return new global::ModerationAPI.JsonConverters.PublicAuthorStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.PublicQueueItemClientActionAction)) + { + return new global::ModerationAPI.JsonConverters.PublicQueueItemClientActionActionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.PublicQueueItemClientActionAction?)) + { + return new global::ModerationAPI.JsonConverters.PublicQueueItemClientActionActionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.PublicQueueItemClientActionBehavior)) + { + return new global::ModerationAPI.JsonConverters.PublicQueueItemClientActionBehaviorJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.PublicQueueItemClientActionBehavior?)) + { + return new global::ModerationAPI.JsonConverters.PublicQueueItemClientActionBehaviorNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.PublicQueueItemMetaType)) + { + return new global::ModerationAPI.JsonConverters.PublicQueueItemMetaTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.PublicQueueItemMetaType?)) + { + return new global::ModerationAPI.JsonConverters.PublicQueueItemMetaTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateRequestEventType)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateRequestEventType?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicCreateRequestEventTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateRequestEventType)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateRequestEventType?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicUpdateRequestEventTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicListResponseItemEventType)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicListResponseItemEventType?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemEventTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicListResponseItemPayloadVersion?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicListResponseItemPayloadVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateResponseEventType)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateResponseEventType?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponseEventTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicCreateResponsePayloadVersion?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicCreateResponsePayloadVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicGetResponseEventType)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicGetResponseEventType?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicGetResponseEventTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicGetResponsePayloadVersion?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicGetResponsePayloadVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateResponseEventType)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateResponseEventType?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponseEventTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.WebhooksPublicUpdateResponsePayloadVersion?)) + { + return new global::ModerationAPI.JsonConverters.WebhooksPublicUpdateResponsePayloadVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorBlockedWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorBlockedWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorBlockedWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorBlockedWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorUnblockedWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorUnblockedWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorUnblockedWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorUnblockedWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorSuspendedWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorSuspendedWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorSuspendedWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorSuspendedWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorUpdatedWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorUpdatedWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorUpdatedWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorUpdatedWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorTrustLevelChangedWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorTrustLevelChangedWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorTrustLevelChangedWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorTrustLevelChangedWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorActionWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorActionWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateAuthorActionWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateAuthorActionWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateQueueItemResolvedWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateQueueItemResolvedWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateQueueItemResolvedWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateQueueItemResolvedWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateQueueItemActionWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateQueueItemActionWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateQueueItemActionWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateQueueItemActionWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateQueueItemRejectedWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateQueueItemRejectedWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateQueueItemRejectedWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateQueueItemRejectedWebhookVersionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateQueueItemAllowedWebhookVersion)) + { + return new global::ModerationAPI.JsonConverters.CreateQueueItemAllowedWebhookVersionJsonConverter(); + } + + if (typeToConvert == typeof(global::ModerationAPI.CreateQueueItemAllowedWebhookVersion?)) + { + return new global::ModerationAPI.JsonConverters.CreateQueueItemAllowedWebhookVersionNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new WebhooksSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.Authorizations.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..ecd1af4 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class WebhooksClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::ModerationAPI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.Constructors.Bearer.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..2b5f2e5 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class WebhooksClient + { + /// + + public WebhooksClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicCreate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicCreate.g.cs new file mode 100644 index 0000000..8ecaa6d --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicCreate.g.cs @@ -0,0 +1,551 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class WebhooksClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_WebhooksPublicCreateSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_WebhooksPublicCreateSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_WebhooksPublicCreateSecurityRequirement0, + }; + partial void PrepareWebhooksPublicCreateArguments( + global::System.Net.Http.HttpClient httpClient, + global::ModerationAPI.WebhooksPublicCreateRequest request); + partial void PrepareWebhooksPublicCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::ModerationAPI.WebhooksPublicCreateRequest request); + partial void ProcessWebhooksPublicCreateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessWebhooksPublicCreateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a webhook
+ /// Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task WebhooksPublicCreateAsync( + + global::ModerationAPI.WebhooksPublicCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await WebhooksPublicCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a webhook
+ /// Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> WebhooksPublicCreateAsResponseAsync( + + global::ModerationAPI.WebhooksPublicCreateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareWebhooksPublicCreateArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_WebhooksPublicCreateSecurityRequirements, + operationName: "WebhooksPublicCreateAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: "/webhooks", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareWebhooksPublicCreateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicCreate", + methodName: "WebhooksPublicCreateAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicCreate", + methodName: "WebhooksPublicCreateAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicCreate", + methodName: "WebhooksPublicCreateAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessWebhooksPublicCreateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicCreate", + methodName: "WebhooksPublicCreateAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicCreate", + methodName: "WebhooksPublicCreateAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessWebhooksPublicCreateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.WebhooksPublicCreateResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.WebhooksPublicCreateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a webhook
+ /// Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint). + ///
+ /// + /// The webhook's name, used to identify it in the dashboard + /// + /// + /// The webhook's description + /// + /// + /// The webhook's URL. We'll call this URL when an event occurs. + /// + /// + /// Event types this webhook subscribes to. One webhook URL receives all events you list here. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task WebhooksPublicCreateAsync( + string name, + string url, + global::System.Collections.Generic.IList eventTypes, + string? description = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.WebhooksPublicCreateRequest + { + Name = name, + Description = description, + Url = url, + EventTypes = eventTypes, + }; + + return await WebhooksPublicCreateAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicDelete.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicDelete.g.cs new file mode 100644 index 0000000..eaad2a5 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicDelete.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class WebhooksClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_WebhooksPublicDeleteSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_WebhooksPublicDeleteSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_WebhooksPublicDeleteSecurityRequirement0, + }; + partial void PrepareWebhooksPublicDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareWebhooksPublicDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessWebhooksPublicDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessWebhooksPublicDeleteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a webhook
+ /// Delete a webhook. + ///
+ /// + /// The ID of the webhook to delete. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task WebhooksPublicDeleteAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await WebhooksPublicDeleteAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete a webhook
+ /// Delete a webhook. + ///
+ /// + /// The ID of the webhook to delete. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> WebhooksPublicDeleteAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareWebhooksPublicDeleteArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_WebhooksPublicDeleteSecurityRequirements, + operationName: "WebhooksPublicDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/webhooks/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareWebhooksPublicDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicDelete", + methodName: "WebhooksPublicDeleteAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicDelete", + methodName: "WebhooksPublicDeleteAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicDelete", + methodName: "WebhooksPublicDeleteAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessWebhooksPublicDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicDelete", + methodName: "WebhooksPublicDeleteAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicDelete", + methodName: "WebhooksPublicDeleteAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessWebhooksPublicDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.WebhooksPublicDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.WebhooksPublicDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGet.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGet.g.cs new file mode 100644 index 0000000..2aaedb1 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGet.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class WebhooksClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_WebhooksPublicGetSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_WebhooksPublicGetSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_WebhooksPublicGetSecurityRequirement0, + }; + partial void PrepareWebhooksPublicGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareWebhooksPublicGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessWebhooksPublicGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessWebhooksPublicGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a webhook
+ /// Get a webhook by ID. + ///
+ /// + /// The ID of the webhook to get. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task WebhooksPublicGetAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await WebhooksPublicGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a webhook
+ /// Get a webhook by ID. + ///
+ /// + /// The ID of the webhook to get. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> WebhooksPublicGetAsResponseAsync( + string id, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareWebhooksPublicGetArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_WebhooksPublicGetSecurityRequirements, + operationName: "WebhooksPublicGetAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/webhooks/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareWebhooksPublicGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGet", + methodName: "WebhooksPublicGetAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGet", + methodName: "WebhooksPublicGetAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGet", + methodName: "WebhooksPublicGetAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessWebhooksPublicGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGet", + methodName: "WebhooksPublicGetAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGet", + methodName: "WebhooksPublicGetAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessWebhooksPublicGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.WebhooksPublicGetResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.WebhooksPublicGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGetSecret.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGetSecret.g.cs new file mode 100644 index 0000000..51a1879 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicGetSecret.g.cs @@ -0,0 +1,454 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class WebhooksClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_WebhooksPublicGetSecretSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_WebhooksPublicGetSecretSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_WebhooksPublicGetSecretSecurityRequirement0, + }; + partial void PrepareWebhooksPublicGetSecretArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareWebhooksPublicGetSecretRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessWebhooksPublicGetSecretResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessWebhooksPublicGetSecretResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get the webhook signing secret
+ /// Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task WebhooksPublicGetSecretAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await WebhooksPublicGetSecretAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get the webhook signing secret
+ /// Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> WebhooksPublicGetSecretAsResponseAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareWebhooksPublicGetSecretArguments( + httpClient: HttpClient); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_WebhooksPublicGetSecretSecurityRequirements, + operationName: "WebhooksPublicGetSecretAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: "/webhook-secret", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareWebhooksPublicGetSecretRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGetSecret", + methodName: "WebhooksPublicGetSecretAsync", + pathTemplate: "\"/webhook-secret\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGetSecret", + methodName: "WebhooksPublicGetSecretAsync", + pathTemplate: "\"/webhook-secret\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGetSecret", + methodName: "WebhooksPublicGetSecretAsync", + pathTemplate: "\"/webhook-secret\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessWebhooksPublicGetSecretResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGetSecret", + methodName: "WebhooksPublicGetSecretAsync", + pathTemplate: "\"/webhook-secret\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicGetSecret", + methodName: "WebhooksPublicGetSecretAsync", + pathTemplate: "\"/webhook-secret\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessWebhooksPublicGetSecretResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.WebhooksPublicGetSecretResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.WebhooksPublicGetSecretResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicList.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicList.g.cs new file mode 100644 index 0000000..cd0f9f1 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicList.g.cs @@ -0,0 +1,454 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class WebhooksClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_WebhooksPublicListSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_WebhooksPublicListSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_WebhooksPublicListSecurityRequirement0, + }; + partial void PrepareWebhooksPublicListArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareWebhooksPublicListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessWebhooksPublicListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessWebhooksPublicListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List webhooks
+ /// List all webhooks for the authenticated project. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> WebhooksPublicListAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await WebhooksPublicListAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List webhooks
+ /// List all webhooks for the authenticated project. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> WebhooksPublicListAsResponseAsync( + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareWebhooksPublicListArguments( + httpClient: HttpClient); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_WebhooksPublicListSecurityRequirements, + operationName: "WebhooksPublicListAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: "/webhooks", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareWebhooksPublicListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicList", + methodName: "WebhooksPublicListAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicList", + methodName: "WebhooksPublicListAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicList", + methodName: "WebhooksPublicListAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessWebhooksPublicListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicList", + methodName: "WebhooksPublicListAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicList", + methodName: "WebhooksPublicListAsync", + pathTemplate: "\"/webhooks\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessWebhooksPublicListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicUpdate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicUpdate.g.cs new file mode 100644 index 0000000..a300739 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.WebhooksPublicUpdate.g.cs @@ -0,0 +1,606 @@ + +#nullable enable + +namespace ModerationAPI +{ + public partial class WebhooksClient + { + + + private static readonly global::ModerationAPI.EndPointSecurityRequirement s_WebhooksPublicUpdateSecurityRequirement0 = + new global::ModerationAPI.EndPointSecurityRequirement + { + Authorizations = new global::ModerationAPI.EndPointAuthorizationRequirement[] + { new global::ModerationAPI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::ModerationAPI.EndPointSecurityRequirement[] s_WebhooksPublicUpdateSecurityRequirements = + new global::ModerationAPI.EndPointSecurityRequirement[] + { s_WebhooksPublicUpdateSecurityRequirement0, + }; + partial void PrepareWebhooksPublicUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::ModerationAPI.WebhooksPublicUpdateRequest request); + partial void PrepareWebhooksPublicUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::ModerationAPI.WebhooksPublicUpdateRequest request); + partial void ProcessWebhooksPublicUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessWebhooksPublicUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a webhook
+ /// Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. + ///
+ /// + /// The ID of the webhook to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task WebhooksPublicUpdateAsync( + string id, + + global::ModerationAPI.WebhooksPublicUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await WebhooksPublicUpdateAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a webhook
+ /// Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. + ///
+ /// + /// The ID of the webhook to update. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> WebhooksPublicUpdateAsResponseAsync( + string id, + + global::ModerationAPI.WebhooksPublicUpdateRequest request, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareWebhooksPublicUpdateArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::ModerationAPI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_WebhooksPublicUpdateSecurityRequirements, + operationName: "WebhooksPublicUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ModerationAPI.PathBuilder( + path: $"/webhooks/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ModerationAPI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Put, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ModerationAPI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareWebhooksPublicUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicUpdate", + methodName: "WebhooksPublicUpdateAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicUpdate", + methodName: "WebhooksPublicUpdateAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ModerationAPI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ModerationAPI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicUpdate", + methodName: "WebhooksPublicUpdateAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ModerationAPI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessWebhooksPublicUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicUpdate", + methodName: "WebhooksPublicUpdateAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ModerationAPI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ModerationAPI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WebhooksPublicUpdate", + methodName: "WebhooksPublicUpdateAsync", + pathTemplate: "$\"/webhooks/{id}\"", + httpMethod: "PUT", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid input data + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ModerationAPI.ErrorBadRequest? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ModerationAPI.ErrorBadRequest.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Authorization not provided + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ModerationAPI.ErrorUnauthorized? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ModerationAPI.ErrorUnauthorized.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::ModerationAPI.ErrorNotFound? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::ModerationAPI.ErrorNotFound.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessWebhooksPublicUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ModerationAPI.WebhooksPublicUpdateResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ModerationAPI.WebhooksPublicUpdateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ModerationAPI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ModerationAPI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::ModerationAPI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a webhook
+ /// Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. + ///
+ /// + /// The ID of the webhook to update. + /// + /// + /// The webhook's name, used to identify it in the dashboard + /// + /// + /// The webhook's description + /// + /// + /// The webhook's URL. We'll call this URL when an event occurs. + /// + /// + /// Event types this webhook subscribes to. One webhook URL receives all events you list here. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task WebhooksPublicUpdateAsync( + string id, + string? name = default, + string? description = default, + string? url = default, + global::System.Collections.Generic.IList? eventTypes = default, + global::ModerationAPI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::ModerationAPI.WebhooksPublicUpdateRequest + { + Name = name, + Description = description, + Url = url, + EventTypes = eventTypes, + }; + + return await WebhooksPublicUpdateAsync( + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.g.cs new file mode 100644 index 0000000..a5cca59 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.WebhooksClient.g.cs @@ -0,0 +1,151 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class WebhooksClient : global::ModerationAPI.IWebhooksClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.moderationapi.com/v1"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::ModerationAPI.AutoSDKClientOptions Options { get; } + + + internal global::ModerationAPI.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::ModerationAPI.AutoSDKServerConfiguration(); + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::ModerationAPI.WebhooksSourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the WebhooksClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public WebhooksClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the WebhooksClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public WebhooksClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the WebhooksClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public WebhooksClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ModerationAPI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + if (baseUri is not null) + { + HttpClient.BaseAddress ??= baseUri; + } + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::ModerationAPI.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/autosdk.generated-examples.json b/src/libs/ModerationAPI/Generated/autosdk.generated-examples.json index cc0f2ec..e9c3b82 100644 --- a/src/libs/ModerationAPI/Generated/autosdk.generated-examples.json +++ b/src/libs/ModerationAPI/Generated/autosdk.generated-examples.json @@ -92,7 +92,7 @@ "Order": 9, "Title": "Delete an author", "Slug": "author-delete", - "Description": "Delete a specific author", + "Description": "Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID.", "Language": "csharp", "Code": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Authors;\n\nModerationApiClient client = new();\n\nAuthorDeleteParams parameters = new() { ID = \u0022id\u0022 };\n\nvar author = await client.Authors.Delete(parameters);\n\nConsole.WriteLine(author);", "Format": "sdk", @@ -145,6 +145,138 @@ }, { "Order": 14, + "Title": "Create a channel", + "Slug": "management-channels-create", + "Description": "Create a channel in a project, with the default rules. The project\u0027s first channel becomes its default. Needs the \u0060channels:write\u0060 permission.", + "Language": "http", + "Code": "### Create a channel\n# @name management-channels-create\nPOST {{host}}/projects/{{projectId}}/channels\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022key\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022contentType\u0022: \u0022profile\u0022\n}\n\n## Responses\n# 200\n# Description: Channel created successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-channels-create", + "Setup": null + }, + { + "Order": 15, + "Title": "Delete a channel", + "Slug": "management-channels-delete", + "Description": "Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the \u0060channels:write\u0060 permission.", + "Language": "http", + "Code": "### Delete a channel\n# @name management-channels-delete\nDELETE {{host}}/channels/{{id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Channel deleted successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-channels-delete", + "Setup": null + }, + { + "Order": 16, + "Title": "Duplicate a channel", + "Slug": "management-channels-duplicate", + "Description": "Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the \u0060channels:write\u0060 permission.", + "Language": "http", + "Code": "### Duplicate a channel\n# @name management-channels-duplicate\nPOST {{host}}/channels/{{id}}/duplicate\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022key\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Channel duplicated successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-channels-duplicate", + "Setup": null + }, + { + "Order": 17, + "Title": "Get a channel", + "Slug": "management-channels-get", + "Description": "Get a channel by ID. Needs the \u0060channels:read\u0060 permission.", + "Language": "http", + "Code": "### Get a channel\n# @name management-channels-get\nGET {{host}}/channels/{{id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Channel retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-channels-get", + "Setup": null + }, + { + "Order": 18, + "Title": "List channels", + "Slug": "management-channels-list", + "Description": "List the channels in a project. Needs the \u0060channels:read\u0060 permission.", + "Language": "http", + "Code": "### List channels\n# @name management-channels-list\nGET {{host}}/projects/{{projectId}}/channels\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Channels retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-channels-list", + "Setup": null + }, + { + "Order": 19, + "Title": "Update a channel", + "Slug": "management-channels-update", + "Description": "Update a channel. Fields you leave out keep their value. Needs the \u0060channels:write\u0060 permission.", + "Language": "http", + "Code": "### Update a channel\n# @name management-channels-update\nPUT {{host}}/channels/{{id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022key\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022contentType\u0022: \u0022profile\u0022,\n \u0022flaggingMode\u0022: \u0022DRY_RUN\u0022,\n \u0022contextEnabled\u0022: true,\n \u0022enableImageModeration\u0022: true,\n \u0022enableVideoModeration\u0022: true,\n \u0022enableAudioModeration\u0022: true,\n \u0022enableVoiceModeration\u0022: true,\n \u0022includeTranscriptInResponse\u0022: true,\n \u0022transcriptionQuality\u0022: \u0022SPEED\u0022,\n \u0022unicodeSpoofDetectionEnabled\u0022: true,\n \u0022frameCaptureInterval\u0022: 0,\n \u0022maxFramesPerVideo\u0022: 0,\n \u0022spreadFrames\u0022: true\n}\n\n## Responses\n# 200\n# Description: Channel updated successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-channels-update", + "Setup": null + }, + { + "Order": 20, + "Title": "Create a project", + "Slug": "management-projects-create", + "Description": "Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the \u0060projects:write\u0060 permission and a key that reaches all projects.", + "Language": "http", + "Code": "### Create a project\n# @name management-projects-create\nPOST {{host}}/projects\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022domain\u0022: \u0022string\u0022,\n \u0022context\u0022: \u0022string\u0022,\n \u0022brief\u0022: \u0022string\u0022,\n \u0022usedByMinors\u0022: false\n}\n\n## Responses\n# 200\n# Description: Project created successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-projects-create", + "Setup": null + }, + { + "Order": 21, + "Title": "Delete a project", + "Slug": "management-projects-delete", + "Description": "Delete a project with everything in it: channels, queues, API keys and stored content. This can\u0027t be undone. The project\u0027s API keys stop working at once. Needs the \u0060projects:write\u0060 permission.", + "Language": "http", + "Code": "### Delete a project\n# @name management-projects-delete\nDELETE {{host}}/projects/{{id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Project deleted successfully\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-projects-delete", + "Setup": null + }, + { + "Order": 22, + "Title": "Duplicate a project", + "Slug": "management-projects-duplicate", + "Description": "Copy a project\u0027s configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the \u0060projects:write\u0060 permission and a key that reaches all projects.", + "Language": "http", + "Code": "### Duplicate a project\n# @name management-projects-duplicate\nPOST {{host}}/projects/{{id}}/duplicate\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022name\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Project duplicated successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-projects-duplicate", + "Setup": null + }, + { + "Order": 23, + "Title": "Get a project", + "Slug": "management-projects-get", + "Description": "Get a project by ID. Needs the \u0060projects:read\u0060 permission.", + "Language": "http", + "Code": "### Get a project\n# @name management-projects-get\nGET {{host}}/projects/{{id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Project retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-projects-get", + "Setup": null + }, + { + "Order": 24, + "Title": "List projects", + "Slug": "management-projects-list", + "Description": "List every project in the organization. Needs the \u0060projects:read\u0060 permission.", + "Language": "csharp", + "Code": "using var client = new ModerationAPIClient(apiKey);\nvar response = await client.Projects.ManagementProjectsListAsync();", + "Format": "sdk", + "OperationId": "management-projects-list", + "Setup": "This example assumes \u0060using ModerationAPI;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 25, + "Title": "Update a project", + "Slug": "management-projects-update", + "Description": "Update a project. Fields you leave out keep their value. Needs the \u0060projects:write\u0060 permission.", + "Language": "http", + "Code": "### Update a project\n# @name management-projects-update\nPUT {{host}}/projects/{{id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022domain\u0022: \u0022https://example.com\u0022,\n \u0022context\u0022: \u0022string\u0022,\n \u0022globalFlaggingMode\u0022: \u0022DRY_RUN\u0022,\n \u0022enableRequestLogging\u0022: true,\n \u0022casebookEnabled\u0022: true\n}\n\n## Responses\n# 200\n# Description: Project updated successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 403\n# Description: Insufficient access\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "management-projects-update", + "Setup": null + }, + { + "Order": 26, "Title": "Get queue items", "Slug": "queueview-opengetitems", "Description": "Get paginated list of items in a moderation queue with filtering options", @@ -155,7 +287,7 @@ "Setup": null }, { - "Order": 15, + "Order": 27, "Title": "Get a queue", "Slug": "queueview-opengetqueue", "Description": "Get a queue", @@ -166,7 +298,7 @@ "Setup": null }, { - "Order": 16, + "Order": 28, "Title": "Get queue statistics", "Slug": "queueview-opengetstats", "Description": "Get detailed statistics about a moderation queue including review times, action counts, and trends", @@ -177,7 +309,7 @@ "Setup": null }, { - "Order": 17, + "Order": 29, "Title": "Resolve a queue item", "Slug": "queueview-openresolveitem", "Description": "Mark a queue item as resolved with a specific moderation action", @@ -188,7 +320,7 @@ "Setup": null }, { - "Order": 18, + "Order": 30, "Title": "Unresolve a queue item", "Slug": "queueview-openunresolveitem", "Description": "Mark a previously resolved queue item as unresolved/pending", @@ -199,7 +331,73 @@ "Setup": null }, { - "Order": 19, + "Order": 31, + "Title": "Create a webhook", + "Slug": "webhooks-publiccreate", + "Description": "Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint).", + "Language": "http", + "Code": "### Create a webhook\n# @name webhooks-publicCreate\nPOST {{host}}/webhooks\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022url\u0022: \u0022https://example.com\u0022,\n \u0022eventTypes\u0022: [\n \u0022QUEUE_ITEM_NEW\u0022\n ]\n}\n\n## Responses\n# 200\n# Description: Webhook created successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json", + "Format": "http", + "OperationId": "webhooks-publicCreate", + "Setup": null + }, + { + "Order": 32, + "Title": "Delete a webhook", + "Slug": "webhooks-publicdelete", + "Description": "Delete a webhook.", + "Language": "http", + "Code": "### Delete a webhook\n# @name webhooks-publicDelete\nDELETE {{host}}/webhooks/{{id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Webhook deleted successfully\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "webhooks-publicDelete", + "Setup": null + }, + { + "Order": 33, + "Title": "Get a webhook", + "Slug": "webhooks-publicget", + "Description": "Get a webhook by ID.", + "Language": "http", + "Code": "### Get a webhook\n# @name webhooks-publicGet\nGET {{host}}/webhooks/{{id}}\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Webhook retrieved successfully\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "webhooks-publicGet", + "Setup": null + }, + { + "Order": 34, + "Title": "Get the webhook signing secret", + "Slug": "webhooks-publicgetsecret", + "Description": "Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the \u0060modapi-signature\u0060 header to HMAC-SHA256(raw request body, secret) hex-encoded.", + "Language": "csharp", + "Code": "using var client = new ModerationAPIClient(apiKey);\nvar response = await client.Webhooks.WebhooksPublicGetSecretAsync();", + "Format": "sdk", + "OperationId": "webhooks-publicGetSecret", + "Setup": "This example assumes \u0060using ModerationAPI;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 35, + "Title": "List webhooks", + "Slug": "webhooks-publiclist", + "Description": "List all webhooks for the authenticated project.", + "Language": "csharp", + "Code": "using var client = new ModerationAPIClient(apiKey);\nvar response = await client.Webhooks.WebhooksPublicListAsync();", + "Format": "sdk", + "OperationId": "webhooks-publicList", + "Setup": "This example assumes \u0060using ModerationAPI;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 36, + "Title": "Update a webhook", + "Slug": "webhooks-publicupdate", + "Description": "Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead.", + "Language": "http", + "Code": "### Update a webhook\n# @name webhooks-publicUpdate\nPUT {{host}}/webhooks/{{id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022url\u0022: \u0022https://example.com\u0022,\n \u0022eventTypes\u0022: [\n \u0022QUEUE_ITEM_NEW\u0022\n ]\n}\n\n## Responses\n# 200\n# Description: Webhook updated successfully\n# Content-Type: application/json\n# 400\n# Description: Invalid input data\n# Content-Type: application/json\n# 401\n# Description: Authorization not provided\n# Content-Type: application/json\n# 404\n# Description: Not found\n# Content-Type: application/json", + "Format": "http", + "OperationId": "webhooks-publicUpdate", + "Setup": null + }, + { + "Order": 37, "Title": "Add words to wordlist", "Slug": "wordlist-addwords", "Description": "Add words to an existing wordlist", @@ -210,7 +408,7 @@ "Setup": null }, { - "Order": 20, + "Order": 38, "Title": "Get wordlist", "Slug": "wordlist-getwordlistpublic", "Description": "Get a specific wordlist by ID", @@ -221,7 +419,7 @@ "Setup": null }, { - "Order": 21, + "Order": 39, "Title": "List wordlists", "Slug": "wordlist-list", "Description": "List all wordlists for the authenticated organization", @@ -232,7 +430,7 @@ "Setup": "This example assumes \u0060using ModerationAPI;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 22, + "Order": 40, "Title": "Remove words from wordlist", "Slug": "wordlist-removewords", "Description": "Remove words from an existing wordlist", @@ -243,7 +441,7 @@ "Setup": null }, { - "Order": 23, + "Order": 41, "Title": "Update wordlist", "Slug": "wordlist-update", "Description": "Update a wordlist", @@ -254,7 +452,7 @@ "Setup": null }, { - "Order": 24, + "Order": 42, "Title": "Get embedding status", "Slug": "wordlist-wordlistembeddingstatus", "Description": "Get the current embedding progress status for a wordlist", diff --git a/src/libs/ModerationAPI/openapi.yaml b/src/libs/ModerationAPI/openapi.yaml index e006941..ed916eb 100644 --- a/src/libs/ModerationAPI/openapi.yaml +++ b/src/libs/ModerationAPI/openapi.yaml @@ -1,10669 +1,12922 @@ -openapi: 3.1.0 -info: - title: Moderation API - description: API for automated content moderation - version: 1.1.0 -servers: - - url: https://api.moderationapi.com/v1 -tags: - - name: Actions - - name: Queues - - name: Webhooks - - name: Wordlist - - name: UserReports - - name: Voice - description: Real-time voice moderation over WebSocket. -externalDocs: - url: https://docs.moderationapi.com -paths: - /authors: - get: - operationId: author-openListAuthors - summary: List authors - description: >- - Get a paginated list of authors with their activity metrics and - reputation - tags: - - author - security: - - Authorization: [] - parameters: - - in: query - name: pageSize - schema: - default: 20 - description: Number of authors per page - type: number - - in: query - name: pageNumber - schema: - default: 1 - description: Page number to fetch - type: number - - in: query - name: sortBy - schema: - type: string - enum: - - trustLevel - - violationCount - - reportCount - - memberSince - - lastActive - - contentCount - - flaggedContentRatio - - averageSentiment - - in: query - name: sortDirection - schema: - default: desc - description: Sort direction - type: string - enum: - - asc - - desc - - in: query - name: memberSinceDate - schema: - type: string - - in: query - name: lastActiveDate - schema: - type: string - - in: query - name: contentTypes - schema: - type: string - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - authors: - type: array - items: - $ref: '#/components/schemas/PublicAuthor' - pagination: - type: object - properties: - total: - type: number - pageSize: - type: number - pageNumber: - type: number - hasNextPage: - type: boolean - hasPreviousPage: - type: boolean - required: - - total - - pageSize - - pageNumber - - hasNextPage - - hasPreviousPage - additionalProperties: false - required: - - authors - - pagination - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const authors = await client.authors.list(); - - console.log(authors.authors); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - authors = client.authors.list() - print(authors.authors) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - authors = moderation_api.authors.list - - - puts(authors) - - lang: PHP - source: >- - authors->list( - contentTypes: 'contentTypes', - lastActiveDate: 'lastActiveDate', - memberSinceDate: 'memberSinceDate', - pageNumber: 0, - pageSize: 0, - sortBy: 'trustLevel', - sortDirection: 'asc', - ); - - var_dump($authors); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Authors; - - ModerationApiClient client = new(); - - AuthorListParams parameters = new(); - - var authors = await client.Authors.List(parameters); - - Console.WriteLine(authors); - post: - operationId: author-openCreate - summary: Create a new author - description: >- - Create a new author. Typically not needed as authors are created - automatically when content is moderated. - tags: - - author - security: - - Authorization: [] - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - profile_picture: - description: URL of the author's profile picture - anyOf: - - type: string - format: uri - - type: 'null' - external_link: - description: URL of the author's external profile - anyOf: - - type: string - format: uri - - type: 'null' - name: - description: Author name or identifier - anyOf: - - type: string - - type: 'null' - email: - description: Author email address - anyOf: - - type: string - format: email - pattern: >- - ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ - - type: 'null' - company: - description: The author's company or organization - anyOf: - - type: string - - type: 'null' - metadata: - type: object - properties: - email_verified: - description: Whether the author's email is verified - anyOf: - - type: boolean - - type: 'null' - phone_verified: - description: Whether the author's phone number is verified - anyOf: - - type: boolean - - type: 'null' - identity_verified: - description: Whether the author's identity is verified - anyOf: - - type: boolean - - type: 'null' - is_paying_customer: - description: Whether the author is a paying customer - anyOf: - - type: boolean - - type: 'null' - additionalProperties: {} - description: >- - Additional metadata provided by your system. We recommend - including any relevant information that may assist in the - moderation process. - first_seen: - type: number - description: Timestamp when author first appeared - last_seen: - type: number - description: Timestamp of last activity - manual_trust_level: - anyOf: - - type: number - minimum: -1 - maximum: 4 - - type: 'null' - external_id: - type: string - description: >- - External ID of the user, typically the ID of the author in - your database. - required: - - external_id - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PublicAuthor' - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: >- - import ModerationAPI from '@moderation-api/sdk'; - - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - - const author = await client.authors.create({ external_id: - 'external_id' }); - - - console.log(author.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - author = client.authors.create( - external_id="external_id", - ) - print(author.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - author = moderation_api.authors.create(external_id: "external_id") - - - puts(author) - - lang: PHP - source: >- - authors->create( - externalID: 'external_id', - company: 'company', - email: 'dev@stainless.com', - externalLink: 'https://example.com', - firstSeen: 0, - lastSeen: 0, - manualTrustLevel: -1, - metadata: [ - 'emailVerified' => true, - 'identityVerified' => true, - 'isPayingCustomer' => true, - 'phoneVerified' => true, +{ + "openapi": "3.1.0", + "info": { + "title": "Moderation API", + "description": "API for automated content moderation", + "version": "1.1.0" + }, + "servers": [ + { + "url": "https://api.moderationapi.com/v1" + } + ], + "tags": [ + { + "name": "Actions" + }, + { + "name": "Queues" + }, + { + "name": "Webhooks" + }, + { + "name": "Wordlist" + }, + { + "name": "UserReports" + }, + { + "name": "Projects" + }, + { + "name": "Channels" + }, + { + "name": "Voice", + "description": "Real-time voice moderation over WebSocket." + } + ], + "externalDocs": { + "url": "https://docs.moderationapi.com" + }, + "paths": { + "/authors": { + "get": { + "operationId": "author-openListAuthors", + "summary": "List authors", + "description": "Get a paginated list of authors with their activity metrics and reputation", + "tags": [ + "author" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of authors per page", + "type": "number" + } + }, + { + "in": "query", + "name": "pageNumber", + "schema": { + "default": 1, + "description": "Page number to fetch", + "type": "number" + } + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "trustLevel", + "violationCount", + "reportCount", + "memberSince", + "lastActive", + "contentCount", + "flaggedContentRatio", + "averageSentiment" + ] + } + }, + { + "in": "query", + "name": "sortDirection", + "schema": { + "default": "desc", + "description": "Sort direction", + "type": "string", + "enum": [ + "asc", + "desc" + ] + } + }, + { + "in": "query", + "name": "memberSinceDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "lastActiveDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "contentTypes", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "authors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "pagination": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "pageSize": { + "type": "number" + }, + "pageNumber": { + "type": "number" + }, + "hasNextPage": { + "type": "boolean" + }, + "hasPreviousPage": { + "type": "boolean" + } + }, + "required": [ + "total", + "pageSize", + "pageNumber", + "hasNextPage", + "hasPreviousPage" + ], + "additionalProperties": false + } + }, + "required": [ + "authors", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst authors = await client.authors.list();\n\nconsole.log(authors.authors);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nauthors = client.authors.list()\nprint(authors.authors)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nauthors = moderation_api.authors.list\n\nputs(authors)" + }, + { + "lang": "PHP", + "source": "authors->list(\n contentTypes: 'contentTypes',\n lastActiveDate: 'lastActiveDate',\n memberSinceDate: 'memberSinceDate',\n pageNumber: 0,\n pageSize: 0,\n sortBy: 'trustLevel',\n sortDirection: 'asc',\n );\n\n var_dump($authors);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Authors;\n\nModerationApiClient client = new();\n\nAuthorListParams parameters = new();\n\nvar authors = await client.Authors.List(parameters);\n\nConsole.WriteLine(authors);" + } + ] + }, + "post": { + "operationId": "author-openCreate", + "summary": "Create a new author", + "description": "Create a new author. Typically not needed as authors are created automatically when content is moderated.", + "tags": [ + "author" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "profile_picture": { + "description": "URL of the author's profile picture", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "external_link": { + "description": "URL of the author's external profile", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "Author name or identifier", + "type": [ + "string", + "null" + ] + }, + "email": { + "description": "Author email address", + "anyOf": [ + { + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + { + "type": "null" + } + ] + }, + "company": { + "description": "The author's company or organization", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": "object", + "properties": { + "email_verified": { + "description": "Whether the author's email is verified", + "type": [ + "boolean", + "null" + ] + }, + "phone_verified": { + "description": "Whether the author's phone number is verified", + "type": [ + "boolean", + "null" + ] + }, + "identity_verified": { + "description": "Whether the author's identity is verified", + "type": [ + "boolean", + "null" + ] + }, + "is_paying_customer": { + "description": "Whether the author is a paying customer", + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": {}, + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process." + }, + "first_seen": { + "type": "number", + "description": "Timestamp when author first appeared" + }, + "last_seen": { + "type": "number", + "description": "Timestamp of last activity" + }, + "manual_trust_level": { + "anyOf": [ + { + "type": "number", + "minimum": -1, + "maximum": 4 + }, + { + "type": "null" + } + ] + }, + "external_id": { + "type": "string", + "description": "External ID of the user, typically the ID of the author in your database." + } + }, + "required": [ + "external_id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicAuthor" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst author = await client.authors.create({ external_id: 'external_id' });\n\nconsole.log(author.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nauthor = client.authors.create(\n external_id=\"external_id\",\n)\nprint(author.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nauthor = moderation_api.authors.create(external_id: \"external_id\")\n\nputs(author)" + }, + { + "lang": "PHP", + "source": "authors->create(\n externalID: 'external_id',\n company: 'company',\n email: 'user@example.com',\n externalLink: 'https://example.com',\n firstSeen: 0,\n lastSeen: 0,\n manualTrustLevel: -1,\n metadata: [\n 'emailVerified' => true,\n 'identityVerified' => true,\n 'isPayingCustomer' => true,\n 'phoneVerified' => true,\n ],\n name: 'name',\n profilePicture: 'https://example.com',\n );\n\n var_dump($author);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Authors;\n\nModerationApiClient client = new();\n\nAuthorCreateParams parameters = new() { ExternalID = \"external_id\" };\n\nvar author = await client.Authors.Create(parameters);\n\nConsole.WriteLine(author);" + } + ] + } + }, + "/authors/{id}": { + "get": { + "operationId": "author-openGetAuthorDetails", + "summary": "Get author details", + "description": "Get detailed information about a specific author including historical data and analysis", + "tags": [ + "author" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicAuthor" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst author = await client.authors.retrieve('id');\n\nconsole.log(author.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nauthor = client.authors.retrieve(\n \"id\",\n)\nprint(author.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nauthor = moderation_api.authors.retrieve(\"id\")\n\nputs(author)" + }, + { + "lang": "PHP", + "source": "authors->retrieve('id');\n\n var_dump($author);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Authors;\n\nModerationApiClient client = new();\n\nAuthorRetrieveParams parameters = new() { ID = \"id\" };\n\nvar author = await client.Authors.Retrieve(parameters);\n\nConsole.WriteLine(author);" + } + ] + }, + "put": { + "operationId": "author-openUpdate", + "summary": "Update author details", + "description": "Update the details of a specific author", + "tags": [ + "author" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "profile_picture": { + "description": "URL of the author's profile picture", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "external_link": { + "description": "URL of the author's external profile", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "Author name or identifier", + "type": [ + "string", + "null" + ] + }, + "email": { + "description": "Author email address", + "anyOf": [ + { + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + { + "type": "null" + } + ] + }, + "company": { + "description": "The author's company or organization", + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": "object", + "properties": { + "email_verified": { + "description": "Whether the author's email is verified", + "type": [ + "boolean", + "null" + ] + }, + "phone_verified": { + "description": "Whether the author's phone number is verified", + "type": [ + "boolean", + "null" + ] + }, + "identity_verified": { + "description": "Whether the author's identity is verified", + "type": [ + "boolean", + "null" + ] + }, + "is_paying_customer": { + "description": "Whether the author is a paying customer", + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": {}, + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process." + }, + "first_seen": { + "type": "number", + "description": "Timestamp when author first appeared" + }, + "last_seen": { + "type": "number", + "description": "Timestamp of last activity" + }, + "manual_trust_level": { + "anyOf": [ + { + "type": "number", + "minimum": -1, + "maximum": 4 + }, + { + "type": "null" + } + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicAuthor" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst author = await client.authors.update('id');\n\nconsole.log(author.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nauthor = client.authors.update(\n id=\"id\",\n)\nprint(author.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nauthor = moderation_api.authors.update(\"id\")\n\nputs(author)" + }, + { + "lang": "PHP", + "source": "authors->update(\n 'id',\n company: 'company',\n email: 'user@example.com',\n externalLink: 'https://example.com',\n firstSeen: 0,\n lastSeen: 0,\n manualTrustLevel: -1,\n metadata: [\n 'emailVerified' => true,\n 'identityVerified' => true,\n 'isPayingCustomer' => true,\n 'phoneVerified' => true,\n ],\n name: 'name',\n profilePicture: 'https://example.com',\n );\n\n var_dump($author);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Authors;\n\nModerationApiClient client = new();\n\nAuthorUpdateParams parameters = new() { ID = \"id\" };\n\nvar author = await client.Authors.Update(parameters);\n\nConsole.WriteLine(author);" + } + ] + }, + "delete": { + "operationId": "author-delete", + "summary": "Delete an author", + "description": "Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID.", + "tags": [ + "author" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + }, + "required": [ + "success" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst author = await client.authors.delete('id');\n\nconsole.log(author.success);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nauthor = client.authors.delete(\n \"id\",\n)\nprint(author.success)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nauthor = moderation_api.authors.delete(\"id\")\n\nputs(author)" + }, + { + "lang": "PHP", + "source": "authors->delete('id');\n\n var_dump($author);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Authors;\n\nModerationApiClient client = new();\n\nAuthorDeleteParams parameters = new() { ID = \"id\" };\n\nvar author = await client.Authors.Delete(parameters);\n\nConsole.WriteLine(author);" + } + ] + } + }, + "/queue/{id}": { + "get": { + "operationId": "queueView-openGetQueue", + "summary": "Get a queue", + "description": "Get a queue", + "tags": [ + "review-queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "queue": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "filter": { + "type": "object", + "properties": { + "isFlagged": { + "type": "string", + "enum": [ + "ALL", + "FLAGGED", + "NOT_FLAGGED", + "SHADOW_FLAGGED" + ] + }, + "casebookAnswer": { + "type": "string", + "enum": [ + "ALL", + "ALLOWED", + "REJECTED", + "NO_ANSWER" + ] + }, + "casebookAgreement": { + "type": "string", + "enum": [ + "ALL", + "OVERRULED", + "AGREED" + ] + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "filterLabels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "FLAGGED", + "NOT_FLAGGED", + "THRESHOLDS", + "MATCHED" + ] + }, + "minThreshold": { + "anyOf": [ + { + "type": "number", + "minimum": 0, + "maximum": 100 + }, + { + "type": "null" + } + ] + }, + "maxThreshold": { + "anyOf": [ + { + "type": "number", + "minimum": 0, + "maximum": 100 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "label", + "type" + ], + "additionalProperties": false + } + }, + "metadataFilters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "value": { + "type": "string", + "maxLength": 512 + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + }, + "filteredChannelIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "filteredActionIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "languages": { + "type": "array", + "items": { + "type": "string" + } + }, + "contentTypes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ] + } + }, + "mediaTypes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "text", + "image", + "video", + "object", + "audio" + ] + } + }, + "authorTrustLevels": { + "type": "array", + "items": { + "type": "integer", + "minimum": -1, + "maximum": 4 + } + }, + "recommendationActions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ] + } + }, + "minSeverity": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "maxSeverity": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "afterDate": { + "type": "string" + }, + "beforeDate": { + "type": "string" + }, + "within": { + "type": "number", + "exclusiveMinimum": 0 + }, + "withinUnit": { + "type": "string", + "enum": [ + "MINUTES", + "HOURS", + "DAYS", + "WEEKS", + "MONTHS", + "YEARS" + ] + }, + "clearDateWindow": { + "type": "boolean" + }, + "checkStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "all", + "checked", + "unchecked" + ] + }, + { + "type": "null" + } + ] + }, + "authorID": { + "type": "string" + }, + "contentID": { + "type": "string" + }, + "conversationIds": { + "type": "array", + "items": { + "type": [ + "string", + "null" + ] + } + }, + "search": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "unresolvedItemsCount": { + "type": "number" + }, + "resolvedItemsCount": { + "type": "number" + }, + "totalItemsCount": { + "type": "number" + } + }, + "required": [ + "id", + "name", + "description", + "filter", + "unresolvedItemsCount", + "resolvedItemsCount", + "totalItemsCount" + ], + "additionalProperties": false + } + }, + "required": [ + "queue" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst queue = await client.queue.retrieve('id');\n\nconsole.log(queue.queue);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nqueue = client.queue.retrieve(\n \"id\",\n)\nprint(queue.queue)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nqueue = moderation_api.queue.retrieve(\"id\")\n\nputs(queue)" + }, + { + "lang": "PHP", + "source": "queue->retrieve('id');\n\n var_dump($queue);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Queue;\n\nModerationApiClient client = new();\n\nQueueRetrieveParams parameters = new() { ID = \"id\" };\n\nvar queue = await client.Queue.Retrieve(parameters);\n\nConsole.WriteLine(queue);" + } + ] + } + }, + "/queue/{id}/stats": { + "get": { + "operationId": "queueView-openGetStats", + "summary": "Get queue statistics", + "description": "Get detailed statistics about a moderation queue including review times, action counts, and trends", + "tags": [ + "review-queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "query", + "name": "withinDays", + "schema": { + "default": "30", + "description": "Number of days to analyze statistics for", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reviewStats": { + "type": "object", + "properties": { + "averageTimeToReview": { + "type": "number", + "description": "Average time in milliseconds to review an item" + }, + "totalReviewed": { + "type": "number", + "description": "Total number of items reviewed" + }, + "totalPending": { + "type": "number", + "description": "Total number of items pending review" + } + }, + "required": [ + "averageTimeToReview", + "totalReviewed", + "totalPending" + ], + "additionalProperties": false + }, + "actionStats": { + "type": "array", + "items": { + "type": "object", + "properties": { + "actionId": { + "type": "string", + "description": "ID of the moderation action" + }, + "actionName": { + "type": "string", + "description": "Name of the moderation action" + }, + "count": { + "type": "number", + "description": "Number of times this action was taken" + }, + "percentageOfTotal": { + "type": "number", + "description": "Percentage this action represents of all actions" + } + }, + "required": [ + "actionId", + "actionName", + "count", + "percentageOfTotal" + ], + "additionalProperties": false + } + }, + "topReviewers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "ID of the reviewer" + }, + "name": { + "type": "string", + "description": "Name of the reviewer" + }, + "reviewCount": { + "type": "number", + "description": "Number of items reviewed" + }, + "averageTimePerReview": { + "type": "number", + "description": "Average review time in milliseconds" + }, + "accuracyScore": { + "description": "Optional accuracy score based on review quality metrics", + "type": "number" + }, + "topActions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "actionId": { + "type": "string", + "description": "Most used action by this reviewer" + }, + "actionName": { + "type": "string", + "description": "Name of the most used action" + }, + "count": { + "type": "number", + "description": "Number of times this action was used" + } + }, + "required": [ + "actionId", + "actionName", + "count" + ], + "additionalProperties": false + }, + "description": "Most common actions taken by this reviewer" + } + }, + "required": [ + "userId", + "name", + "reviewCount", + "averageTimePerReview", + "topActions" + ], + "additionalProperties": false + }, + "description": "List of top reviewers and their statistics" + }, + "trends": { + "type": "object", + "properties": { + "dailyReviewCounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "Date in YYYY-MM-DD format" + }, + "count": { + "type": "number", + "description": "Number of reviews on this date" + } + }, + "required": [ + "date", + "count" + ], + "additionalProperties": false + } + }, + "flaggedContentTrends": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "Content flag/label" + }, + "trend": { + "type": "number", + "description": "Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing" + } + }, + "required": [ + "label", + "trend" + ], + "additionalProperties": false + } + } + }, + "required": [ + "dailyReviewCounts", + "flaggedContentTrends" + ], + "additionalProperties": false + } + }, + "required": [ + "reviewStats", + "actionStats", + "topReviewers", + "trends" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.queue.getStats('id');\n\nconsole.log(response.actionStats);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nresponse = client.queue.get_stats(\n id=\"id\",\n)\nprint(response.action_stats)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nresponse = moderation_api.queue.get_stats(\"id\")\n\nputs(response)" + }, + { + "lang": "PHP", + "source": "queue->getStats('id', withinDays: 'withinDays');\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Queue;\n\nModerationApiClient client = new();\n\nQueueGetStatsParams parameters = new() { ID = \"id\" };\n\nvar response = await client.Queue.GetStats(parameters);\n\nConsole.WriteLine(response);" + } + ] + } + }, + "/queue/{id}/items": { + "get": { + "operationId": "queueView-openGetItems", + "summary": "Get queue items", + "description": "Get paginated list of items in a moderation queue with filtering options", + "tags": [ + "review-queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "default": 20, + "description": "Number of items per page", + "type": "number" + } + }, + { + "in": "query", + "name": "pageNumber", + "schema": { + "default": 1, + "description": "Page number to fetch", + "type": "number" + } + }, + { + "in": "query", + "name": "sortField", + "schema": { + "type": "string", + "enum": [ + "createdAt", + "severity", + "reviewedAt" + ] + } + }, + { + "in": "query", + "name": "sortDirection", + "schema": { + "default": "desc", + "description": "Sort direction", + "type": "string", + "enum": [ + "asc", + "desc" + ] + } + }, + { + "in": "query", + "name": "conversationIds", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "labels", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "afterDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "beforeDate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "includeResolved", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "authorId", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "filteredActionIds", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Content ID" + }, + "content": { + "type": "string", + "description": "The content to be moderated" + }, + "language": { + "description": "Content language", + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "Label name" + }, + "score": { + "type": "number", + "description": "Confidence score of the label" + }, + "flagged": { + "type": "boolean", + "description": "Whether this label caused a flag" + } + }, + "required": [ + "label", + "score", + "flagged" + ], + "additionalProperties": false + } + }, + "conversationId": { + "description": "Conversation ID", + "type": "string" + }, + "authorId": { + "description": "Author ID", + "type": "string" + }, + "actions": { + "description": "Action IDs taken on this item", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Action ID" + }, + "name": { + "type": "string", + "description": "Action name" + }, + "comment": { + "description": "Action comment", + "type": "string" + }, + "timestamp": { + "type": "number", + "description": "Unix timestamp of when the action was taken" + }, + "reviewer": { + "description": "Moderator userID", + "type": "string" + } + }, + "required": [ + "id", + "name", + "timestamp" + ], + "additionalProperties": false + } + }, + "flagged": { + "type": "boolean", + "description": "Whether the item is flagged by any label" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "resolved" + ], + "description": "Status of the item" + }, + "timestamp": { + "type": "number", + "description": "Unix timestamp of when the item was created" + }, + "contentType": { + "description": "Type of the content object", + "type": "string" + } + }, + "required": [ + "id", + "content", + "labels", + "flagged", + "status", + "timestamp" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "totalItems": { + "type": "number" + }, + "totalPages": { + "type": "number" + }, + "currentPage": { + "type": "number" + }, + "hasNextPage": { + "type": "boolean" + }, + "hasPreviousPage": { + "type": "boolean" + } + }, + "required": [ + "totalItems", + "totalPages", + "currentPage", + "hasNextPage", + "hasPreviousPage" + ], + "additionalProperties": false + } + }, + "required": [ + "items", + "pagination" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst items = await client.queue.items.list('id');\n\nconsole.log(items.items);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nitems = client.queue.items.list(\n id=\"id\",\n)\nprint(items.items)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nitems = moderation_api.queue.items.list(\"id\")\n\nputs(items)" + }, + { + "lang": "PHP", + "source": "queue->items->list(\n 'id',\n afterDate: 'afterDate',\n authorID: 'authorId',\n beforeDate: 'beforeDate',\n conversationIDs: 'conversationIds',\n filteredActionIDs: 'filteredActionIds',\n includeResolved: 'includeResolved',\n labels: 'labels',\n pageNumber: 0,\n pageSize: 0,\n sortDirection: 'asc',\n sortField: 'createdAt',\n );\n\n var_dump($items);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Queue.Items;\n\nModerationApiClient client = new();\n\nItemListParams parameters = new() { ID = \"id\" };\n\nvar items = await client.Queue.Items.List(parameters);\n\nConsole.WriteLine(items);" + } + ] + } + }, + "/queue/{id}/items/{itemId}/resolve": { + "post": { + "operationId": "queueView-openResolveItem", + "summary": "Resolve a queue item", + "description": "Mark a queue item as resolved with a specific moderation action", + "tags": [ + "review-queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "path", + "name": "itemId", + "schema": { + "type": "string", + "description": "The item ID to resolve" + }, + "required": true, + "description": "The item ID to resolve" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "comment": { + "description": "Optional comment", + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "resolvedAt": { + "type": "string", + "description": "Timestamp when the item was resolved" + }, + "comment": { + "description": "Optional comment", + "type": "string" + } + }, + "required": [ + "success", + "resolvedAt" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.queue.items.resolve('itemId', { id: 'id' });\n\nconsole.log(response.resolvedAt);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nresponse = client.queue.items.resolve(\n item_id=\"itemId\",\n id=\"id\",\n)\nprint(response.resolved_at)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nresponse = moderation_api.queue.items.resolve(\"itemId\", id: \"id\")\n\nputs(response)" + }, + { + "lang": "PHP", + "source": "queue->items->resolve(\n 'itemId', id: 'id', comment: 'comment'\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Queue.Items;\n\nModerationApiClient client = new();\n\nItemResolveParams parameters = new()\n{\n ID = \"id\",\n ItemID = \"itemId\",\n};\n\nvar response = await client.Queue.Items.Resolve(parameters);\n\nConsole.WriteLine(response);" + } + ] + } + }, + "/queue/{id}/items/{itemId}/unresolve": { + "post": { + "operationId": "queueView-openUnresolveItem", + "summary": "Unresolve a queue item", + "description": "Mark a previously resolved queue item as unresolved/pending", + "tags": [ + "review-queues" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The queue ID" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "path", + "name": "itemId", + "schema": { + "type": "string", + "description": "The item ID to unresolve" + }, + "required": true, + "description": "The item ID to unresolve" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "comment": { + "description": "Optional reason for unresolving the item", + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "status": { + "type": "string", + "description": "New status of the item" + }, + "unresolvedAt": { + "type": "string", + "description": "Timestamp when the item was unresolved" + } + }, + "required": [ + "success", + "status", + "unresolvedAt" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.queue.items.unresolve('itemId', { id: 'id' });\n\nconsole.log(response.status);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nresponse = client.queue.items.unresolve(\n item_id=\"itemId\",\n id=\"id\",\n)\nprint(response.status)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nresponse = moderation_api.queue.items.unresolve(\"itemId\", id: \"id\")\n\nputs(response)" + }, + { + "lang": "PHP", + "source": "queue->items->unresolve(\n 'itemId', id: 'id', comment: 'comment'\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Queue.Items;\n\nModerationApiClient client = new();\n\nItemUnresolveParams parameters = new()\n{\n ID = \"id\",\n ItemID = \"itemId\",\n};\n\nvar response = await client.Queue.Items.Unresolve(parameters);\n\nConsole.WriteLine(response);" + } + ] + } + }, + "/actions": { + "get": { + "operationId": "actions-list", + "summary": "List moderation actions", + "description": "List all available moderation actions for the authenticated organization.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "queueId", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the action." + }, + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText" + ], + "additionalProperties": false + }, + "description": "List of moderation actions with their associated webhooks" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst actions = await client.actions.list();\n\nconsole.log(actions);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nactions = client.actions.list()\nprint(actions)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nactions = moderation_api.actions.list\n\nputs(actions)" + }, + { + "lang": "PHP", + "source": "actions->list(queueID: 'queueId');\n\n var_dump($actions);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Actions;\n\nModerationApiClient client = new();\n\nActionListParams parameters = new();\n\nvar actions = await client.Actions.List(parameters);\n\nConsole.WriteLine(actions);" + } + ] + }, + "post": { + "operationId": "actions-create", + "summary": "Create an action", + "description": "Create an action.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ] + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Action created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the action." + }, + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "409": { + "description": "Action with this key already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.CONFLICT" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst action = await client.actions.create({ name: 'name' });\n\nconsole.log(action.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\naction = client.actions.create(\n name=\"name\",\n)\nprint(action.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\naction = moderation_api.actions.create(name: \"name\")\n\nputs(action)" + }, + { + "lang": "PHP", + "source": "actions->create(\n name: 'name',\n builtIn: true,\n description: 'description',\n filterInQueueIDs: ['string'],\n freeText: true,\n key: 'key',\n position: 'ALL_QUEUES',\n possibleValues: [['value' => 'value']],\n queueBehaviour: 'REMOVE',\n type: 'AUTHOR_BLOCK',\n valueRequired: true,\n );\n\n var_dump($action);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Actions;\n\nModerationApiClient client = new();\n\nActionCreateParams parameters = new() { Name = \"name\" };\n\nvar action = await client.Actions.Create(parameters);\n\nConsole.WriteLine(action);" + } + ] + } + }, + "/actions/{id}": { + "get": { + "operationId": "actions-get", + "summary": "Get an action", + "description": "Get an action by ID.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the action to get." + }, + "required": true, + "description": "The ID of the action to get." + } + ], + "responses": { + "200": { + "description": "Action retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the action." + }, + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst action = await client.actions.retrieve('id');\n\nconsole.log(action.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\naction = client.actions.retrieve(\n \"id\",\n)\nprint(action.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\naction = moderation_api.actions.retrieve(\"id\")\n\nputs(action)" + }, + { + "lang": "PHP", + "source": "actions->retrieve('id');\n\n var_dump($action);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Actions;\n\nModerationApiClient client = new();\n\nActionRetrieveParams parameters = new() { ID = \"id\" };\n\nvar action = await client.Actions.Retrieve(parameters);\n\nConsole.WriteLine(action);" + } + ] + }, + "put": { + "operationId": "actions-update", + "summary": "Update an action", + "description": "Update an action.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the action to update." + }, + "required": true, + "description": "The ID of the action to update." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ] + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the action." + }, + "key": { + "description": "User defined key of the action.", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the action." + }, + "description": { + "description": "The description of the action.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The type of the action.", + "anyOf": [ + { + "type": "string", + "enum": [ + "AUTHOR_BLOCK", + "AUTHOR_BLOCK_TEMP", + "AUTHOR_UNBLOCK", + "AUTHOR_DELETE", + "AUTHOR_REPORT", + "AUTHOR_WARN", + "AUTHOR_CUSTOM", + "ITEM_REJECT", + "ITEM_ALLOW", + "ITEM_CUSTOM" + ] + }, + { + "type": "null" + } + ] + }, + "builtIn": { + "default": false, + "description": "Whether the action is a built-in action or a custom one.", + "type": [ + "boolean", + "null" + ] + }, + "queueBehaviour": { + "default": "NO_CHANGE", + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "default": [], + "description": "The IDs of the queues the action is available in.", + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "default": "ALL_QUEUES", + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "default": [], + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the action." + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "default": false, + "description": "Whether the action requires a value to be executed.", + "type": "boolean" + }, + "freeText": { + "default": false, + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "type": "boolean" + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "409": { + "description": "Action with this key already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.CONFLICT" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst action = await client.actions.update('id');\n\nconsole.log(action.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\naction = client.actions.update(\n id=\"id\",\n)\nprint(action.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\naction = moderation_api.actions.update(\"id\")\n\nputs(action)" + }, + { + "lang": "PHP", + "source": "actions->update(\n 'id',\n builtIn: true,\n description: 'description',\n filterInQueueIDs: ['string'],\n freeText: true,\n key: 'key',\n name: 'name',\n position: 'ALL_QUEUES',\n possibleValues: [['value' => 'value']],\n queueBehaviour: 'REMOVE',\n type: 'AUTHOR_BLOCK',\n valueRequired: true,\n );\n\n var_dump($action);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Actions;\n\nModerationApiClient client = new();\n\nActionUpdateParams parameters = new() { ID = \"id\" };\n\nvar action = await client.Actions.Update(parameters);\n\nConsole.WriteLine(action);" + } + ] + }, + "delete": { + "operationId": "actions-delete", + "summary": "Delete an action", + "description": "Delete an action and all of its webhooks.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the action to delete." + }, + "required": true, + "description": "The ID of the action to delete." + } + ], + "responses": { + "200": { + "description": "Action deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the action was deleted." + }, + "id": { + "type": "string", + "description": "The ID of the action." + } + }, + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst action = await client.actions.delete('id');\n\nconsole.log(action.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\naction = client.actions.delete(\n \"id\",\n)\nprint(action.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\naction = moderation_api.actions.delete(\"id\")\n\nputs(action)" + }, + { + "lang": "PHP", + "source": "actions->delete('id');\n\n var_dump($action);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Actions;\n\nModerationApiClient client = new();\n\nActionDeleteParams parameters = new() { ID = \"id\" };\n\nvar action = await client.Actions.Delete(parameters);\n\nConsole.WriteLine(action);" + } + ] + } + }, + "/actions/execute": { + "post": { + "operationId": "actions-execute", + "summary": "Execute moderation action", + "description": "Execute a moderation action on one or more content items.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "actionKey": { + "type": "string", + "description": "ID or key of the action to execute" + }, + "contentIds": { + "description": "IDs of the content items to apply the action to. Provide this or authorIds.", + "type": "array", + "items": { + "type": "string" + } + }, + "authorIds": { + "description": "IDs of the authors to apply the action to. Provide this or contentIds.", + "type": "array", + "items": { + "type": "string" + } + }, + "value": { + "description": "Optional value to provide with the action", + "type": "string" + }, + "queueId": { + "description": "Optional queue ID if the action is queue-specific", + "type": "string" + }, + "duration": { + "description": "Optional duration in milliseconds for actions with timeouts", + "type": "number", + "minimum": 0 + } + }, + "required": [ + "actionKey" + ], + "description": "Input parameters" + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.actions.execute.execute({ actionKey: 'actionKey' });\n\nconsole.log(response.success);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nresponse = client.actions.execute.execute(\n action_key=\"actionKey\",\n)\nprint(response.success)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nresponse = moderation_api.actions.execute.execute(action_key: \"actionKey\")\n\nputs(response)" + }, + { + "lang": "PHP", + "source": "actions->execute->execute(\n actionKey: 'actionKey',\n authorIDs: ['string'],\n contentIDs: ['string'],\n duration: 0,\n queueID: 'queueId',\n value: 'value',\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Actions.Execute;\n\nModerationApiClient client = new();\n\nExecuteExecuteParams parameters = new() { ActionKey = \"actionKey\" };\n\nvar response = await client.Actions.Execute.Execute(parameters);\n\nConsole.WriteLine(response);" + } + ] + } + }, + "/actions/{actionId}/execute": { + "post": { + "operationId": "actions-executeDeprecated", + "summary": "Execute an action", + "description": "Execute an action on a set of content items in a queue.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [ + { + "in": "path", + "name": "actionId", + "schema": { + "type": "string", + "description": "The ID or key of the action to execute." + }, + "required": true, + "description": "The ID or key of the action to execute." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contentIds": { + "description": "The IDs of the content items to perform the action on.", + "type": "array", + "items": { + "type": "string" + } + }, + "authorIds": { + "description": "IDs of the authors to apply the action to", + "type": "array", + "items": { + "type": "string" + } + }, + "queueId": { + "description": "The ID of the queue the action was performed from if any.", + "type": "string" + }, + "value": { + "description": "The value of the action. Useful to set a reason for the action etc.", + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Action executed successfully." + }, + "actionId": { + "type": "string", + "description": "The ID of the action." + }, + "ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the content items." + } + }, + "required": [ + "success", + "actionId", + "ids" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.actions.execute.executeByID('actionId');\n\nconsole.log(response.ids);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nresponse = client.actions.execute.execute_by_id(\n action_id=\"actionId\",\n)\nprint(response.ids)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nresponse = moderation_api.actions.execute.execute_by_id(\"actionId\")\n\nputs(response)" + }, + { + "lang": "PHP", + "source": "actions->execute->executeByID(\n 'actionId',\n authorIDs: ['string'],\n contentIDs: ['string'],\n queueID: 'queueId',\n value: 'value',\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Actions.Execute;\n\nModerationApiClient client = new();\n\nExecuteExecuteByIDParams parameters = new() { ActionID = \"actionId\" };\n\nvar response = await client.Actions.Execute.ExecuteByID(parameters);\n\nConsole.WriteLine(response);" + } + ] + } + }, + "/webhooks": { + "get": { + "operationId": "webhooks-publicList", + "summary": "List webhooks", + "description": "List all webhooks for the authenticated project.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Webhooks retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the webhook." + }, + "name": { + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." + }, + "eventTypes": { + "default": [], + "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + } + }, + "payloadVersion": { + "type": "string", + "enum": [ + "V1", + "V2" + ], + "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + }, + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "url", + "eventTypes", + "payloadVersion", + "createdAt" + ], + "additionalProperties": false + } + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + } + } + }, + "post": { + "operationId": "webhooks-publicCreate", + "summary": "Create a webhook", + "description": "Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint).", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "The webhook's name, used to identify it in the dashboard" + }, + "description": { + "description": "The webhook's description", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "format": "uri", + "description": "The webhook's URL. We'll call this URL when an event occurs." + }, + "eventTypes": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + }, + "description": "Event types this webhook subscribes to. One webhook URL receives all events you list here." + } + }, + "required": [ + "name", + "url", + "eventTypes" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Webhook created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the webhook." + }, + "name": { + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." + }, + "eventTypes": { + "default": [], + "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + } + }, + "payloadVersion": { + "type": "string", + "enum": [ + "V1", + "V2" + ], + "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + }, + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "url", + "eventTypes", + "payloadVersion", + "createdAt" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + } + } + } + }, + "/webhooks/{id}": { + "get": { + "operationId": "webhooks-publicGet", + "summary": "Get a webhook", + "description": "Get a webhook by ID.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the webhook to get." + }, + "required": true, + "description": "The ID of the webhook to get." + } + ], + "responses": { + "200": { + "description": "Webhook retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the webhook." + }, + "name": { + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." + }, + "eventTypes": { + "default": [], + "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + } + }, + "payloadVersion": { + "type": "string", + "enum": [ + "V1", + "V2" + ], + "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + }, + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "url", + "eventTypes", + "payloadVersion", + "createdAt" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + }, + "put": { + "operationId": "webhooks-publicUpdate", + "summary": "Update a webhook", + "description": "Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the webhook to update." + }, + "required": true, + "description": "The ID of the webhook to update." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "description": "The webhook's name, used to identify it in the dashboard" + }, + "description": { + "description": "The webhook's description", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "format": "uri", + "description": "The webhook's URL. We'll call this URL when an event occurs." + }, + "eventTypes": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + }, + "description": "Event types this webhook subscribes to. One webhook URL receives all events you list here." + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Webhook updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the webhook." + }, + "name": { + "type": "string", + "description": "The webhook's name." + }, + "description": { + "description": "The webhook's description.", + "type": [ + "string", + "null" + ] + }, + "url": { + "type": "string", + "description": "The URL we call when a subscribed event occurs." + }, + "eventTypes": { + "default": [], + "description": "Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "QUEUE_ITEM_NEW", + "QUEUE_ITEM_COMPLETED", + "QUEUE_ITEM_ACTION", + "QUEUE_ITEM_REJECTED", + "QUEUE_ITEM_ALLOWED", + "AUTHOR_BLOCKED", + "AUTHOR_UNBLOCKED", + "AUTHOR_SUSPENDED", + "AUTHOR_UPDATED", + "AUTHOR_TRUST_LEVEL_CHANGED", + "AUTHOR_ACTION" + ] + } + }, + "payloadVersion": { + "type": "string", + "enum": [ + "V1", + "V2" + ], + "description": "Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API." + }, + "createdAt": { + "description": "The date the webhook was created.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "url", + "eventTypes", + "payloadVersion", + "createdAt" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + }, + "delete": { + "operationId": "webhooks-publicDelete", + "summary": "Delete a webhook", + "description": "Delete a webhook.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the webhook to delete." + }, + "required": true, + "description": "The ID of the webhook to delete." + } + ], + "responses": { + "200": { + "description": "Webhook deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the webhook was deleted." + }, + "id": { + "type": "string", + "description": "The ID of the webhook." + } + }, + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + } + }, + "/webhook-secret": { + "get": { + "operationId": "webhooks-publicGetSecret", + "summary": "Get the webhook signing secret", + "description": "Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded.", + "tags": [ + "Webhooks" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Signing secret retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "The signing secret for this project. Every webhook delivery is signed with HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` header." + } + }, + "required": [ + "secret" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + } + } + } + }, + "/moderate/text": { + "post": { + "operationId": "moderation-text", + "summary": "Analyze text", + "description": "(Deprecated — use https://api.moderationapi.com/v1/moderate) Analyze text content. Runs the same policy engine as POST /moderate; the per-model result blocks are approximated from the policies it ran.", + "tags": [ + "Moderate" + ], + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contentId": { + "description": "The unique ID of the content in your database.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "channelKey": { + "description": "The key of the channel.", + "type": "string" + }, + "doNotStore": { + "description": "Do not store the content. The content won't enter the review queue", + "type": "boolean" + }, + "authorId": { + "description": "The author of the content.", + "type": "string" + }, + "contextId": { + "description": "For example the ID of a chat room or a post", + "type": "string" + }, + "metadata": { + "description": "Any metadata you want to store with the content", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "value": { + "type": "string", + "maxLength": 100000, + "description": "The text you'd like to analyze. We recommend to submit plain text or HTML" + } + }, + "required": [ + "value" + ], + "description": "Input parameters for text moderation" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Success if the request was successful" + }, + "contentId": { + "description": "The ID of the content.", + "type": "string" + }, + "request": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "The timestamp of the request" + }, + "quota_usage": { + "type": "number", + "description": "The quota usage of the request" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false, + "description": "Information about the request" + }, + "flagged": { + "type": "boolean", + "description": "Whether the content was flagged by any models" + }, + "author": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" + }, + "external_id": { + "description": "The author's ID from your system", + "type": [ + "string", + "null" + ] + }, + "block": { + "anyOf": [ + { + "type": "object", + "properties": { + "until": { + "description": "The timestamp until which they are blocked if the author is suspended.", + "type": [ + "number", + "null" + ] + }, + "reason": { + "description": "The moderators reason why the author was blocked or suspended.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Block or suspension details, if applicable. Null if the author is enabled." + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ], + "description": "Current author status" + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" + }, + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content." + }, + "content_moderated": { + "type": "boolean", + "description": "Whether the content was moderated or not. Same as `content` !== `original`" + }, + "unicode_spoofing": { + "type": "boolean", + "description": "Whether the content is using look-alike characters. Often used by spammers." + }, + "data_found": { + "type": "boolean", + "description": "Whether any entity matchers found data for the content" + }, + "original": { + "type": "string", + "description": "The original content" + }, + "content": { + "type": "string", + "description": "The content after moderation. With all mask replacements applied and look-alike characters replaced with the original characters." + } + }, + "required": [ + "status", + "request", + "flagged", + "author", + "content_moderated", + "unicode_spoofing", + "data_found", + "original", + "content" + ], + "additionalProperties": false + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + ] + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + } + } + }, + "/moderate/image": { + "post": { + "operationId": "moderation-image", + "summary": "Analyze image", + "description": "(Deprecated — use https://api.moderationapi.com/v1/moderate) Analyze an image. Runs the same policy engine as POST /moderate; `labels` is approximated from the policies it ran and `texts` is no longer populated.", + "tags": [ + "Moderate" + ], + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contentId": { + "description": "The unique ID of the content in your database.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "channelKey": { + "description": "The key of the channel.", + "type": "string" + }, + "doNotStore": { + "description": "Do not store the content. The content won't enter the review queue", + "type": "boolean" + }, + "authorId": { + "description": "The author of the content.", + "type": "string" + }, + "contextId": { + "description": "For example the ID of a chat room or a post", + "type": "string" + }, + "metadata": { + "description": "Any metadata you want to store with the content", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the image you want to analyze." + } + }, + "required": [ + "url" + ], + "description": "Input parameters for image moderation" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Success if the request was successful" + }, + "contentId": { + "description": "The ID of the content.", + "type": "string" + }, + "request": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "description": "The timestamp of the request" + }, + "quota_usage": { + "type": "number", + "description": "The quota usage of the request" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false, + "description": "Information about the request" + }, + "flagged": { + "type": "boolean", + "description": "Whether the content was flagged by any models" + }, + "author": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" + }, + "external_id": { + "description": "The author's ID from your system", + "type": [ + "string", + "null" + ] + }, + "block": { + "anyOf": [ + { + "type": "object", + "properties": { + "until": { + "description": "The timestamp until which they are blocked if the author is suspended.", + "type": [ + "number", + "null" + ] + }, + "reason": { + "description": "The moderators reason why the author was blocked or suspended.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Block or suspension details, if applicable. Null if the author is enabled." + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ], + "description": "Current author status" + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" + }, + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content." + }, + "data_found": { + "type": "boolean", + "description": "Whether any entity matchers found data for the content" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "score": { + "type": "number" + } + }, + "required": [ + "label", + "score" + ], + "additionalProperties": false + }, + "description": "Legacy image labels, approximated from the equivalent policies. Use POST /moderate for the policy probabilities themselves." + } + }, + "required": [ + "status", + "request", + "flagged", + "author", + "data_found", + "labels" + ], + "additionalProperties": false + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + ] + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + } + } + }, + "/account": { + "get": { + "operationId": "account-get", + "summary": "Get account details", + "description": "Get account details", + "tags": [ + "Account" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Account details retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the account" + }, + "paid_plan_name": { + "type": "string", + "description": "Name of the paid plan" + }, + "text_api_quota": { + "type": "number", + "description": "Text API quota" + }, + "remaining_quota": { + "type": "number", + "description": "Remaining quota" + }, + "current_project": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the current project" + }, + "name": { + "type": "string", + "description": "Name of the current project" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "paid_plan_name", + "text_api_quota", + "remaining_quota" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst accounts = await client.account.list();\n\nconsole.log(accounts.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\naccounts = client.account.list()\nprint(accounts.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\naccounts = moderation_api.account.list\n\nputs(accounts)" + }, + { + "lang": "PHP", + "source": "account->list();\n\n var_dump($accounts);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Account;\n\nModerationApiClient client = new();\n\nAccountListParams parameters = new();\n\nvar accounts = await client.Account.List(parameters);\n\nConsole.WriteLine(accounts);" + } + ] + } + }, + "/auth": { + "get": { + "operationId": "account-legacyAuthGet", + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the authentication" + }, + "message": { + "type": "string", + "description": "Message of the authentication" + } + }, + "required": [ + "status", + "message" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst auth = await client.auth.retrieve();\n\nconsole.log(auth.message);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nauth = client.auth.retrieve()\nprint(auth.message)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nauth = moderation_api.auth.retrieve\n\nputs(auth)" + }, + { + "lang": "PHP", + "source": "auth->retrieve();\n\n var_dump($auth);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Auth;\n\nModerationApiClient client = new();\n\nAuthRetrieveParams parameters = new();\n\nvar auth = await client.Auth.Retrieve(parameters);\n\nConsole.WriteLine(auth);" + } + ] + }, + "post": { + "operationId": "account-legacyAuthPost", + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the authentication" + }, + "message": { + "type": "string", + "description": "Message of the authentication" + }, + "project": { + "type": "string", + "description": "Name of the authenticated project" + } + }, + "required": [ + "status", + "message", + "project" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst auth = await client.auth.create();\n\nconsole.log(auth.message);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nauth = client.auth.create()\nprint(auth.message)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nauth = moderation_api.auth.create\n\nputs(auth)" + }, + { + "lang": "PHP", + "source": "auth->create();\n\n var_dump($auth);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Auth;\n\nModerationApiClient client = new();\n\nAuthCreateParams parameters = new();\n\nvar auth = await client.Auth.Create(parameters);\n\nConsole.WriteLine(auth);" + } + ] + } + }, + "/wordlist": { + "get": { + "operationId": "wordlist-list", + "summary": "List wordlists", + "description": "List all wordlists for the authenticated organization", + "tags": [ + "wordlist" + ], + "security": [ + { + "Authorization": [] + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of the wordlist" + }, + "name": { + "description": "Name of the wordlist", + "type": [ + "string", + "null" + ] + }, + "description": { + "description": "Description of the wordlist", + "type": [ + "string", + "null" + ] + }, + "createdAt": { + "description": "When the wordlist was created", + "type": [ + "string", + "null" + ] + }, + "userId": { + "description": "User who created the wordlist", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name", + "description", + "createdAt", + "userId" + ], + "additionalProperties": false + }, + "description": "Array of wordlists" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst wordlists = await client.wordlist.list();\n\nconsole.log(wordlists);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nwordlists = client.wordlist.list()\nprint(wordlists)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nwordlists = moderation_api.wordlist.list\n\nputs(wordlists)" + }, + { + "lang": "PHP", + "source": "wordlist->list();\n\n var_dump($wordlists);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Wordlist;\n\nModerationApiClient client = new();\n\nWordlistListParams parameters = new();\n\nvar wordlists = await client.Wordlist.List(parameters);\n\nConsole.WriteLine(wordlists);" + } + ] + } + }, + "/wordlist/{id}": { + "get": { + "operationId": "wordlist-getWordlistPublic", + "summary": "Get wordlist", + "description": "Get a specific wordlist by ID", + "tags": [ + "wordlist" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to get" + }, + "required": true, + "description": "ID of the wordlist to get" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the wordlist" + }, + "name": { + "anyOf": [ + { + "type": "string", + "description": "Name of the wordlist" + }, + { + "type": "null" + } + ] + }, + "words": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Words in the wordlist" + }, + "createdAt": { + "description": "Creation date of the wordlist", + "type": "string" + }, + "organizationId": { + "type": "string", + "description": "ID of the organization" + }, + "userId": { + "anyOf": [ + { + "type": "string", + "description": "ID of the user" + }, + { + "type": "null" + } + ] + }, + "strict": { + "type": "boolean", + "description": "Strict mode" + } + }, + "required": [ + "id", + "name", + "words", + "createdAt", + "organizationId", + "userId", + "strict" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst wordlist = await client.wordlist.retrieve('id');\n\nconsole.log(wordlist.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nwordlist = client.wordlist.retrieve(\n \"id\",\n)\nprint(wordlist.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nwordlist = moderation_api.wordlist.retrieve(\"id\")\n\nputs(wordlist)" + }, + { + "lang": "PHP", + "source": "wordlist->retrieve('id');\n\n var_dump($wordlist);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Wordlist;\n\nModerationApiClient client = new();\n\nWordlistRetrieveParams parameters = new() { ID = \"id\" };\n\nvar wordlist = await client.Wordlist.Retrieve(parameters);\n\nConsole.WriteLine(wordlist);" + } + ] + }, + "put": { + "operationId": "wordlist-update", + "summary": "Update wordlist", + "description": "Update a wordlist", + "tags": [ + "wordlist" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to update" + }, + "required": true, + "description": "ID of the wordlist to update" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "New name for the wordlist", + "type": "string" + }, + "key": { + "description": "New key for the wordlist", + "type": "string" + }, + "description": { + "description": "New description for the wordlist", + "type": "string" + }, + "words": { + "description": "New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored.", + "type": "array", + "items": { + "type": "string" + } + }, + "strict": { + "description": "Deprecated. Now using threshold in project settings.", + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Wordlist updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the wordlist" + }, + "name": { + "anyOf": [ + { + "type": "string", + "description": "Name of the wordlist" + }, + { + "type": "null" + } + ] + }, + "words": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Words in the wordlist" + }, + "createdAt": { + "description": "Creation date of the wordlist", + "type": "string" + }, + "organizationId": { + "type": "string", + "description": "ID of the organization" + }, + "userId": { + "anyOf": [ + { + "type": "string", + "description": "ID of the user" + }, + { + "type": "null" + } + ] + }, + "strict": { + "type": "boolean", + "description": "Strict mode" + } + }, + "required": [ + "id", + "name", + "words", + "createdAt", + "organizationId", + "userId", + "strict" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst wordlist = await client.wordlist.update('id');\n\nconsole.log(wordlist.id);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nwordlist = client.wordlist.update(\n id=\"id\",\n)\nprint(wordlist.id)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nwordlist = moderation_api.wordlist.update(\"id\")\n\nputs(wordlist)" + }, + { + "lang": "PHP", + "source": "wordlist->update(\n 'id',\n description: 'description',\n key: 'key',\n name: 'name',\n strict: true,\n words: ['string'],\n );\n\n var_dump($wordlist);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Wordlist;\n\nModerationApiClient client = new();\n\nWordlistUpdateParams parameters = new() { ID = \"id\" };\n\nvar wordlist = await client.Wordlist.Update(parameters);\n\nConsole.WriteLine(wordlist);" + } + ] + } + }, + "/wordlist/{id}/embedding-status": { + "get": { + "operationId": "wordlist-wordlistEmbeddingStatus", + "summary": "Get embedding status", + "description": "Get the current embedding progress status for a wordlist", + "tags": [ + "wordlist" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to check embedding status for" + }, + "required": true, + "description": "ID of the wordlist to check embedding status for" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "progress": { + "type": "number", + "description": "Percentage of words that have been embedded (0-100)" + }, + "totalWords": { + "type": "number", + "description": "Total number of words in the wordlist" + }, + "remainingWords": { + "type": "number", + "description": "Number of words still waiting to be embedded" + } + }, + "required": [ + "progress", + "totalWords", + "remainingWords" + ], + "additionalProperties": false, + "description": "Embedding status details" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.wordlist.getEmbeddingStatus('id');\n\nconsole.log(response.progress);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nresponse = client.wordlist.get_embedding_status(\n \"id\",\n)\nprint(response.progress)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nresponse = moderation_api.wordlist.get_embedding_status(\"id\")\n\nputs(response)" + }, + { + "lang": "PHP", + "source": "wordlist->getEmbeddingStatus('id');\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Wordlist;\n\nModerationApiClient client = new();\n\nWordlistGetEmbeddingStatusParams parameters = new() { ID = \"id\" };\n\nvar response = await client.Wordlist.GetEmbeddingStatus(parameters);\n\nConsole.WriteLine(response);" + } + ] + } + }, + "/wordlist/{id}/words": { + "post": { + "operationId": "wordlist-addWords", + "summary": "Add words to wordlist", + "description": "Add words to an existing wordlist", + "tags": [ + "wordlist" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to add words to" + }, + "required": true, + "description": "ID of the wordlist to add words to" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "words": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of words to add to the wordlist. Duplicate words will be ignored." + } + }, + "required": [ + "words" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Words successfully added to wordlist", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "addedCount": { + "type": "number", + "description": "Number of words added" + }, + "totalCount": { + "type": "number", + "description": "Total number of words in wordlist" + }, + "addedWords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of words that were added" + } + }, + "required": [ + "addedCount", + "totalCount", + "addedWords" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.wordlist.words.add('id', { words: ['string'] });\n\nconsole.log(response.addedCount);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nresponse = client.wordlist.words.add(\n id=\"id\",\n words=[\"string\"],\n)\nprint(response.added_count)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nresponse = moderation_api.wordlist.words.add(\"id\", words: [\"string\"])\n\nputs(response)" + }, + { + "lang": "PHP", + "source": "wordlist->words->add('id', words: ['string']);\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Wordlist.Words;\n\nModerationApiClient client = new();\n\nWordAddParams parameters = new()\n{\n ID = \"id\",\n Words =\n [\n \"string\"\n ],\n};\n\nvar response = await client.Wordlist.Words.Add(parameters);\n\nConsole.WriteLine(response);" + } + ] + }, + "delete": { + "operationId": "wordlist-removeWords", + "summary": "Remove words from wordlist", + "description": "Remove words from an existing wordlist", + "tags": [ + "wordlist" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to remove words from" + }, + "required": true, + "description": "ID of the wordlist to remove words from" + }, + { + "in": "query", + "name": "words", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of words to remove from the wordlist" + }, + "required": true, + "description": "Array of words to remove from the wordlist" + } + ], + "responses": { + "200": { + "description": "Words successfully removed from wordlist", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "removedCount": { + "type": "number", + "description": "Number of words removed" + }, + "totalCount": { + "type": "number", + "description": "Total number of words in wordlist" + }, + "removedWords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of words removed" + } + }, + "required": [ + "removedCount", + "totalCount", + "removedWords" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst word = await client.wordlist.words.remove('id', { words: ['string'] });\n\nconsole.log(word.removedCount);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nword = client.wordlist.words.remove(\n id=\"id\",\n words=[\"string\"],\n)\nprint(word.removed_count)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nword = moderation_api.wordlist.words.remove(\"id\", words: [\"string\"])\n\nputs(word)" + }, + { + "lang": "PHP", + "source": "wordlist->words->remove('id', words: ['string']);\n\n var_dump($word);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Wordlist.Words;\n\nModerationApiClient client = new();\n\nWordRemoveParams parameters = new()\n{\n ID = \"id\",\n Words =\n [\n \"string\"\n ],\n};\n\nvar word = await client.Wordlist.Words.Remove(parameters);\n\nConsole.WriteLine(word);" + } + ] + } + }, + "/moderate": { + "post": { + "operationId": "newModerate-moderate", + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "description": "Audio", + "title": "Audio" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string", + "description": "The key of the content node" + }, + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "description": "Audio", + "title": "Audio" + } + ], + "title": "Content leaf", + "type": "object" + }, + "description": "Values in the object. Can be mixed content types." + } + }, + "required": [ + "type", + "data" + ], + "description": "Object", + "title": "Object" + } + ], + "description": "The content sent for moderation", + "type": "object" + }, + "timestamp": { + "description": "Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time.", + "type": "number" + }, + "channel": { + "description": "Provide a channel ID or key. Will use the project's default channel if not provided.", + "type": "string" + }, + "contentId": { + "description": "The unique ID of the content in your database.", + "type": "string", + "maxLength": 100 + }, + "metaType": { + "description": "The meta type of content being moderated", + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ] + }, + "authorId": { + "description": "The author of the content.", + "type": "string" + }, + "conversationId": { + "description": "For example the ID of a chat room or a post", + "type": "string" + }, + "metadata": { + "description": "Any metadata you want to store with the content", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "clientAction": { + "description": "A recommendation from your own client-side flagging (e.g. a banned-IP list or a third-party tool). Feeds the rules engine and can escalate or override the recommended action. Does not change whether our analysis flagged the content.", + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ], + "description": "Your recommendation for the content: allow, review, or reject." + }, + "behavior": { + "description": "How your recommendation combines with ours. Defaults to 'escalate', which only applies it when stricter than ours; 'override' replaces ours outright.", + "type": "string", + "enum": [ + "override", + "escalate" + ] + }, + "source": { + "description": "Where your recommendation came from, e.g. \"banned-ip\".", + "type": "string", + "maxLength": 100 + }, + "reason": { + "description": "A human-readable explanation for your recommendation.", + "type": "string", + "maxLength": 500 + } + }, + "required": [ + "action" + ] + }, + "doNotStore": { + "description": "Do not store the content. The content won't enter the review queue", + "type": "boolean" + }, + "policies": { + "description": "(Enterprise) override the channel policies for this moderation request only.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "toxicity" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Toxicity" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "personal_information" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Personal Information" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "toxicity_severe" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Toxicity Severe" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "hate" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Hate" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_drugs" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Drugs" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_alcohol" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Alcohol" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_firearms" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Firearms" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_tobacco" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Tobacco" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_gambling" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Illicit Gambling" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "cannabis" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Cannabis" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "adult" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Adult" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "crypto" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Crypto" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "sexual" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Sexual" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "sexual_minors" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Sexual Minors" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "flirtation" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Flirtation" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "profanity" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Profanity" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "violence" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Violence" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "self_harm" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Self Harm" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "spam" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Spam" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "low_quality" + }, + "minWords": { + "description": "Flag content with fewer than this many words as low-effort. Defaults to 3. Set to disable by omitting.", + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + } + }, + "required": [ + "flag", + "id" + ], + "title": "Low-quality content" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "face_detection" + }, + "comparator": { + "description": "Flag images that contain \"at least\" or \"fewer than\" the configured number of faces. Defaults to at_least.", + "type": "string", + "enum": [ + "at_least", + "fewer_than" + ] + }, + "count": { + "description": "Number of faces the comparator applies to. Defaults to 1, so the default rule flags any image containing a face.", + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + } + }, + "required": [ + "flag", + "id" + ], + "title": "Face detection" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "self_promotion" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Self Promotion" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "political" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Political" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "religion" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Religion" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "code_abuse" + } + }, + "required": [ + "flag", + "id" + ], + "title": "Code Abuse" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "unicode_spoofing" + }, + "signals": { + "description": "Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy.", + "type": "object", + "propertyNames": { + "type": "string", + "enum": [ + "mixed_script", + "confusable_word", + "invisible", + "zalgo", + "illegal", + "encoding_damage" + ] + }, + "additionalProperties": { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + } + } + } + } + }, + "required": [ + "flag", + "id" + ], + "title": "Unicode Spoofing" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "pii" + }, + "entities": { + "type": "object", + "propertyNames": { + "type": "string", + "enum": [ + "email", + "phone", + "url", + "address", + "name", + "username", + "ip_address", + "credit_card", + "sensitive_other" + ] + }, + "additionalProperties": { + "type": "object", + "properties": { + "enable": { + "type": "boolean" + }, + "flag": { + "type": "boolean" + }, + "shouldMask": { + "type": "boolean" + }, + "mask": { + "type": "string" + } + }, + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "entities" + ], + "title": "PII Masking" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "url" + }, + "entities": { + "type": "object", + "propertyNames": { + "type": "string", + "enum": [ + "email", + "phone", + "url", + "address", + "name", + "username", + "ip_address", + "credit_card", + "sensitive_other" + ] + }, + "additionalProperties": { + "type": "object", + "properties": { + "enable": { + "type": "boolean" + }, + "flag": { + "type": "boolean" + }, + "shouldMask": { + "type": "boolean" + }, + "mask": { + "type": "string" + } + }, + "additionalProperties": {} + } + } + }, + "required": [ + "id", + "entities" + ], + "title": "URL Masking" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "url_risk" + }, + "allowlistWordlistIds": { + "description": "IDs of wordlists whose entries are treated as allowed URL domains. Matches short-circuit the risk model and are never flagged.", + "type": "array", + "items": { + "type": "string" + } + }, + "blocklistWordlistIds": { + "description": "IDs of wordlists whose entries are treated as blocked URL domains. Matches short-circuit the risk model and are always flagged. Blocklists take precedence over allowlists.", + "type": "array", + "items": { + "type": "string" + } + }, + "flagLinkShorteners": { + "description": "When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl, etc.) is always flagged regardless of risk score. Allowlist matches still win.", + "type": "boolean" + } + }, + "required": [ + "flag", + "id" + ], + "title": "URL Risk" + }, + { + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "guideline" + }, + "instructions": { + "type": "string" + }, + "guidelineKey": { + "type": "string" + } + }, + "required": [ + "flag", + "id", + "instructions", + "guidelineKey" + ], + "title": "Guideline" + } + ], + "type": "object" + } + } + }, + "required": [ + "content" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier for the content. Either the contentId provided by you or an autogenerated ID." + }, + "masked": { + "type": "boolean", + "description": "Whether any values have been masked." + }, + "unicode_cleaned": { + "type": "boolean", + "description": "Whether Unicode spoofing normalization rewrote the content — confusables folded to their Latin lookalikes, invisible characters and combining-mark abuse stripped." + }, + "modified": { + "anyOf": [ + { + "anyOf": [ + { + "type": "string", + "title": "Modified string content" + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "title": "Modified object content" + }, + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false, + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Audio", + "title": "Audio" + } + ], + "title": "Content leaf", + "type": "object" + }, + "title": "Modified nested object content" + } + ] + }, + { + "type": "null" + } + ], + "description": "The modified content, if any." + }, + "transcript": { + "description": "The transcribed text from audio content. Only present when audio moderation is used and transcript inclusion is enabled on the channel.", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "masked", + "unicode_cleaned", + "modified" + ], + "additionalProperties": false, + "description": "Potentially modified content." + }, + "author": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" + }, + "external_id": { + "description": "The author's ID from your system", + "type": [ + "string", + "null" + ] + }, + "block": { + "anyOf": [ + { + "type": "object", + "properties": { + "until": { + "description": "The timestamp until which they are blocked if the author is suspended.", + "type": [ + "number", + "null" + ] + }, + "reason": { + "description": "The moderators reason why the author was blocked or suspended.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Block or suspension details, if applicable. Null if the author is enabled." + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ], + "description": "Current author status" + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" + }, + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content." + }, + "evaluation": { + "type": "object", + "properties": { + "flagged": { + "type": "boolean", + "description": "Whether the content was flagged by any policy." + }, + "flag_probability": { + "type": "number", + "description": "The probability that the content should be flagged." + }, + "severity_score": { + "type": "number", + "description": "The severity score of the content. A higher score indicates more severe content." + }, + "unicode_spoofed": { + "description": "Whether the content was flagged for Unicode spoofing.", + "type": "boolean" + }, + "shadow_flagged": { + "description": "Whether the content would have been flagged by analyze-only policies (flag: false).", + "type": "boolean" + } + }, + "required": [ + "flagged", + "flag_probability", + "severity_score" + ], + "additionalProperties": false, + "description": "The evaluation of the content after running the channel policies." + }, + "recommendation": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ], + "description": "The action to take based on the recommendation" + }, + "reason_codes": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string", + "enum": [ + "severity_reject", + "severity_review", + "author_block", + "dry_run", + "trusted_allow", + "untrusted_severity", + "rule_match", + "rule_default", + "rule_fallback", + "client_override", + "casebook_match" + ] + }, + { + "type": "string", + "pattern": "^rule:[\\s\\S]{0,}$" + } + ] + }, + "description": "Reason codes for the recommendation. Standard codes plus a `rule:` code identifying the rule that produced the action. Can be used to display a reason to the user." + }, + "matched_rules": { + "description": "Rules that matched during evaluation, if rules engine is active.", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "key", + "name" + ], + "additionalProperties": false + } + } + }, + "required": [ + "action", + "reason_codes" + ], + "additionalProperties": false, + "description": "The recommendation for the content based on the evaluation." + }, + "casebook": { + "anyOf": [ + { + "type": "object", + "properties": { + "verdict": { + "type": "string", + "enum": [ + "allow", + "reject" + ], + "description": "The ruling your past decisions point to for this content." + }, + "similarity": { + "type": "number", + "description": "How close the nearest matching case is, from 0 to 1. 1 means the content is identical to something you have already decided." + }, + "agreement": { + "type": "number", + "description": "How unanimous the matching cases are, from 0 to 1: the share of them that decided this way, ignoring how many there are. Always at least 0.8 when a ruling is returned — below that the casebook reports a disagreement instead of picking a side — so it tells you how clean the consensus was, and is not a threshold to re-apply yourself." + }, + "confidence": { + "type": "number", + "description": "How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled by how much evidence backs it, so a handful of close, recent cases outweighs one distant one. Older cases count for less, halving in weight roughly every 180 days. This is the number to use in rules when you want a strength condition." + }, + "case_count": { + "type": "number", + "description": "How many of your past cases backed this ruling." + }, + "topic": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "required": [ + "id", + "label" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "The topic the closest matching case is filed under, or null when it has not been grouped into one yet." + } + }, + "required": [ + "verdict", + "similarity", + "agreement", + "confidence", + "case_count", + "topic" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "What your casebook — the record of your past moderation decisions — found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in `recommendation`, where a higher-priority rule may have settled the item first." + }, + "policies": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier for the classifier output." + }, + "type": { + "type": "string", + "const": "classifier" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "flagged": { + "type": "boolean" + }, + "flagged_fields": { + "description": "The keys of the flagged fields if submitting an object.", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "flagged": { + "type": "boolean" + }, + "shadowFlagged": { + "type": "boolean" + } + }, + "required": [ + "id", + "probability", + "flagged" + ], + "additionalProperties": false + } + }, + "data": { + "description": "Optional structured data produced by the policy. For face detection: { count, faces: [{ confidence, gender, age }] }.", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "id", + "type", + "probability", + "flagged" + ], + "additionalProperties": false, + "description": "Classifier policy.", + "title": "Classifier output" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "const": "entity_matcher" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "flagged": { + "type": "boolean" + }, + "flagged_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "matches": { + "type": "array", + "items": { + "type": "object", + "properties": { + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "match": { + "type": "string" + }, + "span": { + "minItems": 2, + "maxItems": 2, + "type": "array", + "items": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "reasons": { + "description": "Stable codes explaining why a URL was flagged (URL Risk only).", + "type": "array", + "items": { + "type": "string" + } + }, + "signals": { + "description": "Observable properties of a URL (URL Risk only). Absent for allow/block list matches.", + "type": "object", + "properties": { + "brand_impersonation": { + "anyOf": [ + { + "type": "object", + "properties": { + "brand": { + "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "registered_domain_token", + "subdomain_token" + ] + } + }, + "required": [ + "brand", + "method" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "has_suspicious_characters": { + "type": "boolean" + }, + "is_link_shortener": { + "type": "boolean" + }, + "domain_age_days": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ] + }, + "has_email_setup": { + "type": [ + "boolean", + "null" + ] + }, + "redirect_count": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ] + }, + "final_url": { + "type": [ + "string", + "null" + ] + }, + "bot_protection": { + "type": [ + "boolean", + "null" + ] + }, + "is_reported": { + "type": "boolean" + } + }, + "required": [ + "brand_impersonation", + "has_suspicious_characters", + "is_link_shortener", + "domain_age_days", + "has_email_setup", + "redirect_count", + "final_url", + "bot_protection", + "is_reported" + ], + "additionalProperties": false + }, + "entity_type": { + "description": "Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII matches. Absent for URL Risk and wordlist matches where the type is already encoded in the parent label.", + "type": "string" + } + }, + "required": [ + "probability", + "match", + "span" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "type", + "probability", + "flagged", + "matches" + ], + "additionalProperties": false, + "description": "Entity matcher policy.", + "title": "Entity matcher output" + } + ], + "description": "Policy output schema.", + "type": "object" + }, + "description": "Results of all policies in the channel. Sorted by highest probability." + }, + "insights": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "sentiment" + }, + "type": { + "type": "string", + "const": "insight" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "value": { + "anyOf": [ + { + "type": "string", + "enum": [ + "positive", + "neutral", + "negative" + ] + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "type", + "probability", + "value" + ], + "additionalProperties": false, + "description": "Sentiment insight", + "title": "Sentiment insight" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "const": "language" + }, + "type": { + "type": "string", + "const": "insight" + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "value": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "type", + "probability", + "value" + ], + "additionalProperties": false, + "description": "Language insight", + "title": "Language insight" + } + ], + "type": "object" + }, + "description": "Results of all insights enabled in the channel." + }, + "meta": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success", + "partial_success" + ] + }, + "timestamp": { + "type": "number" + }, + "channel_key": { + "type": "string", + "description": "The unique key of the channel where the content was handled. Either the channel provided by you or automatically routed." + }, + "usage": { + "type": "number" + }, + "processing_time": { + "type": "string" + } + }, + "required": [ + "status", + "timestamp", + "channel_key", + "usage" + ], + "additionalProperties": false, + "description": "Metadata about the moderation request" + }, + "errors": { + "description": "Policies that had errors", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "id", + "message" + ], + "additionalProperties": false + } + } + }, + "required": [ + "content", + "author", + "evaluation", + "recommendation", + "casebook", + "policies", + "insights", + "meta" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "JavaScript", + "source": "import ModerationAPI from '@moderation-api/sdk';\n\nconst client = new ModerationAPI({\n secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.content.submit({ content: { text: 'text', type: 'text' } });\n\nconsole.log(response.author);" + }, + { + "lang": "Python", + "source": "import os\nfrom moderation_api import ModerationAPI\n\nclient = ModerationAPI(\n secret_key=os.environ.get(\"MODAPI_SECRET_KEY\"), # This is the default and can be omitted\n)\nresponse = client.content.submit(\n content={\n \"text\": \"text\",\n \"type\": \"text\",\n },\n)\nprint(response.author)" + }, + { + "lang": "Ruby", + "source": "require \"moderation_api\"\n\nmoderation_api = ModerationAPI::Client.new(secret_key: \"My Secret Key\")\n\nresponse = moderation_api.content.submit(content: {text: \"text\", type: :text})\n\nputs(response)" + }, + { + "lang": "PHP", + "source": "content->submit(\n content: ['text' => 'text', 'type' => 'text'],\n authorID: 'authorId',\n channel: 'channel',\n clientAction: [\n 'action' => 'review',\n 'behavior' => 'override',\n 'reason' => 'reason',\n 'source' => 'source',\n ],\n contentID: 'contentId',\n conversationID: 'conversationId',\n doNotStore: true,\n metadata: ['foo' => 'bar'],\n metaType: 'profile',\n policies: [['id' => 'toxicity', 'flag' => true, 'threshold' => 0]],\n timestamp: 0,\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}" + }, + { + "lang": "C#", + "source": "using System;\nusing ModerationApi;\nusing ModerationApi.Models.Content;\n\nModerationApiClient client = new();\n\nContentSubmitParams parameters = new() { Content = new Text(\"text\") };\n\nvar response = await client.Content.Submit(parameters);\n\nConsole.WriteLine(response);" + } + ] + } + }, + "/projects": { + "get": { + "operationId": "management-projects-list", + "summary": "List projects", + "description": "List every project in the organization. Needs the `projects:read` permission.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Projects retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Project" + } + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + } + } + }, + "post": { + "operationId": "management-projects-create", + "summary": "Create a project", + "description": "Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 35, + "description": "The project's name." + }, + "domain": { + "description": "The website or app the project moderates content for. Used to write the context when none is given.", + "type": "string", + "maxLength": 255 + }, + "context": { + "description": "What the platform is and who uses it.", + "type": "string", + "maxLength": 2000 + }, + "brief": { + "description": "What you moderate, the problems you see and your guidelines.", + "type": "string", + "maxLength": 2000 + }, + "usedByMinors": { + "default": false, + "description": "Whether children use the platform.", + "type": "boolean" + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Project created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectWithKey" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + } + } + } + }, + "/projects/{id}": { + "get": { + "operationId": "management-projects-get", + "summary": "Get a project", + "description": "Get a project by ID. Needs the `projects:read` permission.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the project." + }, + "required": true, + "description": "The ID of the project." + } + ], + "responses": { + "200": { + "description": "Project retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + }, + "put": { + "operationId": "management-projects-update", + "summary": "Update a project", + "description": "Update a project. Fields you leave out keep their value. Needs the `projects:write` permission.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the project to update." + }, + "required": true, + "description": "The ID of the project to update." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "The project's name.", + "type": "string", + "minLength": 1, + "maxLength": 75 + }, + "description": { + "description": "The project's description.", + "anyOf": [ + { + "type": "string", + "maxLength": 500 + }, + { + "type": "null" + } + ] + }, + "domain": { + "description": "The website or app the project moderates content for. Setting it on a project without context writes one.", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "context": { + "description": "What the platform is and who uses it.", + "anyOf": [ + { + "type": "string", + "maxLength": 2000 + }, + { + "type": "null" + } + ] + }, + "globalFlaggingMode": { + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates without flagging.", + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ] + }, + "enableRequestLogging": { + "description": "Whether moderated content is stored and shown in the dashboard.", + "type": "boolean" + }, + "casebookEnabled": { + "description": "Whether review queue decisions are recorded in the casebook.", + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Project updated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + }, + "delete": { + "operationId": "management-projects-delete", + "summary": "Delete a project", + "description": "Delete a project with everything in it: channels, queues, API keys and stored content. This can't be undone. The project's API keys stop working at once. Needs the `projects:write` permission.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the project." + }, + "required": true, + "description": "The ID of the project." + } + ], + "responses": { + "200": { + "description": "Project deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the project was deleted." + }, + "id": { + "type": "string", + "description": "The ID of the project." + } + }, + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + } + }, + "/projects/{id}/duplicate": { + "post": { + "operationId": "management-projects-duplicate", + "summary": "Duplicate a project", + "description": "Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects.", + "tags": [ + "Projects" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the project to copy." + }, + "required": true, + "description": "The ID of the project to copy." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Name of the copy. Defaults to the original name with \"(copy)\".", + "type": "string", + "minLength": 1, + "maxLength": 75 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Project duplicated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectWithKey" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + } + }, + "/projects/{projectId}/channels": { + "get": { + "operationId": "management-channels-list", + "summary": "List channels", + "description": "List the channels in a project. Needs the `channels:read` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "schema": { + "type": "string", + "description": "The ID of the project." + }, + "required": true, + "description": "The ID of the project." + } + ], + "responses": { + "200": { + "description": "Channels retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Channel" + } + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + }, + "post": { + "operationId": "management-channels-create", + "summary": "Create a channel", + "description": "Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "schema": { + "type": "string", + "description": "The ID of the project to add the channel to." + }, + "required": true, + "description": "The ID of the project to add the channel to." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100, + "description": "The channel's name." + }, + "key": { + "description": "The key you pass as `channel` when you moderate content. Defaults to the name in lowercase with dashes. Must be unique in the project.", + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9_-]+$" + }, + "description": { + "description": "The channel's description.", + "type": "string", + "maxLength": 500 + }, + "contentType": { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ], + "description": "The kind of content the channel moderates." + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Channel created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Channel" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + } + }, + "/channels/{id}": { + "get": { + "operationId": "management-channels-get", + "summary": "Get a channel", + "description": "Get a channel by ID. Needs the `channels:read` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the channel." + }, + "required": true, + "description": "The ID of the channel." + } + ], + "responses": { + "200": { + "description": "Channel retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Channel" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + }, + "put": { + "operationId": "management-channels-update", + "summary": "Update a channel", + "description": "Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the channel to update." + }, + "required": true, + "description": "The ID of the channel to update." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "The channel's name.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "key": { + "description": "The key you pass as `channel` when you moderate content. Changing it breaks integrations that send the old key.", + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9_-]+$" + }, + "description": { + "description": "The channel's description.", + "anyOf": [ + { + "type": "string", + "maxLength": 500 + }, + { + "type": "null" + } + ] + }, + "contentType": { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ], + "description": "The kind of content the channel moderates." + }, + "flaggingMode": { + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ], + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it." + }, + "contextEnabled": { + "type": "boolean", + "description": "Whether earlier messages in the conversation are read when moderating a message." + }, + "enableImageModeration": { + "type": "boolean", + "description": "Whether images are moderated." + }, + "enableVideoModeration": { + "type": "boolean", + "description": "Whether videos are moderated." + }, + "enableAudioModeration": { + "type": "boolean", + "description": "Whether audio is moderated." + }, + "enableVoiceModeration": { + "type": "boolean", + "description": "Whether real-time voice streams are moderated." + }, + "includeTranscriptInResponse": { + "type": "boolean", + "description": "Whether audio and video transcripts are returned in responses." + }, + "transcriptionQuality": { + "type": "string", + "enum": [ + "SPEED", + "BALANCED", + "ACCURACY" + ], + "description": "Trade-off between transcription speed and accuracy." + }, + "unicodeSpoofDetectionEnabled": { + "type": "boolean", + "description": "Whether look-alike Unicode characters are normalized before moderation." + }, + "frameCaptureInterval": { + "type": "number", + "minimum": 0.1, + "maximum": 60, + "description": "Seconds between frames captured from a video." + }, + "maxFramesPerVideo": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "description": "The most frames moderated per video." + }, + "spreadFrames": { + "type": "boolean", + "description": "Whether frames are spread evenly across the whole video." + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Channel updated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Channel" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + }, + "delete": { + "operationId": "management-channels-delete", + "summary": "Delete a channel", + "description": "Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the `channels:write` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the channel." + }, + "required": true, + "description": "The ID of the channel." + } + ], + "responses": { + "200": { + "description": "Channel deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "description": "Whether the channel was deleted." + }, + "id": { + "type": "string", + "description": "The ID of the channel." + } + }, + "required": [ + "deleted", + "id" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + } + }, + "/channels/{id}/duplicate": { + "post": { + "operationId": "management-channels-duplicate", + "summary": "Duplicate a channel", + "description": "Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission.", + "tags": [ + "Channels" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The ID of the channel to copy." + }, + "required": true, + "description": "The ID of the channel to copy." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "description": "Name of the copy. Defaults to the original name with \"(copy)\".", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "key": { + "description": "Key of the copy. Defaults to the original key with a timestamp. Must be unique in the project.", + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9_-]+$" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Channel duplicated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Channel" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.BAD_REQUEST" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.UNAUTHORIZED" + } + } + } + }, + "403": { + "description": "Insufficient access", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.FORBIDDEN" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error.NOT_FOUND" + } + } + } + } + } + } + }, + "/stream": { + "get": { + "tags": [ + "Voice" + ], + "summary": "Real-time voice moderation stream (WebSocket)", + "description": "Open a WebSocket to moderate live voice/call audio in real time. Speech is transcribed and each finalized utterance is moderated by your enabled text policies; you receive a verdict per utterance as it's spoken.\n\n**This is a WebSocket upgrade, not a regular HTTP call.** The request body below documents the frames you *send* over the socket; the `101` response documents the events you *receive*.\n\n- **Auth:** `Authorization: Bearer ` on the upgrade. A missing/invalid key closes `4401`; voice not enabled on the plan/channel closes `4403`.\n- **Subprotocol:** request `moderationapi.v1`.\n- **Flow:** send one `start` frame, then `media` frames as audio arrives, then `stop` (or disconnect). You receive `session.started`, `utterance.final` per utterance, optional `utterance.partial`/`warning`, and `session.ended`.\n- **Close codes:** `1000` normal · `1011` server error · `4400` bad request · `4401` auth failed · `4403` voice not enabled · `4429` concurrency limit.\n\nSee the [Real-time voice guide](https://docs.moderationapi.com/content-moderation/real-time-voice) for the full walkthrough and code examples.", + "servers": [ + { + "url": "wss://voice.moderationapi.com/v1", + "description": "Voice streaming gateway" + } + ], + "parameters": [ + { + "name": "Authorization", + "in": "header", + "required": true, + "description": "Bearer ", + "schema": { + "type": "string" + } + }, + { + "name": "Sec-WebSocket-Protocol", + "in": "header", + "required": true, + "description": "Requested subprotocol.", + "schema": { + "type": "string", + "enum": [ + "moderationapi.v1" + ] + } + } + ], + "requestBody": { + "description": "Frames sent by the client over the socket (not an HTTP body).", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/VoiceStartFrame" + }, + { + "$ref": "#/components/schemas/VoiceMediaFrame" + }, + { + "$ref": "#/components/schemas/VoiceStopFrame" + } + ], + "discriminator": { + "propertyName": "event" + } + } + } + } + }, + "responses": { + "101": { + "description": "Switching Protocols. The server then streams event frames over the socket; the key one is `utterance.final`.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/VoiceSessionStarted" + }, + { + "$ref": "#/components/schemas/VoiceUtteranceFinal" + }, + { + "$ref": "#/components/schemas/VoiceSessionEnded" + } + ], + "discriminator": { + "propertyName": "event" + } + } + } + } + } + }, + "x-webSocket": true + } + } + }, + "components": { + "schemas": { + "PublicAuthor": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Author ID in Moderation API" + }, + "external_id": { + "description": "The author's ID from your system", + "type": [ + "string", + "null" + ] + }, + "profile_picture": { + "description": "URL of the author's profile picture", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "external_link": { + "description": "URL of the author's external profile", + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "Author name or identifier", + "type": [ + "string", + "null" + ] + }, + "email": { + "description": "Author email address", + "anyOf": [ + { + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + { + "type": "null" + } + ] + }, + "company": { + "description": "The author's company or organization", + "type": [ + "string", + "null" + ] + }, + "first_seen": { + "type": "number", + "description": "Timestamp when author first appeared" + }, + "last_seen": { + "type": "number", + "description": "Timestamp of last activity" + }, + "last_incident": { + "description": "Timestamp of last incident", + "type": [ + "number", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ], + "description": "Current author status" + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "type": "number", + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)" + }, + "manual": { + "type": "boolean", + "description": "True if the trust level was set manually by a moderator" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + }, + "block": { + "anyOf": [ + { + "type": "object", + "properties": { + "until": { + "description": "The timestamp until which they are blocked if the author is suspended.", + "type": [ + "number", + "null" + ] + }, + "reason": { + "description": "The moderators reason why the author was blocked or suspended.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Block or suspension details, if applicable. Null if the author is enabled." + }, + "risk_evaluation": { + "anyOf": [ + { + "type": "object", + "properties": { + "risk_level": { + "description": "Calculated risk level based on more than 10 behavioral signals.", + "anyOf": [ + { + "type": "number", + "minimum": 0, + "maximum": 100 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "description": "Risk assessment details, if available." + }, + "metrics": { + "type": "object", + "properties": { + "total_content": { + "type": "number", + "description": "Total pieces of content" + }, + "flagged_content": { + "type": "number", + "description": "Number of flagged content pieces" + }, + "average_sentiment": { + "description": "Average sentiment score of content (-1 to 1). Requires a sentiment model in your project.", + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "total_content", + "flagged_content" + ], + "additionalProperties": false + }, + "metadata": { + "type": "object", + "properties": { + "email_verified": { + "description": "Whether the author's email is verified", + "type": [ + "boolean", + "null" + ] + }, + "phone_verified": { + "description": "Whether the author's phone number is verified", + "type": [ + "boolean", + "null" + ] + }, + "identity_verified": { + "description": "Whether the author's identity is verified", + "type": [ + "boolean", + "null" + ] + }, + "is_paying_customer": { + "description": "Whether the author is a paying customer", + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": {}, + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process." + } + }, + "required": [ + "id", + "first_seen", + "last_seen", + "status", + "trust_level", + "block", + "risk_evaluation", + "metrics", + "metadata" + ], + "additionalProperties": false + }, + "error.BAD_REQUEST": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message", + "example": "Invalid input data" + }, + "code": { + "type": "string", + "description": "The error code", + "example": "BAD_REQUEST" + }, + "issues": { + "description": "An array of issues that were responsible for the error", + "example": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false + } + } + }, + "required": [ + "message", + "code" + ], + "additionalProperties": false, + "title": "Invalid input data error (400)", + "description": "The error information", + "example": { + "code": "BAD_REQUEST", + "message": "Invalid input data", + "issues": [] + } + }, + "error.UNAUTHORIZED": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message", + "example": "Authorization not provided" + }, + "code": { + "type": "string", + "description": "The error code", + "example": "UNAUTHORIZED" + }, + "issues": { + "description": "An array of issues that were responsible for the error", + "example": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false + } + } + }, + "required": [ + "message", + "code" + ], + "additionalProperties": false, + "title": "Authorization not provided error (401)", + "description": "The error information", + "example": { + "code": "UNAUTHORIZED", + "message": "Authorization not provided", + "issues": [] + } + }, + "error.FORBIDDEN": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message", + "example": "Insufficient access" + }, + "code": { + "type": "string", + "description": "The error code", + "example": "FORBIDDEN" + }, + "issues": { + "description": "An array of issues that were responsible for the error", + "example": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false + } + } + }, + "required": [ + "message", + "code" + ], + "additionalProperties": false, + "title": "Insufficient access error (403)", + "description": "The error information", + "example": { + "code": "FORBIDDEN", + "message": "Insufficient access", + "issues": [] + } + }, + "error.NOT_FOUND": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message", + "example": "Not found" + }, + "code": { + "type": "string", + "description": "The error code", + "example": "NOT_FOUND" + }, + "issues": { + "description": "An array of issues that were responsible for the error", + "example": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false + } + } + }, + "required": [ + "message", + "code" + ], + "additionalProperties": false, + "title": "Not found error (404)", + "description": "The error information", + "example": { + "code": "NOT_FOUND", + "message": "Not found", + "issues": [] + } + }, + "error.INTERNAL_SERVER_ERROR": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message", + "example": "Internal server error" + }, + "code": { + "type": "string", + "description": "The error code", + "example": "INTERNAL_SERVER_ERROR" + }, + "issues": { + "description": "An array of issues that were responsible for the error", + "example": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false + } + } + }, + "required": [ + "message", + "code" + ], + "additionalProperties": false, + "title": "Internal server error error (500)", + "description": "The error information", + "example": { + "code": "INTERNAL_SERVER_ERROR", + "message": "Internal server error", + "issues": [] + } + }, + "error.CONFLICT": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The error message", + "example": "Action with this key already exists" + }, + "code": { + "type": "string", + "description": "The error code", + "example": "CONFLICT" + }, + "issues": { + "description": "An array of issues that were responsible for the error", + "example": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false + } + } + }, + "required": [ + "message", + "code" + ], + "additionalProperties": false, + "title": "Action with this key already exists error (409)", + "description": "The error information", + "example": { + "code": "CONFLICT", + "message": "Action with this key already exists", + "issues": [] + } + }, + "Project": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the project." + }, + "name": { + "type": "string", + "description": "The project's name." + }, + "description": { + "description": "The project's description.", + "type": [ + "string", + "null" + ] + }, + "domain": { + "description": "The website or app the project moderates content for.", + "type": [ + "string", + "null" + ] + }, + "context": { + "description": "What the platform is and who uses it. AI moderation reads it to judge content in context.", + "type": [ + "string", + "null" + ] + }, + "globalFlaggingMode": { + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ], + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup." + }, + "enableRequestLogging": { + "type": "boolean", + "description": "Whether moderated content is stored and shown in the dashboard." + }, + "casebookEnabled": { + "type": "boolean", + "description": "Whether decisions made in the review queue are recorded in the project's casebook." + }, + "createdAt": { + "description": "When the project was created.", + "type": "string" + }, + "updatedAt": { + "description": "When the project was last changed.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "description", + "domain", + "context", + "globalFlaggingMode", + "enableRequestLogging", + "casebookEnabled", + "createdAt", + "updatedAt" + ], + "additionalProperties": false + }, + "ProjectWithKey": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the project." + }, + "name": { + "type": "string", + "description": "The project's name." + }, + "description": { + "description": "The project's description.", + "type": [ + "string", + "null" + ] + }, + "domain": { + "description": "The website or app the project moderates content for.", + "type": [ + "string", + "null" + ] + }, + "context": { + "description": "What the platform is and who uses it. AI moderation reads it to judge content in context.", + "type": [ + "string", + "null" + ] + }, + "globalFlaggingMode": { + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ], + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup." + }, + "enableRequestLogging": { + "type": "boolean", + "description": "Whether moderated content is stored and shown in the dashboard." + }, + "casebookEnabled": { + "type": "boolean", + "description": "Whether decisions made in the review queue are recorded in the project's casebook." + }, + "createdAt": { + "description": "When the project was created.", + "type": "string" + }, + "updatedAt": { + "description": "When the project was last changed.", + "type": "string" + }, + "secretKey": { + "type": "string", + "description": "A secret API key for the new project. Use it to moderate content in this project. It is also shown in the project's settings." + } + }, + "required": [ + "id", + "name", + "description", + "domain", + "context", + "globalFlaggingMode", + "enableRequestLogging", + "casebookEnabled", + "createdAt", + "updatedAt", + "secretKey" + ], + "additionalProperties": false + }, + "Channel": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the channel." + }, + "projectId": { + "type": "string", + "description": "The ID of the project the channel is in." + }, + "key": { + "type": "string", + "description": "The key you pass as `channel` when you moderate content. Unique in the project." + }, + "name": { + "type": "string", + "description": "The channel's name." + }, + "description": { + "description": "The channel's description.", + "type": [ + "string", + "null" + ] + }, + "isDefault": { + "type": "boolean", + "description": "Whether requests that name no channel use this one. Each project has one default channel." + }, + "contentType": { + "anyOf": [ + { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ], + "description": "The kind of content the channel moderates." + }, + { + "type": "null" + } + ] + }, + "flaggingMode": { + "type": "string", + "enum": [ + "DRY_RUN", + "ACTIVE" + ], + "description": "`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it." + }, + "contextEnabled": { + "type": "boolean", + "description": "Whether earlier messages in the conversation are read when moderating a message." + }, + "enableImageModeration": { + "type": "boolean", + "description": "Whether images are moderated." + }, + "enableVideoModeration": { + "type": "boolean", + "description": "Whether videos are moderated." + }, + "enableAudioModeration": { + "type": "boolean", + "description": "Whether audio is moderated." + }, + "enableVoiceModeration": { + "type": "boolean", + "description": "Whether real-time voice streams are moderated." + }, + "includeTranscriptInResponse": { + "type": "boolean", + "description": "Whether audio and video transcripts are returned in responses." + }, + "transcriptionQuality": { + "type": "string", + "enum": [ + "SPEED", + "BALANCED", + "ACCURACY" + ], + "description": "Trade-off between transcription speed and accuracy." + }, + "unicodeSpoofDetectionEnabled": { + "type": "boolean", + "description": "Whether look-alike Unicode characters are normalized before moderation." + }, + "frameCaptureInterval": { + "type": "number", + "minimum": 0.1, + "maximum": 60, + "description": "Seconds between frames captured from a video." + }, + "maxFramesPerVideo": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "description": "The most frames moderated per video." + }, + "spreadFrames": { + "type": "boolean", + "description": "Whether frames are spread evenly across the whole video." + }, + "createdAt": { + "description": "When the channel was created.", + "type": "string" + }, + "updatedAt": { + "description": "When the channel was last changed.", + "type": "string" + } + }, + "required": [ + "id", + "projectId", + "key", + "name", + "description", + "isDefault", + "contentType", + "flaggingMode", + "contextEnabled", + "enableImageModeration", + "enableVideoModeration", + "enableAudioModeration", + "enableVoiceModeration", + "includeTranscriptInResponse", + "transcriptionQuality", + "unicodeSpoofDetectionEnabled", + "frameCaptureInterval", + "maxFramesPerVideo", + "spreadFrames", + "createdAt", + "updatedAt" + ], + "additionalProperties": false + }, + "AuthorBlockedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.blocked", + "description": "The event type.", + "example": "author.blocked" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformedAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.blocked", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_block_123", + "key": "block", + "name": "Block author", + "value": null, + "created_at": "2026-05-08T12:38:00.000Z", + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "blocked", + "trust_level": { + "level": -1, + "manual": false + }, + "block": { + "until": null, + "reason": "Repeated spam violations" + }, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "PublicActionPerformedAuthor": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Moderation action ID" + }, + "key": { + "description": "Customer-defined key identifying this action", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Display name of the action", + "type": [ + "string", + "null" + ] + }, + "value": { + "description": "The value passed to the action when it ran", + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the action was performed" + }, + "queue": { + "description": "The queue the item belongs to, if any", + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "author": { + "description": "The author the action was performed on", + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "required": [ + "id", + "key", + "name", + "value", + "created_at", + "author" + ], + "additionalProperties": false + }, + "AuthorUnblockedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.unblocked", + "description": "The event type.", + "example": "author.unblocked" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformedAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.unblocked", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_unblock_789", + "key": "auto_unblock", + "name": "Auto unblock", + "value": null, + "created_at": "2026-05-09T12:39:00.000Z", + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 0, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "AuthorSuspendedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.suspended", + "description": "The event type.", + "example": "author.suspended" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformedAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.suspended", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_suspend_456", + "key": "suspend_24h", + "name": "Suspend (24h)", + "value": "24h", + "created_at": "2026-05-08T12:39:00.000Z", + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "suspended", + "trust_level": { + "level": 0, + "manual": false + }, + "block": { + "until": 1746878400000, + "reason": "Cooling-off period" + }, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "AuthorUpdatedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.updated", + "description": "The event type.", + "example": "author.updated" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.updated", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + }, + "AuthorTrustLevelChangedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.trust_level_changed", + "description": "The event type.", + "example": "author.trust_level_changed" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.trust_level_changed", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 3, + "manual": true + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + }, + "AuthorActionEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "author.action", + "description": "The event type.", + "example": "author.action" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformedAuthor" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "author.action", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_warn_111", + "key": "send_warning", + "name": "Send warning email", + "value": "violation_notice", + "created_at": "2026-05-08T12:42:00.000Z", + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "QueueItemCompletedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "queue_item.resolved", + "description": "The event type.", + "example": "queue_item.resolved" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicQueueItemEvent" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "queue_item.resolved", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "item": { + "id": "item_xyz789", + "flagged": true, + "labels": [ + { + "label": "classifier/spam", + "score": 0.94, + "flagged": true, + "manual": false + } + ], + "flagged_fields": [], + "language": "en", + "content": { + "type": "text", + "text": "Buy crypto now!" + }, + "timestamp": "2026-05-08T12:34:56.789Z", + "metadata": null, + "client_action": null, + "conversation_id": null, + "author_id": "user-555", + "channel_key": null, + "meta_type": "comment" + }, + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "blocked", + "trust_level": { + "level": -1, + "manual": false + }, + "block": { + "until": null, + "reason": "Repeated spam violations" + }, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + }, + "queue": { + "id": "que_abc123" + } + } + } + } + }, + "PublicQueueItemEvent": { + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/PublicQueueItem" + }, + "author": { + "$ref": "#/components/schemas/PublicAuthor" + }, + "queue": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + } + }, + "required": [ + "item" + ], + "additionalProperties": false + }, + "PublicQueueItem": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Content ID from your system" + }, + "flagged": { + "description": "Whether the content was flagged by moderation", + "type": [ + "boolean", + "null" + ] + }, + "labels": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "The label name" + }, + "score": { + "type": "number", + "description": "Confidence score between 0 and 1" + }, + "manual": { + "description": "True if the label was applied manually by a moderator", + "type": "boolean" + }, + "flagged": { + "description": "Whether this label crossed its flagging threshold", + "type": "boolean" + }, + "shadow_flagged": { + "description": "Whether this label crossed its threshold under a shadowed policy — reported for visibility, never counted toward a flagging decision", + "type": "boolean" + }, + "matches": { + "type": "array", + "items": { + "type": "object", + "properties": { + "match": { + "type": "string", + "description": "The matched substring" + }, + "probability": { + "type": "number", + "description": "Match confidence between 0 and 1" + }, + "span": { + "type": "array", + "prefixItems": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "items": false, + "minItems": 2, + "maxItems": 2, + "description": "[start, end] character offsets in the source text" + }, + "mask": { + "type": [ + "string", + "null" + ] + }, + "reasons": { + "type": "array", + "items": { + "type": "string" + } + }, + "signals": { + "type": "object", + "properties": { + "brand_impersonation": { + "anyOf": [ + { + "type": "object", + "properties": { + "brand": { + "type": "string" + }, + "method": { + "type": "string" + } + }, + "required": [ + "brand", + "method" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "has_suspicious_characters": { + "type": "boolean" + }, + "is_link_shortener": { + "type": "boolean" + }, + "domain_age_days": { + "type": [ + "number", + "null" + ] + }, + "has_email_setup": { + "type": [ + "boolean", + "null" + ] + }, + "redirect_count": { + "type": [ + "number", + "null" + ] + }, + "final_url": { + "type": [ + "string", + "null" + ] + }, + "bot_protection": { + "type": [ + "boolean", + "null" + ] + }, + "is_reported": { + "type": "boolean" + } + }, + "required": [ + "brand_impersonation", + "has_suspicious_characters", + "is_link_shortener", + "domain_age_days", + "has_email_setup", + "redirect_count", + "final_url", + "bot_protection", + "is_reported" + ], + "additionalProperties": false + }, + "entity_type": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "type": "string" + } + }, + "skeleton": { + "type": "string" + } + }, + "required": [ + "match", + "probability", + "span" + ], + "additionalProperties": false + } + } + }, + "required": [ + "label", + "score" + ], + "additionalProperties": false + } + }, + { + "type": "null" + } + ], + "description": "Moderation labels applied to the content" + }, + "flagged_fields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "For object content, the field keys (e.g. \"bio\") that triggered a flag. Empty when no fields were flagged or the content is not an object." + }, + "language": { + "description": "Detected ISO language code, if available", + "type": [ + "string", + "null" + ] + }, + "content": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false, + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" ], - name: 'name', - profilePicture: 'https://example.com', - ); - - var_dump($author); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: >- - using System; - - using ModerationApi; - - using ModerationApi.Models.Authors; - - - ModerationApiClient client = new(); - - - AuthorCreateParams parameters = new() { ExternalID = "external_id" - }; - - - var author = await client.Authors.Create(parameters); - - - Console.WriteLine(author); - /authors/{id}: - get: - operationId: author-openGetAuthorDetails - summary: Get author details - description: >- - Get detailed information about a specific author including historical - data and analysis - tags: - - author - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: Either external ID or the ID assigned by moderation API. - required: true - description: Either external ID or the ID assigned by moderation API. - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PublicAuthor' - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const author = await client.authors.retrieve('id'); - - console.log(author.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - author = client.authors.retrieve( - "id", - ) - print(author.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - author = moderation_api.authors.retrieve("id") - - - puts(author) - - lang: PHP - source: >- - authors->retrieve('id'); - - var_dump($author); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Authors; - - ModerationApiClient client = new(); - - AuthorRetrieveParams parameters = new() { ID = "id" }; - - var author = await client.Authors.Retrieve(parameters); - - Console.WriteLine(author); - put: - operationId: author-openUpdate - summary: Update author details - description: Update the details of a specific author - tags: - - author - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: Either external ID or the ID assigned by moderation API. - required: true - description: Either external ID or the ID assigned by moderation API. - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - profile_picture: - description: URL of the author's profile picture - anyOf: - - type: string - format: uri - - type: 'null' - external_link: - description: URL of the author's external profile - anyOf: - - type: string - format: uri - - type: 'null' - name: - description: Author name or identifier - anyOf: - - type: string - - type: 'null' - email: - description: Author email address - anyOf: - - type: string - format: email - pattern: >- - ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ - - type: 'null' - company: - description: The author's company or organization - anyOf: - - type: string - - type: 'null' - metadata: - type: object - properties: - email_verified: - description: Whether the author's email is verified - anyOf: - - type: boolean - - type: 'null' - phone_verified: - description: Whether the author's phone number is verified - anyOf: - - type: boolean - - type: 'null' - identity_verified: - description: Whether the author's identity is verified - anyOf: - - type: boolean - - type: 'null' - is_paying_customer: - description: Whether the author is a paying customer - anyOf: - - type: boolean - - type: 'null' - additionalProperties: {} - description: >- - Additional metadata provided by your system. We recommend - including any relevant information that may assist in the - moderation process. - first_seen: - type: number - description: Timestamp when author first appeared - last_seen: - type: number - description: Timestamp of last activity - manual_trust_level: - anyOf: - - type: number - minimum: -1 - maximum: 4 - - type: 'null' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PublicAuthor' - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const author = await client.authors.update('id'); - - console.log(author.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - author = client.authors.update( - id="id", - ) - print(author.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - author = moderation_api.authors.update("id") - - - puts(author) - - lang: PHP - source: >- - authors->update( - 'id', - company: 'company', - email: 'dev@stainless.com', - externalLink: 'https://example.com', - firstSeen: 0, - lastSeen: 0, - manualTrustLevel: -1, - metadata: [ - 'emailVerified' => true, - 'identityVerified' => true, - 'isPayingCustomer' => true, - 'phoneVerified' => true, + "additionalProperties": false, + "description": "Audio", + "title": "Audio" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string", + "description": "The key of the content node" + }, + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string", + "maxLength": 100000, + "description": "The content text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false, + "description": "Text", + "title": "Text" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content. Either url or data must be provided.", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue.", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "description": "Image", + "title": "Image" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "type": "string", + "format": "uri", + "description": "A public URL of the video content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Video", + "title": "Video" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the audio content" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false, + "description": "Audio", + "title": "Audio" + } + ], + "title": "Content leaf", + "type": "object" + }, + "description": "Values in the object. Can be mixed content types." + } + }, + "required": [ + "type", + "data" ], - name: 'name', - profilePicture: 'https://example.com', - ); - - var_dump($author); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Authors; - - ModerationApiClient client = new(); - - AuthorUpdateParams parameters = new() { ID = "id" }; - - var author = await client.Authors.Update(parameters); - - Console.WriteLine(author); - delete: - operationId: author-delete - summary: Delete an author - description: Delete a specific author - tags: - - author - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - required: true - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - required: - - success - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const author = await client.authors.delete('id'); - - console.log(author.success); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - author = client.authors.delete( - "id", - ) - print(author.success) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - author = moderation_api.authors.delete("id") - - - puts(author) - - lang: PHP - source: >- - authors->delete('id'); - - var_dump($author); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Authors; - - ModerationApiClient client = new(); - - AuthorDeleteParams parameters = new() { ID = "id" }; - - var author = await client.Authors.Delete(parameters); - - Console.WriteLine(author); - /queue/{id}: - get: - operationId: queueView-openGetQueue - summary: Get a queue - description: Get a queue - tags: - - review-queues - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: The queue ID - required: true - description: The queue ID - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - queue: - type: object - properties: - id: - type: string - name: - type: string - description: - type: string - filter: - type: object - properties: - conversationIds: - type: array - items: - anyOf: - - type: string - - type: 'null' - filterLabels: - type: array - items: - type: object - properties: - label: - type: string - type: - type: string - enum: - - FLAGGED - - NOT_FLAGGED - - THRESHOLDS - minThreshold: - anyOf: - - type: number - minimum: 0 - maximum: 100 - - type: 'null' - maxThreshold: - anyOf: - - type: number - minimum: 0 - maximum: 100 - - type: 'null' - required: - - label - - type - additionalProperties: false - labels: - type: array - items: - type: string - afterDate: - type: string - beforeDate: - type: string - showChecked: - type: boolean - authorID: - type: string - filteredActionIds: - type: array - items: - type: string - filteredChannelIds: - type: array - items: - type: string - recommendationActions: - type: array - items: - type: string - enum: - - review - - allow - - reject - additionalProperties: false - unresolvedItemsCount: - type: number - resolvedItemsCount: - type: number - totalItemsCount: - type: number - required: - - id - - name - - description - - filter - - unresolvedItemsCount - - resolvedItemsCount - - totalItemsCount - additionalProperties: false - required: - - queue - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const queue = await client.queue.retrieve('id'); - - console.log(queue.queue); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - queue = client.queue.retrieve( - "id", - ) - print(queue.queue) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - queue = moderation_api.queue.retrieve("id") - - - puts(queue) - - lang: PHP - source: >- - queue->retrieve('id'); - - var_dump($queue); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Queue; - - ModerationApiClient client = new(); - - QueueRetrieveParams parameters = new() { ID = "id" }; - - var queue = await client.Queue.Retrieve(parameters); - - Console.WriteLine(queue); - /queue/{id}/stats: - get: - operationId: queueView-openGetStats - summary: Get queue statistics - description: >- - Get detailed statistics about a moderation queue including review times, - action counts, and trends - tags: - - review-queues - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: The queue ID - required: true - description: The queue ID - - in: query - name: withinDays - schema: - default: '30' - description: Number of days to analyze statistics for - type: string - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - reviewStats: - type: object - properties: - averageTimeToReview: - type: number - description: Average time in milliseconds to review an item - totalReviewed: - type: number - description: Total number of items reviewed - totalPending: - type: number - description: Total number of items pending review - required: - - averageTimeToReview - - totalReviewed - - totalPending - additionalProperties: false - actionStats: - type: array - items: - type: object - properties: - actionId: - type: string - description: ID of the moderation action - actionName: - type: string - description: Name of the moderation action - count: - type: number - description: Number of times this action was taken - percentageOfTotal: - type: number - description: Percentage this action represents of all actions - required: - - actionId - - actionName - - count - - percentageOfTotal - additionalProperties: false - topReviewers: - type: array - items: - type: object - properties: - userId: - type: string - description: ID of the reviewer - name: - type: string - description: Name of the reviewer - reviewCount: - type: number - description: Number of items reviewed - averageTimePerReview: - type: number - description: Average review time in milliseconds - accuracyScore: - description: >- - Optional accuracy score based on review quality - metrics - type: number - topActions: - type: array - items: - type: object - properties: - actionId: - type: string - description: Most used action by this reviewer - actionName: - type: string - description: Name of the most used action - count: - type: number - description: Number of times this action was used - required: - - actionId - - actionName - - count - additionalProperties: false - description: Most common actions taken by this reviewer - required: - - userId - - name - - reviewCount - - averageTimePerReview - - topActions - additionalProperties: false - description: List of top reviewers and their statistics - trends: - type: object - properties: - dailyReviewCounts: - type: array - items: - type: object - properties: - date: - type: string - description: Date in YYYY-MM-DD format - count: - type: number - description: Number of reviews on this date - required: - - date - - count - additionalProperties: false - flaggedContentTrends: - type: array - items: - type: object - properties: - label: - type: string - description: Content flag/label - trend: - type: number - description: >- - Trend indicator (-1 to 1) showing if this type - of flagged content is increasing or decreasing - required: - - label - - trend - additionalProperties: false - required: - - dailyReviewCounts - - flaggedContentTrends - additionalProperties: false - required: - - reviewStats - - actionStats - - topReviewers - - trends - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const response = await client.queue.getStats('id'); - - console.log(response.actionStats); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - response = client.queue.get_stats( - id="id", - ) - print(response.action_stats) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - response = moderation_api.queue.get_stats("id") - - - puts(response) - - lang: PHP - source: >- - queue->getStats('id', withinDays: 'withinDays'); - - var_dump($response); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Queue; - - ModerationApiClient client = new(); - - QueueGetStatsParams parameters = new() { ID = "id" }; - - var response = await client.Queue.GetStats(parameters); - - Console.WriteLine(response); - /queue/{id}/items: - get: - operationId: queueView-openGetItems - summary: Get queue items - description: Get paginated list of items in a moderation queue with filtering options - tags: - - review-queues - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: The queue ID - required: true - description: The queue ID - - in: query - name: pageSize - schema: - default: 20 - description: Number of items per page - type: number - - in: query - name: pageNumber - schema: - default: 1 - description: Page number to fetch - type: number - - in: query - name: sortField - schema: - type: string - enum: - - createdAt - - severity - - reviewedAt - - in: query - name: sortDirection - schema: - default: desc - description: Sort direction - type: string - enum: - - asc - - desc - - in: query - name: conversationIds - schema: - type: string - - in: query - name: labels - schema: - type: string - - in: query - name: afterDate - schema: - type: string - - in: query - name: beforeDate - schema: - type: string - - in: query - name: includeResolved - schema: - type: string - - in: query - name: authorId - schema: - type: string - - in: query - name: filteredActionIds - schema: - type: string - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - items: - type: array - items: - type: object - properties: - id: - type: string - description: Content ID - content: - type: string - description: The content to be moderated - language: - description: Content language - type: string - labels: - type: array - items: - type: object - properties: - label: - type: string - description: Label name - score: - type: number - description: Confidence score of the label - flagged: - type: boolean - description: Whether this label caused a flag - required: - - label - - score - - flagged - additionalProperties: false - conversationId: - description: Conversation ID - type: string - authorId: - description: Author ID - type: string - actions: - description: Action IDs taken on this item - type: array - items: - type: object - properties: - id: - type: string - description: Action ID - name: - type: string - description: Action name - comment: - description: Action comment - type: string - timestamp: - type: number - description: Unix timestamp of when the action was taken - reviewer: - description: Moderator userID - type: string - required: - - id - - name - - timestamp - additionalProperties: false - flagged: - type: boolean - description: Whether the item is flagged by any label - status: - type: string - enum: - - pending - - resolved - description: Status of the item - timestamp: - type: number - description: Unix timestamp of when the item was created - contentType: - description: Type of the content object - type: string - required: - - id - - content - - labels - - flagged - - status - - timestamp - additionalProperties: false - pagination: - type: object - properties: - totalItems: - type: number - totalPages: - type: number - currentPage: - type: number - hasNextPage: - type: boolean - hasPreviousPage: - type: boolean - required: - - totalItems - - totalPages - - currentPage - - hasNextPage - - hasPreviousPage - additionalProperties: false - required: - - items - - pagination - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const items = await client.queue.items.list('id'); - - console.log(items.items); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - items = client.queue.items.list( - id="id", - ) - print(items.items) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - items = moderation_api.queue.items.list("id") - - - puts(items) - - lang: PHP - source: >- - queue->items->list( - 'id', - afterDate: 'afterDate', - authorID: 'authorId', - beforeDate: 'beforeDate', - conversationIDs: 'conversationIds', - filteredActionIDs: 'filteredActionIds', - includeResolved: 'includeResolved', - labels: 'labels', - pageNumber: 0, - pageSize: 0, - sortDirection: 'asc', - sortField: 'createdAt', - ); - - var_dump($items); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Queue.Items; - - ModerationApiClient client = new(); - - ItemListParams parameters = new() { ID = "id" }; - - var items = await client.Queue.Items.List(parameters); - - Console.WriteLine(items); - /queue/{id}/items/{itemId}/resolve: - post: - operationId: queueView-openResolveItem - summary: Resolve a queue item - description: Mark a queue item as resolved with a specific moderation action - tags: - - review-queues - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: The queue ID - required: true - description: The queue ID - - in: path - name: itemId - schema: - type: string - description: The item ID to resolve - required: true - description: The item ID to resolve - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - comment: - description: Optional comment - type: string - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - resolvedAt: - type: string - description: Timestamp when the item was resolved - comment: - description: Optional comment - type: string - required: - - success - - resolvedAt - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: >- - import ModerationAPI from '@moderation-api/sdk'; - - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - - const response = await client.queue.items.resolve('itemId', { id: - 'id' }); - - - console.log(response.resolvedAt); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - response = client.queue.items.resolve( - item_id="itemId", - id="id", - ) - print(response.resolved_at) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - response = moderation_api.queue.items.resolve("itemId", id: "id") - - - puts(response) - - lang: PHP - source: >- - queue->items->resolve( - 'itemId', id: 'id', comment: 'comment' - ); - - var_dump($response); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Queue.Items; - - ModerationApiClient client = new(); - - ItemResolveParams parameters = new() - { - ID = "id", - ItemID = "itemId", - }; - - var response = await client.Queue.Items.Resolve(parameters); - - Console.WriteLine(response); - /queue/{id}/items/{itemId}/unresolve: - post: - operationId: queueView-openUnresolveItem - summary: Unresolve a queue item - description: Mark a previously resolved queue item as unresolved/pending - tags: - - review-queues - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: The queue ID - required: true - description: The queue ID - - in: path - name: itemId - schema: - type: string - description: The item ID to unresolve - required: true - description: The item ID to unresolve - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - comment: - description: Optional reason for unresolving the item - type: string - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - status: - type: string - description: New status of the item - unresolvedAt: - type: string - description: Timestamp when the item was unresolved - required: - - success - - status - - unresolvedAt - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: >- - import ModerationAPI from '@moderation-api/sdk'; - - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - - const response = await client.queue.items.unresolve('itemId', { id: - 'id' }); - - - console.log(response.status); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - response = client.queue.items.unresolve( - item_id="itemId", - id="id", - ) - print(response.status) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - response = moderation_api.queue.items.unresolve("itemId", id: "id") - - - puts(response) - - lang: PHP - source: >- - queue->items->unresolve( - 'itemId', id: 'id', comment: 'comment' - ); - - var_dump($response); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Queue.Items; - - ModerationApiClient client = new(); - - ItemUnresolveParams parameters = new() - { - ID = "id", - ItemID = "itemId", - }; - - var response = await client.Queue.Items.Unresolve(parameters); - - Console.WriteLine(response); - /actions: - get: - operationId: actions-list - summary: List moderation actions - description: >- - List all available moderation actions for the authenticated - organization. - tags: - - Actions - security: - - Authorization: [] - parameters: - - in: query - name: queueId - schema: - type: string - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: array - items: - type: object - properties: - id: - type: string - description: The ID of the action. - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - createdAt: - description: The date the action was created. - type: string - name: - type: string - description: The name of the action. - description: - description: The description of the action. - anyOf: - - type: string - - type: 'null' - type: - description: The type of the action. - anyOf: - - type: string - enum: - - AUTHOR_BLOCK - - AUTHOR_BLOCK_TEMP - - AUTHOR_UNBLOCK - - AUTHOR_DELETE - - AUTHOR_REPORT - - AUTHOR_WARN - - AUTHOR_CUSTOM - - ITEM_REJECT - - ITEM_ALLOW - - ITEM_CUSTOM - - type: 'null' - builtIn: - default: false - description: Whether the action is a built-in action or a custom one. - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - default: NO_CHANGE - description: >- - Whether the action resolves and removes the item, - unresolves and re-add it to the queue, or does not - change the resolve status. - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - default: [] - description: The IDs of the queues the action is available in. - type: array - items: - type: string - position: - default: ALL_QUEUES - description: >- - Show the action in all queues, selected queues or no - queues (to use via API only). - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - default: [] - description: >- - The possible values of the action. The user will be - prompted to select one of these values when executing - the action. - type: array - items: - type: object - properties: - value: - type: string - description: The value of the action. - required: - - value - additionalProperties: false - valueRequired: - default: false - description: Whether the action requires a value to be executed. - type: boolean - freeText: - default: false - description: >- - Whether the action allows any text to be entered as a - value or if it must be one of the possible values. - type: boolean - required: - - id - - createdAt - - name - - builtIn - - queueBehaviour - - filterInQueueIds - - position - - possibleValues - - valueRequired - - freeText - additionalProperties: false - description: List of moderation actions with their associated webhooks - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const actions = await client.actions.list(); - - console.log(actions); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - actions = client.actions.list() - print(actions) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - actions = moderation_api.actions.list - - - puts(actions) - - lang: PHP - source: >- - actions->list(queueID: 'queueId'); - - var_dump($actions); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Actions; - - ModerationApiClient client = new(); - - ActionListParams parameters = new(); - - var actions = await client.Actions.List(parameters); - - Console.WriteLine(actions); - post: - operationId: actions-create - summary: Create an action - description: Create an action. - tags: - - Actions - security: - - Authorization: [] - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - name: - type: string - description: The name of the action. - description: - description: The description of the action. - anyOf: - - type: string - - type: 'null' - type: - description: The type of the action. - anyOf: - - type: string - enum: - - AUTHOR_BLOCK - - AUTHOR_BLOCK_TEMP - - AUTHOR_UNBLOCK - - AUTHOR_DELETE - - AUTHOR_REPORT - - AUTHOR_WARN - - AUTHOR_CUSTOM - - ITEM_REJECT - - ITEM_ALLOW - - ITEM_CUSTOM - - type: 'null' - builtIn: - default: false - description: Whether the action is a built-in action or a custom one. - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - default: NO_CHANGE - description: >- - Whether the action resolves and removes the item, unresolves - and re-add it to the queue, or does not change the resolve - status. - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - default: [] - description: The IDs of the queues the action is available in. - type: array - items: - type: string - position: - default: ALL_QUEUES - description: >- - Show the action in all queues, selected queues or no queues - (to use via API only). - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - default: [] - description: >- - The possible values of the action. The user will be prompted - to select one of these values when executing the action. - type: array - items: - type: object - properties: - value: - type: string - description: The value of the action. - required: - - value - valueRequired: - default: false - description: Whether the action requires a value to be executed. - type: boolean - freeText: - default: false - description: >- - Whether the action allows any text to be entered as a value - or if it must be one of the possible values. - type: boolean - required: - - name - responses: - '200': - description: Action created successfully - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the action. - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - createdAt: - description: The date the action was created. - type: string - name: - type: string - description: The name of the action. - description: - description: The description of the action. - anyOf: - - type: string - - type: 'null' - type: - description: The type of the action. - anyOf: - - type: string - enum: - - AUTHOR_BLOCK - - AUTHOR_BLOCK_TEMP - - AUTHOR_UNBLOCK - - AUTHOR_DELETE - - AUTHOR_REPORT - - AUTHOR_WARN - - AUTHOR_CUSTOM - - ITEM_REJECT - - ITEM_ALLOW - - ITEM_CUSTOM - - type: 'null' - builtIn: - default: false - description: Whether the action is a built-in action or a custom one. - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - default: NO_CHANGE - description: >- - Whether the action resolves and removes the item, - unresolves and re-add it to the queue, or does not change - the resolve status. - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - default: [] - description: The IDs of the queues the action is available in. - type: array - items: - type: string - position: - default: ALL_QUEUES - description: >- - Show the action in all queues, selected queues or no - queues (to use via API only). - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - default: [] - description: >- - The possible values of the action. The user will be - prompted to select one of these values when executing the - action. - type: array - items: - type: object - properties: - value: - type: string - description: The value of the action. - required: - - value - additionalProperties: false - valueRequired: - default: false - description: Whether the action requires a value to be executed. - type: boolean - freeText: - default: false - description: >- - Whether the action allows any text to be entered as a - value or if it must be one of the possible values. - type: boolean - required: - - id - - createdAt - - name - - builtIn - - queueBehaviour - - filterInQueueIds - - position - - possibleValues - - valueRequired - - freeText - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '409': - description: Action with this key already exists - content: - application/json: - schema: - $ref: '#/components/schemas/error.CONFLICT' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const action = await client.actions.create({ name: 'name' }); - - console.log(action.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - action = client.actions.create( - name="name", - ) - print(action.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - action = moderation_api.actions.create(name: "name") - - - puts(action) - - lang: PHP - source: >- - actions->create( - name: 'name', - builtIn: true, - description: 'description', - filterInQueueIDs: ['string'], - freeText: true, - key: 'key', - position: 'ALL_QUEUES', - possibleValues: [['value' => 'value']], - queueBehaviour: 'REMOVE', - type: 'AUTHOR_BLOCK', - valueRequired: true, - ); - - var_dump($action); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Actions; - - ModerationApiClient client = new(); - - ActionCreateParams parameters = new() { Name = "name" }; - - var action = await client.Actions.Create(parameters); - - Console.WriteLine(action); - /actions/{id}: - get: - operationId: actions-get - summary: Get an action - description: Get an action by ID. - tags: - - Actions - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: The ID of the action to get. - required: true - description: The ID of the action to get. - responses: - '200': - description: Action retrieved successfully - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the action. - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - createdAt: - description: The date the action was created. - type: string - name: - type: string - description: The name of the action. - description: - description: The description of the action. - anyOf: - - type: string - - type: 'null' - type: - description: The type of the action. - anyOf: - - type: string - enum: - - AUTHOR_BLOCK - - AUTHOR_BLOCK_TEMP - - AUTHOR_UNBLOCK - - AUTHOR_DELETE - - AUTHOR_REPORT - - AUTHOR_WARN - - AUTHOR_CUSTOM - - ITEM_REJECT - - ITEM_ALLOW - - ITEM_CUSTOM - - type: 'null' - builtIn: - default: false - description: Whether the action is a built-in action or a custom one. - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - default: NO_CHANGE - description: >- - Whether the action resolves and removes the item, - unresolves and re-add it to the queue, or does not change - the resolve status. - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - default: [] - description: The IDs of the queues the action is available in. - type: array - items: - type: string - position: - default: ALL_QUEUES - description: >- - Show the action in all queues, selected queues or no - queues (to use via API only). - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - default: [] - description: >- - The possible values of the action. The user will be - prompted to select one of these values when executing the - action. - type: array - items: - type: object - properties: - value: - type: string - description: The value of the action. - required: - - value - additionalProperties: false - valueRequired: - default: false - description: Whether the action requires a value to be executed. - type: boolean - freeText: - default: false - description: >- - Whether the action allows any text to be entered as a - value or if it must be one of the possible values. - type: boolean - required: - - id - - createdAt - - name - - builtIn - - queueBehaviour - - filterInQueueIds - - position - - possibleValues - - valueRequired - - freeText - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const action = await client.actions.retrieve('id'); - - console.log(action.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - action = client.actions.retrieve( - "id", - ) - print(action.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - action = moderation_api.actions.retrieve("id") - - - puts(action) - - lang: PHP - source: >- - actions->retrieve('id'); - - var_dump($action); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Actions; - - ModerationApiClient client = new(); - - ActionRetrieveParams parameters = new() { ID = "id" }; - - var action = await client.Actions.Retrieve(parameters); - - Console.WriteLine(action); - put: - operationId: actions-update - summary: Update an action - description: Update an action. - tags: - - Actions - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: The ID of the action to update. - required: true - description: The ID of the action to update. - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - name: - type: string - description: The name of the action. - description: - description: The description of the action. - anyOf: - - type: string - - type: 'null' - type: - description: The type of the action. - anyOf: - - type: string - enum: - - AUTHOR_BLOCK - - AUTHOR_BLOCK_TEMP - - AUTHOR_UNBLOCK - - AUTHOR_DELETE - - AUTHOR_REPORT - - AUTHOR_WARN - - AUTHOR_CUSTOM - - ITEM_REJECT - - ITEM_ALLOW - - ITEM_CUSTOM - - type: 'null' - builtIn: - default: false - description: Whether the action is a built-in action or a custom one. - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - default: NO_CHANGE - description: >- - Whether the action resolves and removes the item, unresolves - and re-add it to the queue, or does not change the resolve - status. - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - default: [] - description: The IDs of the queues the action is available in. - type: array - items: - type: string - position: - default: ALL_QUEUES - description: >- - Show the action in all queues, selected queues or no queues - (to use via API only). - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - default: [] - description: >- - The possible values of the action. The user will be prompted - to select one of these values when executing the action. - type: array - items: - type: object - properties: - value: - type: string - description: The value of the action. - required: - - value - valueRequired: - default: false - description: Whether the action requires a value to be executed. - type: boolean - freeText: - default: false - description: >- - Whether the action allows any text to be entered as a value - or if it must be one of the possible values. - type: boolean - responses: - '200': - description: Action updated successfully - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the action. - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - createdAt: - description: The date the action was created. - type: string - name: - type: string - description: The name of the action. - description: - description: The description of the action. - anyOf: - - type: string - - type: 'null' - type: - description: The type of the action. - anyOf: - - type: string - enum: - - AUTHOR_BLOCK - - AUTHOR_BLOCK_TEMP - - AUTHOR_UNBLOCK - - AUTHOR_DELETE - - AUTHOR_REPORT - - AUTHOR_WARN - - AUTHOR_CUSTOM - - ITEM_REJECT - - ITEM_ALLOW - - ITEM_CUSTOM - - type: 'null' - builtIn: - default: false - description: Whether the action is a built-in action or a custom one. - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - default: NO_CHANGE - description: >- - Whether the action resolves and removes the item, - unresolves and re-add it to the queue, or does not change - the resolve status. - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - default: [] - description: The IDs of the queues the action is available in. - type: array - items: - type: string - position: - default: ALL_QUEUES - description: >- - Show the action in all queues, selected queues or no - queues (to use via API only). - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - default: [] - description: >- - The possible values of the action. The user will be - prompted to select one of these values when executing the - action. - type: array - items: - type: object - properties: - value: - type: string - description: The value of the action. - required: - - value - additionalProperties: false - valueRequired: - default: false - description: Whether the action requires a value to be executed. - type: boolean - freeText: - default: false - description: >- - Whether the action allows any text to be entered as a - value or if it must be one of the possible values. - type: boolean - required: - - id - - createdAt - - name - - builtIn - - queueBehaviour - - filterInQueueIds - - position - - possibleValues - - valueRequired - - freeText - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '409': - description: Action with this key already exists - content: - application/json: - schema: - $ref: '#/components/schemas/error.CONFLICT' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const action = await client.actions.update('id'); - - console.log(action.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - action = client.actions.update( - id="id", - ) - print(action.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - action = moderation_api.actions.update("id") - - - puts(action) - - lang: PHP - source: >- - actions->update( - 'id', - builtIn: true, - description: 'description', - filterInQueueIDs: ['string'], - freeText: true, - key: 'key', - name: 'name', - position: 'ALL_QUEUES', - possibleValues: [['value' => 'value']], - queueBehaviour: 'REMOVE', - type: 'AUTHOR_BLOCK', - valueRequired: true, - ); - - var_dump($action); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Actions; - - ModerationApiClient client = new(); - - ActionUpdateParams parameters = new() { ID = "id" }; - - var action = await client.Actions.Update(parameters); - - Console.WriteLine(action); - delete: - operationId: actions-delete - summary: Delete an action - description: Delete an action and all of its webhooks. - tags: - - Actions - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: The ID of the action to delete. - required: true - description: The ID of the action to delete. - responses: - '200': - description: Action deleted successfully - content: - application/json: - schema: - type: object - properties: - deleted: - type: boolean - description: Whether the action was deleted. - id: - type: string - description: The ID of the action. - required: - - deleted - - id - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const action = await client.actions.delete('id'); - - console.log(action.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - action = client.actions.delete( - "id", - ) - print(action.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - action = moderation_api.actions.delete("id") - - - puts(action) - - lang: PHP - source: >- - actions->delete('id'); - - var_dump($action); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Actions; - - ModerationApiClient client = new(); - - ActionDeleteParams parameters = new() { ID = "id" }; - - var action = await client.Actions.Delete(parameters); - - Console.WriteLine(action); - /actions/execute: - post: - operationId: actions-execute - summary: Execute moderation action - description: Execute a moderation action on one or more content items. - tags: - - Actions - security: - - Authorization: [] - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - actionKey: - type: string - description: ID or key of the action to execute - contentIds: - description: >- - IDs of the content items to apply the action to. Provide - this or authorIds. - type: array - items: - type: string - authorIds: - description: >- - IDs of the authors to apply the action to. Provide this or - contentIds. - type: array - items: - type: string - value: - description: Optional value to provide with the action - type: string - queueId: - description: Optional queue ID if the action is queue-specific - type: string - duration: - description: Optional duration in milliseconds for actions with timeouts - type: number - minimum: 0 - required: - - actionKey - description: Input parameters - responses: - '200': - description: Action executed successfully - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - description: Whether the action was executed successfully - required: - - success - additionalProperties: false - description: Execution result - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - x-codeSamples: - - lang: JavaScript - source: >- - import ModerationAPI from '@moderation-api/sdk'; - - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - - const response = await client.actions.execute.execute({ actionKey: - 'actionKey' }); - - - console.log(response.success); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - response = client.actions.execute.execute( - action_key="actionKey", - ) - print(response.success) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - response = moderation_api.actions.execute.execute(action_key: - "actionKey") - - - puts(response) - - lang: PHP - source: >- - actions->execute->execute( - actionKey: 'actionKey', - authorIDs: ['string'], - contentIDs: ['string'], - duration: 0, - queueID: 'queueId', - value: 'value', - ); - - var_dump($response); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Actions.Execute; - - ModerationApiClient client = new(); - - ExecuteExecuteParams parameters = new() { ActionKey = "actionKey" }; - - var response = await client.Actions.Execute.Execute(parameters); - - Console.WriteLine(response); - /actions/{actionId}/execute: - post: - operationId: actions-executeDeprecated - summary: Execute an action - description: Execute an action on a set of content items in a queue. - tags: - - Actions - security: - - Authorization: [] - deprecated: true - parameters: - - in: path - name: actionId - schema: - type: string - description: The ID or key of the action to execute. - required: true - description: The ID or key of the action to execute. - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - contentIds: - description: The IDs of the content items to perform the action on. - type: array - items: - type: string - authorIds: - description: IDs of the authors to apply the action to - type: array - items: - type: string - queueId: - description: The ID of the queue the action was performed from if any. - type: string - value: - description: >- - The value of the action. Useful to set a reason for the - action etc. - type: string - responses: - '200': - description: Action executed successfully - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - description: Action executed successfully. - actionId: - type: string - description: The ID of the action. - ids: - type: array - items: - type: string - description: The IDs of the content items. - required: - - success - - actionId - - ids - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - x-codeSamples: - - lang: JavaScript - source: >- - import ModerationAPI from '@moderation-api/sdk'; - - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - - const response = await - client.actions.execute.executeByID('actionId'); - - - console.log(response.ids); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - response = client.actions.execute.execute_by_id( - action_id="actionId", - ) - print(response.ids) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - response = moderation_api.actions.execute.execute_by_id("actionId") - - - puts(response) - - lang: PHP - source: >- - actions->execute->executeByID( - 'actionId', - authorIDs: ['string'], - contentIDs: ['string'], - queueID: 'queueId', - value: 'value', - ); - - var_dump($response); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: >- - using System; - - using ModerationApi; - - using ModerationApi.Models.Actions.Execute; - - - ModerationApiClient client = new(); - - - ExecuteExecuteByIDParams parameters = new() { ActionID = "actionId" - }; - - - var response = await client.Actions.Execute.ExecuteByID(parameters); - - - Console.WriteLine(response); - /moderate/text: - post: - operationId: moderation-text - summary: Analyze text - description: >- - (Deprecated use https://api.moderationapi.com/v1/moderate) Analyze text - content with your configured moderation models and filters. - tags: - - Moderate - security: - - Authorization: [] - deprecated: true - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - contentId: - description: The unique ID of the content in your database. - type: string - minLength: 1 - maxLength: 100 - value: - type: string - maxLength: 100000 - description: >- - The text you'd like to analyze. We recommend to submit plain - text or HTML - channelKey: - description: The key of the channel. - type: string - doNotStore: - description: >- - Do not store the content. The content won't enter the review - queue - type: boolean - authorId: - description: The author of the content. - type: string - contextId: - description: For example the ID of a chat room or a post - type: string - metadata: - description: Any metadata you want to store with the content - type: object - propertyNames: - type: string - additionalProperties: {} - required: - - value - description: Input parameters for text moderation - responses: - '200': - description: Successful response - content: - application/json: - schema: - allOf: - - type: object - properties: - status: - type: string - description: Success if the request was successful - error: - description: Error message if the request failed - contentId: - description: >- - The ID of the content. Only returned if the content - was stored. - type: string - request: - type: object - properties: - timestamp: - type: number - description: The timestamp of the request - quota_usage: - type: number - description: The quota usage of the request - required: - - timestamp - - quota_usage - additionalProperties: false - description: Information about the request - flagged: - type: boolean - description: Whether the content was flagged by any models - author: - anyOf: - - type: object - properties: - id: - type: string - description: Author ID in Moderation API - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - anyOf: - - type: object - properties: - until: - description: >- - The timestamp until which they are - blocked if the author is suspended. - anyOf: - - type: number - - type: 'null' - reason: - description: >- - The moderators reason why the author was - blocked or suspended. - anyOf: - - type: string - - type: 'null' - additionalProperties: false - - type: 'null' - description: >- - Block or suspension details, if applicable. - Null if the author is enabled. - status: - type: string - enum: - - enabled - - suspended - - blocked - description: Current author status - trust_level: - type: object - properties: - level: - type: number - description: Author trust level (-1, 0, 1, 2, 3, or 4) - manual: - type: boolean - description: >- - True if the trust level was set manually - by a moderator - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - description: >- - The author of the content if your account has authors - enabled. Requires you to send authorId when submitting - content. - content_moderated: - type: boolean - description: >- - Whether the content was moderated or not. Same as - `content` !== `original` - unicode_spoofing: - type: boolean - description: >- - Whether the content is using look-alike characters. - Often used by spammers. - data_found: - type: boolean - description: Whether any entity matchers found data for the content - original: - type: string - description: The original content - content: - type: string - description: >- - The content after moderation. With all mask - replacements applied and look-alike characters - replaced with the original characters. - nsfw: - description: >- - The NSFW model output if enabled in your project. Read - more at https://docs.moderationapi.com/models/nsfw - type: object - properties: - label: - description: The label of the model - type: string - score: - description: The confidence of the model - type: number - error: - description: Indicates an error with the model - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate - type: string - label_scores: - description: The confidence of all labels - type: object - properties: - SENSITIVE: - description: >- - Mentions religion, politics, race, etc., but - is neutral or positive. - type: number - UNSAFE: - description: >- - Sexual, hateful, profane, and inappropriate - content. - type: number - NEUTRAL: - description: '' - type: number - additionalProperties: false - additionalProperties: false - toxicity: - description: >- - The toxicity model output if enabled in your project. - Read more at - https://docs.moderationapi.com/models/toxicity - type: object - properties: - label: - description: The label of the model - type: string - score: - description: The confidence of the model - type: number - error: - description: Indicates an error with the model - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate - type: string - label_scores: - description: The confidence of all labels - type: object - properties: - TOXICITY: - description: Rude or disrespectful content. - type: number - PROFANITY: - description: >- - Swearing, curse words, and other obscene - language. - type: number - DISCRIMINATION: - description: Discrimination of race, religion, gender, etc. - type: number - SEVERE_TOXICITY: - description: Very hateful and aggressive content. - type: number - INSULT: - description: >- - Negative comments about looks or personality - etc. - type: number - THREAT: - description: >- - Content containing intention to harm or - violence. - type: number - NEUTRAL: - description: '' - type: number - additionalProperties: false - additionalProperties: false - quality: - description: >- - The spam model output if enabled in your project. Read - more at https://docs.moderationapi.com/models/spam - type: object - properties: - label: - description: The label of the model - type: string - score: - description: The confidence of the model - type: number - error: - description: Indicates an error with the model - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate - type: string - label_scores: - description: The confidence of all labels - type: object - properties: - UNSUBSTANTIAL: - description: Trivial or short content. - type: number - INCOHERENT: - description: Difficult to understand, nonsensical. - type: number - SPAM: - description: Irrelevant and unsolicited commercial content. - type: number - NEUTRAL: - description: '' - type: number - additionalProperties: false - additionalProperties: false - sentiment: - description: >- - The sentiment model output if enabled in your project. - Read more at - https://docs.moderationapi.com/models/sentiment - type: object - properties: - label: - description: The label of the model - type: string - score: - description: The confidence of the model - type: number - error: - description: Indicates an error with the model - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate - type: string - label_scores: - description: The confidence of all labels - type: object - properties: - POSITIVE: - description: Positive sentiment. - type: number - NEGATIVE: - description: Negative sentiment. - type: number - NEUTRAL: - description: '' - type: number - additionalProperties: false - additionalProperties: false - propriety: - description: >- - The propriety model output if enabled in your project. - Read more at - https://docs.moderationapi.com/models/propriety - type: object - properties: - label: - description: The label of the model - type: string - score: - description: The confidence of the model - type: number - error: - description: Indicates an error with the model - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate - type: string - label_scores: - description: The confidence of all labels - type: object - properties: - FLIRTATION: - description: Pickup lines, compliments on appearance, etc. - type: number - SEXUALLY_EXPLICIT: - description: References to sexual acts, body parts, etc. - type: number - NEUTRAL: - description: '' - type: number - additionalProperties: false - additionalProperties: false - email: - description: >- - The email entity matcher output if enabled in your - project. Read more at - https://docs.moderationapi.com/models/email - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - phone: - description: >- - The phone entity matcher output if enabled in your - project. Read more at - https://docs.moderationapi.com/models/phone - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - url: - description: >- - The url entity matcher output if enabled in your - project. Read more at - https://docs.moderationapi.com/models/url - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - address: - description: >- - The address entity matcher output if enabled in your - project. Read more at - https://docs.moderationapi.com/models/address - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - name: - description: >- - The name entity matcher output if enabled in your - project. Read more at - https://docs.moderationapi.com/models/name - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - username: - description: >- - The username entity matcher output if enabled in your - project. Read more at - https://docs.moderationapi.com/models/username - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - profanity: - description: >- - The profanity entity matcher output if enabled in your - project. Read more at - https://docs.moderationapi.com/models/profanity - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - sensitive: - description: >- - The sensitive numbers entity matcher output if enabled - in your project. Read more at - https://docs.moderationapi.com/models/sensitive - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - wordlist: - description: >- - The wordlist entity matcher output if enabled in your - project. Read more at - https://docs.moderationapi.com/models/word - type: object - properties: - mode: - description: The detection mode. - type: string - enum: - - NORMAL - - SUSPICIOUS - - PARANOID - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might not - be accurate. - type: string - additionalProperties: false - wordlists: - description: >- - The wordlist entity matcher outputs if enabled in your - project. Read more at - https://docs.moderationapi.com/models/word - type: array - items: - type: object - properties: - mode: - type: string - enum: - - BLOCK_LIST - - REQUIRE_LIST - - PASS_LIST - description: The flagging mode. - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might - not be accurate. - type: string - flagged: - type: boolean - description: Whether the wordlists flagged the content. - name: - type: string - description: The name of the wordlist - id: - type: string - description: The ID of the wordlist - score: - type: number - description: The score of the wordlist - required: - - mode - - flagged - - name - - id - - score - additionalProperties: false - required: - - status - - request - - flagged - - author - - content_moderated - - unicode_spoofing - - data_found - - original - - content - additionalProperties: false - - type: object - propertyNames: - type: string - additionalProperties: {} - description: >- - Moderation analysis results including model outputs and - detected patterns - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - /moderate/object: - post: - operationId: moderation-object - summary: Analyze object. - description: >- - (Deprecated use https://api.moderationapi.com/v1/moderate) Analyze an - object with multiple fields including text, images, video, audio. Use to - moderate a post, a profile, a form submission or anything that have - multiple fields. - tags: - - Moderate - security: - - Authorization: [] - deprecated: true - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - contentId: - description: The unique ID of the content in your database. - type: string - minLength: 1 - maxLength: 100 - channelKey: - description: The key of the channel. - type: string - doNotStore: - description: >- - Do not store the content. The content won't enter the review - queue - type: boolean - authorId: - description: The author of the content. - type: string - contextId: - description: For example the ID of a chat room or a post - type: string - metadata: - description: Any metadata you want to store with the content - type: object - propertyNames: - type: string - additionalProperties: {} - value: - type: object - properties: - type: - type: string - enum: - - profile - - event - - product - - object - description: The type of the object you want to analyze. - data: - type: object - propertyNames: - type: string - additionalProperties: - type: object - properties: - type: - type: string - enum: - - text - - image - - video - - audio - description: >- - The type of content (e.g., "text", "image", - "video") - modelIds: - description: Optional array of specific model IDs to use - type: array - items: - type: string - value: - type: string - description: The content to analyze - required: - - type - - value - required: - - type - - data - description: The object you want to analyze. - required: - - value - responses: - '200': - description: Successful response - content: - application/json: - schema: - allOf: - - type: object - properties: - status: - type: string - description: Success if the request was successful - error: - description: Error message if the request failed - contentId: - description: >- - The ID of the content. Only returned if the content - was stored. - type: string - request: - type: object - properties: - timestamp: - type: number - description: The timestamp of the request - quota_usage: - type: number - description: The quota usage of the request - required: - - timestamp - - quota_usage - additionalProperties: false - description: Information about the request - flagged: - type: boolean - description: Whether the content was flagged by any models - author: - anyOf: - - type: object - properties: - id: - type: string - description: Author ID in Moderation API - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - anyOf: - - type: object - properties: - until: - description: >- - The timestamp until which they are - blocked if the author is suspended. - anyOf: - - type: number - - type: 'null' - reason: - description: >- - The moderators reason why the author was - blocked or suspended. - anyOf: - - type: string - - type: 'null' - additionalProperties: false - - type: 'null' - description: >- - Block or suspension details, if applicable. - Null if the author is enabled. - status: - type: string - enum: - - enabled - - suspended - - blocked - description: Current author status - trust_level: - type: object - properties: - level: - type: number - description: Author trust level (-1, 0, 1, 2, 3, or 4) - manual: - type: boolean - description: >- - True if the trust level was set manually - by a moderator - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - description: >- - The author of the content if your account has authors - enabled. Requires you to send authorId when submitting - content. - unicode_spoofing: - type: boolean - description: >- - Whether the content is using look-alike characters. - Often used by spammers. - data_found: - type: boolean - description: Whether any entity matchers found data for the content - labels: - type: array - items: - type: object - properties: - label: - type: string - description: The label of the model - model: - type: string - description: The model that found the label - score: - type: number - minimum: 0 - maximum: 1 - description: The confidence of the model - required: - - label - - model - - score - additionalProperties: false - description: The scores of each label - entities: - type: array - items: - type: object - properties: - model: - type: string - description: The model that found the entity - matches: - type: array - items: - type: string - description: The matches of the entity - score: - description: The similarity score of the matches - type: number - required: - - model - - matches - additionalProperties: false - description: The entities found in the content - wordlists: - description: >- - The wordlist entity matcher outputs if enabled in your - project. Read more at - https://docs.moderationapi.com/models/word - type: array - items: - type: object - properties: - mode: - type: string - enum: - - BLOCK_LIST - - REQUIRE_LIST - - PASS_LIST - description: The flagging mode. - found: - description: Whether a match was found or not. - type: boolean - matches: - description: The matches of the entity matcher. - type: array - items: - type: string - components: - description: The components of the matcher. - error: - description: Indicates an error with the matcher. - type: string - warning: - description: >- - Indicates a warning from the model, e.g. if the - text is too short or long and the model might - not be accurate. - type: string - flagged: - type: boolean - description: Whether the wordlists flagged the content. - name: - type: string - description: The name of the wordlist - id: - type: string - description: The ID of the wordlist - score: - type: number - description: The score of the wordlist - required: - - mode - - flagged - - name - - id - - score - additionalProperties: false - fields: - type: array - items: - type: object - properties: - key: - type: string - description: The key of the field - flagged: - type: boolean - description: Whether the field was flagged - flagged_by: - type: array - items: - type: string - description: The models that flagged the field - required: - - key - - flagged - - flagged_by - additionalProperties: false - description: The fields in the object and their flags - required: - - status - - request - - flagged - - author - - unicode_spoofing - - data_found - - labels - - entities - - fields - additionalProperties: false - - type: object - propertyNames: - type: string - additionalProperties: {} - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - /moderate/image: - post: - operationId: moderation-image - summary: Analyze image - description: >- - (Deprecated use https://api.moderationapi.com/v1/moderate) Analyze image - with your Moderation API project - tags: - - Moderate - security: - - Authorization: [] - deprecated: true - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - contentId: - description: The unique ID of the content in your database. - type: string - minLength: 1 - maxLength: 100 - channelKey: - description: The key of the channel. - type: string - doNotStore: - description: >- - Do not store the content. The content won't enter the review - queue - type: boolean - authorId: - description: The author of the content. - type: string - contextId: - description: For example the ID of a chat room or a post - type: string - metadata: - description: Any metadata you want to store with the content - type: object - propertyNames: - type: string - additionalProperties: {} - url: - type: string - format: uri - description: The URL of the image you want to analyze. - required: - - url - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - status: - type: string - description: Success if the request was successful - error: - description: Error message if the request failed - contentId: - description: >- - The ID of the content. Only returned if the content was - stored. - type: string - request: - type: object - properties: - timestamp: - type: number - description: The timestamp of the request - quota_usage: - type: number - description: The quota usage of the request - required: - - timestamp - - quota_usage - additionalProperties: false - description: Information about the request - flagged: - type: boolean - description: Whether the content was flagged by any models - author: - anyOf: - - type: object - properties: - id: - type: string - description: Author ID in Moderation API - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - anyOf: - - type: object - properties: - until: - description: >- - The timestamp until which they are blocked - if the author is suspended. - anyOf: - - type: number - - type: 'null' - reason: - description: >- - The moderators reason why the author was - blocked or suspended. - anyOf: - - type: string - - type: 'null' - additionalProperties: false - - type: 'null' - description: >- - Block or suspension details, if applicable. Null - if the author is enabled. - status: - type: string - enum: - - enabled - - suspended - - blocked - description: Current author status - trust_level: - type: object - properties: - level: - type: number - description: Author trust level (-1, 0, 1, 2, 3, or 4) - manual: - type: boolean - description: >- - True if the trust level was set manually by a - moderator - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - description: >- - The author of the content if your account has authors - enabled. Requires you to send authorId when submitting - content. - labels: - type: array - items: - type: object - properties: - label: - type: string - enum: - - nudity - - suggestive - - gore - - hate - - violence - - weapon - - smoking - - drugs - - alcohol - - text - - toxic - description: The label of the model - score: - type: number - minimum: 0 - maximum: 1 - description: The confidence of the model - required: - - label - - score - additionalProperties: false - description: The scores of each label - texts: - description: >- - The texts found in the image, if the image text model is - enabled - type: array - items: - type: string - required: - - status - - request - - flagged - - author - - labels - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - /moderate/video: - post: - operationId: moderation-video - summary: Analyze video - description: >- - (Deprecated use https://api.moderationapi.com/v1/moderate) Analyze video - content with your configured moderation models and filters. - tags: - - Moderate - security: - - Authorization: [] - deprecated: true - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - contentId: - description: The unique ID of the content in your database. - type: string - minLength: 1 - maxLength: 100 - channelKey: - description: The key of the channel. - type: string - doNotStore: - description: >- - Do not store the content. The content won't enter the review - queue - type: boolean - authorId: - description: The author of the content. - type: string - contextId: - description: For example the ID of a chat room or a post - type: string - metadata: - description: Any metadata you want to store with the content - type: object - propertyNames: - type: string - additionalProperties: {} - url: - type: string - format: uri - description: The URL of the video you want to analyze. - required: - - url - description: Input parameters for video moderation - responses: - '200': - description: Successful response - content: - application/json: - schema: - allOf: - - type: object - properties: - status: - type: string - description: Success if the request was successful - error: - description: Error message if the request failed - contentId: - description: >- - The ID of the content. Only returned if the content - was stored. - type: string - request: - type: object - properties: - timestamp: - type: number - description: The timestamp of the request - quota_usage: - type: number - description: The quota usage of the request - required: - - timestamp - - quota_usage - additionalProperties: false - description: Information about the request - flagged: - type: boolean - description: Whether the content was flagged by any models - author: - anyOf: - - type: object - properties: - id: - type: string - description: Author ID in Moderation API - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - anyOf: - - type: object - properties: - until: - description: >- - The timestamp until which they are - blocked if the author is suspended. - anyOf: - - type: number - - type: 'null' - reason: - description: >- - The moderators reason why the author was - blocked or suspended. - anyOf: - - type: string - - type: 'null' - additionalProperties: false - - type: 'null' - description: >- - Block or suspension details, if applicable. - Null if the author is enabled. - status: - type: string - enum: - - enabled - - suspended - - blocked - description: Current author status - trust_level: - type: object - properties: - level: - type: number - description: Author trust level (-1, 0, 1, 2, 3, or 4) - manual: - type: boolean - description: >- - True if the trust level was set manually - by a moderator - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - description: >- - The author of the content if your account has authors - enabled. Requires you to send authorId when submitting - content. - required: - - status - - request - - flagged - - author - additionalProperties: false - - type: object - propertyNames: - type: string - additionalProperties: {} - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - /moderate/audio: - post: - operationId: moderation-audio - summary: Analyze audio - description: >- - (Deprecated use https://api.moderationapi.com/v1/moderate) Analyze audio - content with your configured moderation models and filters. - tags: - - Moderate - security: - - Authorization: [] - deprecated: true - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - contentId: - description: The unique ID of the content in your database. - type: string - minLength: 1 - maxLength: 100 - channelKey: - description: The key of the channel. - type: string - doNotStore: - description: >- - Do not store the content. The content won't enter the review - queue - type: boolean - authorId: - description: The author of the content. - type: string - contextId: - description: For example the ID of a chat room or a post - type: string - metadata: - description: Any metadata you want to store with the content - type: object - propertyNames: - type: string - additionalProperties: {} - url: - type: string - format: uri - description: The URL of the audio you want to analyze. - required: - - url - description: Input parameters for audio moderation - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - status: - type: string - description: Success if the request was successful - error: - description: Error message if the request failed - contentId: - description: >- - The ID of the content. Only returned if the content was - stored. - type: string - request: - type: object - properties: - timestamp: - type: number - description: The timestamp of the request - quota_usage: - type: number - description: The quota usage of the request - required: - - timestamp - - quota_usage - additionalProperties: false - description: Information about the request - flagged: - type: boolean - description: Whether the content was flagged by any models - author: - anyOf: - - type: object - properties: - id: - type: string - description: Author ID in Moderation API - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - anyOf: - - type: object - properties: - until: - description: >- - The timestamp until which they are blocked - if the author is suspended. - anyOf: - - type: number - - type: 'null' - reason: - description: >- - The moderators reason why the author was - blocked or suspended. - anyOf: - - type: string - - type: 'null' - additionalProperties: false - - type: 'null' - description: >- - Block or suspension details, if applicable. Null - if the author is enabled. - status: - type: string - enum: - - enabled - - suspended - - blocked - description: Current author status - trust_level: - type: object - properties: - level: - type: number - description: Author trust level (-1, 0, 1, 2, 3, or 4) - manual: - type: boolean - description: >- - True if the trust level was set manually by a - moderator - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - description: >- - The author of the content if your account has authors - enabled. Requires you to send authorId when submitting - content. - required: - - status - - request - - flagged - - author - additionalProperties: false - description: Audio moderation analysis results - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - /account: - get: - operationId: account-get - summary: Get account details - description: Get account details - tags: - - Account - security: - - Authorization: [] - parameters: [] - responses: - '200': - description: Account details retrieved successfully - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: ID of the account - paid_plan_name: - type: string - description: Name of the paid plan - text_api_quota: - type: number - description: Text API quota - remaining_quota: - type: number - description: Remaining quota - current_project: - type: object - properties: - id: - type: string - description: ID of the current project - name: - type: string - description: Name of the current project - required: - - id - - name - additionalProperties: false - required: - - id - - paid_plan_name - - text_api_quota - - remaining_quota - additionalProperties: false - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const accounts = await client.account.list(); - - console.log(accounts.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - accounts = client.account.list() - print(accounts.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - accounts = moderation_api.account.list - - - puts(accounts) - - lang: PHP - source: >- - account->list(); - - var_dump($accounts); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Account; - - ModerationApiClient client = new(); - - AccountListParams parameters = new(); - - var accounts = await client.Account.List(parameters); - - Console.WriteLine(accounts); - /auth: - get: - operationId: account-legacyAuthGet - security: - - Authorization: [] - deprecated: true - parameters: [] - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - status: - type: string - description: Status of the authentication - message: - type: string - description: Message of the authentication - required: - - status - - message - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const auth = await client.auth.retrieve(); - - console.log(auth.message); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - auth = client.auth.retrieve() - print(auth.message) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - auth = moderation_api.auth.retrieve - - - puts(auth) - - lang: PHP - source: >- - auth->retrieve(); - - var_dump($auth); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Auth; - - ModerationApiClient client = new(); - - AuthRetrieveParams parameters = new(); - - var auth = await client.Auth.Retrieve(parameters); - - Console.WriteLine(auth); - post: - operationId: account-legacyAuthPost - security: - - Authorization: [] - deprecated: true - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: {} - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - status: - type: string - description: Status of the authentication - message: - type: string - description: Message of the authentication - project: - type: string - description: Name of the authenticated project - required: - - status - - message - - project - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const auth = await client.auth.create(); - - console.log(auth.message); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - auth = client.auth.create() - print(auth.message) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - auth = moderation_api.auth.create - - - puts(auth) - - lang: PHP - source: >- - auth->create(); - - var_dump($auth); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Auth; - - ModerationApiClient client = new(); - - AuthCreateParams parameters = new(); - - var auth = await client.Auth.Create(parameters); - - Console.WriteLine(auth); - /wordlist: - get: - operationId: wordlist-list - summary: List wordlists - description: List all wordlists for the authenticated organization - tags: - - wordlist - security: - - Authorization: [] - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: array - items: - type: object - properties: - id: - type: string - description: Unique identifier of the wordlist - name: - anyOf: - - type: string - - type: 'null' - description: Name of the wordlist - description: - anyOf: - - type: string - - type: 'null' - description: Description of the wordlist - createdAt: - anyOf: - - type: string - - type: 'null' - description: When the wordlist was created - userId: - anyOf: - - type: string - - type: 'null' - description: User who created the wordlist - required: - - id - - name - - description - - createdAt - - userId - additionalProperties: false - description: Array of wordlists - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const wordlists = await client.wordlist.list(); - - console.log(wordlists); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - wordlists = client.wordlist.list() - print(wordlists) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - wordlists = moderation_api.wordlist.list - - - puts(wordlists) - - lang: PHP - source: >- - wordlist->list(); - - var_dump($wordlists); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Wordlist; - - ModerationApiClient client = new(); - - WordlistListParams parameters = new(); - - var wordlists = await client.Wordlist.List(parameters); - - Console.WriteLine(wordlists); - /wordlist/{id}: - get: - operationId: wordlist-getWordlistPublic - summary: Get wordlist - description: Get a specific wordlist by ID - tags: - - wordlist - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: ID of the wordlist to get - required: true - description: ID of the wordlist to get - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: ID of the wordlist - name: - anyOf: - - type: string - description: Name of the wordlist - - type: 'null' - words: - type: array - items: - type: string - description: Words in the wordlist - createdAt: - description: Creation date of the wordlist - type: string - organizationId: - type: string - description: ID of the organization - userId: - anyOf: - - type: string - description: ID of the user - - type: 'null' - strict: - type: boolean - description: Strict mode - required: - - id - - name - - words - - createdAt - - organizationId - - userId - - strict - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const wordlist = await client.wordlist.retrieve('id'); - - console.log(wordlist.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - wordlist = client.wordlist.retrieve( - "id", - ) - print(wordlist.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - wordlist = moderation_api.wordlist.retrieve("id") - - - puts(wordlist) - - lang: PHP - source: >- - wordlist->retrieve('id'); - - var_dump($wordlist); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Wordlist; - - ModerationApiClient client = new(); - - WordlistRetrieveParams parameters = new() { ID = "id" }; - - var wordlist = await client.Wordlist.Retrieve(parameters); - - Console.WriteLine(wordlist); - put: - operationId: wordlist-update - summary: Update wordlist - description: Update a wordlist - tags: - - wordlist - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: ID of the wordlist to update - required: true - description: ID of the wordlist to update - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - description: New name for the wordlist - type: string - key: - description: New key for the wordlist - type: string - description: - description: New description for the wordlist - type: string - words: - description: >- - New words for the wordlist. Replace the existing words with - these new ones. Duplicate words will be ignored. - type: array - items: - type: string - strict: - description: Deprecated. Now using threshold in project settings. - type: boolean - responses: - '200': - description: Wordlist updated successfully - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: ID of the wordlist - name: - anyOf: - - type: string - description: Name of the wordlist - - type: 'null' - words: - type: array - items: - type: string - description: Words in the wordlist - createdAt: - description: Creation date of the wordlist - type: string - organizationId: - type: string - description: ID of the organization - userId: - anyOf: - - type: string - description: ID of the user - - type: 'null' - strict: - type: boolean - description: Strict mode - required: - - id - - name - - words - - createdAt - - organizationId - - userId - - strict - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const wordlist = await client.wordlist.update('id'); - - console.log(wordlist.id); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - wordlist = client.wordlist.update( - id="id", - ) - print(wordlist.id) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - wordlist = moderation_api.wordlist.update("id") - - - puts(wordlist) - - lang: PHP - source: >- - wordlist->update( - 'id', - description: 'description', - key: 'key', - name: 'name', - strict: true, - words: ['string'], - ); - - var_dump($wordlist); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Wordlist; - - ModerationApiClient client = new(); - - WordlistUpdateParams parameters = new() { ID = "id" }; - - var wordlist = await client.Wordlist.Update(parameters); - - Console.WriteLine(wordlist); - /wordlist/{id}/embedding-status: - get: - operationId: wordlist-wordlistEmbeddingStatus - summary: Get embedding status - description: Get the current embedding progress status for a wordlist - tags: - - wordlist - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: ID of the wordlist to check embedding status for - required: true - description: ID of the wordlist to check embedding status for - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - progress: - type: number - description: Percentage of words that have been embedded (0-100) - totalWords: - type: number - description: Total number of words in the wordlist - remainingWords: - type: number - description: Number of words still waiting to be embedded - required: - - progress - - totalWords - - remainingWords - additionalProperties: false - description: Embedding status details - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: |- - import ModerationAPI from '@moderation-api/sdk'; - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - const response = await client.wordlist.getEmbeddingStatus('id'); - - console.log(response.progress); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - response = client.wordlist.get_embedding_status( - "id", - ) - print(response.progress) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - response = moderation_api.wordlist.get_embedding_status("id") - - - puts(response) - - lang: PHP - source: >- - wordlist->getEmbeddingStatus('id'); - - var_dump($response); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Wordlist; - - ModerationApiClient client = new(); - - WordlistGetEmbeddingStatusParams parameters = new() { ID = "id" }; - - var response = await client.Wordlist.GetEmbeddingStatus(parameters); - - Console.WriteLine(response); - /wordlist/{id}/words: - post: - operationId: wordlist-addWords - summary: Add words to wordlist - description: Add words to an existing wordlist - tags: - - wordlist - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: ID of the wordlist to add words to - required: true - description: ID of the wordlist to add words to - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - words: - type: array - items: - type: string - description: >- - Array of words to add to the wordlist. Duplicate words will - be ignored. - required: - - words - responses: - '200': - description: Words successfully added to wordlist - content: - application/json: - schema: - type: object - properties: - addedCount: - type: number - description: Number of words added - totalCount: - type: number - description: Total number of words in wordlist - addedWords: - type: array - items: - type: string - description: List of words that were added - required: - - addedCount - - totalCount - - addedWords - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - x-codeSamples: - - lang: JavaScript - source: >- - import ModerationAPI from '@moderation-api/sdk'; - - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - - const response = await client.wordlist.words.add('id', { words: - ['string'] }); - - - console.log(response.addedCount); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - response = client.wordlist.words.add( - id="id", - words=["string"], - ) - print(response.added_count) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - response = moderation_api.wordlist.words.add("id", words: - ["string"]) - - - puts(response) - - lang: PHP - source: >- - wordlist->words->add('id', words: ['string']); - - var_dump($response); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Wordlist.Words; - - ModerationApiClient client = new(); - - WordAddParams parameters = new() - { - ID = "id", - Words = - [ - "string" + "additionalProperties": false, + "description": "Object", + "title": "Object" + } + ], + "description": "The original content payload", + "type": "object" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the content was submitted" + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {}, + "description": "Arbitrary key/value metadata. Top-level keys are strings." + }, + { + "type": "null" + } + ], + "description": "Customer-supplied metadata attached to the content (same shape as the moderation API `metadata` input)." + }, + "client_action": { + "anyOf": [ + { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ], + "description": "Your recommendation for the content: allow, review, or reject." + }, + "behavior": { + "description": "How your recommendation combines with ours. Defaults to 'escalate', which only applies it when stricter than ours; 'override' replaces ours outright.", + "type": "string", + "enum": [ + "override", + "escalate" + ] + }, + "source": { + "description": "Where your recommendation came from, e.g. \"banned-ip\".", + "type": "string", + "maxLength": 100 + }, + "reason": { + "description": "A human-readable explanation for your recommendation.", + "type": "string", + "maxLength": 500 + } + }, + "required": [ + "action" ], - }; - - var response = await client.Wordlist.Words.Add(parameters); - - Console.WriteLine(response); - delete: - operationId: wordlist-removeWords - summary: Remove words from wordlist - description: Remove words from an existing wordlist - tags: - - wordlist - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - type: string - description: ID of the wordlist to remove words from - required: true - description: ID of the wordlist to remove words from - - in: query - name: words - schema: - type: array - items: - type: string - description: Array of words to remove from the wordlist - required: true - description: Array of words to remove from the wordlist - responses: - '200': - description: Words successfully removed from wordlist - content: - application/json: - schema: - type: object - properties: - removedCount: - type: number - description: Number of words removed - totalCount: - type: number - description: Total number of words in wordlist - removedWords: - type: array - items: - type: string - description: List of words removed - required: - - removedCount - - totalCount - - removedWords - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/error.NOT_FOUND' - x-codeSamples: - - lang: JavaScript - source: >- - import ModerationAPI from '@moderation-api/sdk'; - - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - - const word = await client.wordlist.words.remove('id', { words: - ['string'] }); - - - console.log(word.removedCount); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - word = client.wordlist.words.remove( - id="id", - words=["string"], - ) - print(word.removed_count) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - word = moderation_api.wordlist.words.remove("id", words: ["string"]) - - - puts(word) - - lang: PHP - source: >- - wordlist->words->remove('id', words: ['string']); - - var_dump($word); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: |- - using System; - using ModerationApi; - using ModerationApi.Models.Wordlist.Words; - - ModerationApiClient client = new(); - - WordRemoveParams parameters = new() - { - ID = "id", - Words = - [ - "string" + "additionalProperties": false, + "description": "A recommendation from your own client-side flagging." + }, + { + "type": "null" + } + ], + "description": "The recommendation you submitted via the moderation API `clientAction` input, if any." + }, + "conversation_id": { + "description": "Conversation grouping ID, if any", + "type": [ + "string", + "null" + ] + }, + "author_id": { + "description": "External author ID (the customer's identifier, not Moderation API's internal id)", + "type": [ + "string", + "null" + ] + }, + "channel_key": { + "description": "The channel the content was submitted to, identified by your customer-defined channel key.", + "type": [ + "string", + "null" + ] + }, + "meta_type": { + "anyOf": [ + { + "type": "string", + "enum": [ + "profile", + "message", + "post", + "comment", + "event", + "product", + "review", + "voice", + "other" + ] + }, + { + "type": "null" + } + ], + "description": "High-level content type (e.g. message, post, comment). Defaults to the channel's configured content type but can be overridden per request via the moderation API `type` field." + } + }, + "required": [ + "id", + "flagged", + "labels", + "flagged_fields", + "language", + "content", + "timestamp", + "metadata", + "client_action", + "conversation_id", + "author_id", + "channel_key", + "meta_type" + ], + "additionalProperties": false + }, + "QueueItemActionEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "queue_item.action", + "description": "The event type.", + "example": "queue_item.action" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformed" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "queue_item.action", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_99999", + "key": "shadow_ban", + "name": "Shadow ban", + "value": "24h", + "created_at": "2026-05-08T12:36:00.000Z", + "queue": { + "id": "que_abc123" + }, + "item": { + "id": "item_xyz791", + "flagged": true, + "labels": [ + { + "label": "classifier/spam", + "score": 0.94, + "flagged": true, + "manual": false + } ], - }; - - var word = await client.Wordlist.Words.Remove(parameters); - - Console.WriteLine(word); - /moderate: - post: - operationId: newModerate-moderate - security: - - Authorization: [] - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - content: - oneOf: - - type: object - properties: - type: - type: string - const: text - text: - type: string - maxLength: 100000 - description: The content text - required: - - type - - text - description: Text - title: Text - - type: object - properties: - type: - type: string - const: image - url: - description: >- - A public URL of the image content. Either url or - data must be provided. - type: string - format: uri - data: - description: >- - Base64-encoded image data. Either url or data must - be provided. Note: base64 images are not stored and - will not appear in the review queue. - type: string - maxLength: 5500000 - required: - - type - description: Image - title: Image - - type: object - properties: - type: - type: string - const: video - url: - type: string - format: uri - description: A public URL of the video content - required: - - type - - url - description: Video - title: Video - - type: object - properties: - type: - type: string - const: audio - url: - type: string - format: uri - description: The URL of the audio content - required: - - type - - url - description: Audio - title: Audio - - type: object - properties: - type: - type: string - const: object - data: - type: object - propertyNames: - type: string - description: The key of the content node - additionalProperties: - oneOf: - - type: object - properties: - type: - type: string - const: text - text: - type: string - maxLength: 100000 - description: The content text - required: - - type - - text - description: Text - title: Text - - type: object - properties: - type: - type: string - const: image - url: - description: >- - A public URL of the image content. Either - url or data must be provided. - type: string - format: uri - data: - description: >- - Base64-encoded image data. Either url or - data must be provided. Note: base64 images - are not stored and will not appear in the - review queue. - type: string - maxLength: 5500000 - required: - - type - description: Image - title: Image - - type: object - properties: - type: - type: string - const: video - url: - type: string - format: uri - description: A public URL of the video content - required: - - type - - url - description: Video - title: Video - - type: object - properties: - type: - type: string - const: audio - url: - type: string - format: uri - description: The URL of the audio content - required: - - type - - url - description: Audio - title: Audio - title: Content leaf - type: object - description: Values in the object. Can be mixed content types. - required: - - type - - data - description: Object - title: Object - description: The content sent for moderation - type: object - timestamp: - description: >- - Unix timestamp (in milliseconds) of when the content was - created. Use if content is not submitted in real-time. - type: number - channel: - description: >- - Provide a channel ID or key. Will use the project's default - channel if not provided. - type: string - contentId: - description: The unique ID of the content in your database. - type: string - maxLength: 100 - metaType: - description: The meta type of content being moderated - type: string - enum: - - profile - - message - - post - - comment - - event - - product - - review - - voice - - other - authorId: - description: The author of the content. - type: string - conversationId: - description: For example the ID of a chat room or a post - type: string - metadata: - description: Any metadata you want to store with the content - type: object - propertyNames: - type: string - additionalProperties: {} - clientAction: - description: >- - A recommendation from your own client-side flagging (e.g. a - banned-IP list or a third-party tool). Feeds the rules - engine and can escalate or override the recommended action. - Does not change whether our analysis flagged the content. - type: object - properties: - action: - type: string - enum: - - review - - allow - - reject - description: >- - Your recommendation for the content: allow, review, or - reject. - behavior: - description: >- - How your recommendation combines with ours. Defaults to - 'escalate', which only applies it when stricter than - ours; 'override' replaces ours outright. - type: string - enum: - - override - - escalate - source: - description: Where your recommendation came from, e.g. "banned-ip". - type: string - maxLength: 100 - reason: - description: A human-readable explanation for your recommendation. - type: string - maxLength: 500 - required: - - action - doNotStore: - description: >- - Do not store the content. The content won't enter the review - queue - type: boolean - policies: - description: >- - (Enterprise) override the channel policies for this - moderation request only. - type: array - items: - oneOf: - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: toxicity - required: - - flag - - id - title: Toxicity - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: personal_information - required: - - flag - - id - title: Personal Information - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: toxicity_severe - required: - - flag - - id - title: Toxicity Severe - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: hate - required: - - flag - - id - title: Hate - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: illicit - required: - - flag - - id - title: Illicit - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: illicit_drugs - required: - - flag - - id - title: Illicit Drugs - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: illicit_alcohol - required: - - flag - - id - title: Illicit Alcohol - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: illicit_firearms - required: - - flag - - id - title: Illicit Firearms - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: illicit_tobacco - required: - - flag - - id - title: Illicit Tobacco - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: illicit_gambling - required: - - flag - - id - title: Illicit Gambling - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: cannabis - required: - - flag - - id - title: Cannabis - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: adult - required: - - flag - - id - title: Adult - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: crypto - required: - - flag - - id - title: Crypto - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: sexual - required: - - flag - - id - title: Sexual - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: flirtation - required: - - flag - - id - title: Flirtation - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: profanity - required: - - flag - - id - title: Profanity - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: violence - required: - - flag - - id - title: Violence - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: self_harm - required: - - flag - - id - title: Self Harm - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: spam - required: - - flag - - id - title: Spam - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: low_quality - minWords: - description: >- - Flag content with fewer than this many words as - low-effort. Defaults to 3. Set to disable by - omitting. - type: integer - minimum: 1 - maximum: 9007199254740991 - required: - - flag - - id - title: Low-quality content - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: face_detection - comparator: - description: >- - Flag images that contain "at least" or "fewer - than" the configured number of faces. Defaults to - at_least. - type: string - enum: - - at_least - - fewer_than - count: - description: >- - Number of faces the comparator applies to. - Defaults to 1, so the default rule flags any image - containing a face. - type: integer - minimum: 0 - maximum: 9007199254740991 - required: - - flag - - id - title: Face detection - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: self_promotion - required: - - flag - - id - title: Self Promotion - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: political - required: - - flag - - id - title: Political - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: religion - required: - - flag - - id - title: Religion - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: code_abuse - required: - - flag - - id - title: Code Abuse - - type: object - properties: - id: - type: string - const: pii - entities: - type: object - propertyNames: - type: string - enum: - - email - - phone - - url - - address - - name - - username - - ip_address - - credit_card - - sensitive_other - additionalProperties: - type: object - properties: - enable: - type: boolean - flag: - type: boolean - shouldMask: - type: boolean - mask: - type: string - additionalProperties: {} - required: - - email - - phone - - url - - address - - name - - username - - ip_address - - credit_card - - sensitive_other - required: - - id - - entities - title: PII Masking - - type: object - properties: - id: - type: string - const: url - entities: - type: object - propertyNames: - type: string - enum: - - email - - phone - - url - - address - - name - - username - - ip_address - - credit_card - - sensitive_other - additionalProperties: - type: object - properties: - enable: - type: boolean - flag: - type: boolean - shouldMask: - type: boolean - mask: - type: string - additionalProperties: {} - required: - - email - - phone - - url - - address - - name - - username - - ip_address - - credit_card - - sensitive_other - required: - - id - - entities - title: URL Masking - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: url_risk - allowlistWordlistIds: - description: >- - IDs of wordlists whose entries are treated as - allowed URL domains. Matches short-circuit the - risk model and are never flagged. - type: array - items: - type: string - blocklistWordlistIds: - description: >- - IDs of wordlists whose entries are treated as - blocked URL domains. Matches short-circuit the - risk model and are always flagged. Blocklists take - precedence over allowlists. - type: array - items: - type: string - flagLinkShorteners: - description: >- - When true, any URL detected as a free link - shortener (bit.ly, t.co, tinyurl, etc.) is always - flagged regardless of risk score. Allowlist - matches still win. - type: boolean - required: - - flag - - id - title: URL Risk - - type: object - properties: - flag: - type: boolean - threshold: - type: number - minimum: 0 - maximum: 1 - id: - type: string - const: guideline - instructions: - type: string - guidelineKey: - type: string - required: - - flag - - id - - instructions - - guidelineKey - title: Guideline - type: object - required: - - content - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - content: - type: object - properties: - id: - type: string - description: >- - The unique identifier for the content. Either the - contentId provided by you or an autogenerated ID. - masked: - type: boolean - description: Whether any values have been masked. - modified: - anyOf: - - anyOf: - - type: string - title: Modified string content - - type: object - propertyNames: - type: string - additionalProperties: {} - title: Modified object content - - type: object - propertyNames: - type: string - additionalProperties: - oneOf: - - type: object - properties: - type: - type: string - const: text - text: - type: string - maxLength: 100000 - description: The content text - required: - - type - - text - additionalProperties: false - description: Text - title: Text - - type: object - properties: - type: - type: string - const: image - url: - description: >- - A public URL of the image content. - Either url or data must be provided. - type: string - format: uri - data: - description: >- - Base64-encoded image data. Either url or - data must be provided. Note: base64 - images are not stored and will not - appear in the review queue. - type: string - maxLength: 5500000 - required: - - type - additionalProperties: false - description: Image - title: Image - - type: object - properties: - type: - type: string - const: video - url: - type: string - format: uri - description: A public URL of the video content - required: - - type - - url - additionalProperties: false - description: Video - title: Video - - type: object - properties: - type: - type: string - const: audio - url: - type: string - format: uri - description: The URL of the audio content - required: - - type - - url - additionalProperties: false - description: Audio - title: Audio - title: Content leaf - type: object - title: Modified nested object content - - type: 'null' - description: The modified content, if any. - transcript: - description: >- - The transcribed text from audio content. Only present - when audio moderation is used and transcript inclusion - is enabled on the channel. - anyOf: - - type: string - - type: 'null' - required: - - id - - masked - - modified - additionalProperties: false - description: Potentially modified content. - author: - anyOf: - - type: object - properties: - id: - type: string - description: Author ID in Moderation API - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - anyOf: - - type: object - properties: - until: - description: >- - The timestamp until which they are blocked - if the author is suspended. - anyOf: - - type: number - - type: 'null' - reason: - description: >- - The moderators reason why the author was - blocked or suspended. - anyOf: - - type: string - - type: 'null' - additionalProperties: false - - type: 'null' - description: >- - Block or suspension details, if applicable. Null - if the author is enabled. - status: - type: string - enum: - - enabled - - suspended - - blocked - description: Current author status - trust_level: - type: object - properties: - level: - type: number - description: Author trust level (-1, 0, 1, 2, 3, or 4) - manual: - type: boolean - description: >- - True if the trust level was set manually by a - moderator - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - description: >- - The author of the content if your account has authors - enabled. Requires you to send authorId when submitting - content. - evaluation: - type: object - properties: - flagged: - type: boolean - description: Whether the content was flagged by any policy. - flag_probability: - type: number - description: The probability that the content should be flagged. - severity_score: - type: number - description: >- - The severity score of the content. A higher score - indicates more severe content. - unicode_spoofed: - description: Whether the content was flagged for Unicode spoofing. - type: boolean - shadow_flagged: - description: >- - Whether the content would have been flagged by - analyze-only policies (flag: false). - type: boolean - required: - - flagged - - flag_probability - - severity_score - additionalProperties: false - description: >- - The evaluation of the content after running the channel - policies. - recommendation: - type: object - properties: - action: - type: string - enum: - - review - - allow - - reject - description: The action to take based on the recommendation - reason_codes: - type: array - items: - type: string - enum: - - severity_reject - - severity_review - - author_block - - dry_run - - trusted_allow - - untrusted_severity - - rule_match - - rule_default - - rule_fallback - - client_override - description: >- - The reason code for the recommendation. Can be used to - display a reason to the user. - matched_rules: - description: >- - Rules that matched during evaluation, if rules engine - is active. - type: array - items: - type: object - properties: - key: - type: string - name: - type: string - required: - - key - - name - additionalProperties: false - required: - - action - - reason_codes - additionalProperties: false - description: >- - The recommendation for the content based on the - evaluation. - policies: - type: array - items: - oneOf: - - type: object - properties: - id: - type: string - description: The unique identifier for the classifier output. - type: - type: string - const: classifier - probability: - type: number - minimum: 0 - maximum: 1 - flagged: - type: boolean - flagged_fields: - description: >- - The keys of the flagged fields if submitting an - object. - type: array - items: - type: string - labels: - type: array - items: - type: object - properties: - id: - type: string - probability: - type: number - minimum: 0 - maximum: 1 - flagged: - type: boolean - required: - - id - - probability - - flagged - additionalProperties: false - data: - description: >- - Optional structured data produced by the policy. - For face detection: { count, faces: [{ - confidence, gender, age }] }. - type: object - propertyNames: - type: string - additionalProperties: {} - required: - - id - - type - - probability - - flagged - additionalProperties: false - description: Classifier policy. - title: Classifier output - - type: object - properties: - id: - type: string - type: - type: string - const: entity_matcher - probability: - type: number - minimum: 0 - maximum: 1 - flagged: - type: boolean - flagged_fields: - type: array - items: - type: string - matches: - type: array - items: - type: object - properties: - probability: - type: number - minimum: 0 - maximum: 1 - match: - type: string - span: - minItems: 2 - maxItems: 2 - type: array - items: - type: integer - minimum: -9007199254740991 - maximum: 9007199254740991 - reasons: - description: >- - Stable codes explaining why a URL was - flagged (URL Risk only). - type: array - items: - type: string - signals: - description: >- - Observable properties of a URL (URL Risk - only). Absent for allow/block list - matches. - type: object - properties: - brand_impersonation: - anyOf: - - type: object - properties: - brand: - type: string - method: - type: string - enum: - - registered_domain_token - - subdomain_token - required: - - brand - - method - additionalProperties: false - - type: 'null' - has_suspicious_characters: - type: boolean - is_link_shortener: - type: boolean - domain_age_days: - anyOf: - - type: integer - minimum: -9007199254740991 - maximum: 9007199254740991 - - type: 'null' - has_email_setup: - anyOf: - - type: boolean - - type: 'null' - redirect_count: - anyOf: - - type: integer - minimum: -9007199254740991 - maximum: 9007199254740991 - - type: 'null' - final_url: - anyOf: - - type: string - - type: 'null' - bot_protection: - anyOf: - - type: boolean - - type: 'null' - is_reported: - type: boolean - required: - - brand_impersonation - - has_suspicious_characters - - is_link_shortener - - domain_age_days - - has_email_setup - - redirect_count - - final_url - - bot_protection - - is_reported - additionalProperties: false - entity_type: - description: >- - Sub-type of the entity match — e.g. the - NER key (email, phone, name, …) for PII - matches. Absent for URL Risk and wordlist - matches where the type is already encoded - in the parent label. - type: string - required: - - probability - - match - - span - additionalProperties: false - required: - - id - - type - - probability - - flagged - - matches - additionalProperties: false - description: Entity matcher policy. - title: Entity matcher output - description: Policy output schema. - type: object - description: >- - Results of all policies in the channel. Sorted by highest - probability. - insights: - type: array - items: - oneOf: - - type: object - properties: - id: - type: string - const: sentiment - type: - type: string - const: insight - probability: - type: number - minimum: 0 - maximum: 1 - value: - anyOf: - - type: string - enum: - - positive - - neutral - - negative - - type: 'null' - required: - - id - - type - - probability - - value - additionalProperties: false - description: Sentiment insight - title: Sentiment insight - - type: object - properties: - id: - type: string - const: language - type: - type: string - const: insight - probability: - type: number - minimum: 0 - maximum: 1 - value: - anyOf: - - type: string - - type: 'null' - required: - - id - - type - - probability - - value - additionalProperties: false - description: Language insight - title: Language insight - type: object - description: Results of all insights enabled in the channel. - meta: - type: object - properties: - status: - type: string - enum: - - success - - partial_success - timestamp: - type: number - channel_key: - type: string - description: >- - The unique key of the channel where the content was - handled. Either the channel provided by you or - automatically routed. - usage: - type: number - processing_time: - type: string - required: - - status - - timestamp - - channel_key - - usage - additionalProperties: false - description: Metadata about the moderation request - errors: - description: Policies that had errors - type: array - items: - type: object - properties: - id: - type: string - message: - type: string - required: - - id - - message - additionalProperties: false - required: - - content - - author - - evaluation - - recommendation - - policies - - insights - - meta - additionalProperties: false - '400': - description: Invalid input data - content: - application/json: - schema: - $ref: '#/components/schemas/error.BAD_REQUEST' - '401': - description: Authorization not provided - content: - application/json: - schema: - $ref: '#/components/schemas/error.UNAUTHORIZED' - '403': - description: Insufficient access - content: - application/json: - schema: - $ref: '#/components/schemas/error.FORBIDDEN' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR' - x-codeSamples: - - lang: JavaScript - source: >- - import ModerationAPI from '@moderation-api/sdk'; - - - const client = new ModerationAPI({ - secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted - }); - - - const response = await client.content.submit({ content: { text: - 'text', type: 'text' } }); - - - console.log(response.author); - - lang: Python - source: |- - import os - from moderation_api import ModerationAPI - - client = ModerationAPI( - secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted - ) - response = client.content.submit( - content={ - "text": "text", - "type": "text", + "flagged_fields": [], + "language": "en", + "content": { + "type": "text", + "text": "Buy crypto now!" }, - ) - print(response.author) - - lang: Ruby - source: >- - require "moderation_api" - - - moderation_api = ModerationAPI::Client.new(secret_key: "My Secret - Key") - - - response = moderation_api.content.submit(content: {text: "text", - type: :text}) - - - puts(response) - - lang: PHP - source: >- - content->submit( - content: ['text' => 'text', 'type' => 'text'], - authorID: 'authorId', - channel: 'channel', - clientAction: [ - 'action' => 'review', - 'behavior' => 'override', - 'reason' => 'reason', - 'source' => 'source', + "timestamp": "2026-05-08T12:34:56.789Z", + "metadata": null, + "client_action": null, + "conversation_id": null, + "author_id": "user-555", + "channel_key": null, + "meta_type": "comment" + }, + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "PublicActionPerformed": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Moderation action ID" + }, + "key": { + "description": "Customer-defined key identifying this action", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Display name of the action", + "type": [ + "string", + "null" + ] + }, + "value": { + "description": "The value passed to the action when it ran", + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the action was performed" + }, + "queue": { + "description": "The queue the item belongs to, if any", + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "item": { + "description": "The content item the action was performed on, if any", + "$ref": "#/components/schemas/PublicQueueItem" + }, + "author": { + "description": "The author the action was performed on, if any", + "$ref": "#/components/schemas/PublicAuthor" + } + }, + "required": [ + "id", + "key", + "name", + "value", + "created_at" + ], + "additionalProperties": false + }, + "QueueItemRejectedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "queue_item.rejected", + "description": "The event type.", + "example": "queue_item.rejected" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformed" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "queue_item.rejected", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_67890", + "key": "reject", + "name": "Reject", + "value": "spam", + "created_at": "2026-05-08T12:34:56.789Z", + "queue": { + "id": "que_abc123" + }, + "item": { + "id": "item_xyz789", + "flagged": true, + "labels": [ + { + "label": "classifier/spam", + "score": 0.94, + "flagged": true, + "manual": false + } ], - contentID: 'contentId', - conversationID: 'conversationId', - doNotStore: true, - metadata: ['foo' => 'bar'], - metaType: 'profile', - policies: [['id' => 'toxicity', 'flag' => true, 'threshold' => 0]], - timestamp: 0, - ); - - var_dump($response); - } catch (APIException $e) { - echo $e->getMessage(); - } - - lang: C# - source: >- - using System; - - using ModerationApi; - - using ModerationApi.Models.Content; - - - ModerationApiClient client = new(); - - - ContentSubmitParams parameters = new() { Content = new Text("text") - }; - - - var response = await client.Content.Submit(parameters); - - - Console.WriteLine(response); - /stream: - get: - tags: - - Voice - summary: Real-time voice moderation stream (WebSocket) - description: >- - Open a WebSocket to moderate live voice/call audio in real time. Speech - is transcribed and each finalized utterance is moderated by your enabled - text policies; you receive a verdict per utterance as it's spoken. - - - **This is a WebSocket upgrade, not a regular HTTP call.** The request - body below documents the frames you *send* over the socket; the `101` - response documents the events you *receive*. - - - - **Auth:** `Authorization: Bearer ` on the upgrade. A - missing/invalid key closes `4401`; voice not enabled on the plan/channel - closes `4403`. - - - **Subprotocol:** request `moderationapi.v1`. - - - **Flow:** send one `start` frame, then `media` frames as audio - arrives, then `stop` (or disconnect). You receive `session.started`, - `utterance.final` per utterance, optional `utterance.partial`/`warning`, - and `session.ended`. - - - **Close codes:** `1000` normal · `1011` server error · `4400` bad - request · `4401` auth failed · `4403` voice not enabled · `4429` - concurrency limit. - - - See the [Real-time voice - guide](https://docs.moderationapi.com/content-moderation/real-time-voice) - for the full walkthrough and code examples. - servers: - - url: wss://voice.moderationapi.com/v1 - description: Voice streaming gateway - parameters: - - name: Authorization - in: header - required: true - description: Bearer - schema: - type: string - - name: Sec-WebSocket-Protocol - in: header - required: true - description: Requested subprotocol. - schema: - type: string - enum: - - moderationapi.v1 - requestBody: - description: Frames sent by the client over the socket (not an HTTP body). - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/VoiceStartFrame' - - $ref: '#/components/schemas/VoiceMediaFrame' - - $ref: '#/components/schemas/VoiceStopFrame' - discriminator: - propertyName: event - responses: - '101': - description: >- - Switching Protocols. The server then streams event frames over the - socket; the key one is `utterance.final`. - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/VoiceSessionStarted' - - $ref: '#/components/schemas/VoiceUtteranceFinal' - - $ref: '#/components/schemas/VoiceSessionEnded' - discriminator: - propertyName: event - x-webSocket: true -components: - schemas: - PublicAuthor: - type: object - properties: - id: - type: string - description: Author ID in Moderation API - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - profile_picture: - description: URL of the author's profile picture - anyOf: - - type: string - format: uri - - type: 'null' - external_link: - description: URL of the author's external profile - anyOf: - - type: string - format: uri - - type: 'null' - name: - description: Author name or identifier - anyOf: - - type: string - - type: 'null' - email: - description: Author email address - anyOf: - - type: string - format: email - pattern: >- - ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ - - type: 'null' - company: - description: The author's company or organization - anyOf: - - type: string - - type: 'null' - first_seen: - type: number - description: Timestamp when author first appeared - last_seen: - type: number - description: Timestamp of last activity - last_incident: - description: Timestamp of last incident - anyOf: - - type: number - - type: 'null' - status: - type: string - enum: - - enabled - - suspended - - blocked - description: Current author status - trust_level: - type: object - properties: - level: - type: number - description: Author trust level (-1, 0, 1, 2, 3, or 4) - manual: - type: boolean - description: True if the trust level was set manually by a moderator - required: - - level - - manual - additionalProperties: false - block: - anyOf: - - type: object - properties: - until: - description: >- - The timestamp until which they are blocked if the author is - suspended. - anyOf: - - type: number - - type: 'null' - reason: - description: >- - The moderators reason why the author was blocked or - suspended. - anyOf: - - type: string - - type: 'null' - additionalProperties: false - - type: 'null' - description: >- - Block or suspension details, if applicable. Null if the author is - enabled. - risk_evaluation: - anyOf: - - type: object - properties: - risk_level: - description: >- - Calculated risk level based on more than 10 behavioral - signals. - anyOf: - - type: number - minimum: 0 - maximum: 100 - - type: 'null' - additionalProperties: false - - type: 'null' - description: Risk assessment details, if available. - metrics: - type: object - properties: - total_content: - type: number - description: Total pieces of content - flagged_content: - type: number - description: Number of flagged content pieces - average_sentiment: - description: >- - Average sentiment score of content (-1 to 1). Requires a - sentiment model in your project. - anyOf: - - type: number - - type: 'null' - required: - - total_content - - flagged_content - additionalProperties: false - metadata: - type: object - properties: - email_verified: - description: Whether the author's email is verified - anyOf: - - type: boolean - - type: 'null' - phone_verified: - description: Whether the author's phone number is verified - anyOf: - - type: boolean - - type: 'null' - identity_verified: - description: Whether the author's identity is verified - anyOf: - - type: boolean - - type: 'null' - is_paying_customer: - description: Whether the author is a paying customer - anyOf: - - type: boolean - - type: 'null' - additionalProperties: {} - description: >- - Additional metadata provided by your system. We recommend including - any relevant information that may assist in the moderation process. - required: - - id - - first_seen - - last_seen - - status - - trust_level - - block - - risk_evaluation - - metrics - - metadata - additionalProperties: false - error.BAD_REQUEST: - type: object - properties: - message: - type: string - description: The error message - example: Invalid input data - code: - type: string - description: The error code - example: BAD_REQUEST - issues: - description: An array of issues that were responsible for the error - example: [] - type: array - items: - type: object - properties: - message: - type: string - required: - - message - additionalProperties: false - required: - - message - - code - additionalProperties: false - title: Invalid input data error (400) - description: The error information - example: - code: BAD_REQUEST - message: Invalid input data - issues: [] - error.UNAUTHORIZED: - type: object - properties: - message: - type: string - description: The error message - example: Authorization not provided - code: - type: string - description: The error code - example: UNAUTHORIZED - issues: - description: An array of issues that were responsible for the error - example: [] - type: array - items: - type: object - properties: - message: - type: string - required: - - message - additionalProperties: false - required: - - message - - code - additionalProperties: false - title: Authorization not provided error (401) - description: The error information - example: - code: UNAUTHORIZED - message: Authorization not provided - issues: [] - error.FORBIDDEN: - type: object - properties: - message: - type: string - description: The error message - example: Insufficient access - code: - type: string - description: The error code - example: FORBIDDEN - issues: - description: An array of issues that were responsible for the error - example: [] - type: array - items: - type: object - properties: - message: - type: string - required: - - message - additionalProperties: false - required: - - message - - code - additionalProperties: false - title: Insufficient access error (403) - description: The error information - example: - code: FORBIDDEN - message: Insufficient access - issues: [] - error.NOT_FOUND: - type: object - properties: - message: - type: string - description: The error message - example: Not found - code: - type: string - description: The error code - example: NOT_FOUND - issues: - description: An array of issues that were responsible for the error - example: [] - type: array - items: - type: object - properties: - message: - type: string - required: - - message - additionalProperties: false - required: - - message - - code - additionalProperties: false - title: Not found error (404) - description: The error information - example: - code: NOT_FOUND - message: Not found - issues: [] - error.INTERNAL_SERVER_ERROR: - type: object - properties: - message: - type: string - description: The error message - example: Internal server error - code: - type: string - description: The error code - example: INTERNAL_SERVER_ERROR - issues: - description: An array of issues that were responsible for the error - example: [] - type: array - items: - type: object - properties: - message: - type: string - required: - - message - additionalProperties: false - required: - - message - - code - additionalProperties: false - title: Internal server error error (500) - description: The error information - example: - code: INTERNAL_SERVER_ERROR - message: Internal server error - issues: [] - error.CONFLICT: - type: object - properties: - message: - type: string - description: The error message - example: Action with this key already exists - code: - type: string - description: The error code - example: CONFLICT - issues: - description: An array of issues that were responsible for the error - example: [] - type: array - items: - type: object - properties: - message: - type: string - required: - - message - additionalProperties: false - required: - - message - - code - additionalProperties: false - title: Action with this key already exists error (409) - description: The error information - example: - code: CONFLICT - message: Action with this key already exists - issues: [] - AuthorBlockedEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: author.blocked - description: The event type. - example: author.blocked - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicActionPerformedAuthor' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: author.blocked - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: act_block_123 - key: block - name: Block author - value: null - created_at: '2026-05-08T12:38:00.000Z' - author: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: blocked - trust_level: - level: -1 - manual: false - block: - until: null - reason: Repeated spam violations - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - PublicActionPerformedAuthor: - type: object - properties: - id: - type: string - description: Moderation action ID - key: - anyOf: - - type: string - - type: 'null' - description: Customer-defined key identifying this action - name: - anyOf: - - type: string - - type: 'null' - description: Display name of the action - value: - anyOf: - - type: string - - type: 'null' - description: The value passed to the action when it ran - created_at: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the action was performed - queue: - description: The queue the item belongs to, if any - type: object - properties: - id: - type: string - required: - - id - additionalProperties: false - author: - description: The author the action was performed on - $ref: '#/components/schemas/PublicAuthor' - required: - - id - - key - - name - - value - - created_at - - author - additionalProperties: false - AuthorUnblockedEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: author.unblocked - description: The event type. - example: author.unblocked - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicActionPerformedAuthor' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: author.unblocked - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: act_unblock_789 - key: auto_unblock - name: Auto unblock - value: null - created_at: '2026-05-09T12:39:00.000Z' - author: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: enabled - trust_level: - level: 0 - manual: false - block: null - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - AuthorSuspendedEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: author.suspended - description: The event type. - example: author.suspended - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicActionPerformedAuthor' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: author.suspended - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: act_suspend_456 - key: suspend_24h - name: Suspend (24h) - value: 24h - created_at: '2026-05-08T12:39:00.000Z' - author: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: suspended - trust_level: - level: 0 - manual: false - block: - until: 1746878400000 - reason: Cooling-off period - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - AuthorUpdatedEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: author.updated - description: The event type. - example: author.updated - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicAuthor' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: author.updated - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: enabled - trust_level: - level: 1 - manual: false - block: null - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - AuthorTrustLevelChangedEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: author.trust_level_changed - description: The event type. - example: author.trust_level_changed - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicAuthor' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: author.trust_level_changed - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: enabled - trust_level: - level: 3 - manual: true - block: null - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - AuthorActionEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: author.action - description: The event type. - example: author.action - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicActionPerformedAuthor' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: author.action - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: act_warn_111 - key: send_warning - name: Send warning email - value: violation_notice - created_at: '2026-05-08T12:42:00.000Z' - author: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: enabled - trust_level: - level: 1 - manual: false - block: null - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - QueueItemCompletedEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: queue_item.resolved - description: The event type. - example: queue_item.resolved - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicQueueItemEvent' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: queue_item.resolved - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - item: - id: item_xyz789 - flagged: true - labels: - - label: spam/SPAM - score: 0.94 - flagged: true - manual: false - flagged_fields: [] - language: en - content: - type: text - text: Buy crypto now! - timestamp: '2026-05-08T12:34:56.789Z' - metadata: null - client_action: null - conversation_id: null - author_id: user-555 - channel_key: null - meta_type: comment - author: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: blocked - trust_level: - level: -1 - manual: false - block: - until: null - reason: Repeated spam violations - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - queue: - id: que_abc123 - PublicQueueItemEvent: - type: object - properties: - item: - $ref: '#/components/schemas/PublicQueueItem' - author: - $ref: '#/components/schemas/PublicAuthor' - queue: - type: object - properties: - id: - type: string - required: - - id - additionalProperties: false - required: - - item - additionalProperties: false - PublicQueueItem: - type: object - properties: - id: - type: string - description: Content ID from your system - flagged: - anyOf: - - type: boolean - - type: 'null' - description: Whether the content was flagged by moderation - labels: - anyOf: - - type: array - items: - type: object - properties: - label: - type: string - description: The label name - score: - type: number - description: Confidence score between 0 and 1 - manual: - description: True if the label was applied manually by a moderator - type: boolean - flagged: - description: Whether this label crossed its flagging threshold - type: boolean - matches: - type: array - items: - type: object - properties: - match: - type: string - description: The matched substring - probability: - type: number - description: Match confidence between 0 and 1 - span: - type: array - prefixItems: - - type: number - - type: number - description: '[start, end] character offsets in the source text' - mask: - anyOf: - - type: string - - type: 'null' - reasons: - type: array - items: - type: string - signals: - type: object - properties: - brand_impersonation: - anyOf: - - type: object - properties: - brand: - type: string - method: - type: string - required: - - brand - - method - additionalProperties: false - - type: 'null' - has_suspicious_characters: - type: boolean - is_link_shortener: - type: boolean - domain_age_days: - anyOf: - - type: number - - type: 'null' - has_email_setup: - anyOf: - - type: boolean - - type: 'null' - redirect_count: - anyOf: - - type: number - - type: 'null' - final_url: - anyOf: - - type: string - - type: 'null' - bot_protection: - anyOf: - - type: boolean - - type: 'null' - is_reported: - type: boolean - required: - - brand_impersonation - - has_suspicious_characters - - is_link_shortener - - domain_age_days - - has_email_setup - - redirect_count - - final_url - - bot_protection - - is_reported - additionalProperties: false - entity_type: - type: string - required: - - match - - probability - - span - additionalProperties: false - required: - - label - - score - additionalProperties: false - - type: 'null' - description: Moderation labels applied to the content - flagged_fields: - type: array - items: - type: string - description: >- - For object content, the field keys (e.g. "bio") that triggered a - flag. Empty when no fields were flagged or the content is not an - object. - language: - anyOf: - - type: string - - type: 'null' - description: Detected ISO language code, if available - content: - oneOf: - - type: object - properties: - type: - type: string - const: text - text: - type: string - maxLength: 100000 - description: The content text - required: - - type - - text - additionalProperties: false - description: Text - title: Text - - type: object - properties: - type: - type: string - const: image - url: - description: >- - A public URL of the image content. Either url or data must - be provided. - type: string - format: uri - data: - description: >- - Base64-encoded image data. Either url or data must be - provided. Note: base64 images are not stored and will not - appear in the review queue. - type: string - maxLength: 5500000 - required: - - type - additionalProperties: false - description: Image - title: Image - - type: object - properties: - type: - type: string - const: video - url: - type: string - format: uri - description: A public URL of the video content - required: - - type - - url - additionalProperties: false - description: Video - title: Video - - type: object - properties: - type: - type: string - const: audio - url: - type: string - format: uri - description: The URL of the audio content - required: - - type - - url - additionalProperties: false - description: Audio - title: Audio - - type: object - properties: - type: - type: string - const: object - data: - type: object - propertyNames: - type: string - description: The key of the content node - additionalProperties: - oneOf: - - type: object - properties: - type: - type: string - const: text - text: - type: string - maxLength: 100000 - description: The content text - required: - - type - - text - additionalProperties: false - description: Text - title: Text - - type: object - properties: - type: - type: string - const: image - url: - description: >- - A public URL of the image content. Either url or - data must be provided. - type: string - format: uri - data: - description: >- - Base64-encoded image data. Either url or data must - be provided. Note: base64 images are not stored - and will not appear in the review queue. - type: string - maxLength: 5500000 - required: - - type - additionalProperties: false - description: Image - title: Image - - type: object - properties: - type: - type: string - const: video - url: - type: string - format: uri - description: A public URL of the video content - required: - - type - - url - additionalProperties: false - description: Video - title: Video - - type: object - properties: - type: - type: string - const: audio - url: - type: string - format: uri - description: The URL of the audio content - required: - - type - - url - additionalProperties: false - description: Audio - title: Audio - title: Content leaf - type: object - description: Values in the object. Can be mixed content types. - required: - - type - - data - additionalProperties: false - description: Object - title: Object - description: The original content payload - type: object - timestamp: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the content was submitted - metadata: - anyOf: - - type: object - propertyNames: - type: string - additionalProperties: {} - description: Arbitrary key/value metadata. Top-level keys are strings. - - type: 'null' - description: >- - Customer-supplied metadata attached to the content (same shape as - the moderation API `metadata` input). - client_action: - anyOf: - - type: object - properties: - action: - type: string - enum: - - review - - allow - - reject - description: >- - Your recommendation for the content: allow, review, or - reject. - behavior: - description: >- - How your recommendation combines with ours. Defaults to - 'escalate', which only applies it when stricter than ours; - 'override' replaces ours outright. - type: string - enum: - - override - - escalate - source: - description: Where your recommendation came from, e.g. "banned-ip". - type: string - maxLength: 100 - reason: - description: A human-readable explanation for your recommendation. - type: string - maxLength: 500 - required: - - action - additionalProperties: false - description: A recommendation from your own client-side flagging. - - type: 'null' - description: >- - The recommendation you submitted via the moderation API - `clientAction` input, if any. - conversation_id: - anyOf: - - type: string - - type: 'null' - description: Conversation grouping ID, if any - author_id: - anyOf: - - type: string - - type: 'null' - description: >- - External author ID (the customer's identifier, not Moderation API's - internal id) - channel_key: - anyOf: - - type: string - - type: 'null' - description: >- - The channel the content was submitted to, identified by your - customer-defined channel key. - meta_type: - anyOf: - - type: string - enum: - - profile - - message - - post - - comment - - event - - product - - review - - voice - - other - - type: 'null' - description: >- - High-level content type (e.g. message, post, comment). Defaults to - the channel's configured content type but can be overridden per - request via the moderation API `type` field. - required: - - id - - flagged - - labels - - flagged_fields - - language - - content - - timestamp - - metadata - - client_action - - conversation_id - - author_id - - channel_key - - meta_type - additionalProperties: false - QueueItemActionEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: queue_item.action - description: The event type. - example: queue_item.action - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicActionPerformed' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: queue_item.action - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: act_99999 - key: shadow_ban - name: Shadow ban - value: 24h - created_at: '2026-05-08T12:36:00.000Z' - queue: - id: que_abc123 - item: - id: item_xyz791 - flagged: true - labels: - - label: spam/SPAM - score: 0.94 - flagged: true - manual: false - flagged_fields: [] - language: en - content: - type: text - text: Buy crypto now! - timestamp: '2026-05-08T12:34:56.789Z' - metadata: null - client_action: null - conversation_id: null - author_id: user-555 - channel_key: null - meta_type: comment - author: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: enabled - trust_level: - level: 1 - manual: false - block: null - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - PublicActionPerformed: - type: object - properties: - id: - type: string - description: Moderation action ID - key: - anyOf: - - type: string - - type: 'null' - description: Customer-defined key identifying this action - name: - anyOf: - - type: string - - type: 'null' - description: Display name of the action - value: - anyOf: - - type: string - - type: 'null' - description: The value passed to the action when it ran - created_at: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the action was performed - queue: - description: The queue the item belongs to, if any - type: object - properties: - id: - type: string - required: - - id - additionalProperties: false - item: - description: The content item the action was performed on, if any - $ref: '#/components/schemas/PublicQueueItem' - author: - description: The author the action was performed on, if any - $ref: '#/components/schemas/PublicAuthor' - required: - - id - - key - - name - - value - - created_at - additionalProperties: false - QueueItemRejectedEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: queue_item.rejected - description: The event type. - example: queue_item.rejected - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicActionPerformed' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: queue_item.rejected - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: act_67890 - key: reject - name: Reject - value: spam - created_at: '2026-05-08T12:34:56.789Z' - queue: - id: que_abc123 - item: - id: item_xyz789 - flagged: true - labels: - - label: spam/SPAM - score: 0.94 - flagged: true - manual: false - flagged_fields: [] - language: en - content: - type: text - text: Buy crypto now! - timestamp: '2026-05-08T12:34:56.789Z' - metadata: null - client_action: null - conversation_id: null - author_id: user-555 - channel_key: null - meta_type: comment - author: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: enabled - trust_level: - level: 1 - manual: false - block: null - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - QueueItemAllowedEvent: - type: object - properties: - id: - type: string - description: Stable event ID. Use this to dedupe retries. - example: evt_clxxx... - type: - type: string - const: queue_item.allowed - description: The event type. - example: queue_item.allowed - api_version: - type: string - const: v2 - example: v2 - created: - type: string - format: date-time - pattern: >- - ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$ - description: ISO 8601 timestamp of when the event was emitted. - data: - type: object - properties: - object: - $ref: '#/components/schemas/PublicActionPerformed' - required: - - object - additionalProperties: false - required: - - id - - type - - api_version - - created - - data - additionalProperties: false - example: - id: evt_clx9f2k0a0001abcd1234 - type: queue_item.allowed - api_version: v2 - created: '2026-05-08T12:34:56.789Z' - data: - object: - id: act_11111 - key: allow - name: Allow - value: null - created_at: '2026-05-08T12:35:10.123Z' - queue: - id: que_abc123 - item: - id: item_xyz790 - flagged: false - labels: [] - flagged_fields: [] - language: en - content: - type: text - text: Buy crypto now! - timestamp: '2026-05-08T12:34:56.789Z' - metadata: null - client_action: null - conversation_id: null - author_id: user-555 - channel_key: null - meta_type: comment - author: - id: auth_555 - external_id: user-555 - profile_picture: null - external_link: null - name: Jane Doe - email: jane@example.com - company: null - first_seen: 1746792000000 - last_seen: 1746792000000 - last_incident: null - status: enabled - trust_level: - level: 1 - manual: false - block: null - risk_evaluation: null - metrics: - total_content: 42 - flagged_content: 7 - average_sentiment: -0.1 - metadata: {} - WebhookEvent: - title: WebhookEvent - description: >- - Discriminated union of every v2 webhook event. Switch on `type` to - narrow to a specific event shape. - oneOf: - - $ref: '#/components/schemas/AuthorBlockedEvent' - - $ref: '#/components/schemas/AuthorUnblockedEvent' - - $ref: '#/components/schemas/AuthorSuspendedEvent' - - $ref: '#/components/schemas/AuthorUpdatedEvent' - - $ref: '#/components/schemas/AuthorTrustLevelChangedEvent' - - $ref: '#/components/schemas/AuthorActionEvent' - - $ref: '#/components/schemas/QueueItemCompletedEvent' - - $ref: '#/components/schemas/QueueItemActionEvent' - - $ref: '#/components/schemas/QueueItemRejectedEvent' - - $ref: '#/components/schemas/QueueItemAllowedEvent' - discriminator: - propertyName: type - mapping: - author.blocked: '#/components/schemas/AuthorBlockedEvent' - author.unblocked: '#/components/schemas/AuthorUnblockedEvent' - author.suspended: '#/components/schemas/AuthorSuspendedEvent' - author.updated: '#/components/schemas/AuthorUpdatedEvent' - author.trust_level_changed: '#/components/schemas/AuthorTrustLevelChangedEvent' - author.action: '#/components/schemas/AuthorActionEvent' - queue_item.resolved: '#/components/schemas/QueueItemCompletedEvent' - queue_item.action: '#/components/schemas/QueueItemActionEvent' - queue_item.rejected: '#/components/schemas/QueueItemRejectedEvent' - queue_item.allowed: '#/components/schemas/QueueItemAllowedEvent' - VoiceStartFrame: - type: object - description: >- - First frame the client sends. Declares the conversation, audio format, - and tracks. - required: - - event - - mediaFormat - - tracks - properties: - event: - type: string - enum: - - start - conversationId: - type: string - description: >- - Your external conversation id. Omit to have one generated and - returned in `session.started`. - channel: - type: string - description: Optional. Selects which channel's policy configuration applies. - mediaFormat: - type: object - required: - - encoding - - sampleRate - properties: - encoding: - type: string - description: >- - audio/x-mulaw (PCMU), audio/x-alaw (PCMA), audio/l16 (linear16), - or a common container (wav/mp3/ogg/flac). - example: audio/x-mulaw - sampleRate: - type: integer - minimum: 8000 - maximum: 48000 - example: 8000 - tracks: - type: array - description: One or both tracks. Stream only the track(s) you have. - items: - type: object - required: - - name - properties: - name: - type: string - enum: - - inbound - - outbound - authorId: - type: string - description: Your identifier for the speaker on this track. - emitPartials: - type: boolean - default: false - description: Set true to also receive interim, non-final transcripts. - metadata: - type: object - additionalProperties: true - description: >- - Arbitrary JSON attached to the conversation. Stored as-is and not - interpreted by moderation. - VoiceMediaFrame: - type: object - description: Audio chunk for one track. - required: - - event - - media - properties: - event: - type: string - enum: - - media - media: - type: object - required: - - track - - payload - properties: - track: - type: string - enum: - - inbound - - outbound - payload: - type: string - description: Base64-encoded audio in the declared format. - VoiceStopFrame: - type: object - description: Ends the call gracefully (or just disconnect). - required: - - event - properties: - event: - type: string - enum: - - stop - VoiceSessionStarted: - type: object - description: Sent after the start frame is accepted. - required: - - v - - event - - sessionId - - tracks - properties: - v: - type: integer - enum: - - 1 - event: - type: string - enum: - - session.started - conversationId: - type: string - sessionId: - type: string - tracks: - type: array - items: - type: string - VoiceUtteranceFinal: - type: object - description: >- - A finalized utterance with its moderation result. The - evaluation/recommendation/policies match the standard moderation - response. - required: - - v - - event - - contentId - - track - - text - - recommendation - properties: - v: - type: integer - enum: - - 1 - event: - type: string - enum: - - utterance.final - conversationId: - type: string - contentId: - type: string - track: - type: string - enum: - - inbound - - outbound - authorId: - type: string - text: - type: string - startMs: - type: integer - endMs: - type: integer - sttConfidence: - type: number - evaluation: - type: object - additionalProperties: true - recommendation: - type: object - properties: - action: - type: string - enum: - - allow - - review - - reject - policies: - type: array - items: - type: object - additionalProperties: true - VoiceSessionEnded: - type: object - description: Sent when the call ends, with summary stats. - required: - - v - - event - - stats - properties: - v: - type: integer - enum: - - 1 - event: - type: string - enum: - - session.ended - conversationId: - type: string - sessionId: - type: string - stats: - type: object - properties: - durationMs: - type: integer - utterances: - type: integer - actions: - type: object - properties: - allow: - type: integer - review: - type: integer - reject: - type: integer - securitySchemes: - Authorization: - type: http - scheme: bearer -webhooks: - author.blocked: - post: - summary: Author was permanently blocked - description: >- - Fired when an author transitions to the `blocked` status. The - `data.object` is the action_performed record that drove the transition, - with the author and triggering action nested as inline resources. - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AuthorBlockedEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - author.unblocked: - post: - summary: Author was unblocked - description: >- - Fired when an author transitions back to the `enabled` status. May fire - automatically when a temporary suspension expires (the auto-unblock - worker runs the `AUTHOR_UNBLOCK` action). - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AuthorUnblockedEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - author.suspended: - post: - summary: Author was temporarily suspended - description: >- - Fired when an author is suspended for a finite period. The `block.until` - field on the nested author indicates when the suspension expires. - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AuthorSuspendedEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - author.updated: - post: - summary: Author profile or metadata changed - description: >- - Fired when public author fields (name, email, profile picture, metadata, - etc.) change. Status transitions have their own dedicated events and do - **not** trigger this. - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AuthorUpdatedEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - author.trust_level_changed: - post: - summary: Author trust level transitioned - description: >- - Fired when an author's resolved trust level (manual override, falling - back to computed) transitions to a new value. Does not fire for no-op - recomputes. - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AuthorTrustLevelChangedEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - author.action: - post: - summary: A custom action was performed on an author - description: >- - Fired when an `AUTHOR_CUSTOM` moderation action runs against an author. - Same shape as the lifecycle events (`author.blocked`, - `author.suspended`, `author.unblocked`). - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AuthorActionEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - queue_item.resolved: - post: - summary: A queue item was resolved - description: >- - Fired when a moderator marks a queue item as resolved (checked off the - queue). - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/QueueItemCompletedEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - queue_item.action: - post: - summary: A custom action was performed on a queue item - description: >- - Fired when a **custom** moderation action runs against a queue item. The - `data.object` is the action_performed record with the related action, - item, author, and queue nested as inline resources. Built-in actions - (reject, allow) have dedicated events — see `queue_item.rejected` and - `queue_item.allowed` instead. - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/QueueItemActionEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - queue_item.rejected: - post: - summary: A queue item was rejected - description: >- - Fired when the built-in **reject** action runs against a queue item. - Same shape as `queue_item.action`. Customers who want every action - firing should subscribe to both this and the other built-in/custom - events; subscribing only to `queue_item.action` no longer catches - built-in events. - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/QueueItemRejectedEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. - queue_item.allowed: - post: - summary: A queue item was allowed - description: >- - Fired when the built-in **allow** action runs against a queue item. Same - shape as `queue_item.action`. Customers who want every action firing - should subscribe to both this and the other built-in/custom events. - tags: - - Webhooks - parameters: - - in: header - name: webhook-version - required: true - schema: - type: string - enum: - - v2 - description: Payload envelope version. Always `v2` for events documented here. - - in: header - name: webhook-event-id - required: true - schema: - type: string - description: Stable event ID (matches `id` in the body). Use to dedupe retries. - - in: header - name: modapi-signature - required: false - schema: - type: string - description: >- - HMAC-SHA256 signature of the raw request body, signed with the - webhook secret. Verify before trusting the payload. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/QueueItemAllowedEvent' - responses: - '200': - description: >- - Acknowledge receipt. Any 2xx status closes the delivery as - successful; non-2xx triggers retry with exponential backoff. + "flagged_fields": [], + "language": "en", + "content": { + "type": "text", + "text": "Buy crypto now!" + }, + "timestamp": "2026-05-08T12:34:56.789Z", + "metadata": null, + "client_action": null, + "conversation_id": null, + "author_id": "user-555", + "channel_key": null, + "meta_type": "comment" + }, + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "QueueItemAllowedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable event ID. Use this to dedupe retries.", + "example": "evt_clxxx..." + }, + "type": { + "type": "string", + "const": "queue_item.allowed", + "description": "The event type.", + "example": "queue_item.allowed" + }, + "api_version": { + "type": "string", + "const": "v2", + "example": "v2" + }, + "created": { + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$", + "description": "ISO 8601 timestamp of when the event was emitted." + }, + "data": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/PublicActionPerformed" + } + }, + "required": [ + "object" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "api_version", + "created", + "data" + ], + "additionalProperties": false, + "example": { + "id": "evt_clx9f2k0a0001abcd1234", + "type": "queue_item.allowed", + "api_version": "v2", + "created": "2026-05-08T12:34:56.789Z", + "data": { + "object": { + "id": "act_11111", + "key": "allow", + "name": "Allow", + "value": null, + "created_at": "2026-05-08T12:35:10.123Z", + "queue": { + "id": "que_abc123" + }, + "item": { + "id": "item_xyz790", + "flagged": false, + "labels": [], + "flagged_fields": [], + "language": "en", + "content": { + "type": "text", + "text": "Buy crypto now!" + }, + "timestamp": "2026-05-08T12:34:56.789Z", + "metadata": null, + "client_action": null, + "conversation_id": null, + "author_id": "user-555", + "channel_key": null, + "meta_type": "comment" + }, + "author": { + "id": "auth_555", + "external_id": "user-555", + "profile_picture": null, + "external_link": null, + "name": "Jane Doe", + "email": "jane@example.com", + "company": null, + "first_seen": 1746792000000, + "last_seen": 1746792000000, + "last_incident": null, + "status": "enabled", + "trust_level": { + "level": 1, + "manual": false + }, + "block": null, + "risk_evaluation": null, + "metrics": { + "total_content": 42, + "flagged_content": 7, + "average_sentiment": -0.1 + }, + "metadata": {} + } + } + } + } + }, + "WebhookEvent": { + "title": "WebhookEvent", + "description": "Discriminated union of every v2 webhook event. Switch on `type` to narrow to a specific event shape.", + "oneOf": [ + { + "$ref": "#/components/schemas/AuthorBlockedEvent" + }, + { + "$ref": "#/components/schemas/AuthorUnblockedEvent" + }, + { + "$ref": "#/components/schemas/AuthorSuspendedEvent" + }, + { + "$ref": "#/components/schemas/AuthorUpdatedEvent" + }, + { + "$ref": "#/components/schemas/AuthorTrustLevelChangedEvent" + }, + { + "$ref": "#/components/schemas/AuthorActionEvent" + }, + { + "$ref": "#/components/schemas/QueueItemCompletedEvent" + }, + { + "$ref": "#/components/schemas/QueueItemActionEvent" + }, + { + "$ref": "#/components/schemas/QueueItemRejectedEvent" + }, + { + "$ref": "#/components/schemas/QueueItemAllowedEvent" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "author.blocked": "#/components/schemas/AuthorBlockedEvent", + "author.unblocked": "#/components/schemas/AuthorUnblockedEvent", + "author.suspended": "#/components/schemas/AuthorSuspendedEvent", + "author.updated": "#/components/schemas/AuthorUpdatedEvent", + "author.trust_level_changed": "#/components/schemas/AuthorTrustLevelChangedEvent", + "author.action": "#/components/schemas/AuthorActionEvent", + "queue_item.resolved": "#/components/schemas/QueueItemCompletedEvent", + "queue_item.action": "#/components/schemas/QueueItemActionEvent", + "queue_item.rejected": "#/components/schemas/QueueItemRejectedEvent", + "queue_item.allowed": "#/components/schemas/QueueItemAllowedEvent" + } + } + }, + "VoiceStartFrame": { + "type": "object", + "description": "First frame the client sends. Declares the conversation, audio format, and tracks.", + "required": [ + "event", + "mediaFormat", + "tracks" + ], + "properties": { + "event": { + "type": "string", + "enum": [ + "start" + ] + }, + "conversationId": { + "type": "string", + "description": "Your external conversation id. Omit to have one generated and returned in `session.started`." + }, + "channel": { + "type": "string", + "description": "Optional. Selects which channel's policy configuration applies." + }, + "mediaFormat": { + "type": "object", + "required": [ + "encoding", + "sampleRate" + ], + "properties": { + "encoding": { + "type": "string", + "description": "audio/x-mulaw (PCMU), audio/x-alaw (PCMA), audio/l16 (linear16), or a common container (wav/mp3/ogg/flac).", + "example": "audio/x-mulaw" + }, + "sampleRate": { + "type": "integer", + "minimum": 8000, + "maximum": 48000, + "example": 8000 + } + } + }, + "tracks": { + "type": "array", + "description": "One or both tracks. Stream only the track(s) you have.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "enum": [ + "inbound", + "outbound" + ] + }, + "authorId": { + "type": "string", + "description": "Your identifier for the speaker on this track." + } + } + } + }, + "emitPartials": { + "type": "boolean", + "default": false, + "description": "Set true to also receive interim, non-final transcripts." + }, + "metadata": { + "type": "object", + "additionalProperties": true, + "description": "Arbitrary JSON attached to the conversation. Stored as-is and not interpreted by moderation." + } + } + }, + "VoiceMediaFrame": { + "type": "object", + "description": "Audio chunk for one track.", + "required": [ + "event", + "media" + ], + "properties": { + "event": { + "type": "string", + "enum": [ + "media" + ] + }, + "media": { + "type": "object", + "required": [ + "track", + "payload" + ], + "properties": { + "track": { + "type": "string", + "enum": [ + "inbound", + "outbound" + ] + }, + "payload": { + "type": "string", + "description": "Base64-encoded audio in the declared format." + } + } + } + } + }, + "VoiceStopFrame": { + "type": "object", + "description": "Ends the call gracefully (or just disconnect).", + "required": [ + "event" + ], + "properties": { + "event": { + "type": "string", + "enum": [ + "stop" + ] + } + } + }, + "VoiceSessionStarted": { + "type": "object", + "description": "Sent after the start frame is accepted.", + "required": [ + "v", + "event", + "sessionId", + "tracks" + ], + "properties": { + "v": { + "type": "integer", + "enum": [ + 1 + ] + }, + "event": { + "type": "string", + "enum": [ + "session.started" + ] + }, + "conversationId": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "tracks": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "VoiceUtteranceFinal": { + "type": "object", + "description": "A finalized utterance with its moderation result. The evaluation/recommendation/policies match the standard moderation response.", + "required": [ + "v", + "event", + "contentId", + "track", + "text", + "recommendation" + ], + "properties": { + "v": { + "type": "integer", + "enum": [ + 1 + ] + }, + "event": { + "type": "string", + "enum": [ + "utterance.final" + ] + }, + "conversationId": { + "type": "string" + }, + "contentId": { + "type": "string" + }, + "track": { + "type": "string", + "enum": [ + "inbound", + "outbound" + ] + }, + "authorId": { + "type": "string" + }, + "text": { + "type": "string" + }, + "startMs": { + "type": "integer" + }, + "endMs": { + "type": "integer" + }, + "sttConfidence": { + "type": "number" + }, + "evaluation": { + "type": "object", + "additionalProperties": true + }, + "recommendation": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "allow", + "review", + "reject" + ] + } + } + }, + "policies": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "VoiceSessionEnded": { + "type": "object", + "description": "Sent when the call ends, with summary stats.", + "required": [ + "v", + "event", + "stats" + ], + "properties": { + "v": { + "type": "integer", + "enum": [ + 1 + ] + }, + "event": { + "type": "string", + "enum": [ + "session.ended" + ] + }, + "conversationId": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "stats": { + "type": "object", + "properties": { + "durationMs": { + "type": "integer" + }, + "utterances": { + "type": "integer" + }, + "actions": { + "type": "object", + "properties": { + "allow": { + "type": "integer" + }, + "review": { + "type": "integer" + }, + "reject": { + "type": "integer" + } + } + } + } + } + } + } + }, + "securitySchemes": { + "Authorization": { + "type": "http", + "scheme": "bearer" + } + } + }, + "webhooks": { + "author.blocked": { + "post": { + "summary": "Author was permanently blocked", + "description": "Fired when an author transitions to the `blocked` status. The `data.object` is the action_performed record that drove the transition, with the author and triggering action nested as inline resources.", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorBlockedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.unblocked": { + "post": { + "summary": "Author was unblocked", + "description": "Fired when an author transitions back to the `enabled` status. May fire automatically when a temporary suspension expires (the auto-unblock worker runs the `AUTHOR_UNBLOCK` action).", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorUnblockedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.suspended": { + "post": { + "summary": "Author was temporarily suspended", + "description": "Fired when an author is suspended for a finite period. The `block.until` field on the nested author indicates when the suspension expires.", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorSuspendedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.updated": { + "post": { + "summary": "Author profile or metadata changed", + "description": "Fired when public author fields (name, email, profile picture, metadata, etc.) change. Status transitions have their own dedicated events and do **not** trigger this.", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorUpdatedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.trust_level_changed": { + "post": { + "summary": "Author trust level transitioned", + "description": "Fired when an author's resolved trust level (manual override, falling back to computed) transitions to a new value. Does not fire for no-op recomputes.", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorTrustLevelChangedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "author.action": { + "post": { + "summary": "A custom action was performed on an author", + "description": "Fired when an `AUTHOR_CUSTOM` moderation action runs against an author. Same shape as the lifecycle events (`author.blocked`, `author.suspended`, `author.unblocked`).", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthorActionEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "queue_item.resolved": { + "post": { + "summary": "A queue item was resolved", + "description": "Fired when a moderator marks a queue item as resolved (checked off the queue).", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueItemCompletedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "queue_item.action": { + "post": { + "summary": "A custom action was performed on a queue item", + "description": "Fired when a **custom** moderation action runs against a queue item. The `data.object` is the action_performed record with the related action, item, author, and queue nested as inline resources. Built-in actions (reject, allow) have dedicated events — see `queue_item.rejected` and `queue_item.allowed` instead.", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueItemActionEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "queue_item.rejected": { + "post": { + "summary": "A queue item was rejected", + "description": "Fired when the built-in **reject** action runs against a queue item. Same shape as `queue_item.action`. Customers who want every action firing should subscribe to both this and the other built-in/custom events; subscribing only to `queue_item.action` no longer catches built-in events.", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueItemRejectedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + }, + "queue_item.allowed": { + "post": { + "summary": "A queue item was allowed", + "description": "Fired when the built-in **allow** action runs against a queue item. Same shape as `queue_item.action`. Customers who want every action firing should subscribe to both this and the other built-in/custom events.", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "in": "header", + "name": "webhook-version", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ] + }, + "description": "Payload envelope version. Always `v2` for events documented here." + }, + { + "in": "header", + "name": "webhook-event-id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Stable event ID (matches `id` in the body). Use to dedupe retries." + }, + { + "in": "header", + "name": "modapi-signature", + "required": false, + "schema": { + "type": "string" + }, + "description": "HMAC-SHA256 signature of the raw request body, signed with the webhook secret. Verify before trusting the payload." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueueItemAllowedEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Acknowledge receipt. Any 2xx status closes the delivery as successful; non-2xx triggers retry with exponential backoff." + } + } + } + } + } +}